【中文版】

Introduction

MFP language introduction

MFP functions

all functions

integer operation

logic functions

statistic and stochastic

trigononmetric functions

exponential functions

complex number

system functions

array or matrix

graphic functions

expression and calculus

string functions

hyperbolic trigononmetric

sorting functions

polynomial

signal processing

file operation

time and date

graphic display

multimedia functions

data structure

data interchange format

platform and hardware

parallel computing

RTC multimedia

reflection

MFP compiling

others

deploy user functions

call MFP in your app

build Android APK

game programming

chart plotting

MFP math analysis

MFP file procession

number string and array

time date and system

Introduction of SCP

Scientific Calculator Plus Help : RTC multimedia functions

Function name Function info
add_peer_stream

::mfp::multimedia::webrtc_lib::add_peer_stream(1) :

add_peer_stream adds multimedia (i.e. video and voice) stream to a web RTC peer connection. Note that web RTC here is the web RTC library for voice and video communication, not the same thing as the WEBRTC protocol for data communication. It has one parameter which is the peerId, i.e. the remote address of the peer connection.

add_rtc_media_ice_candidate

::mfp::multimedia::webrtc_lib::add_rtc_media_ice_candidate(2) :

This function adds an ICE candidate to a web RTC peer connection. It has two parameters. First is peer connection's Id. Second is string based content of this ICE candidate.

add_rtc_video_output

::mfp::multimedia::webrtc_lib::add_rtc_video_output(5) :

add_rtc_video_output adds a RTC video window in a display. It has five parameters. The first one is a display handle, which is the returned value of open_screen_display function. The following parameters are the integer based left, top, width and height of the video output window. These parameters determine the position of the video output window in the display.

close_rtc_media_peer

::mfp::multimedia::webrtc_lib::close_rtc_media_peer(1) :

This function closes a web RTC peer connection. Note that web RTC here is the web RTC library for voice and video communication, not the same thing as the WEBRTC protocol for data communication. This function's only parameter is the web RTC peer connection Id, i.e. its remote address.

create_rtc_media_answer

::mfp::multimedia::webrtc_lib::create_rtc_media_answer(5) :

This function creates a web RTC answer signal after an offer signal is received. Note that web RTC here is the web RTC library for voice and video communication, not the same thing as the WEBRTC protocol for data communication. It has five parameters. First is peer connection id. Second is SDP type. A string whose value is "offer" is expected. The third one is a string based SDP content, i.e. offer signal content. The fourth one is a map for mandatory constraint parameters. The last one is also a map for optional constraint parameters. The last parameter is optional. An example of this function is create_rtc_media_answer(remoteAddr, sdpType, sdpContent, [["OfferToReceiveAudio", "true"], ["OfferToReceiveVideo", supportVideoStr]], [["DtlsSrtpKeyAgreement", "true"]]) .

create_rtc_media_offer

::mfp::multimedia::webrtc_lib::create_rtc_media_offer(3) :

This function creates a web RTC offer signal. Note that web RTC here is the web RTC library for voice and video communication, not the same thing as the WEBRTC protocol for data communication. It has three parameters. First is peer connection id. The second one is a map for mandatory constraint parameters. The last one is also a map for optional constraint parameters. The last parameter is optional. An example of this function is create_rtc_media_offer(remoteAddr, [["OfferToReceiveAudio", "true"], ["OfferToReceiveVideo", supportVideoStr]], [["DtlsSrtpKeyAgreement", "true"]]) .

get_audio_track_enable

::mfp::multimedia::webrtc_lib::get_audio_track_enable(1) :

This function tests if audio track has been enabled. True is returned if audio track is enabled. Otherwise false. It has only one parameter which is a display handle returned from open_screen_display function.

get_rtc_video_output_count

::mfp::multimedia::webrtc_lib::get_rtc_video_output_count(1) :

This function returns the number of RTC video output windows in a display. It has only one parameter which is a display handle returned from open_screen_display function.

get_rtc_video_output_lefttop

::mfp::multimedia::webrtc_lib::get_rtc_video_output_lefttop(2) :

This function returns a two element array whose first element is the x coordinate and second element is the y coordinate of a RTC video output window's left-top corner. It has two parameters. The first one is a display handle returned from open_screen_display function. The second one is the index of the RTC video output window in this display's RTC video output window list. The first RTC video output window's index is 0, second is 1, etc.

get_video_track_enable

::mfp::multimedia::webrtc_lib::get_video_track_enable(1) :

This function tests if video track has been enabled. True is returned if video track is enabled. Otherwise false. It has only one parameter which is a display handle returned from open_screen_display function.

