Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::Windows::Media::MediaBuffer Class Reference

Wrapper for the IMediaBuffer interface which provides methods for manipulating a data buffer. Buffers passed to the IMediaObject::ProcessInput and ProcessOutput methods must implement this interface. More...

#include <HWMediaObj.h>

Inheritance diagram for Harlinn::Windows::Media::MediaBuffer:
[legend]
Collaboration diagram for Harlinn::Windows::Media::MediaBuffer:
[legend]

Public Member Functions

void SetLength (DWORD length) const
 Specifies the length of the data currently in the buffer.
 
void GetMaxLength (DWORD *maxLength) const
 Retrieves the maximum number of bytes this buffer can hold.
 
DWORD GetMaxLength () const
 
void GetBufferAndLength (BYTE **buffer, DWORD *length) const
 Retrieves the buffer and the size of the valid data in the buffer.
 
std::span< BYTE > GetBufferAndLength () const
 
- Public Member Functions inherited from Harlinn::Common::Core::Unknown
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.
 
Unknownoperator= (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.
 
Unknownoperator= (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.
 
Unknownoperator= (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< TAs () 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>
TGetInterfacePointer () 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

- Public Types inherited from Harlinn::Common::Core::Unknown
using InterfaceType = IUnknown
 Every derived class defines InterfaceType as the type of the interface wrapped by the derived class.
 
- Static Public Member Functions inherited from Harlinn::Common::Core::Unknown
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)
 
- Protected Attributes inherited from Harlinn::Common::Core::Unknown
IUnknown * unknown_
 

Detailed Description

Wrapper for the IMediaBuffer interface which provides methods for manipulating a data buffer. Buffers passed to the IMediaObject::ProcessInput and ProcessOutput methods must implement this interface.

Member Function Documentation

◆ GetBufferAndLength() [1/2]

std::span< BYTE > Harlinn::Windows::Media::MediaBuffer::GetBufferAndLength ( ) const
inline

◆ GetBufferAndLength() [2/2]

void Harlinn::Windows::Media::MediaBuffer::GetBufferAndLength ( BYTE ** buffer,
DWORD * length ) const
inline

Retrieves the buffer and the size of the valid data in the buffer.

Parameters
bufferAddress of a pointer that receives the buffer array. Can be nullptr if length is not nullptr.
lengthPointer to a variable that receives the size of the valid data, in bytes. Can be nullptr if buffer is not nullptr.

◆ GetMaxLength() [1/2]

DWORD Harlinn::Windows::Media::MediaBuffer::GetMaxLength ( ) const
inline

◆ GetMaxLength() [2/2]

void Harlinn::Windows::Media::MediaBuffer::GetMaxLength ( DWORD * maxLength) const
inline

Retrieves the maximum number of bytes this buffer can hold.

Parameters
maxLengthPointer to a variable that receives the buffer's maximum size, in bytes.

◆ SetLength()

void Harlinn::Windows::Media::MediaBuffer::SetLength ( DWORD length) const
inline

Specifies the length of the data currently in the buffer.

Parameters
lengthSize of the data, in bytes. The value must not exceed the buffer's maximum size. Call the MediaBuffer::GetMaxLength function to obtain the maximum size.

The documentation for this class was generated from the following file: