|
Ocean
|
This class implements utilities functions for the Microsoft Media Foundation. More...
#include <Utilities.h>
Data Structures | |
| struct | GUIDCompare |
| GUID helper struct. More... | |
Static Public Member Functions | |
| static std::string | attribute2String (const GUID &attribute) |
| Translates a media foundation attribute to a readable string. | |
| static std::string | majorMediaType2String (const GUID &type) |
| Translates a major media type to a readable string. | |
| static std::string | videoSubtype2String (const GUID &type) |
| Translates a video subtype to a readable string. | |
| static std::string | unregisteredVideoSubtype2String (const GUID &type) |
| Translates an unregistered video subtype to a readable string. | |
| static std::string | audioSubtype2String (const GUID &type) |
| Translates an audio subtype to a readable string. | |
| static std::string | transformCategory2String (const GUID &category) |
| Translates an transform category to a readable string. | |
| static std::string | guid2String (const GUID &value) |
| Translates the GUID key to a string. | |
| static bool | dumpAttributes (IMFAttributes *attributes, std::string &result) |
| Dumps a set of attributes to a string object. | |
| static bool | enumerateTransforms (std::string &result) |
| Enumerates the registered media foundation transforms. | |
| static LiveVideo::StreamType | mediaSubtypeToStreamType (const GUID &mediaSubtype, LiveVideo::CodecType *codecType=nullptr) |
| Returns the stream type of a Media Foundation media subtype. | |
| static FrameType::PixelFormat | mediaSubtypeToPixelFormat (const GUID &mediaSubtype) |
| Returns the pixel format of a Media Foundation media subtype. | |
| static GUID | convertPixelFormat (const FrameType::PixelFormat pixelFormat) |
| Converts a pixel format to a Media Foundation media subtype. | |
| static ScopedIMFMediaSource | createMediaSourceByUrl (const std::wstring &url) |
| Creates the media source object for a given URL. | |
| static ScopedIMFTopologyNode | addSourceNodeToTopology (IMFTopology *topology, IMFMediaSource *mediaSource, IMFPresentationDescriptor *presentationDescriptor, IMFStreamDescriptor *streamDescriptor) |
| Adds a source node to a given topology. | |
| static ScopedIMFTopologyNode | addOutputNodeToTopology (IMFTopology *topology, IMFActivate *sinkActivate, const DWORD streamIndex=0) |
| Adds an output node to a given topology. | |
| static bool | connectSelectedStream (IMFTopology *topology, IMFMediaSource *mediaSource, IMFActivate *sinkActivate, const GUID &majorMediaType) |
| Connects the selected media source with a given sink activate object. | |
| static bool | getAllocatedString (IMFActivate *activate, const GUID &key, std::string &value) |
| Returns an allocated string from an activate. | |
| template<typename T > | |
| static ScopedMediaFoundationObject< T > | topologyNodeObject (IMFTopologyNode *node) |
| Extracts an object from a topology node. | |
| template<typename T > | |
| static ScopedMediaFoundationObject< T > | eventObject (IMFMediaEvent *mediaEvent) |
| Extracts an object from an event. | |
Private Types | |
| using | IdMap = std::map< GUID, std::string, GUIDCompare > |
| Definition of a map mapping GUID objects to strings. | |
Static Private Member Functions | |
| static IdMap | guidMap () |
| Returns a map mapping all GUID ids to readable strings. | |
| static IdMap | attributeMap () |
| Returns a map mapping attribute GUID ids to readable strings. | |
| static IdMap | majorMediaTypeMap () |
| Returns a map mapping major media type GUID ids to readable strings. | |
| static IdMap | videoSubtypeMap () |
| Returns a map mapping video subtype GUID ids to readable strings. | |
| static IdMap | audioSubtypeMap () |
| Returns a map mapping audio subtype GUID ids to readable strings. | |
| static IdMap | transformCategoryMap () |
| Returns a map mapping transform category GUID ids to readable strings. | |
This class implements utilities functions for the Microsoft Media Foundation.
|
private |
Definition of a map mapping GUID objects to strings.
|
static |
Adds an output node to a given topology.
| topology | The topology to that the node will be added, must be valid |
| sinkActivate | Sink activate object, must be valid |
| streamIndex | Stream index |
|
static |
Adds a source node to a given topology.
| topology | The topology to that the node will be added, must be valid |
| mediaSource | Media source object, must be valid |
| presentationDescriptor | Presentation descriptor, must be valid |
| streamDescriptor | Stream descriptor, must be valid |
|
static |
Translates a media foundation attribute to a readable string.
| attribute | The attribute to be translated |
|
staticprivate |
Returns a map mapping attribute GUID ids to readable strings.
|
static |
Translates an audio subtype to a readable string.
| type | The type to be translated |
|
staticprivate |
Returns a map mapping audio subtype GUID ids to readable strings.
|
static |
Connects the selected media source with a given sink activate object.
| topology | The topology that will receive the connection, must be valid |
| mediaSource | The media source object, must be valid |
| sinkActivate | The sink activate object, must be valid |
| majorMediaType | Major media type |
|
static |
|
static |
Creates the media source object for a given URL.
The resulting object has to be released by the caller.
| url | URL for that the media source object will be returned |
|
static |
Dumps a set of attributes to a string object.
| attributes | The attributes to dump |
| result | Resulting dump |
|
static |
Enumerates the registered media foundation transforms.
| result | The resulting enumerated transforms |
|
static |
Extracts an object from an event.
| mediaEvent | Media event from that the object will be extracted, must be valid |
| T | Data type of the desired object |
|
static |
Returns an allocated string from an activate.
| activate | The activate from which the string will be returned, must be valid |
| key | The key identifying which value to retrieve, must be valid |
| value | The resulting string value @reutrn True, if succeeded |
|
static |
Translates the GUID key to a string.
| value | The value to be translated |
|
staticprivate |
Returns a map mapping all GUID ids to readable strings.
|
static |
Translates a major media type to a readable string.
| type | The type to be translated |
|
staticprivate |
Returns a map mapping major media type GUID ids to readable strings.
|
static |
|
static |
Returns the stream type of a Media Foundation media subtype.
| mediaSubtype | Media Foundation media type for that the stream type will be returned |
| codecType | Optional resulting codec type, nullptr if not of interest |
|
static |
Extracts an object from a topology node.
| node | The node from that the object will be extracted, must be valid |
| T | Data type of the desired object |
|
static |
Translates an transform category to a readable string.
| category | The category to be translated |
|
staticprivate |
Returns a map mapping transform category GUID ids to readable strings.
|
static |
Translates an unregistered video subtype to a readable string.
| type | The type to be translated |
|
static |
Translates a video subtype to a readable string.
| type | The type to be translated |
|
staticprivate |
Returns a map mapping video subtype GUID ids to readable strings.