neuray API Programmer's Manual

ivideo_plugin.h File Reference

Description

Video plugin API.

Code Example

ivideo_plugin.h

‎//*****************************************************************************
// Copyright 1986, 2016 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>
#include <mi/neuraylib/version.h>

namespace mi {

namespace neuraylib {

class IBuffer;
class ICanvas;
class IPlugin_api;


#define MI_NEURAY_VIDEO_PLUGIN_TYPE "video v8"

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 bool 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 bool encode_canvas(const ICanvas* canvas, IVideo_data** out) = 0;

    virtual bool 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 bool init( IBuffer* data, bool* need_more_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 bool decode_canvas(
        neuraylib::ICanvas* canvas, IBuffer* data, bool* need_more_data, bool* buffered_frames) = 0;

    virtual bool 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;
};
 // end group mi_neuray_plugins

} // namespace neuraylib

#ifdef MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
using neuraylib::IBuffer;
using neuraylib::IVideo_data;
using neuraylib::IVideo_decoder;
using neuraylib::IVideo_encoder;
using neuraylib::IVideo_plugin;
#endif // MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION

} // 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 
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 v8"
Type of video encoder plugins. More...