initialize_rtc_mmedia

::mfp::multimedia::webrtc_lib::initialize_rtc_mmedia(0) :

This function initializes web RTC library. Note that web RTC here is the web RTC library for voice and video communication, not the same thing as the WEBRTC protocol for data communication. This function returns true if it succeeds. Otherwise false.

link_video_stream

::mfp::multimedia::webrtc_lib::link_video_stream(4) :

This function links a web RTC video stream to a RTC video output window. It has four parameters. The first one is a display handle, which is returned from an open_screen_display call. The second one is a peer connection object's Id. The third one is video stream's track Id. The last one is video output window index. This function doesn't return anything. If any parameters are invalid, or it fails to link video stream to the video output window, an exception is thrown.

receive_rtc_mmedia_message

::mfp::multimedia::webrtc_lib::receive_rtc_mmedia_message(1) :

This function retrieves a web RTC message. Note that web RTC here is the web RTC library for voice and video communication, not the same thing as the WEBRTC protocol for data communication. It has only one parameter which is the expiry time. If this parameter is a positive value, this function blocks and waits for the number of milliseconds. If this parameter is 0, this function returns immediately. Otherwise, this function waits indefinitely until a message is available. If after waiting no message is available, this function returns null. Otherwise, it returns a four element array whose first element is message's destination peer connection Id, second element is RTC session Id, third element is message type and last element is message content. If this message is a RTC signal, message type should be "signal" and message content should be a Json string whose "type" field is signal type, i.e. "offer", "answer" or "candidate"; and, if signal type is "offer" or "answer", "sdp" field is sdp content. If this message is a peer connection event, message type should be "pc" and message content is a Json based string whose "type" field is peer connection event type, e.g. "ice_connection_change"; and "content" field is string based content of the event.

remove_peer_stream

::mfp::multimedia::webrtc_lib::remove_peer_stream(1) :

This function removes video stream from a peer connection object. It has only one parameter which is the peer connection. This function returns nothing.

set_audio_track_enable

::mfp::multimedia::webrtc_lib::set_audio_track_enable(2) :

This function enables or disables audio track. It has two parameters. The first parameter is a display handle returned from open_screen_display function. The second parameter is a boolean value. True means enabling audio track and false means disabling audio track. This function returns previous state of audio track. True means before the function call the audio track was enabled. False means before the function call the audio track was disabled.

set_rtc_media_remote_description

::mfp::multimedia::webrtc_lib::set_rtc_media_remote_description(3) :

This function sets a web RTC remote description after an answer signal is received. Note that web RTC here is the web RTC library for voice and video communication, not the same thing as the WEBRTC protocol for data communication. It has three parameters. First is peer connection id. Second is SDP type. A string whose value is "answer" is expected. The third one is a string based SDP content, i.e. answer signal content. This function returns nothing. An example of this function is set_rtc_media_remote_description(remoteAddr, sdpType, sdpContent) .

set_video_track_enable

::mfp::multimedia::webrtc_lib::set_video_track_enable(2) :

This function enables or disables video track. It has two parameters. The first parameter is a display handle returned from open_screen_display function. The second parameter is a boolean value. True means enabling video track and false means disabling video track. This function returns previous state of video track. True means before the function call the video track was enabled. False means before the function call the video track was disabled.

start_local_stream

::mfp::multimedia::webrtc_lib::start_local_stream(2) :

This function starts web RTC's local video stream. Note that web RTC here is the web RTC library for voice and video communication, not the same thing as the WEBRTC protocol for data communication. It has two parameters. The first one is a display handle returned from open_screen_display function. The second one is the index of the RTC video output window in this display's RTC video output window list. The first RTC video output window's index is 0, second is 1, etc. This function returns true if local stream is started successfully. Otherwise it returns false.

stop_local_stream

::mfp::multimedia::webrtc_lib::stop_local_stream(1) :

This function stops web RTC's local video stream. Note that web RTC here is the web RTC library for voice and video communication, not the same thing as the WEBRTC protocol for data communication. It has only one parameter which is a display handle returned from open_screen_display function. This function returns nothing.

unlink_video_stream

::mfp::multimedia::webrtc_lib::unlink_video_stream(2...) :

This function unlinks a video track to a video output window. It has two working modes. The first working mode includes three parameters which are, first, a display handle returned from open_screen_display function; second, a peer connection object id; and third a video track id. The second working mode includes only two parameters. The first one is a display handle and the second one is the index of the RTC video output window in this display's RTC video output window list. The first RTC video output window's index is 0, second is 1, etc. This function returns the number of unlinked RTC video tracks.