ILMDVRSink.SetOffsetToReach Method

DVR Module How To Examples

 

Syntax

Object.SetOffsetToReach(RegistrationID As Long, Offset As Double)

 

Parameter

Description

RegistrationID

The unique identifier used in ILMDVRSink.CreateEvents2 to create the offset reached event.

Offset

The target offset.

Returns

S_OK

The function was successful.

E_INVALIDARG

The registration ID or the offset values are invalid.

<> S_OK

An error occurred. Refer to the Error Codes or the HRESULT error codes in the DirectShow documentation.

 

Remarks

Use this method to instruct the DVR sink object to set the offset reached event once it has written data past a certain offset. This method is used internally by the DVR source object.

For example, if an application wants to read N bytes from offset X, then it will do the following:

  1. Reset the offset reached event

  2. Call SetOffsetToReach(X + N)

  3. Use a windows waiting function and wait for the offset reached event to be set. (This of course, assumes the event was created through an earlier call to ILMDVRSink.CreateEvents2.

The offset must be > 0 and it indicates the offset of the first byte that is not needed. So, the byte at offset 'Offset -1' will be present in the DVR buffer, but the byte at offset 'Offset' might not be written yet.

See Also

Functions:

ILMDVRSink.FreeEvents, ILMDVRSink.CreateEvents2

Topics:

Multimedia Properties, Methods and Events , DVR Module Properties, Methods and Events