neuray API Programmer's Manual

ivideo_plugin.h File Reference

Description

Video plugin API.

Code Example

ivideo_plugin.h

‎/***************************************************************************************************
 * Copyright 2024 NVIDIA Corporation. All rights reserved.
 **************************************************************************************************/

#ifndef MI_NEURAYLIB_IVIDEO_PLUGIN_H
#define MI_NEURAYLIB_IVIDEO_PLUGIN_H

#include <mi/base/types.h>
#include <mi/base/plugin.h>
#include <mi/base/interface_declare.h>

namespace mi {

namespace neuraylib {

class IBuffer;
class ICanvas;
class ICanvas_cuda;
class IPlugin_api;


#define MI_NEURAY_VIDEO_PLUGIN_TYPE "video v33"

class IVideo_data : public
    mi::base::Interface_declare<0xbdd686fa,0x3e37,0x43aa,0xbd,0xe6,0x7b,0xab,0x9f,0x3e,0x1c,0xfc>
{
public:
    virtual Uint8* get_data() = 0;

    virtual Size 
               get_data_size() const = 0;

    virtual bool is_key_frame() const = 0;
};


class IVideo_encoder : public
    mi::base::Interface_declare<0x572ef6ad,0xbc37,0x417d,0xbf,0x7c,0x17,0x17,0x4e,0x96,0xa3,0x06>
{
public:
    virtual Sint32 
               init(
        Uint32 resolution_x, Uint32 resolution_y,
        IVideo_data** out) = 0;

    virtual bool set_parameter(const char* name, const char* value) = 0;

    virtual const char* get_parameter(const char* name) = 0;

    virtual const char* get_supported_type(Uint32 index) const = 0;

    virtual Sint32 
               encode_canvas(const ICanvas* canvas, IVideo_data** out) = 0;

    virtual Sint32 
               encode_canvas(const ICanvas_cuda* canvas, IVideo_data** out) = 0;

    virtual Sint32 
               close(IVideo_data** out) = 0;

    virtual const char* get_identifier() const = 0;
};

class IVideo_decoder : public
    mi::base::Interface_declare<0xe7fa52c7,0xd881,0x4a29,0x9e,0x82,0x3b,0xdd,0xa6,0xcf,0x14,0xc8>
{
public:
    virtual Sint32 
               init( IBuffer* data) = 0;

    virtual Uint32 
               get_encoded_width() = 0;

    virtual Uint32 
               get_encoded_height() = 0;

    virtual const char* get_format_parameter( const char* parameter) = 0;

    virtual const char* get_supported_type( Uint32 index) const = 0;

    virtual Sint32 
               decode_canvas(neuraylib::ICanvas* canvas, IBuffer* data) = 0;

    virtual Sint32 
               close() = 0;

    virtual const char* get_identifier() const = 0;

    virtual bool set_parameter( const char* name, const char* value) = 0;

    virtual const char* get_parameter( const char* name) = 0;
};


class IVideo_plugin : public base::Plugin
{
public:
    virtual const char* get_name() const = 0;

    virtual bool init( IPlugin_api* plugin_api) = 0;

    virtual bool exit( IPlugin_api* plugin_api) = 0;

    virtual IVideo_encoder* create_video_encoder() const = 0;

    virtual IVideo_decoder* create_video_decoder() const = 0;
};

class IVideo_codec_factory : public
    mi::base::Interface_declare<0x79be801,0x17a7,0x48d8,0x8a,0x4,0x73,0xd4,0x35,0x6d,0x2,0x28>
{
public:
    virtual IVideo_encoder* create_video_encoder( const char* codec_name) = 0;

    virtual IVideo_decoder* create_video_decoder( const char* codec_name) = 0;
};
 // end group mi_neuray_plugins

} // namespace neuraylib

} // namespace mi

#endif // MI_NEURAYLIB_IVIDEO_PLUGIN_H

Namespaces

namespace 
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH. More...
namespace 
Namespace for the neuray API. More...

Classes

class 
API component that allow creation of installed video encoders and decoders. More...
class 
A buffer for video data representing a frame. More...
class 
Abstract interface for video decoders. More...
class 
Abstract interface for video encoders. More...
class 
Abstract interface for video encoder plugins. More...

Defines

#define  "video v33"
Type of video encoder plugins. More...