NVIDIA Iray API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ivideo_plugin.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // Copyright 1986, 2016 NVIDIA Corporation. All rights reserved.
3 // ****************************************************************************
6 // ****************************************************************************
7 
8 #ifndef MI_NEURAYLIB_IVIDEO_PLUGIN_H
9 #define MI_NEURAYLIB_IVIDEO_PLUGIN_H
10 
11 #include <mi/base/types.h>
12 #include <mi/base/plugin.h>
14 #include <mi/neuraylib/version.h>
15 
16 namespace mi {
17 
18 namespace neuraylib {
19 
20 class IBuffer;
21 class ICanvas;
22 class IPlugin_api;
23 
28 #define MI_NEURAY_VIDEO_PLUGIN_TYPE "video v8"
30 
32 class IVideo_data : public
33  mi::base::Interface_declare<0xbdd686fa,0x3e37,0x43aa,0xbd,0xe6,0x7b,0xab,0x9f,0x3e,0x1c,0xfc>
34 {
35 public:
38  virtual Uint8* get_data() = 0;
39 
42  virtual Size get_data_size() const = 0;
43 
46  virtual bool is_key_frame() const = 0;
47 };
48 
49 
55 class IVideo_encoder : public
56  mi::base::Interface_declare<0x572ef6ad,0xbc37,0x417d,0xbf,0x7c,0x17,0x17,0x4e,0x96,0xa3,0x06>
57 {
58 public:
68  virtual bool init(
69  Uint32 resolution_x, Uint32 resolution_y,
70  IVideo_data** out) = 0;
71 
78  virtual bool set_parameter(const char* name, const char* value) = 0;
79 
84  virtual const char* get_parameter(const char* name) = 0;
85 
95  virtual const char* get_supported_type(Uint32 index) const = 0;
96 
104  virtual bool encode_canvas(const ICanvas* canvas, IVideo_data** out) = 0;
105 
112  virtual bool close(IVideo_data** out) = 0;
113 
115  virtual const char* get_identifier() const = 0;
116 };
117 
123 class IVideo_decoder : public
124  mi::base::Interface_declare<0xe7fa52c7,0xd881,0x4a29,0x9e,0x82,0x3b,0xdd,0xa6,0xcf,0x14,0xc8>
125 {
126 public:
138  virtual bool init( IBuffer* data, bool* need_more_data) = 0;
139 
142  virtual Uint32 get_encoded_width() = 0;
143 
146  virtual Uint32 get_encoded_height() = 0;
147 
149  virtual const char* get_format_parameter( const char* parameter) = 0;
150 
160  virtual const char* get_supported_type( Uint32 index) const = 0;
161 
175  virtual bool decode_canvas(
176  neuraylib::ICanvas* canvas, IBuffer* data, bool* need_more_data, bool* buffered_frames) = 0;
177 
181  virtual bool close() = 0;
182 
184  virtual const char* get_identifier() const = 0;
185 
192  virtual bool set_parameter( const char* name, const char* value) = 0;
193 
198  virtual const char* get_parameter( const char* name) = 0;
199 };
200 
201 
206 {
207 public:
213  virtual const char* get_name() const = 0;
214 
219  virtual bool init( IPlugin_api* plugin_api) = 0;
220 
225  virtual bool exit( IPlugin_api* plugin_api) = 0;
226 
228  virtual IVideo_encoder* create_video_encoder() const = 0;
229 
231  virtual IVideo_decoder* create_video_decoder() const = 0;
232 };
233  // end group mi_neuray_plugins
235 
236 } // namespace neuraylib
237 
238 #ifdef MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
239 using neuraylib::IBuffer;
244 #endif // MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
245 
246 } // namespace mi
247 
248 #endif // MI_NEURAYLIB_IVIDEO_PLUGIN_H