mi::neuraylib::IVideo_decoder Class Reference
[Extensions and Plugins]
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.
Public Member Functions
- virtual bool close() =0
- Closes the video stream. More...
- virtual bool decode_canvas( neuraylib::ICanvas* canvas, IBuffer* data, bool* need_more_data, bool* buffered_frames) =0
- Decodes video stream data to a canvas. More...
- virtual Uint32 get_encoded_height() =0
- Returns the encoded height of the video stream. More...
- virtual Uint32 get_encoded_width() =0
- Returns the encoded width 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.
- virtual const char* get_identifier() const =0
- Returns a concise single-line unique identifier.
- virtual const char* get_parameter( const char* name) =0
- Returns the value of a parameter of the decoder. More...
- virtual const char* get_supported_type( Uint32 index) const =0
- Returns the index -th supported pixel type. More...
- virtual bool init( IBuffer* data, bool* need_more_data) =0
- Initializes the video decoder. More...
- virtual bool set_parameter( const char* name, const char* value) =0
- Sets a parameter of the decoder. More...
Member Functions
- virtual bool mi::neuraylib::IVideo_decoder::close() [pure virtual]
-
Closes the video stream.
Returns
true , if the stream was successfully closed, false otherwise.
- virtual bool mi::neuraylib::IVideo_decoder::decode_canvas( neuraylib::ICanvas* canvas, IBuffer* data, bool* need_more_data, bool* buffered_frames) [pure virtual]
-
Decodes video stream data to a canvas. Note that the provided data might contain enough information for several frames. Call multiple times with NULL for data until the output variable buffered_frames is set to false. Also, if the output variable need_more_data is set to true, then the data provided was not enough for the next frame. Call again with more data.
Parameters
- canvas
- The target canvas.
- data
- The data to decode.
- need_more_data
- true if no frame could be decoded yet. Call again with more data.
- buffered_frames
- true if there are additional decoded frames queued. false otherwise.
Returns
false if there was an error, true otherwise.
- 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.
- 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.
- 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.
- virtual const char* mi::neuraylib::IVideo_decoder::get_identifier() const [pure virtual]
-
Returns a concise single-line unique identifier.
- virtual const char* mi::neuraylib::IVideo_decoder::get_parameter( const char* name) [pure virtual]
-
Returns the value of a parameter of the decoder.
Parameters
- name
- The name of the parameter to query.
Returns
The value of the parameter.
- 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
- index
- The index of the pixel type to be returned.
Returns
The index -th supported pixel type, NULL if index is out of bounds.
- virtual bool mi::neuraylib::IVideo_decoder::init( IBuffer* data, bool* need_more_data) [pure virtual]
-
Initializes the video decoder. If not enough data is provided then the need_more_data output parameter is set to true 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
- data
- Video stream data to be decoded.
- need_more_data
- true if more data is required to initialize the video stream, false otherwise.
Returns
true , if the stream data was successfully parsed (though more data might be needed). false if initialization failed.
- virtual bool mi::neuraylib::IVideo_decoder::set_parameter( const char* name, const char* value) [pure virtual]
-
Sets a parameter of the decoder.
Parameters
- name
- The name of the parameter to be changed.
- value
- The new value to be set for the parameter.
Returns
true , if the parameter could be successfully set, false otherwise.