Harlinn.Windows 0.1
|
The MediaObject class provides functions for manipulating a Microsoft DirectX Media Object. More...
#include <HWMediaObj.h>
Classes | |
class | MediaType |
struct | StreamCount |
Public Member Functions | |
void | GetStreamCount (DWORD *numberOfInputStreams, DWORD *numberOfOutputStreams) const |
Retrieves the number of input and output streams. | |
StreamCount | GetStreamCount () const |
void | GetInputStreamInfo (DWORD inputStreamIndex, DWORD *flags) const |
Retrieves information about an input stream, such as any restrictions on the number of samples per buffer, and whether the stream performs lookahead on the input data. This information never changes. | |
DWORD | GetInputStreamInfo (DWORD inputStreamIndex) const |
void | GetOutputStreamInfo (DWORD outputStreamIndex, DWORD *flags) const |
Retrieves information about an output stream; for example, whether the stream is discardable, and whether it uses a fixed sample size. This information never changes. | |
DWORD | GetOutputStreamInfo (DWORD outputStreamIndex) const |
bool | GetInputType (DWORD inputStreamIndex, DWORD typeIndex, DMO_MEDIA_TYPE *mediaType) const |
Retrieves a preferred media type for a specified input stream. | |
bool | GetOutputType (DWORD outputStreamIndex, DWORD typeIndex, DMO_MEDIA_TYPE *mediaType) const |
Retrieves a preferred media type for a specified output stream. | |
bool | SetInputType (DWORD inputStreamIndex, const DMO_MEDIA_TYPE *mediaType, DWORD flags=0) const |
Sets the media type on an input stream, or tests whether a media type is acceptable. | |
bool | IsValidInputType (DWORD inputStreamIndex, const DMO_MEDIA_TYPE *mediaType) |
void | ClearInputType (DWORD inputStreamIndex) |
bool | SetOutputType (DWORD outputStreamIndex, const DMO_MEDIA_TYPE *mediaType, DWORD flags) const |
Sets the media type on an output stream, or tests whether a media type is acceptable. | |
bool | IsValidOutputType (DWORD outputStreamIndex, const DMO_MEDIA_TYPE *mediaType) |
void | ClearOutputType (DWORD outputStreamIndex) |
bool | GetInputCurrentType (DWORD inputStreamIndex, DMO_MEDIA_TYPE *mediaType) const |
Retrieves the media type that was set for an input stream, if any. | |
bool | GetOutputCurrentType (DWORD outputStreamIndex, DMO_MEDIA_TYPE *mediaType) const |
void | GetInputSizeInfo (DWORD iputStreamIndex, DWORD *size, DWORD *maxLookahead, DWORD *alignment) const |
void | GetOutputSizeInfo (DWORD outputStreamIndex, DWORD *size, DWORD *alignment) const |
void | GetInputMaxLatency (DWORD inputStreamIndex, REFERENCE_TIME *maxLatency) const |
void | SetInputMaxLatency (DWORD inputStreamIndex, REFERENCE_TIME maxLatency) const |
void | Flush () const |
void | Discontinuity (DWORD inputStreamIndex) const |
void | AllocateStreamingResources () const |
void | FreeStreamingResources () const |
void | GetInputStatus (DWORD inputStreamIndex, DWORD *flags) const |
void | ProcessInput (DWORD inputStreamIndex, IMediaBuffer *buffer, DWORD flags, REFERENCE_TIME timestamp, REFERENCE_TIME timelength) const |
void | ProcessOutput (DWORD flags, DWORD outputBufferCount, DMO_OUTPUT_DATA_BUFFER *outputBuffers, DWORD *status) const |
void | Lock (LONG lock) const |
![]() | |
constexpr | Unknown () noexcept |
The default constructor ensures that the internal pointer to IUnknown is set to nullptr . | |
Unknown (IUnknown *unknown, bool addref=false) noexcept | |
Constructs a new Unknown , taking ownership of the interface pointer held by unknown . | |
Unknown (REFIID iid, const Unknown &unknown, bool throwIfNoInterface=true) | |
Initializes the new object to the interface identified by the iid parameter by querying the interface held by unknown for the requested interface. | |
Unknown (const Unknown &other) noexcept | |
Copy constructor, calls AddRef on the interface pointer held by other . | |
Unknown (Unknown &&other) noexcept | |
Move constructor takes ownership of the interface pointer held by other . | |
~Unknown () noexcept | |
Destructor, calling Release on the wrapped interface. | |
constexpr | operator bool () const noexcept |
Returns true if this object references an interface. | |
Unknown & | operator= (const Unknown &other) noexcept |
Copy assignment, which does nothing if other holds the same interface pointer as this object; and if not, calls Release on the currently held interface pointer, then copying the interface pointer from other , calling AddRef on the newly assigned interface pointer. | |
Unknown & | operator= (Unknown &&other) noexcept |
Move assignment exchanges the current interface pointer, with the interface pointer held by other . | |
void | swap (Unknown &other) noexcept |
Exchanges the current interface pointer, with the interface pointer held by other . | |
void | ResetPtr (IUnknown *other=nullptr, bool addRef=false) noexcept |
Calls Release on the currently held interface pointer if the interface pointer held by other points to a different interface. | |
Unknown & | operator= (nullptr_t) |
Assigning nullptr to the object, releases the currently held interface pointer, and sets the interface pointer to nullptr . | |
IUnknown * | Detach () |
Returns the currently held interface pointer, setting the interface pointer of the object to nullptr . | |
template<typename T > requires std::is_base_of_v<Unknown, T > | |
T | As () const |
Creates an instance of the interface wrapper class T, by querying the interface pointer for the interface type wrapped by T. | |
template<typename T > requires std::is_base_of_v<Unknown, T> | |
bool | Is () const noexcept |
Returns true if the interface can successfully be queried for the interface wrapped by T. | |
template<typename T > requires std::is_base_of_v<IUnknown, T> | |
ComPtr< T > | As () const |
Creates an instance of the interface smart pointer ComPtr<T> for the interface T, by querying the interface pointer for the interface type T. | |
template<typename T > requires std::is_base_of_v<IUnknown, T> | |
bool | Is () const noexcept |
This function can be used to detect if an object supports a particular COM interface derived from IUnknown. | |
template<typename T = IUnknown> | |
T * | GetInterfacePointer () const noexcept |
Retrieves a pointer to the interface wrapped by this object. | |
bool | QueryInterface (REFIID riid, void **itf) const |
Queries a COM object for a pointer to one of its interface; identifying the interface by a reference to its interface identifier (IID). | |
template<typename T > requires std::is_base_of_v<IUnknown, T> | |
bool | QueryInterface (T **itf) const |
Queries the interface for an interface pointer of type T. | |
constexpr bool | operator== (const Unknown &other) const noexcept |
Returns true if the interface pointer held by this object is the same as the interface pointer held by the other object. | |
constexpr bool | operator!= (const Unknown &other) const noexcept |
Returns true if the interface pointer held by this object is not the same as the interface pointer held by the other object. | |
constexpr bool | operator== (const IUnknown *other) const noexcept |
Returns true if the interface pointer held by this object is the same as the interface pointer held by other . | |
constexpr bool | operator!= (const IUnknown *other) const noexcept |
Returns true if the interface pointer held by this object is not the same as the interface pointer held by other . | |
Additional Inherited Members | |
![]() | |
using | InterfaceType = IUnknown |
Every derived class defines InterfaceType as the type of the interface wrapped by the derived class. | |
![]() | |
template<typename T = Unknown> requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromClassId (const CLSID &clsid, DWORD classContext=CLSCTX_INPROC_SERVER) |
Creates and default-initializes a single object of the class associated with a specified CLSID. | |
template<typename T = Unknown> requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromClassId (const wchar_t *clsid, DWORD classContext=CLSCTX_INPROC_SERVER) |
template<typename T = Unknown> requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromClassId (const WideString &clsid, DWORD classContext=CLSCTX_INPROC_SERVER) |
template<typename T = Unknown> requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromProgId (const wchar_t *progId, DWORD classContext=CLSCTX_INPROC_SERVER) |
template<typename T = Unknown> requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromProgId (const WideString &progId, DWORD classContext=CLSCTX_INPROC_SERVER) |
template<typename T = Unknown> requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromDll (const ModuleHandle &dll, const CLSID &clsid) |
![]() | |
IUnknown * | unknown_ |
The MediaObject class provides functions for manipulating a Microsoft DirectX Media Object.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Retrieves the media type that was set for an input stream, if any.
inputStreamIndex | Zero-based index of an input stream |
mediaType | Pointer to a DMO_MEDIA_TYPE structure allocated by the caller. The method fills the structure with the media type. |
The caller must set the media type for the stream before calling this method. To set the media type, call the MediaObject::SetInputType method.
If the method succeeds, call MoFreeMediaType to free the format block.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Retrieves information about an input stream, such as any restrictions on the number of samples per buffer, and whether the stream performs lookahead on the input data. This information never changes.
inputStreamIndex | Zero-based index of an input stream. |
flags | Pointer to a variable that receives a bitwise combination of zero or more _DMO_INPUT_STREAM_INFO_FLAGS flags. |
|
inline |
Retrieves a preferred media type for a specified input stream.
inputStreamIndex | Zero-based index of an input stream |
typeIndex | Zero-based index on the set of acceptable media types. |
mediaType | Pointer to a DMO_MEDIA_TYPE structure allocated by the caller, or nullptr. If this parameter is non-NULL, the method fills the structure with the media type. You can use the value NULL to test whether the type index is in range, by checking the return code. |
Call this method to enumerate an input stream's preferred media types. The DMO assigns each media type an index value in order of preference. The most preferred type has an index of zero. To enumerate all the types, make successive calls while incrementing the type index until the method returns false. The DMO is not guaranteed to enumerate every media type that it supports.
The format block in the returned type might be NULL. If so, the format type is GUID_NULL. Check the format type before dereferencing the format block.
If the method succeeds, call MoFreeMediaType to free the format block. (This function is also safe to call when the format block is NULL.)
To set the media type, call the MediaObject::SetInputType method. Setting the media type on one stream can change another stream's preferred types. In fact, a stream might not have a preferred type until the type is set on another stream. For example, a decoder might not have a preferred output type until the input type is set. However, the DMO is not required to update its preferred types dynamically in this fashion. Thus, the types returned by this method are not guaranteed to be valid; they might fail when used in the SetInputType method.
To test whether a particular media type is acceptable, call SetInputType with the DMO_SET_TYPEF_TEST_ONLY flag.
To test whether the typeIndex parameter is in range, set mediaType to NULL. The method returns true if the index is in range, or false if the index is out of range.
|
inline |
|
inline |
|
inline |
|
inline |
Retrieves information about an output stream; for example, whether the stream is discardable, and whether it uses a fixed sample size. This information never changes.
outputStreamIndex | Zero-based index of an output stream |
flags | Pointer to a variable that receives a bitwise combination of zero or more _DMO_OUTPUT_STREAM_INFO_FLAGS flags. |
|
inline |
Retrieves a preferred media type for a specified output stream.
outputStreamIndex | Zero-based index of an output stream |
typeIndex | Zero-based index on the set of acceptable media types. |
mediaType | Pointer to a DMO_MEDIA_TYPE structure allocated by the caller, or NULL. If this parameter is non-NULL, the method fills the structure with the media type. You can use the value NULL to test whether the type index is in range, by checking the return code. |
Call this method to enumerate an output stream's preferred media types. The DMO assigns each media type an index value, in order of preference. The most preferred type has an index of zero. To enumerate all the types, make successive calls while incrementing the type index, until the method returns false. The DMO is not guaranteed to enumerate every media type that it supports.
The format block in the returned type might be NULL. If so, the format type is GUID_NULL. You should check the format type before dereferencing the format block.
If the method succeeds, call MoFreeMediaType to free the format block. (This function is also safe to call when the format block is NULL.)
To set the media type, call the MediaObject::SetOutputType method. Setting the media type on one stream can change another stream's preferred types. In fact, a stream might not have a preferred type until the type is set on another stream. For example, a decoder might not have a preferred output type until the input type is set. However, the DMO is not required to update its preferred types dynamically in this fashion. Thus, the types returned by this method are not guaranteed to be valid; they might fail when used in the SetOutputType method.
To test whether a particular media type is acceptable, call SetOutputType with the DMO_SET_TYPEF_TEST_ONLY flag.
To test whether the typeIndex parameter is in range, set mediaType to NULL. The method returns true if the index is in range, or false if the index is out of range.
|
inline |
|
inline |
Retrieves the number of input and output streams.
numberOfInputStreams | Pointer to a variable that receives the number of input streams. |
numberOfOutputStreams | Pointer to a variable that receives the number of output streams. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Sets the media type on an input stream, or tests whether a media type is acceptable.
inputStreamIndex | Zero-based index of an input stream |
mediaType | Pointer to a DMO_MEDIA_TYPE structure that specifies the media type. |
flags | Bitwise combination of zero or more flags from the DMO_SET_TYPE_FLAGS enumeration. |
Call this method to test, set, or clear the media type on an input stream:
The media types that are currently set on other streams can affect whether the media type is acceptable.
|
inline |
Sets the media type on an output stream, or tests whether a media type is acceptable.
outputStreamIndex | Zero-based index of an output stream |
mediaType | ointer to a DMO_MEDIA_TYPE structure that specifies the media type. |
flags | Bitwise combination of zero or more flags from the DMO_SET_TYPE_FLAGS enumeration. |
Call this method to test, set, or clear the media type on an input stream:
The media types that are currently set on other streams can affect whether the media type is acceptable.