DVDBuilder for .NET  3.4
DVD Authoring Software Development Kit
VideoRecorder Class Reference

This class represents the DVD video recorder and is used to carry out the DVD recording. More...

Inheritance diagram for VideoRecorder:

Public Member Functions

 VideoRecorder ()
 Creates a VideoRecorder object. More...
 
void Dispose ()
 Disposes the VideoRecorder and reclaims the resources used by the object. More...
 
bool FinalizeMedia ()
 Finalizes VideoRecorder instance. More...
 
ErrorInfo GetDeviceError (int deviceIndex)
 Gets an object that can be used to query the error state of a specified device after a parallel operation of the video recorder. More...
 
bool GetIsFinalized (int deviceIndex)
 Gets information whether the video in all attached devices is finalized. More...
 
Int64 GetMediaFreeSpace (int deviceIndex)
 Gets the usable free space (in bytes) for video recording. More...
 
IList< TitleGetTitles (int deviceIndex)
 Gets an object that can be used to enumerate all DVD-Video titles in the specified device. More...
 
VRDevicePlugin LoadDevicePlugin (string path)
 The LoadDevicePlugin method creates a device plugin object. More...
 
bool PrepareMedia ()
 Prepares the media in the attached devices for writing. More...
 
bool Start ()
 Starts the recording process. More...
 
bool StartAsync ()
 Starts the recording process asynchronously. More...
 
bool Stop ()
 Stops the recording process. More...
 
bool Write (IntPtr dataPtr, Int32 dataSize)
 Passes data to the VideoRecorder to be written to all devices. More...
 
bool Write (byte[] data)
 Passes data to the VideoRecorder to be written to all devices. More...
 

Properties

bool AllowMuxBufferUnderflow [get, set]
 Indicates whether or not a multiplexer buffer underflow is allowed. More...
 
Int32 AverageBitrate [get]
 Gets the average bitrate (bits per second) of the video since the start of the recording. More...
 
IList< VRDeviceDevices [get]
 Gets the device list of the VideoRecorder. More...
 
ErrorInfo Error [get]
 The error information for the last operation. More...
 
bool IsFinalized [get]
 Gets information whether the video is finalized. More...
 
bool IsFinalizeSupported [get]
 Gets information whether the video supports finalization. More...
 
Int64 MediaFreeSpace [get]
 Gets the usable free space (in bytes) for video recording. More...
 

Detailed Description

This class represents the DVD video recorder and is used to carry out the DVD recording.

Version
2.0

Constructor & Destructor Documentation

Creates a VideoRecorder object.

Member Function Documentation

void Dispose ( )

Disposes the VideoRecorder and reclaims the resources used by the object.

bool FinalizeMedia ( )

Finalizes VideoRecorder instance.

This is required for DVD-Video so that the content can be played by a conventional DVD player or even read by the operating system. The media used by the VideoRecorder cannot be ejected manually while the finalization is in progress.

Version
2.0
Returns
true if the video is finalized successfully. Otherwise false.
See also
VideoRecorder.IsFinalizeSupported, VideoRecorder.IsFinalized
ErrorInfo GetDeviceError ( int  deviceIndex)

Gets an object that can be used to query the error state of a specified device after a parallel operation of the video recorder.

This method should be used immediately after one of the following parallel operations:

VideoRecorder.PrepareMedia VideoRecorder.Start VideoRecorder.Write VideoRecorder.Stop VideoRecorder.FinalizeMedia

Only in this case the GetDeviceError method is guaranteed to return a consistent error state for the specified device.

Version
2.0
Parameters
deviceIndexA zero-based index of the device for which the error state is requested.
Returns
An object that contains information about the error state of a video recording device or null if the error state is not available.
bool GetIsFinalized ( int  deviceIndex)

Gets information whether the video in all attached devices is finalized.

If the finalized state cannot be obtained then VideoRecorder.Error facilicty is not ErrorFacility.Success.

