VirtualBox

Changeset 85856 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Aug 21, 2020 9:06:50 AM (4 years ago)
Author:
vboxsync
Message:

Consolidated all the different Bitmap (BMP) file format headers / definitions into new include/iprt/formats/bmp.h (part 1).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/RecordingStream.cpp

    r82968 r85856  
    2424#include <iprt/path.h>
    2525
     26#if VBOX_RECORDING_DUMP
     27# include <iprt/formats/bmp.h>
     28#endif
     29
    2630#include "Recording.h"
    2731#include "RecordingUtils.h"
    2832#include "WebMWriter.h"
    2933
    30 #ifdef VBOX_RECORDING_DUMP
    31 #pragma pack(push)
    32 #pragma pack(1)
    33 typedef struct
    34 {
    35     uint16_t uMagic;
    36     uint32_t uSize;
    37     uint16_t uReserved1;
    38     uint16_t uReserved2;
    39     uint32_t uOffBits;
    40 } RECORDINGBMPHDR, *PRECORDINGBMPHDR;
    41 AssertCompileSize(RECORDINGBMPHDR, 14);
    42 
    43 typedef struct
    44 {
    45     uint32_t uSize;
    46     uint32_t uWidth;
    47     uint32_t uHeight;
    48     uint16_t uPlanes;
    49     uint16_t uBitCount;
    50     uint32_t uCompression;
    51     uint32_t uSizeImage;
    52     uint32_t uXPelsPerMeter;
    53     uint32_t uYPelsPerMeter;
    54     uint32_t uClrUsed;
    55     uint32_t uClrImportant;
    56 } RECORDINGBMPDIBHDR, *PRECORDINGBMPDIBHDR;
    57 AssertCompileSize(RECORDINGBMPDIBHDR, 40);
    58 
    59 #pragma pack(pop)
    60 #endif /* VBOX_RECORDING_DUMP */
    6134
    6235RecordingStream::RecordingStream(RecordingContext *a_pCtx)
     
    664637
    665638#ifdef VBOX_RECORDING_DUMP
    666         RECORDINGBMPHDR bmpHdr;
     639        BMPINFO bmpHdr;
    667640        RT_ZERO(bmpHdr);
    668641
    669         RECORDINGBMPDIBHDR bmpDIBHdr;
     642        WINHDR bmpDIBHdr;
    670643        RT_ZERO(bmpDIBHdr);
    671644
    672         bmpHdr.uMagic   = 0x4d42; /* Magic */
    673         bmpHdr.uSize    = (uint32_t)(sizeof(RECORDINGBMPHDR) + sizeof(RECORDINGBMPDIBHDR) + (w * h * uBytesPerPixel));
    674         bmpHdr.uOffBits = (uint32_t)(sizeof(RECORDINGBMPHDR) + sizeof(RECORDINGBMPDIBHDR));
    675 
    676         bmpDIBHdr.uSize          = sizeof(RECORDINGBMPDIBHDR);
    677         bmpDIBHdr.uWidth         = w;
    678         bmpDIBHdr.uHeight        = h;
    679         bmpDIBHdr.uPlanes        = 1;
    680         bmpDIBHdr.uBitCount      = uBPP;
    681         bmpDIBHdr.uXPelsPerMeter = 5000;
    682         bmpDIBHdr.uYPelsPerMeter = 5000;
     645        bmpHdr.Type     = BMP_HDR_MAGIC;
     646        bmpHdr.FileSize = (uint32_t)(sizeof(BMPINFO) + sizeof(WINHDR) + (w * h * uBytesPerPixel));
     647        bmpHdr.Offset   = (uint32_t)(sizeof(BMPINFO) + sizeof(WINHDR));
     648
     649        bmpDIBHdr.Size          = sizeof(WINHDR);
     650        bmpDIBHdr.Width         = w;
     651        bmpDIBHdr.Height        = h;
     652        bmpDIBHdr.Planes        = 1;
     653        bmpDIBHdr.BitCount      = uBPP;
     654        bmpDIBHdr.XPelsPerMeter = 5000;
     655        bmpDIBHdr.YPelsPerMeter = 5000;
    683656
    684657        char szFileName[RTPATH_MAX];
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette