neuray API Programmer's Manual

mi::rtmp::IStream Class Reference

[RTMP server]

Description

Representing an RTMP stream.

Public Member Functions

virtual IConnectionget_connection() =0
Returns the connection for this stream. More...
virtual const char* get_property( const char* key) const =0
Returns a property from the stream. More...
virtual const char* get_stream_name() const =0
Returns the name of the current playing stream. More...
virtual neuraylib::​IVideo_encoderget_video_codec() =0
Returns the video codec for this stream. More...
virtual void register_frame_event_handler( IFrame_event_handler* frame_event_handler) =0
Registers the frame event handler. More...
virtual void register_pause_event_handler( IPause_event_handler* pause_event_handler) =0
Registers the pause 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_render_event_handler( IRender_event_handler* render_event_handler) =0
Registers the render event handler. More...
virtual Sint32 set_property( const char* key, const char* value) =0
Sets a property on the stream. More...
virtual bool  use_codec( const char* name) =0
Tells the RTMP server which codec will be used on the stream. More...

Member Functions

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

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

Returns a property from the stream.

Parameters

key
The key to obtain the value for.

Returns

The value of the property or NULL if it does not exist.

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.

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.

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_handler
The frame event handler to install. The value NULL removes the installed 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_handler
The pause event handler to install. The value NULL removes the installed 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_handler
The play event handler to install. The value NULL removes the installed 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_handler
The render event handler to install. The value NULL removes the installed handler.
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

key
The key to set the value for.
value
The value of the property

Returns

  • 0: Success.
  • -1: There is no property with that name.
  • -2: Invalid value.

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

name
The 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.