In This Topic ▼

ILMDVRSink Interface

Data Types:

LMDVRSink_EVENT_NOTIFICATIONS

typedef enum  
{ 
   LMDVRSink_EC_ERROR_RECORDING_TO_FILE, 
} LMDVRSink_EVENT_NOTIFICATIONS; 

Lists the possible values of the additional MediaEvents that can be notified by the filter.

LMDVRSink_EC_ERROR_RECORDING_TO_FILE Writing to file specified in StartBackupToFile failed.

DVRStatusConstants

typedef enum 
{ 
   DVRStatus_Writing       = 0, 
   DVRStatus_Paused        = 1, 
   DVRStatus_Stopped       = 2 
} DVRStatusConstants; 

LMDVRSink_APILEVEL

typedef enum 
{ 
   LMDVRSink_APILEVEL_1 = 0 
} LMDVRSink_APILEVEL; 

Interface Properties:

Type

Name

Description

long

FolderCount

Gets or sets the number of buffer folder locations. Use this to determine the number of DVR buffer folder locations on the system.

BSTR

FolderName( long nFolderIndex)

Gets or sets the name of the fully qualified folder path for the specified buffer location.  Use this to determine the full pathname of the specified DVR buffer folder location.

BSTR

BaseName

Gets or sets the name of the base file name of the buffer list file and recording chunk files. Use this to determine the file name of the DVR buffer files.

VARIANT_BOOL

IsGrowing

(Read only) Indicates whether the DVR buffer is still growing. If VARIANT_TRUE, the file is still growing and the final duration is unknown. If VARIANT_FALSE, the buffer is not being updated anymore.

Interface Methods:

HRESULT GetAvailabilityInfo(double * pStartOffset, double * pEndOffset, double * pTotalSize)

Parameters

pStartOffset

A pointer to a double type that receives the first offset of available video.

pEndOffset

A pointer to a double type that receives the last offset of available video.

pTotalSize

Total size of all video data available.

Description

Gets the availability information for data for the current playback range.

Returns

S_OK if successful, otherwise a return code indicating the reason for failure:

E_UNEXPECTED = Unexpected invalid file handle.

LTMM_E_DVR_NO_RECORDINGS = No .LRC recording files exist.

LTMM_E_DVR_CORRUPT_STUB_FILE = Corrupted .LBL file.

HRESULT SetBufferSize(long nFolderIndex, long nFiles, double fileSize)

Parameters

nFolderIndex

The index of the desired buffer location.

nFiles

The maximum number of .LRC files allowed to be created in this location.

fileSize

The maximum file size (in bytes) of each individual .LRC file.

Description

Sets the number of buffer (.LRC) files and the allowed size per buffer file for the specified buffer location.

Returns

S_OK if successful, otherwise a return code indicating the reason for failure:

E_UNEXPECTED = Unexpected invalid file handle

DISP_E_BADINDEX = Index supplied is outside the range of currently valid indexes.

E_INVALIDARG = Either the number of files or file size specified is not valid.

HRESULT GetBufferTotalSize(long nFolderIndex, long uFlags, long * pnFiles, double * pnTotalFileSize)

Parameters

nFolderIndex

The index of the desired buffer location.

uFlags

Flag specifying how to calculate the total size.
Values can be:

   DVRGetTotalSize_Actual  = 0x0000

   DVRGetTotalSize_Allowed = 0x0001

pnFiles

Total number of files included in the buffer size calculation.

pnTotalFileSize

The total calculated buffer file size.

Description

Sets the number of buffer (.LRC) files and the allowed size per buffer file for the specified buffer location.

Returns

S_OK if successful, otherwise a return code indicating the reason for failure:

E_UNEXPECTED = Unexpected invalid file handle

DISP_E_BADINDEX = Index supplied is outside the range of currently valid indexes.

HRESULT CopyBufferToFile(BSTR pszTargetFile, double startOffset, double endOffset)

Parameters

pszTargetFile

Fully qualified pathname of destination file.

startOffset

Starting offset of data to copy.

endOffset

Ending offset of data to copy.

Description

Copies the buffered recording data to the specified fully qualified file pathname.

Returns

S_OK if successful, otherwise a return code indicating the reason for failure:

E_UNEXPECTED = Starting offset not found.

