Microsoft Camcorder Video
- FourCC: CGDI
- Company: Microsoft
- Samples: http://samples.mplayerhq.hu/V-codecs/CGDI/
- References: http://support.microsoft.com/support/office/content/office97/camcorder.asp
According to Microsoft's documentation, Camcorder Video allows users of Microsoft Office 97 to record video of their desktop. This would make it a screen capture codec if not for the fact that it actually records GDI and WINUSER API calls so in order to reconstruct image one has to implement those GDI calls.
Each frame consists of records containing GDI/WINUSER commands:
bytes 0-3 size of record including this field bytes 4-5 command code bytes 6-9 unknown bytes 10-... command arguments, usually 16-bit integers
The internal state keeps a list of GDI objects in an internal array and references them by ID so that the command e.g. for drawing a rectangle sends as parameters rectangle coordinates (left, top, right, bottom) as well as the brush ID that will be selected before rectangle will be drawn. In general the commands that have brush, pen IDs or such send those IDs at the end of the list but before the variable-length part (e.g. points to draw polyline).
Known opcodes are:
0x00
-- fill region using region and brush IDs0x01
-- draw a border around region; parameters are region/brush IDs plus stroke width/height0x02
-- invert region0x03
-- paint region using the provided region/brush IDs0x04
-- draw an arc using provided coordinates and brush ID0x05
-- draw a line to the provided point using brush ID0x06
-- moveto (parameters are point coordinates)0x07
-- not present0x08
-- polyline (first parameter is number of points, second parameter is brush ID, the rest are line points)0x09
-- draw a chord (same parameters as for arc)0x0A
-- draw focused rectangle (parameters are rectangle coordinates)0x0B
-- draw an ellipse (parameters are bounding rectangle plus pen and brush IDs)0x0C
-- draw filled rectangle (WINUSER; parameters are its coordinates and brush ID)0x0D
-- draw frame rectangle (same parameters)0x0E
-- invert rectangle at the provided coordinates0x0F
-- draw a pie (parameters are coordinates passed to the GDI function plus brush and pen IDs)0x10
-- draw a polygon (parameters are number of points, brush/pen IDs and vertices coordinates)0x11
-- draw a series of polygons (essentially the same parameters)0x12
-- draw a rectangle (GDI) using provided coordinates and brush/pen IDs0x13
-- draw a rounded rectangle using provided coordinates, corner radius and brush/pen IDs0x14
-- blit bitmap using the provided arguments toBitBlt
and bitmap ID0x15
-- blit (optionally stretched bitmap)0x16
--ExtFloodFill
using provided coordinates, colour, mode and brush ID0x17
--PatBlt
using provided coordinates, mode and brush ID0x18
-- set pixel at the provided coordinates to the provided colour value0x19
-- stretched blit using provided coordinates, mode and bitmap ID0x1A
--SetDIBitsToDevice
using provided bitmap data0x1B
--StretchDIBits
using provided bitmap data0x1C
-- draw provided text using specified pen/brush IDs0x1D
-- same but usingTextOut
instead ofExtTextOut
0x1E
-- draw text with WINUSER function0x1F
-- WINUSER TabbedTextOut0x20
-- draw window frame0x21
-- create new palette using provided data0x22
-- delete requested GDI object by ID0x23
-- unused0x24
-- init window parameters (origin and viewport)0x25
-- something similar0x26
-0x32
-- unused0x33
-- set mapping mode to the provided argument0x34
-- set window and viewport extents0x35
-- set viewport origin0x36
-- set window origin0x37
-- set background mix mode0x38
-- set background colour0x39
-- set foreground mix mode0x3A
-- set text colour0x3B
-- set text align mode0x3C
-- set text justification0x3D
-- set brush origin0x3E
-- set polygon fill mode0x3F
-- create new brush with the provided parameters as store it at the provided ID0x40
-- create new font using the provided parameters and destination ID0x41
-- create patterned brush0x42
-- create new pen0x43
-- create memory object (some kind of bitmap?) by copying data from the stream to the given ID object0x44
-- init some window parameters0x45
-- unused0x46
-- create new bitmap using data from the stream0x47
-- init some window parameters0x48
-- set default parameters to the drawing system (usually the very first opcode in the first frame)0x49
-- clear drawing system from used objects0x4A
-- set some flag, probably for custom window clipping0x4B
-- delete requested object