IAMTimecodeReader::GetTimecode method

The GetTimecode method retrieves the most recent timecode, userbit, and flag values available in the stream.


HRESULT GetTimecode(
  [out] TIMECODE_SAMPLE *pTimecodeSample


pTimecodeSample [out]

Pointer to a TIMECODE_SAMPLE structure.

Return value

Returns an HRESULT value that depends on the implementation of the interface.


Use this method to monitor the timecode and to parse duplicates and discontinuities.

The timecode contains undefined bits, called userbits. Applications can use these bits to store synchronization information or other custom information.

DV and MPEG Camcorder Implementation

The MSDV driver supports reading SMPTE timecode or absolute track numbers (ATN). The MSTape driver supports reading the relative time counter (RTC). To read time information on these devices, do the following:

Set the dwFlags member of the TIMECODE_SAMPLE structure to one of the following values.

ED_DEVCAP_ATN_READAbsolute track number (DV)
ED_DEVCAP_RTC_READRelative time counter (MPEG tape)


The timecode member of the TIMECODE_SAMPLE structure is a TIMECODE structure. Initialize that structure's dwFrames member to zero.

All other structure members are ignored.

When the method returns, the dwFrames member contains the time information, in the following format.

Time InformationFormat
TimecodeHours, minutes, seconds, and frames, as a binary coded decimal (BCD) value: 0xhhmmssff.
ATNTrack number.
RTCHours, minutes, seconds, and frames, as a BCD value: 0xhhmmssff. The most significant bit of the frames byte is a sign bit. If the frame count is not available, the remaining frame bits are set to 0x7F.


Also, the dwUser member receives the blank flag bit from the device, which has one of the following values.

0x00Not a discontinuity.



Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]


Strmif.h (include Dshow.h)



See also

Getting Timecode from the Device
Error and Success Codes
IAMTimecodeReader Interface