DISP_E_BADINDEX = Index supplied is outside the range of currently valid indexes.

LTMM_E_DVR_NO_RECORDINGS = No .LRC recording files exist.

E_INVALIDARG = Either the number of files or file size specified is not valid.

HRESULT GetStatus(DVRStatusConstants * pStatus, long * pnCurrentFolderIndex, long * pnCurrentRecordingIndex, double * pnCurrentRecordingSize)

Parameters

pStatus

A pointer to an enumeration type that will receive the current DVR status.

Returned values can be:

   DVRStatus_Stopped

   DVRStatus_Paused

   DVRStatus_Writing

pnCurrentFolderIndex

A pointer to a long type that will receive the current location index.

pnCurrentRecordingIndex

A pointer to a long type that will receive the current recording index. This index is the number of the current LRC file.

pnCurrentRecordingSize

A pointer to double type that will receive the current recording size in bytes.

Description

Gets the DVRSink status, buffer files location and buffer file index, and total current recording size.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT CreateEvents(long nRegistrationID, long TargetProcessID, OLE_HANDLE * pDataWrittenEvent, OLE_HANDLE * pRecordingListChangedEvent)

Parameters

nRegistrationID

A unique identifier for this event registration.

TargetProcessID

The process id of the event subscriber.

pDataWrittenEvent

A handle to the write event.

pRecordingListChangedEvent

A handle to the list changed event.

Description

Creates the Windows Event objects used to signal data write and recording list changed events.

Note: This method is now deprecated. Use CreateEvents2 instead.

Returns

S_OK if successful, otherwise a return code indicating the reason for failure:

E_OUTOFMEMORY = Memory allocation error was encountered.

HRESULT CreateEvents2(long nRegistrationID, long TargetProcessID, OLE_HANDLE * pDataWrittenEvent, OLE_HANDLE * pRecordingListChangedEvent, OLE_HANDLE *pOffsetReachedEvent)

Parameters

nRegistrationID

A unique identifier for this event registration.

TargetProcessID

The process id of the event subscriber.

pDataWrittenEvent

A handle to the write event.

pRecordingListChangedEvent

A handle to the list changed event.

pOffsetReachedEvent

A handle to the offset reached event.

Description

Creates the Windows Event objects used to signal the Data Was Written, the Recording List Changed, and the Offset Reached events. This method is used internally by the LEAD DVR Source Filter.

The Offset Reached event is designed to work together with the SetOffsetToReach method.

Returns

S_OK if successful, otherwise a return code indicating the reason for failure:

E_OUTOFMEMORY = Memory allocation error was encountered.

HRESULT FreeEvents(long nRegistrationID)

Parameters

nRegistrationID

A unique identifier for this event registration.

Description

Frees the windows event objects used by to signal data write and recording list changed events.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT ResetToDefaultsEx(LMDVRSink_APILEVEL ApiLevel)

Parameters

ApiLevel

The desired API Level for reset.

Value can be:
     LMDVRSink_APILEVEL_1

 

Description

Resets the DVRSink interface object to the default settings for the API level specified.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT GetBufferInfo(long nBufferIndex, BSTR * pszFileName, double * pnUsefulSize, double * pnFileSize, long * pnPlayIndex, long * pnFlags)

Parameters

nBufferIndex

The index of the buffer file for which to get information.

pszFileName

A pointer to a string type that will receive the filename of the related buffer recording file.

pnUsefulSize

A pointer to a double type that will receive the used file size of this recording chunk file.

pnFileSize

A pointer to a double type that will receive the physical file size of this recording chunk file.

pnPlayIndex

A pointer to a long type that will receive the index in the play order (the first index might not be 0, but all files should have sequential and incrementing indexes after the first index value)

pnFlags

A pointer to a long type that will receive a DVRBufferFlagConstant setting.

Value can be:

   DVRBuffer_Empty  = 0x0001,

   DVRBuffer_Writing = 0x0002,

   DVRBuffer_Finished = 0x0004

Description

Gets the buffer information associated with the buffer file index specified.

Returns

S_OK if successful; otherwise, a return code indicating the reason for failure:

E_INVALIDARG = Buffer index supplied is outside the range of currently valid indexes.

