AVBlocks for C++
1.9
Audio and Video Software Development Kit
|
An input or output point of the Transcoder. More...
Inherits Reference.
Public Member Functions | |
virtual void | setFile (const char_t *filename)=0 |
Sets the file associated with the media socket. | |
virtual const char_t * | file () const =0 |
Returns the file associated with the media socket and previously set via setFile(). | |
virtual void | setStream (primo::Stream *stream)=0 |
Sets the user stream associated with the media socket. | |
virtual primo::Stream * | stream () const =0 |
Returns the associated user stream previously set via setStream(). | |
virtual void | setStreamType (primo::codecs::StreamType::Enum streamType)=0 |
Sets explicitly the format of the associated file or stream. | |
virtual primo::codecs::StreamType::Enum | streamType () const =0 |
Returns the stream type of the associated file or user stream. | |
virtual void | setStreamSubType (primo::codecs::StreamSubType::Enum streamSubType)=0 |
Sets explicitly the stream subtype of the associated file or user stream. | |
virtual primo::codecs::StreamSubType::Enum | streamSubType () const =0 |
Returns the stream subtype of the associated file or user stream. | |
virtual ParameterList * | params () const =0 |
Returns a collection of socket parameters. | |
virtual void | setParams (ParameterList *params)=0 |
Sets the socket parameters. | |
virtual MediaPinList * | pins () const =0 |
Returns a modifiable collection with all the pins (elementary streams) that are defined for this socket. | |
virtual void | setTimePosition (double time)=0 |
Sets the socket time position. | |
virtual double | timePosition () const =0 |
Returns the socket time position. | |
virtual primo::codecs::Metadata * | metadata () const =0 |
Returns the socket metadata. | |
virtual void | setMetadata (primo::codecs::Metadata *metadata)=0 |
Sets the socket metadata. | |
Static Public Member Functions | |
static MediaSocket * | createFromMediaInfo (MediaInfo *mediaInfo) |
Creates a media socket from a MediaInfo object. | |
static MediaSocket * | createFromPreset (Preset::Enum preset, Quality::Enum quality) |
Creates a media socket from an AVBlocks Preset. | |
Protected Member Functions | |
~MediaSocket () | |
This object can be destroyed only by the AVBlocks library. |
An input or output point of the Transcoder.
A MediaSocket object describes either a container (WAV, AVI, MP4, etc.) with one or more streams or simply an elementary stream (MP3, M2V, etc.).
When MediaSocket describes a container the child collection of media pins can contain one or more items (for each contained stream). The socket stream type designates the container type.
When MediaSocket describes an elementary stream the child collection of media pins contains a single item which is the elementary stream itself. The socket stream type is the same as the pin stream type.
MediaSocket * createFromMediaInfo | ( | MediaInfo * | mediaInfo | ) | [static] |
Creates a media socket from a MediaInfo object.
mediaInfo | [in] A pointer to a MediaInfo object with loaded audio/video information. This object is not needed once this method returns. |
This method is meant to help in setting correctly the inputs of the Transcoder. The intended usage is as follows:
References avb_create_media_socket_from_media_info().
MediaSocket * createFromPreset | ( | Preset::Enum | preset, |
Quality::Enum | quality = Quality::Normal |
||
) | [static] |
Creates a media socket from an AVBlocks Preset.
preset | [in] A constant from the Preset enum. |
quality | [in] The required quality of the preset. A constant from the Quality enum. Some presets supports various levels of quality, while others support only a fixed quality in which case the quality parameter is ignored. |
This method is meant to help in setting correctly the outputs of the Transcoder. The intended usage is as follows:
References avb_create_media_socket_from_preset().
virtual const char_t* file | ( | ) | const [pure virtual] |
Returns the file associated with the media socket and previously set via setFile().
virtual primo::codecs::Metadata* metadata | ( | ) | const [pure virtual] |
Returns the socket metadata.
virtual ParameterList* params | ( | ) | const [pure virtual] |
Returns a collection of socket parameters.
These parameters are used when splitting the input or multiplexing the output defined by this media socket.
The caller is not required to release the returned object.
virtual MediaPinList* pins | ( | ) | const [pure virtual] |
Returns a modifiable collection with all the pins (elementary streams) that are defined for this socket.
The returned collection exists only in the context of MediaSocket. The caller cannot influence the lifetime of the returned object.
virtual void setFile | ( | const char_t * | filename | ) | [pure virtual] |
Sets the file associated with the media socket.
filename | [in] a filename as a Unicode zero terminated string. If NULL the filename is cleared. When not NULL the filename is copied internally and is not required after the method returns. |
virtual void setMetadata | ( | primo::codecs::Metadata * | metadata | ) | [pure virtual] |
Sets the socket metadata.
When an output socket has metadata the transcoder tries to generate it regardless of the input metadata. When an output socket has no metadata (NULL) but an input socket has metadata (not NULL) the transcoder uses the input metadata as if it is set for the output.
metadata | [in] A pointer to a Metadata object. Can be NULL in which case the metadata is cleared from the socket. |
virtual void setParams | ( | ParameterList * | params | ) | [pure virtual] |
Sets the socket parameters.
params | [in] A pointer to a ParameterList object. If NULL the stored collection is reset to NULL. Internally the ParameterList object is retained by MediaSocket, so it is safe to release it after this method returns. |
virtual void setStream | ( | primo::Stream * | stream | ) | [pure virtual] |
Sets the user stream associated with the media socket.
This is an alternative to setFile().
stream | [in] A pointer to a Stream object. If NULL the stream object is cleared. Internally the Stream object is retained by MediaSocket, so it is safe to release it after this method returns. |
When both a file and a user stream are associated with a socket the transcoder prefers the stream.
virtual void setStreamType | ( | primo::codecs::StreamType::Enum | streamType | ) | [pure virtual] |
Sets explicitly the format of the associated file or stream.
streamType | [in] stream type such as AVI, WAV, MP4, etc. |
The Transcoder uses this format and the associated file or stream according to following rules:
File | Stream | Type | How MediaSocket is treated by Transcoder |
Y | N | N | OK - the socket defines a file whose type is implicitly determined by the file extension. |
Y | N | Y | OK - the socket defines a file whose type is explicitly specified by the stream type. |
Y,N | Y | Y | OK - the socket defines a user stream whose type is explicitly specified. |
Y,N | Y | N | Error - the socket defines a user stream but its type is unknown. |
N | N | Y | OK - the socket does not have a physical storage. it only describes the input/output data. This is the required definition for input sockets when the push() method is used and also the required definition for output sockets when the pull() method is used. |
N | N | N | Error - undefined socket. |
virtual void setTimePosition | ( | double | time | ) | [pure virtual] |
Sets the socket time position.
This property can be used on an input socket to start reading / decoding from a specific point in time. The transcoder tries to seek in the input socket to the time position before the transcoding operation starts.
time | [in] Time position in seconds. |
virtual primo::Stream* stream | ( | ) | const [pure virtual] |
Returns the associated user stream previously set via setStream().
virtual primo::codecs::StreamSubType::Enum streamSubType | ( | ) | const [pure virtual] |
Returns the stream subtype of the associated file or user stream.
virtual primo::codecs::StreamType::Enum streamType | ( | ) | const [pure virtual] |
Returns the stream type of the associated file or user stream.
virtual double timePosition | ( | ) | const [pure virtual] |
Returns the socket time position.
This property can be used on an input socket to start reading / decoding from a specific point in time. The transcoder tries to seek in the input socket to the time position before the transcoding operation starts.