Abstract interface for video decoders. More...
#include <ivideo_plugin.h>
Public Member Functions | |
virtual Sint32 | init (IBuffer *data)=0 |
Initializes the video decoder. More... | |
virtual Uint32 | get_encoded_width ()=0 |
Returns the encoded width of the video stream. More... | |
virtual Uint32 | get_encoded_height ()=0 |
Returns the encoded height of the video stream. More... | |
virtual const char * | get_format_parameter (const char *parameter)=0 |
Returns a video stream format parameter. Only available after initialization is completed. More... | |
virtual const char * | get_supported_type (Uint32 index) const =0 |
Returns the index -th supported pixel type. More... | |
virtual Sint32 | decode_canvas (neuraylib::ICanvas *canvas, IBuffer *data)=0 |
Decodes video stream data to a canvas. More... | |
virtual Sint32 | close ()=0 |
Closes the video stream. More... | |
virtual const char * | get_identifier () const =0 |
Returns a concise single-line unique identifier. More... | |
virtual bool | set_parameter (const char *name, const char *value)=0 |
Sets a parameter of the decoder. More... | |
virtual const char * | get_parameter (const char *name)=0 |
Returns the value of a parameter of the decoder. More... | |
Public Member Functions inherited from mi::base::IInterface | |
virtual Uint32 | retain () const =0 |
Increments the reference count. More... | |
virtual Uint32 | release () const =0 |
Decrements the reference count. More... | |
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
Acquires a const interface from another. More... | |
template<class T> | |
const T * | get_interface () const |
Acquires a const interface from another. More... | |
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
Acquires a mutable interface from another. More... | |
template<class T> | |
T * | get_interface () |
Acquires a mutable interface from another. More... | |
virtual Uuid | get_iid () const =0 |
Returns the interface ID of the most derived interface. More... | |
Additional Inherited Members | |
Public Types inherited from mi::base::Interface_declare< 0xe7fa52c7, ... > | |
typedef Interface_declare< id1, ... > | Self |
Own type. More... | |
typedef Uuid_t< id1, ... > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Types inherited from mi::base::IInterface | |
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | IID |
Declares the interface ID (IID) of this interface. More... | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0xe7fa52c7, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Static Public Member Functions inherited from mi::base::IInterface | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface. More... | |
Abstract interface for video decoders.
Note that the video decoder has an internal state. Hence, a separate decoder is needed for each stream. It is not possible to use one decoder for different streams, even if all parameters are identical.
|
pure virtual |
Closes the video stream.
|
pure virtual |
Decodes video stream data to a canvas.
Note that the provided data might contain enough information for several frames in which case 1 is returned. Call multiple times with NULL
for data
until 0 (or 2) is returned. If the data is not enough for a complete frame then 2 is returned in which case decode_canvas() must be called with more data before the frame can be decoded.
canvas | The target canvas. |
data | The data to decode. |
|
pure virtual |
Returns the encoded height of the video stream.
Only available after a completed initialization.
|
pure virtual |
Returns the encoded width of the video stream.
Only available after a completed initialization.
|
pure virtual |
Returns a video stream format parameter. Only available after initialization is completed.
|
pure virtual |
Returns a concise single-line unique identifier.
|
pure virtual |
Returns the value of a parameter of the decoder.
name | The name of the parameter to query. |
|
pure virtual |
Returns the index
-th supported pixel type.
The canvas passed to decode_canvas() must use one of the supported types.
The pixel types should be ordered, from index 0 for the most preferred to the least preferred type. See Types for a list of supported pixel types.
index | The index of the pixel type to be returned. |
index
-th supported pixel type, NULL
if index
is out of bounds.
|
pure virtual |
Initializes the video decoder.
If not enough data is provided then 1 is returned and this method must be called again with more data. If enough data was present to decode one or more frames, then those frames will be decoded as part of this call. After the call to init(), call decode_canvas() with data set to NULL
to get any buffered frames.
data | Video stream data to be decoded. |
|
pure virtual |
Sets a parameter of the decoder.
name | The name of the parameter to be changed. |
value | The new value to be set for the parameter. |
true
, if the parameter could be successfully set, false
otherwise.