RealityServer Web Services API Programmer's Manual

mi::rswservices::IRtmp_stream_encoder Class Reference

[RTMP]

Description

Represents an RTMP stream encoder. This class associates a video codec with a render context.

Public Member Functions

virtual const char* get_codec() const =0
returns the name of the codec used
virtual const char* get_codec_parameter( const char* name) const =0
returns a codec parameter or NULL if it is not set. More...
virtual bool  get_codec_parameter( mi::Uint32 index, const char** name, const char** value) const =0
retrieves codec parameters by index. More...
virtual const char* get_name() const =0
returns the name of this stream encoder
virtual const char* get_render_context() const =0
returns the name of the rtmp render context used by this stream encoder.
virtual const char* get_render_context_pool() const =0
returns the name of the rtmp render context pool used by this stream encoder.
virtual mi::Uint32 get_render_rate() const =0
returns the stream render rate
virtual mi::Uint32 get_resolution_x() const =0
returns the width of the stream
virtual mi::Uint32 get_resolution_y() const =0
returns the height of the stream
virtual bool  in_use() const =0
returns whether the encoder is in use or not. More...
virtual Sint32 set_codec_parameter( const char* name, const char* value) =0
sets a parameter of the video codec. More...
virtual void set_render_rate( mi::Uint32 rate) =0
sets the render rate More...
virtual void set_resolution_x( mi::Uint32 resolution_x) =0
sets the width of the stream More...
virtual void set_resolution_y( mi::Uint32 resolution_y) =0
sets the height of the stream More...

Member Functions

virtual const char* mi::​rswservices::​IRtmp_stream_encoder::get_codec() const [pure virtual]

returns the name of the codec used

virtual const char* mi::​rswservices::​IRtmp_stream_encoder::get_codec_parameter( const char* name) const [pure virtual]

returns a codec parameter or NULL if it is not set. If the parameter cannot be found locally (IE: it has not been previously set with set_codec_parameter) then the codec is queried for the parameter instead. This will only occur after playback of the stream has begun.

Parameters

name
the name of the parameter
virtual bool mi::​rswservices::​IRtmp_stream_encoder::get_codec_parameter( mi::Uint32 index, const char** name, const char** value) const [pure virtual]

retrieves codec parameters by index. NB: this method will only iterate over parameters that have previously been set with set_codec_parameter. It will not return results for any default parameters that may be set on the codec itself.

Parameters

index
the index of the parameter
name
receives the name of the parameter
value
receives the value of the parameter

Returns

true if parameter found, false if index is greater than the number of parameters.

virtual const char* mi::​rswservices::​IRtmp_stream_encoder::get_name() const [pure virtual]

returns the name of this stream encoder

virtual const char* mi::​rswservices::​IRtmp_stream_encoder::get_render_context() const [pure virtual]

returns the name of the rtmp render context used by this stream encoder.

virtual const char* mi::​rswservices::​IRtmp_stream_encoder::get_render_context_pool() const [pure virtual]

returns the name of the rtmp render context pool used by this stream encoder.

virtual mi::Uint32 mi::​rswservices::​IRtmp_stream_encoder::get_render_rate() const [pure virtual]

returns the stream render rate

virtual mi::Uint32 mi::​rswservices::​IRtmp_stream_encoder::get_resolution_x() const [pure virtual]

returns the width of the stream

virtual mi::Uint32 mi::​rswservices::​IRtmp_stream_encoder::get_resolution_y() const [pure virtual]

returns the height of the stream

virtual bool mi::​rswservices::​IRtmp_stream_encoder::in_use() const [pure virtual]

returns whether the encoder is in use or not. An encoder can only be used by one stream at a time.

virtual Sint32 mi::​rswservices::​IRtmp_stream_encoder::set_codec_parameter( const char* name, const char* value) [pure virtual]

sets a parameter of the video codec. If the encoder is in use then the parameter is passed on to the codec immediately. Whether or not this parameter change is applied immediately depends on the codec implementation. It may be necessary for the client to call NetStream.play again with this encoder name for parameter changes to have an affect.

Parameters

name
the name of the parameter
value
the value of the parameter

Returns

  • mi::nservices::NRS_ERROR_NONE success
  • mi::nservices::NRS_ERROR_INVALID_PARAMETERS a parameter is NULL or name is an empty string.
  • mi::nservices::NRS_ERROR_MEMORY out of memory;

virtual void mi::​rswservices::​IRtmp_stream_encoder::set_render_rate( mi::Uint32 rate) [pure virtual]

sets the render rate

Parameters

rate
the render rate
virtual void mi::​rswservices::​IRtmp_stream_encoder::set_resolution_x( mi::Uint32 resolution_x) [pure virtual]

sets the width of the stream

Parameters

resolution_x
the width
virtual void mi::​rswservices::​IRtmp_stream_encoder::set_resolution_y( mi::Uint32 resolution_y) [pure virtual]

sets the height of the stream

Parameters

resolution_y
the height