LTMM_E_DVR_NO_RECORDINGS = No .LRC recording files exist.

E_OUTOFMEMORY = A memory allocation error occurred.

Either the number of files or file size specified is not valid.

HRESULT SetOffsetToReach(long nRegistrationID, double Offset)

Parameters

nRegistrationID

The identifier passed to CreateEvents2 when the Offset Reached event was created.

Offset

The offset to reach (in bytes). The Offset Reached event will be set when the DVR sink has written data past this offset. Must be > 0.

Description

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 CreateEvents2.

Returns

S_OK if successful, otherwise a return code indicating the reason for failure:

E_INVALIDARG = the registration identifier is invalid or the offset is invalid.

HRESULT StartChangingAttributes ()

Description

This method is used to change the DVRSink attributes.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT StopChangingAttributes(VARIANT_BOOL bCancelChanges)

Parameters

bCancelChanges

A BOOL value type specifying whether to cancel or apply the pending attribute changes.

Description

Sets the DVRSink attributes. Set to VARIANT_FALSE to set the attributes. Use VARIANT_TRUE to discard changes and reset the attributes to their previous settings.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT StartBackupToFile(BSTR pszFileName, long Flags)

Parameters

pszFileName

Fully qualified pathname of destination backup file.

Flags

Reserved for future use. Set value to 0.

Description

Starts writing the DVR recording data to the specified fully qualified backup filename.

Returns

S_OK if successful, otherwise a return code indicating the reason for failure:

E_UNEXPECTED = Unexpected invalid file handle.

HRESULT StopBackupToFile()

Description

Stops writing the DVR recording data to the backup file.

Returns

S_OK if successful, otherwise a return code indicating the reason for failure:

E_UNEXPECTED = Unexpected invalid file handle.

HRESULT GetFragmentAlignment(double startOffset, double endOffset, double *pAlignedStartOffset, double *pAlignedEndOffset);

Parameters

Parameter Description
startOffset Specifies the byte offset at which to begin scanning for transport fragments.
endOffset Specifies the byte offset at which to stop scanning for transport fragments.
pAlignedStartOffset A pointer to a double variable, storing the offset of the start of the first transport fragment found.
pAlignedEndOffset A pointer to a double variable, storing the offset of the end of the last transport fragment.

Description

Takes the user-supplied byte range and scans for transport fragment boundaries.

Use this function along with CopyBufferToFile to save a completely intact MPEG transport fragment.

Set up the MPEG multiplexer used for recording to DVR by calling put_OutputType(Mpg2MxT_OutputType_HLS). Doing so guarantees that fragment boundaries start with synchronization frames. Specify the boundary time interval by calling put_ResyncInterval(intervalTime).

Returns

S_OK if no error.

S_FALSE if no transport fragment is found: pAlignedStartOffset and pAlignedEndOffset are set equal to startOffset, and indicate an empty search.

HRESULT GetTimedFragmentAlignment(double startOffset, double endOffset, double timeThreshold, double *pAlignedStartOffset, double *pAlignedEndOffset, double *pAlignedDuration);

Parameters

Parameter Description
startOffset Specifies the byte offset at which to begin scanning for transport fragments.
endOffset Specifies the byte offset at which to stop scanning for transport fragments.
timeThreshold Specifies the minimum time (in seconds) of the fragments to find.
pAlignedStartOffset A pointer to a double variable, storing the offset of the start of the first transport fragment found.
pAlignedEndOffset A pointer to a double variable, storing the offset of the end of the last transport fragment.
pAlignedDuration A pointer to a double variable, storing the time (in seconds) of the transport fragments found.

Description

Takes the user-supplied byte range and scans for transport fragment boundaries. It will only return the minimum number of fragments that meet or exceed the timeThreshold.

Use this function along with CopyBufferToFile to save a completely intact MPEG transport fragment.

Set up the MPEG multiplexer used for recording to DVR by calling put_OutputType(Mpg2MxT_OutputType_HLS). Doing so guarantees that fragment boundaries start with synchronization frames. Specify the boundary time interval by calling put_ResyncInterval(intervalTime).

Returns

S_OK if no error.

S_FALSE if no transport fragment is found: pAlignedStartOffset and pAlignedEndOffset are set equal to startOffset, and indicate an empty search.

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Filters C API Help