Version
2.0
Parameters
deviceIndexThe index of the device that will be checked for a finalized video content.
Returns
The return value is true when the video is finalized and false when it's not finalized.
See also
VideoRecorder.IsFinalizeSupported, VideoRecorder.FinalizeMedia
Int64 GetMediaFreeSpace ( int  deviceIndex)

Gets the usable free space (in bytes) for video recording.

The returned value is the free space for the specified device. The video recorder can successfully stop the recording and finalize the video content even when the free space is zero.

This value can be used to estimate the remaining recording time as well (in combination with AverageBitrate). A good estimate of the available recording time in seconds is: MediaFreeSpace*8/AverageBitrate.

During recording this method should be used to estimate the remaining recording space instead of VRDevice.MediaFreeSpace

.

Version
2.0
Parameters
deviceIndexA zero-based index in the video recorder device list. Specifies the device for which the remaining free space is requested.
Returns
The remaining free space (in bytes) that can be used for video recording.
See also
VideoRecorder.AverageBitrate, VideoRecorder.Stop, VideoRecorder.FinalizeMedia, VideoRecorder.MediaFreeSpace, VRDevice.MediaFreeSpace
IList<Title> GetTitles ( int  deviceIndex)

Gets an object that can be used to enumerate all DVD-Video titles in the specified device.

Version
2.0
Parameters
deviceIndexA zero-based index in the video recorder device list. Specifies the device for which the DVD-Video titles will be retrieved.
Returns
A list that contains information about all titles on the specified disc.

The device must be initialized before calling this method.

VRDevicePlugin LoadDevicePlugin ( string  path)

The LoadDevicePlugin method creates a device plugin object.

Version
2.0
Parameters
pathA file system path to the plugin library.
Returns
An instance of the plugin object
bool PrepareMedia ( )

Prepares the media in the attached devices for writing.

It is an integral part of the Start and StartAsync methods. It is not neccesary to call PrepareMedia in order to start the recording. However the Start method may take much less time if PrepareMedia has been called beforehand.

Version
2.0
Returns
true if the media in all attached devices have been prepared successfully. Otherwise false.
See also
VideoRecorder.Start
bool Start ( )

Starts the recording process.

All VideoRecorder.Devices must be initialized before this method is called. After the recording has been started data must be passed to the recorder using the Write method. When the Start method returns successfully the media in VideoRecorder.Devices are locked and cannot be ejected manually. The media are unlocked when the recording is stopped.

Version
2.0
Returns
true if the recording process started successfully. The media used in the recording are locked and cannot be ejected manually. Otherwise false.
See also
VideoRecorder.Write(byte[]), VideoRecorder.Stop
bool StartAsync ( )

Starts the recording process asynchronously.

It is identical to VideoRecorder.Start except that StartAsync has a non-blocking behaviour. The video recorder starts a background task to prepare the media in all attached devices for writing. This is a potentially lengthy operation (especially for DVD+R discs) and StartAsync does not wait for it to finish. A VideoRecorder object is ready to accept data through the Write method as soon as StartSync returns even though the actual recording process is postponed after all media is prepared. If the video recorder cannot accept more data it will set the VideoRecorderError.StartAsyncBufferFull error when data is passed through the Write method. Then the Stop method should be called to stop the recording. The video recorder is designed to accept at least 2 minutes of MPEG-2 video at max birate.

Version
2.0
Returns
true if the recording process started successfully. The media used in the recording are locked and cannot be ejected manually. Otherwise false.
See also
VideoRecorder.Write(byte[]), VideoRecorder.Stop, VideoRecorder.Start
bool Stop ( )

Stops the recording process.

All data buffered in the VideoRecorder is flushed to VideoRecorder.Devices. This method is synchronous and it may take a while (approx. 20 sec.) before the method returns. All media used in the recording are unlocked after the method returns successfully.

Version
2.0
Returns
true if the recording has been stopped successfully. The media used in the recording are unlocked and can be ejected manually. Otherwise false.
See also
VideoRecorder.Start
bool Write ( IntPtr  dataPtr,
Int32  dataSize 
)

