Iray SDK API nvidia_logo_transpbg.gif Up
ivideo_plugin.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IVIDEO_PLUGIN_H
8#define MI_NEURAYLIB_IVIDEO_PLUGIN_H
9
10#include <mi/base/types.h>
11#include <mi/base/plugin.h>
13
14namespace mi {
15
16namespace neuraylib {
17
18class IBuffer;
19class ICanvas;
20class ICanvas_cuda;
21class IPlugin_api;
22
28#define MI_NEURAY_VIDEO_PLUGIN_TYPE "video v32"
29
31class IVideo_data : public
32 mi::base::Interface_declare<0xbdd686fa,0x3e37,0x43aa,0xbd,0xe6,0x7b,0xab,0x9f,0x3e,0x1c,0xfc>
33{
34public:
37 virtual Uint8* get_data() = 0;
38
41 virtual Size get_data_size() const = 0;
42
45 virtual bool is_key_frame() const = 0;
46};
47
48
54class IVideo_encoder : public
55 mi::base::Interface_declare<0x572ef6ad,0xbc37,0x417d,0xbf,0x7c,0x17,0x17,0x4e,0x96,0xa3,0x06>
56{
57public:
73 virtual Sint32 init(
74 Uint32 resolution_x, Uint32 resolution_y,
75 IVideo_data** out) = 0;
76
83 virtual bool set_parameter(const char* name, const char* value) = 0;
84
89 virtual const char* get_parameter(const char* name) = 0;
90
100 virtual const char* get_supported_type(Uint32 index) const = 0;
101
115 virtual Sint32 encode_canvas(const ICanvas* canvas, IVideo_data** out) = 0;
116
131 virtual Sint32 encode_canvas(const ICanvas_cuda* canvas, IVideo_data** out) = 0;
132
143 virtual Sint32 close(IVideo_data** out) = 0;
144
146 virtual const char* get_identifier() const = 0;
147};
148
154class IVideo_decoder : public
155 mi::base::Interface_declare<0xe7fa52c7,0xd881,0x4a29,0x9e,0x82,0x3b,0xdd,0xa6,0xcf,0x14,0xc8>
156{
157public:
174 virtual Sint32 init( IBuffer* data) = 0;
175
179
183
185 virtual const char* get_format_parameter( const char* parameter) = 0;
186
196 virtual const char* get_supported_type( Uint32 index) const = 0;
197
215 virtual Sint32 decode_canvas(neuraylib::ICanvas* canvas, IBuffer* data) = 0;
216
222 virtual Sint32 close() = 0;
223
225 virtual const char* get_identifier() const = 0;
226
233 virtual bool set_parameter( const char* name, const char* value) = 0;
234
239 virtual const char* get_parameter( const char* name) = 0;
240};
241
242
247{
248public:
254 virtual const char* get_name() const = 0;
255
260 virtual bool init( IPlugin_api* plugin_api) = 0;
261
266 virtual bool exit( IPlugin_api* plugin_api) = 0;
267
270
273};
274
277 mi::base::Interface_declare<0x79be801,0x17a7,0x48d8,0x8a,0x4,0x73,0xd4,0x35,0x6d,0x2,0x28>
278{
279public:
283 virtual IVideo_encoder* create_video_encoder( const char* codec_name) = 0;
284
286 virtual IVideo_decoder* create_video_decoder( const char* codec_name) = 0;
287};
288 // end group mi_neuray_plugins
290
291} // namespace neuraylib
292
293} // namespace mi
294
295#endif // MI_NEURAYLIB_IVIDEO_PLUGIN_H
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
The abstract base class for plugins.
Definition: plugin.h:34
Abstract interface for a simple buffer with binary data.
Definition: ibuffer.h:25
Abstract interface for a canvas with CUDA device memory storage.
Definition: icanvas_cuda.h:28
Abstract interface for a canvas represented by a rectangular array of tiles.
Definition: icanvas.h:85
This abstract interface gives access to the Iray SDK API to plugins.
Definition: iplugin_api.h:27
API component that allow creation of installed video encoders and decoders.
Definition: ivideo_plugin.h:278
virtual IVideo_decoder * create_video_decoder(const char *codec_name)=0
Returns a video decoder for the requested codec, or NULL if unsupported.
virtual IVideo_encoder * create_video_encoder(const char *codec_name)=0
Creates a video encoder for a given codec.
A buffer for video data representing a frame.
Definition: ivideo_plugin.h:33
virtual Size get_data_size() const =0
Returns the size of the buffer.
virtual bool is_key_frame() const =0
Indicates whether this frame is a key frame.
virtual Uint8 * get_data()=0
Returns a pointer to the data of the buffer.
Abstract interface for video decoders.
Definition: ivideo_plugin.h:156
virtual Uint32 get_encoded_width()=0
Returns the encoded width of the video stream.
virtual Uint32 get_encoded_height()=0
Returns the encoded height of the video stream.
virtual Sint32 close()=0
Closes the video stream.
virtual const char * get_parameter(const char *name)=0
Returns the value of a parameter of the decoder.
virtual Sint32 decode_canvas(neuraylib::ICanvas *canvas, IBuffer *data)=0
Decodes video stream data to a canvas.
virtual Sint32 init(IBuffer *data)=0
Initializes the video decoder.
virtual const char * get_format_parameter(const char *parameter)=0
Returns a video stream format parameter. Only available after initialization is completed.
virtual bool set_parameter(const char *name, const char *value)=0
Sets a parameter of the decoder.
virtual const char * get_supported_type(Uint32 index) const =0
Returns the index -th supported pixel type.
virtual const char * get_identifier() const =0
Returns a concise single-line unique identifier.
Abstract interface for video encoders.
Definition: ivideo_plugin.h:56
virtual Sint32 encode_canvas(const ICanvas_cuda *canvas, IVideo_data **out)=0
Encodes the pixel data contained in a cuda canvas.
virtual Sint32 init(Uint32 resolution_x, Uint32 resolution_y, IVideo_data **out)=0
Initializes the video stream.
virtual const char * get_identifier() const =0
Returns a concise single-line unique identifier.
virtual Sint32 close(IVideo_data **out)=0
Closes the video stream.
virtual bool set_parameter(const char *name, const char *value)=0
Sets a parameter for the video stream.
virtual Sint32 encode_canvas(const ICanvas *canvas, IVideo_data **out)=0
Encodes the pixel data contained in a canvas.
virtual const char * get_supported_type(Uint32 index) const =0
Returns the index -th supported pixel type.
virtual const char * get_parameter(const char *name)=0
Returns the value of a parameter for the video stream.
Abstract interface for video encoder plugins.
Definition: ivideo_plugin.h:247
virtual IVideo_decoder * create_video_decoder() const =0
Creates a new decoder for a video stream.
virtual bool init(IPlugin_api *plugin_api)=0
Initializes the plugin.
virtual bool exit(IPlugin_api *plugin_api)=0
De-initializes the plugin.
virtual IVideo_encoder * create_video_encoder() const =0
Creates a new encoder for a video stream.
virtual const char * get_name() const =0
Returns the name of the plugin.
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
unsigned char Uint8
8-bit unsigned integer.
Definition: types.h:47
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: neuraylib.h:179
Base class for all plugins.
Basic types.