Iray SDK API nvidia_logo_transpbg.gif Up
mi::rtmp::IStream Class Referenceabstract

Representing an RTMP stream. More...

#include <rtmp.h>

Inheritance diagram for mi::rtmp::IStream:

Public Member Functions

virtual bool use_codec (const char *name)=0
 Tells the RTMP server which codec will be used on the stream. More...
 
virtual neuraylib::IVideo_encoderget_video_codec ()=0
 Returns the video codec for this stream. More...
 
virtual void register_render_event_handler (IRender_event_handler *render_event_handler)=0
 Registers the render event handler. More...
 
virtual void register_frame_event_handler (IFrame_event_handler *frame_event_handler)=0
 Registers the frame event handler. More...
 
virtual void register_play_event_handler (IPlay_event_handler *play_event_handler)=0
 Registers the play event handler. More...
 
virtual void register_pause_event_handler (IPause_event_handler *pause_event_handler)=0
 Registers the pause event handler. More...
 
virtual const char * get_stream_name () const =0
 Returns the name of the current playing stream. More...
 
virtual Sint32 set_property (const char *key, const char *value)=0
 Sets a property on the stream. More...
 
virtual const char * get_property (const char *key) const =0
 Returns a property from the stream. More...
 
virtual IConnectionget_connection ()=0
 Returns the connection for this stream. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xa6532316, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xa6532316, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

Representing an RTMP stream.

Member Function Documentation

 get_connection()

virtual IConnection * mi::rtmp::IStream::get_connection ( )
pure virtual

Returns the connection for this stream.

Useful for registering specific remote call handlers.

Returns
the underlying IConnection on which this stream runs

 get_property()

virtual const char * mi::rtmp::IStream::get_property ( const char *  key) const
pure virtual

Returns a property from the stream.

Parameters
keyThe key to obtain the value for.
Returns
The value of the property or NULL if it does not exist.

 get_stream_name()

virtual const char * mi::rtmp::IStream::get_stream_name ( ) const
pure virtual

Returns the name of the current playing stream.

This is the name passed in as an argument by the RTMP player in the RTMP protocol play message.

Returns
The name of this stream or NULL if not applicable.

 get_video_codec()

virtual neuraylib::IVideo_encoder * mi::rtmp::IStream::get_video_codec ( )
pure virtual

Returns the video codec for this stream.

The method use_codec() must be called first to set the video code for this stream.

Returns
The video encoder for this stream.

 register_frame_event_handler()

virtual void mi::rtmp::IStream::register_frame_event_handler ( IFrame_event_handler frame_event_handler)
pure virtual

Registers the frame event handler.

Parameters
frame_event_handlerThe frame event handler to install. The value NULL removes the installed handler.

 register_pause_event_handler()

virtual void mi::rtmp::IStream::register_pause_event_handler ( IPause_event_handler pause_event_handler)
pure virtual

Registers the pause event handler.

Parameters
pause_event_handlerThe pause event handler to install. The value NULL removes the installed handler.

 register_play_event_handler()

virtual void mi::rtmp::IStream::register_play_event_handler ( IPlay_event_handler play_event_handler)
pure virtual

Registers the play event handler.

Parameters
play_event_handlerThe play event handler to install. The value NULL removes the installed handler.

 register_render_event_handler()

virtual void mi::rtmp::IStream::register_render_event_handler ( IRender_event_handler render_event_handler)
pure virtual

Registers the render event handler.

Parameters
render_event_handlerThe render event handler to install. The value NULL removes the installed handler.

 set_property()

virtual Sint32 mi::rtmp::IStream::set_property ( const char *  key,
const char *  value 
)
pure virtual

Sets a property on the stream.

Currently, the only reserved system property is "render_rate". It indicates how often the RTMP server will try to call the registered render event handler. Bandwidth throttling and longer render times make this rate a not always reachable target. If this variable is left unset by the user the RTMP server will try to find a suitable default.

Note
It is recommended that user property names begin with the prefix "user_" to avoid future name clashes.
Parameters
keyThe key to set the value for.
valueThe value of the property
Returns
  • 0: Success.
  • -1: There is no property with that name.
  • -2: Invalid value.

 use_codec()

virtual bool mi::rtmp::IStream::use_codec ( const char *  name)
pure virtual

Tells the RTMP server which codec will be used on the stream.

If no codec is set the data passed via the IFrame_event_handler will be sent out as is without any RTMP encapsulation.

Parameters
nameThe name of the codec to use, for example "screen video", "sorenson" or "h264".
Returns
true if that codec is supported, i.e., the RTMP server has support for this codec (possibly through a video plugin) and the codec is one of the supported formats within an RTMP stream.