Share via


CS_FRAME_INFO (Windows Embedded CE 6.0)

1/6/2010

This structure is used to extend the CSSTREAM_HEADER structure for video streams.

Syntax

typedef struct tagCS_FRAME_INFO {
  ULONG    ExtendedHeaderSize;
  DWORD    dwFrameFlags;
  LONGLONG PictureNumber;
  LONGLONG DropCount;
  HANDLE   hDirectDraw;
  HANDLE   hSurfaceHandle;
  RECT     DirectDrawRect;
  DWORD    Reserved1;
  DWORD    Reserved2;
  DWORD    Reserved3;
  DWORD    Reserved4;
} CS_FRAME_INFO, *PCS_FRAME_INFO;

Members

  • ExtendedHeaderSize
    A ULONG value that specifies the size of this structure, in bytes.
  • dwFrameFlags
    A DWORD value that specifies flags indicating additional information about the frame captured. During capture, the minidriver sets this member to one of the CS_VIDEO_FLAG Values.
  • PictureNumber
    A LONGLONG value that specifies a count representing the current picture number. The counter is reset to zero when the stream is placed in the run state.
  • DropCount
    A LONGLONG value that specifies the number of pictures that were not captured. During capture, the minidriver sets this member. This counter should be incremented whenever a frame should have been captured but was not; this condition usually arises when no buffers were available during capture.
  • hDirectDraw
    A HANDLE that specifies the user-mode handle to DirectDraw. This handle is only provided to the minidriver when capturing to a DirectDraw surface for preview or overlay purposes.
  • hSurfaceHandle
    A HANDLE that specifies the user-mode handle to the DirectDraw surface. This handle is only provided to the minidriver when capturing to a DirectDraw surface for preview or overlay purposes.
  • DirectDrawRect
    A RECTL structure that specifies the portion of the DirectDraw surface that has been locked. This is normally the entire surface.
  • Reserved1
    Reserved and should not be used by the minidriver.
  • Reserved2
    Reserved and should not be used by the minidriver.
  • Reserved3
    Reserved and should not be used by the minidriver.
  • Reserved4
    Reserved and should not be used by the minidriver.

Remarks

The CS_FRAME_INFO structure provides a way to return information about the frame captured, as well as a way to pass Microsoft® DirectDraw® handles used when capturing to a DirectDraw surface.

The PictureNumber member count represents the count of the current picture, which is calculated in one of two ways depending on the device:

  • Measure the time since the stream was started and divide by the frame duration. This method is appropriate for devices that do not provide their own clock. For example: PictureNumber = ElapsedTime / FrameDuration
  • Add together the count of frames captured and the count of frame dropped. This method is appropriate for devices that provide their own clock. For example: PictureNumber = FramesCaptured + FramesDropped

When calculating PictureNumber and DropCount, it is important to use the frame duration specified when the stream was opened, which may not necessarily match the rate at which the device is actually producing images. For example, a USB camera may only produce images at 7.5 fps, but a client could open the stream at 8 fps. In this case, all calculations should use the 8 fps number.

Requirements

Header csmedia.h
Windows Embedded CE Windows Embedded CE 6.0 and later

See Also

Reference

Camera Driver Structures
CSSTREAM_HEADER
CS_VIDEO_FLAG Values

Other Resources

DirectDraw
RECTL