DiCE API nvidia_logo_transpbg.gif Up
mi::neuraylib::IVideo_decoder Class Referenceabstract

Abstract interface for video decoders. More...

#include <ivideo_plugin.h>

Inheritance diagram for mi::neuraylib::IVideo_decoder:

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 IInterfaceget_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 IInterfaceget_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...
 

Detailed Description

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.

Member Function Documentation

 close()

virtual Sint32 mi::neuraylib::IVideo_decoder::close ( )
pure virtual

Closes the video stream.

Returns
  • 0: Decoder successfully closed.
  • <0: Unspecified error.

 decode_canvas()

virtual Sint32 mi::neuraylib::IVideo_decoder::decode_canvas ( neuraylib::ICanvas canvas,
IBuffer *  data 
)
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.

Parameters
canvasThe target canvas.
dataThe data to decode.
Returns
  • 0: Frame successfully decoded.
  • 1: Successfully decoded frame, more frames are buffered.
  • 2: Insufficient data, call again with more data.
  • -1: Invalid parameters.
  • -2: Not initialized or closed.
  • -3: Parse error.
  • <-3: Unspecified error.

 get_encoded_height()

virtual Uint32 mi::neuraylib::IVideo_decoder::get_encoded_height ( )
pure virtual

Returns the encoded height of the video stream.

Only available after a completed initialization.

 get_encoded_width()

virtual Uint32 mi::neuraylib::IVideo_decoder::get_encoded_width ( )
pure virtual

Returns the encoded width of the video stream.

Only available after a completed initialization.

 get_format_parameter()

virtual const char * mi::neuraylib::IVideo_decoder::get_format_parameter ( const char *  parameter)
pure virtual

Returns a video stream format parameter. Only available after initialization is completed.

 get_identifier()

virtual const char * mi::neuraylib::IVideo_decoder::get_identifier ( ) const
pure virtual

Returns a concise single-line unique identifier.

 get_parameter()

virtual const char * mi::neuraylib::IVideo_decoder::get_parameter ( const char *  name)
pure virtual

Returns the value of a parameter of the decoder.

Parameters
nameThe name of the parameter to query.
Returns
The value of the parameter.

 get_supported_type()

virtual const char * mi::neuraylib::IVideo_decoder::get_supported_type ( Uint32  index) const
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.

Parameters
indexThe index of the pixel type to be returned.
Returns
The index -th supported pixel type, NULL if index is out of bounds.

 init()

virtual Sint32 mi::neuraylib::IVideo_decoder::init ( IBuffer *  data)
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.

Parameters
dataVideo stream data to be decoded.
Returns
  • 0: If the decoder was successfully initialized.
  • 1: Need more data.
  • -1: Invalid parameters.
  • -2: Already initialized or closed.
  • -3: No suitable device found (hardware decoders only).
  • -4: Failed to initialize encoder or other needed libraries.
  • -5: Error parsing data.
  • <-5: Unspecified error.

 set_parameter()

virtual bool mi::neuraylib::IVideo_decoder::set_parameter ( const char *  name,
const char *  value 
)
pure virtual

Sets a parameter of the decoder.

Parameters
nameThe name of the parameter to be changed.
valueThe new value to be set for the parameter.
Returns
true, if the parameter could be successfully set, false otherwise.