RealityServer Web Services API Programmer's Manual

irtmp.h File Reference

Description

RealityServer(R) Web Services RTMP API. See RTMP.

Code Example

irtmp.h

‎//*****************************************************************************
// Copyright 1986-2011 by mental images GmbH, Fasanenstr. 81, D-10623 Berlin,
// Germany. All rights reserved.
//*****************************************************************************
//*****************************************************************************

#ifndef MI_RS_WEB_SERVICES_IRTMP_H
#define MI_RS_WEB_SERVICES_IRTMP_H

#include <mi/base/interface_declare.h>

namespace mi {
class IData;
class IMap;

namespace neuraylib {
class IPlugin_api;
class ITransaction;
class IPlugin_api;
class ICanvas;
} // namespace neuraylib

namespace nservices {
class IEvent_context;
class IFactory;
class IScene;
class IArgument_description;
class IConverter;
} // namespace nservices

namespace rswservices {

class IConfiguration;
class IRtmp_render_loop;
class IRtmp_stream_encoder;
class IRtmp_codec_info;









class IRtmp_context : public
    mi::base::Interface_declare<0x3C2D8E92,0x652E,0x4CE6,0x84,0x6B,0x2B,0x55,0x40,0x3F,0x15,0x94>
{
public:
    virtual const char *get_connection_id() const = 0;

    virtual const IMap *get_connection_statistics() const = 0;

    virtual const char *get_connection_property(const char *key) const = 0;

    virtual Sint32 
               set_connection_property(const char *key, const char *value) = 0;

    virtual const IRtmp_codec_info *get_registered_codec(mi::Uint32 index) const = 0;

    virtual const char *get_registered_render_handler(mi::Uint32 index) const = 0;

    virtual mi::Sint32 
               create_render_loop(const char *name,
                                                const char *scene_name,
                                                const char *scope_name,
                                                const char *render_handler_name,
                                                const char *public_pool=NULL) = 0;

    virtual IRtmp_render_loop *get_render_loop(const char *name,
                                                        const char *public_pool=NULL) const = 0;
    virtual mi::Sint32 
               remove_render_loop(const char *name,
                                                const char *public_pool=NULL) = 0;

    virtual mi::Sint32 
               remove_render_loop_pool(const char *public_pool) = 0;

    virtual mi::Sint32 
               create_encoder(const char *name,
                                        const char *codec,
                                        const char *render_loop_name,
                                        const char *public_pool=NULL) = 0;

    virtual IRtmp_stream_encoder *get_encoder(const char *name) const = 0;

    virtual mi::Sint32 
               remove_encoder(const char *name) = 0;
};

class IRtmp_codec_info : public
    mi::base::Interface_declare<0x8C82AB3D,0x8FA4,0x49CF,0xBB,0xAD,0x6E,0xCC,0x13,0x5B,0xA2,0xA0>
{
public:
    virtual const char *get_format() const = 0;

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

class IRtmp_stream_encoder : public
    mi::base::Interface_declare<0x7C7E5DB6,0xC522,0x4E9B,0x9D,0x43,0xFD,0x94,0xA5,0x0A,0x85,0x29>
{
public:
    virtual const char *get_name() const = 0;

    virtual const char *get_render_context() const = 0;

    virtual const char *get_render_context_pool() const = 0;

    virtual const char *get_codec() const = 0;

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

    virtual bool get_codec_parameter(mi::Uint32 index,
                                                const char **name, const char **value) const = 0;

    virtual Sint32 
               set_codec_parameter(const char *name, const char *value) = 0;

    virtual void set_render_rate(mi::Uint32 rate) = 0;

    virtual mi::Uint32 
               get_render_rate() const = 0;

    virtual void set_resolution_x(mi::Uint32 resolution_x) = 0;

    virtual mi::Uint32 
               get_resolution_x() const = 0;

    virtual void set_resolution_y(mi::Uint32 resolution_y) = 0;

    virtual mi::Uint32 
               get_resolution_y() const = 0;

    virtual bool in_use() const  = 0;
};

class IRtmp_render_loop  : public
    mi::base::Interface_declare<0xBE2D3F6A,0xFA45,0x4EAB,0xAE,0xA9,0x56,0xC7,0x9C,0x3E,0xD1,0x32>
{
public:
    virtual const char *get_name() const = 0;

    virtual const char *get_scene_name() const = 0;

    virtual const char *get_scope_name() const = 0;

    virtual const char *get_render_handler_name() const = 0;

    virtual Uint32 
               get_num_arguments() const = 0;

    virtual const IData *get_argument(const char *name) const = 0;

    template <class T>
    const T* get_argument(const char *name) const {
        const base::IInterface *ptr_iinterface = get_argument(name);
        if (ptr_iinterface) {
            const T *ptr_T = ptr_iinterface->get_interface<T>();
            ptr_iinterface->release();
            return ptr_T;
        }
        return NULL;
    };

    virtual Sint32 
               get_argument(
        Uint32 index,
        const char **name,
        const IData **value) const = 0;

    virtual Sint32 
               set_argument(
        const char *name,
        const IData *value) = 0;

    virtual void cancel_render(
        Sint32 cancel_level) = 0;
};


class IRtmp_render_context  : public
    mi::base::Interface_declare<0xA4D8F029,0x6234,0x46BC,0x91,0x64,0x5F,0x4C,0x17,0xE3,0x82,0x4F,
    IRtmp_render_loop>
{
public:
    virtual nservices::IScene *get_scene() const = 0;

    virtual neuraylib::ITransaction *get_transaction() = 0;

    virtual neuraylib::ITransaction* get_user_state() = 0;

    virtual nservices::IConverter *get_converter() const = 0;

    virtual nservices::IEvent_context* get_event_context() const = 0;

    virtual nservices::IFactory *get_factory() const = 0;

    virtual const IConfiguration *get_configuration() const = 0;

    virtual neuraylib::IPlugin_api *get_plugin_api() const = 0;
};

class IRtmp_render_handler : public
    mi::base::Interface_declare<0xB1E24974,0x41BA,0x4E5C,0xAF,0xFC,0x04,0x06,0x4D,0xF2,0x55,0x9F>
{
public:
    virtual mi::neuraylib::ICanvas *render(IRtmp_render_context *context) = 0;

    virtual void cancel_render(
        Sint32 cancel_level) = 0;
};


class IRtmp_render_handler_factory : public
    mi::base::Interface_declare<0xC74D8EC7,0x340F,0x4C29,0x96,0x4B,0x73,0x3F,0xEE,0xED,0x2B,0xB4>
{
public:
    virtual const char *get_name() const = 0;

    virtual const char *get_description() const = 0;

    virtual Sint32 
               get_argument_description(
        nservices::IFactory *factory,
        const char *argument_name,
        nservices::IArgument_description *argument) const = 0;

    virtual Sint32 
               get_argument_description(
        nservices::IFactory *factory,
        Uint32 index,
        nservices::IArgument_description *argument) const = 0;

    virtual IRtmp_render_handler *create_render_handler() const = 0;
};
 // end group mi_rswservices_rtmp

} // namespace rswservices
} // namespace mi

#endif // MI_RS_WEB_SERVICES_IRTMP_H

Namespaces

namespace mi
namespace mi::neuraylib
namespace mi::nservices
namespace 
Namespace for the RealityServer Web Services API. More...

Classes

class 
Supplies information about an installed video codec. More...
class 
Provides information and managements functionality for the RTMP connection. More...
class 
RTMP render context. More...
class 
Implements an RTMP render handler. More...
class 
Factory class for creating render handlers. More...
class 
Describes an RTMP render loop. More...
class 
Represents an RTMP stream encoder. More...