Passes data to the VideoRecorder to be written to all devices.

This method must be called continuously after Start has been called successfully and as long as there is available data to be written. If there is no more data Stop must be called.

Version
2.0
Parameters
dataPtrA pointer to data buffer that has to be written. The data is in the unmanaged memory.
dataSizeThe size (in bytes) of the data buffer specified by the dataPtr parameter
Returns
true if the data has been accepted by the recorder. false is the recorder has failed to accept the data or one or more of the attached devices have failed.

Use the VideoRecorder.GetDeviceError method to inspect the error state of the attached device when the Write method returns false. If all devices have failed the recording process has to be stopped using the Stop method and no more data must be passed to the recorder by calling the Write method. The recording may continue as long as there's at least one active (non-failed) device.

See also
VideoRecorder.Start, VideoRecorder.Stop
bool Write ( byte[]  data)

Passes data to the VideoRecorder to be written to all devices.

This method must be called continuously after Start has been called successfully and as long as there is available data to be written. If there is no more data Stop must be called.

Version
2.0
Parameters
dataThe data buffer that has to be written. The data is in the managed memory.
Returns
true if the data has been accepted by the recorder. false is the recorder has failed to accept the data or one or more of the attached devices have failed.

Use the VideoRecorder.GetDeviceError method to inspect the error state of the attached device when the Write method returns false. If all devices have failed the recording process has to be stopped using the Stop method and no more data must be passed to the recorder by calling the Write method. The recording may continue as long as there's at least one active (non-failed) device.

See also
VideoRecorder.Start, VideoRecorder.Stop

Property Documentation

bool AllowMuxBufferUnderflow
getset

Indicates whether or not a multiplexer buffer underflow is allowed.

Version
2.0.5
Int32 AverageBitrate
get

Gets the average bitrate (bits per second) of the video since the start of the recording.

The returned bitrate may be 0 when the first several seconds of the input video has not been processed yet by the video recorder. This should be checked explicitly when calculating the remaining recording time.

Version
2.0
See also
VideoRecorder.MediaFreeSpace, VideoRecorder.MediaFreeSpace, VideoRecorder.Start, VideoRecorder.Stop
IList<VRDevice> Devices
get

Gets the device list of the VideoRecorder.

The device list can be used to add or remove devices. The VideoRecorder needs at least one device in order to start the recording process.

Version
2.0
ErrorInfo Error
get

The error information for the last operation.

See also
ErrorInfo
bool IsFinalized
get

Gets information whether the video is finalized.

Returns true when the video is finalized, false otherwise. If the finalization state cannot be obtained then VideoRecorder.Error facilicty is not ErrorFacility.Success.

Version
2.0
See also
VideoRecorder.IsFinalizeSupported, VideoRecorder.FinalizeMedia
bool IsFinalizeSupported
get

Gets information whether the video supports finalization.

If it is supported then the FinalizeMedia method can be used to make discs more compatible for playing/reading. Returns true when the video supports finalization, false otherwise. If the finalization support cannot be obtained then VideoRecorder.Error facilicty is not ErrorFacility.Success.

Version
2.0
See also
VideoRecorder.FinalizeMedia, VideoRecorder.IsFinalized
Int64 MediaFreeSpace
get

Gets the usable free space (in bytes) for video recording.

The returned value is the minimum free space of all attached devices. The video recorder can successfully stop the recording and finalize the video content even when the free space is zero.

This value can be used to estimate the remaining recording time as well (in combination with GetAverageBitrate). A good estimate of the available recording time in seconds is: MediaFreeSpace*8/AverageBitrate.

During recording this method should be used to estimate the remaining recording space instead of VRDevice.MediaFreeSpace

.

Version
2.0
See also
VideoRecorder.AverageBitrate, VideoRecorder.FinalizeMedia, VideoRecorder.GetMediaFreeSpace, VRDevice.MediaFreeSpace