Xeno-rat
|
Media Object. More...
Public Member Functions | |
DmoMediaType? | GetInputType (int inputStream, int inputTypeIndex) |
Retrieves the input type for a specified input stream and input type index. | |
DmoMediaType? | GetOutputType (int outputStream, int outputTypeIndex) |
Retrieves the output type for a specified output stream and output type index. | |
DmoMediaType | GetOutputCurrentType (int outputStreamIndex) |
Retrieves the current output media type for the specified output stream index. | |
IEnumerable< DmoMediaType > | GetInputTypes (int inputStreamIndex) |
Retrieves the input types for the specified input stream index. | |
IEnumerable< DmoMediaType > | GetOutputTypes (int outputStreamIndex) |
Retrieves the output types for the specified output stream index. | |
bool | SupportsInputType (int inputStreamIndex, DmoMediaType mediaType) |
Checks if the specified input stream index supports the given media type. | |
void | SetInputType (int inputStreamIndex, DmoMediaType mediaType) |
Sets the input type. | |
void | SetInputWaveFormat (int inputStreamIndex, WaveFormat waveFormat) |
Sets the input wave format for the specified input stream. | |
bool | SupportsInputWaveFormat (int inputStreamIndex, WaveFormat waveFormat) |
Checks if the specified input stream supports the given wave format. | |
bool | SupportsOutputType (int outputStreamIndex, DmoMediaType mediaType) |
Checks if the specified output stream supports the given media type. | |
bool | SupportsOutputWaveFormat (int outputStreamIndex, WaveFormat waveFormat) |
Checks if the specified output stream supports the given wave format. | |
void | SetOutputType (int outputStreamIndex, DmoMediaType mediaType) |
Sets the output type n.b. may need to set the input type first. | |
void | SetOutputWaveFormat (int outputStreamIndex, WaveFormat waveFormat) |
Sets the output wave format for the specified output stream. | |
MediaObjectSizeInfo | GetInputSizeInfo (int inputStreamIndex) |
Retrieves the size information for the input stream at the specified index. | |
MediaObjectSizeInfo | GetOutputSizeInfo (int outputStreamIndex) |
Retrieves the size information for the specified output stream. | |
void | ProcessInput (int inputStreamIndex, IMediaBuffer mediaBuffer, DmoInputDataBufferFlags flags, long timestamp, long duration) |
Processes the input data using the specified media buffer and flags. | |
void | ProcessOutput (DmoProcessOutputFlags flags, int outputBufferCount, DmoOutputDataBuffer[] outputBuffers) |
Processes the output data buffers using the specified flags and output buffer count. | |
void | AllocateStreamingResources () |
Allocates streaming resources for the media object. | |
void | FreeStreamingResources () |
Frees the streaming resources used by the media object. | |
long | GetInputMaxLatency (int inputStreamIndex) |
Retrieves the maximum latency for the specified input stream. | |
void | Flush () |
Flushes the media object. | |
void | Discontinuity (int inputStreamIndex) |
Notifies the media object that a discontinuity has occurred in the input stream at the specified index. | |
bool | IsAcceptingData (int inputStreamIndex) |
Checks if the specified input stream is accepting data. | |
void | Dispose () |
Releases the unmanaged resources used by the media object. | |
Properties | |
int | InputStreamCount [get] |
Number of input streams. | |
int | OutputStreamCount [get] |
Number of output streams. | |
Private Member Functions | |
bool | SetInputType (int inputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags) |
Sets the input type for the specified input stream using the given media type. | |
DmoMediaType | CreateDmoMediaTypeForWaveFormat (WaveFormat waveFormat) |
Creates a DMO media type for the specified WaveFormat. | |
bool | SetOutputType (int outputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags) |
Sets the output type for the specified output stream using the provided media type. | |
Private Attributes | |
IMediaObject | mediaObject |
readonly int | inputStreams |
readonly int | outputStreams |
Media Object.
|
inline |
Allocates streaming resources for the media object.
System.Runtime.InteropServices.COMException | Thrown when an error occurs during the allocation of streaming resources. |
|
inlineprivate |
Creates a DMO media type for the specified WaveFormat.
waveFormat | The WaveFormat for which the DMO media type is to be created. |
This method initializes a DMO media type, sets the wave format, and returns the created media type.
|
inline |
Notifies the media object that a discontinuity has occurred in the input stream at the specified index.
inputStreamIndex | The index of the input stream where the discontinuity has occurred. |
System.Runtime.InteropServices.COMException | Thrown when an error occurs while notifying the media object about the discontinuity. |
|
inline |
Releases the unmanaged resources used by the media object.
This method releases the unmanaged resources used by the media object by calling the Marshal.ReleaseComObject(object) method. If the media object is not null, it releases the resources and sets the media object to null.
|
inline |
Flushes the media object.
System.Runtime.InteropServices.COMException | Thrown when an error is encountered while flushing the media object. |
|
inline |
Frees the streaming resources used by the media object.
System.Runtime.InteropServices.COMException | Thrown when an error occurs while freeing the streaming resources. |
|
inline |
Retrieves the maximum latency for the specified input stream.
inputStreamIndex | The index of the input stream for which to retrieve the maximum latency. |
System.Runtime.InteropServices.COMException | Thrown when an error occurs while retrieving the maximum latency from the media object. |
|
inline |
Retrieves the size information for the input stream at the specified index.
inputStreamIndex | The index of the input stream for which to retrieve size information. |
System.Runtime.InteropServices.COMException | Thrown when an error occurs while retrieving the input size information from the media object. |
|
inline |
Retrieves the input type for a specified input stream and input type index.
inputStream | The index of the input stream. |
inputTypeIndex | The index of the input type. |
COMException | Thrown when an error occurs while retrieving the input type. |
|
inline |
Retrieves the input types for the specified input stream index.
inputStreamIndex | The index of the input stream for which to retrieve the types. |
This method retrieves the input types for the specified input stream index by iterating through the available types using a while loop. It calls the GetInputType method to retrieve each type and yields the result until no more types are available.
|
inline |
Retrieves the current output media type for the specified output stream index.
outputStreamIndex | The index of the output stream for which to retrieve the media type. |
InvalidOperationException | Thrown when the media type was not set. |
Exception | Thrown when an error occurs while retrieving the media type. |
This method retrieves the current media type for the specified output stream index from the media object. If the operation is successful, it returns the current media type. If the media type was not set, it throws an InvalidOperationException. If an error occurs during the retrieval process, it throws an Exception with details of the error.
|
inline |
Retrieves the size information for the specified output stream.
outputStreamIndex | The index of the output stream for which to retrieve size information. |
MarshalDirectiveException | Thrown when an HRESULT indicates a failed COM method call. |
|
inline |
Retrieves the output type for a specified output stream and output type index.
outputStream | The index of the output stream. |
outputTypeIndex | The index of the output type. |
COMException | Thrown when an error occurs during the retrieval of the output type, except when the error is due to no more items being available. |
|
inline |
Retrieves the output types for the specified output stream index.
outputStreamIndex | The index of the output stream for which to retrieve the types. |
This method iterates through the output types of the specified output stream index using a while loop. It retrieves each output type using the GetOutputType method and yields the result. The method continues iterating until no more output types are found for the specified output stream index.
|
inline |
Checks if the specified input stream is accepting data.
inputStreamIndex | The index of the input stream to be checked. |
System.Runtime.InteropServices.COMException | Thrown when an error occurs while getting the input status from the media object. |
|
inline |
Processes the input data using the specified media buffer and flags.
inputStreamIndex | The index of the input stream. |
mediaBuffer | The media buffer containing the input data. |
flags | The flags indicating how the input data should be processed. |
timestamp | The timestamp of the input data. |
duration | The duration of the input data. |
System.Runtime.InteropServices.COMException | Thrown when an error occurs during processing the input data using the media object. |
|
inline |
Processes the output data buffers using the specified flags and output buffer count.
flags | The flags that specify the processing behavior. |
outputBufferCount | The number of output data buffers. |
outputBuffers | An array of DmoOutputDataBuffer objects containing the output data. |
System.Runtime.InteropServices.COMException | Thrown when an error occurs during the processing of output data. |
This method processes the output data buffers using the specified flags and output buffer count. It throws a COMException if an error occurs during the processing.
|
inline |
Sets the input type.
inputStreamIndex | Input stream index |
mediaType | Media Type |
|
inlineprivate |
Sets the input type for the specified input stream using the given media type.
inputStreamIndex | The index of the input stream for which the media type is to be set. |
mediaType | The media type to be set for the input stream. |
ArgumentException | Thrown when the specified media type is not supported. |
|
inline |
Sets the input wave format for the specified input stream.
inputStreamIndex | The index of the input stream for which the wave format is to be set. |
waveFormat | The WaveFormat to be set for the input stream. |
ArgumentException | Thrown when the specified media type is not supported. |
This method sets the input wave format for the specified input stream using the DMO (DirectX Media Object) media type. It creates a DMO media type based on the provided WaveFormat and sets it for the input stream using DmoInterop.SetInputType method. If the media type cannot be set, an ArgumentException is thrown with the message "Media Type not supported".
|
inline |
Sets the output type n.b. may need to set the input type first.
outputStreamIndex | Output stream index |
mediaType | Media type to set |
|
inlineprivate |
Sets the output type for the specified output stream using the provided media type.
outputStreamIndex | The index of the output stream for which the media type is to be set. |
mediaType | The media type to be set for the output stream. |
ArgumentException | Thrown when the specified media type is not supported. |
|
inline |
Sets the output wave format for the specified output stream.
outputStreamIndex | The index of the output stream for which the wave format is to be set. |
waveFormat | The wave format to be set for the output stream. |
ArgumentException | Thrown when the specified media type is not supported. |
|
inline |
Checks if the specified input stream index supports the given media type.
inputStreamIndex | The index of the input stream to be checked. |
mediaType | The media type to be checked for support. |
|
inline |
Checks if the specified input stream supports the given wave format.
inputStreamIndex | The index of the input stream to be checked. |
waveFormat | The wave format to be checked for support. |
This method creates a DMO media type for the provided wave format and then sets the input type for the specified input stream using the DMO_SET_TYPEF_TEST_ONLY flag to check for support. After the check, the allocated DMO media type is freed using MoFreeMediaType method.
|
inline |
Checks if the specified output stream supports the given media type.
outputStreamIndex | The index of the output stream to be checked. |
mediaType | The media type to be checked for support. |
This method internally calls the SetOutputType method with the DMO_SET_TYPEF_TEST_ONLY flag to check if the specified output stream supports the given media type without actually setting it.
|
inline |
Checks if the specified output stream supports the given wave format.
outputStreamIndex | The index of the output stream to be checked. |
waveFormat | The wave format to be checked for support. |
This method creates a DMO media type for the provided wave format and sets the output type for the specified stream to test if it is supported. It then frees the allocated media type and returns the result indicating whether the wave format is supported by the output stream.
|
private |
|
private |
|
private |
|
get |
Number of input streams.
|
get |
Number of output streams.