BitmapToolkit Scol plugin
Functions | Variables
MediaPlayerToolkit

Functions

MediaPlayergetPlayerFromStack (mmachine m, int pos)
 
int destroyMediaPlayerObj (mmachine m, SCOL_PTR_TYPE handsys, int objm)
 
int _CRmediaPlayer (mmachine m)
 _CRMediaPlayer : Create an empty media player (no video loaded).
 
int _DSmediaPlayer (mmachine m)
 _DSMediaPlayer : Delete a media player object.
 
int _OPENmediaPlayerUrl (mmachine m)
 _OPENmediaPlayerUrl : open a media player url.
 
int _OPENmediaPlayerFile (mmachine m)
 _OPENmediaPlayerFile : open a media player file.
 
int _BLTmediaPlayer (mmachine m)
 _BLTmediaPlayer : This function blits the current video frame into a bitmap Prototype: fun [ObjMediaPlayer ObjBitmap] ObjBitmap
 
int _BLTmediaPlayerBuffer (mmachine m)
 _BLTmediaPlayerBuffer : This function blits the current video frame into a buffer Prototype: fun [ObjMediaPlayer ObjBuff I I I] ObjBuff
 
int _GETmediaPlayerBuffer (mmachine m)
 _GETmediaPlayerBuffer : This function blits the current video frame into a buffer Prototype: fun [ObjMediaPlayer] [ObjBuff I I I]
 
int _PLAYmediaPlayer (mmachine m)
 _PLAYmediaPlayer : Play / resume (if paused) the video. Prototype: fun [ObjMediaPlayer] ObjMediaPlayer
 
int _PAUSEmediaPlayer (mmachine m)
 _PAUSEmediaPlayer : Pause the video. Prototype: fun [ObjMediaPlayer] ObjMediaPlayer
 
int _STOPmediaPlayer (mmachine m)
 _STOPmediaPlayer : Stop the video. Prototype: fun [ObjMediaPlayer] ObjMediaPlayer
 
int _SETmediaPlayerSize (mmachine m)
 _SETmediaPlayerSize : Change the video size. Prototype: fun [ObjMediaPlayer I I] ObjMediaPlayer
 
int _GETmediaPlayerSize (mmachine m)
 _GETmediaPlayerSize : Get the current video size. Prototype: fun [ObjMediaPlayer] [I I]
 
int _GETmediaPlayerSourceSize (mmachine m)
 _GETmediaPlayerSourceSize : Get the size of the source video, before resize. Prototype: fun [ObjMediaPlayer] [I I]
 
int _GETmediaPlayerTime (mmachine m)
 _GETmediaPlayerTime : Get the playback position in the current video. Prototype: fun [ObjMediaPlayer] I
 
int _GETmediaPlayerLength (mmachine m)
 _GETmediaPlayerLength : Get the media player length. Prototype: fun [ObjMediaPlayer] I
 
int _SEEKmediaPlayer (mmachine m)
 _SEEKmediaPlayer : Seek to the given position in milliseconds. Prototype: fun [ObjMediaPlayer I] ObjMediaPlayer
 
int _SETmediaPlayerLoop (mmachine m)
 _SETmediaPlayerLoop : Toggle loop playback mode. Prototype: fun [ObjMediaPlayer I] ObjMediaPlayer
 
int _SETmediaPlayerStream (mmachine m)
 _SETmediaPlayerStream : Select a video stream to play in the current file. Prototype: fun [ObjMediaPlayer I] ObjMediaPlayer
 
int _SETmediaPlayerAudioStream (mmachine m)
 _SETmediaPlayerAudioStream : Select an audio stream to play in the current file. Prototype: fun [ObjMediaPlayer I] ObjMediaPlayer
 
int _GETmediaPlayerAudio (mmachine m)
 _GETmediaPlayerAudio : Get raw audio data from the currently playing video. Prototype: fun [ObjMediaPlayer] S
 
int _SETmediaPlayerAudioFormat (mmachine m)
 _SETmediaPlayerAudioFormat : Set the output format for audio. Prototype: fun [ObjMediaPlayer I I] ObjMediaPlayer
 
int _GETmediaPlayerHasAudio (mmachine m)
 _GETmediaPlayerHasAudio : Check whether an audio stream is selected and ready to play. Prototype: fun [ObjMediaPlayer] I
 
int _GETmediaPlayerHasVideo (mmachine m)
 _GETmediaPlayerHasVideo : Check whether a video stream is selected and ready to play. Prototype: fun [ObjMediaPlayer] I
 
int _GETmediaPlayerState (mmachine m)
 _GETmediaPlayerState : Get the current playback state of a MediaPlayer. Prototype: fun [ObjMediaPlayer] I
 
int _GETmediaPlayerIsLiveStream (mmachine m)
 _GETmediaPlayerIsLiveStream : Check whether the current media source is a live stream or not. Prototype: fun [ObjMediaPlayer] I
 
int _GETmediaPlayerIsSeekable (mmachine m)
 _GETmediaPlayerIsSeekable : Check whether the current media source supports seeking. Prototype: fun [ObjMediaPlayer] I
 
int _GETmediaPlayerAudioStreams (mmachine m)
 _GETmediaPlayerAudioStreams : Get a list of the current file's audio streams. Prototype: fun [ObjMediaPlayer] [S r1]
 
int _GETmediaPlayerVideoStreams (mmachine m)
 _GETmediaPlayerVideoStreams : Get a list of the current file's video streams. Prototype: fun [ObjMediaPlayer] [S r1]
 
int _CBmediaPlayerEnd (mmachine m)
 _CBmediaPlayerEnd : This function set the Callback for end event of a media player content Prototype: fun [ObjMediaPlayer fun [ObjMediaPlayer u0] u1 u0] ObjMediaPlayer
 
int getMediaPlayerEndCb (mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE ret)
 
int _CBmediaPlayerLoaded (mmachine m)
 _CBmediaPlayerLoaded : This function set the Callback for loaded event of a media player Prototype: fun [ObjMediaPlayer fun [ObjMediaPlayer u0 I] u1 u0] ObjMediaPlayer
 
int getMediaPlayerLoadedCb (mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE ret)
 

Variables

int OBJMEDIAPLAYERSCOL
 
int NBMEDIAPLAYER_CALLBACK = 2
 
int MEDIAPLAYER_END_CB
 
int MEDIAPLAYER_LOADED_CB
 
int SCOL_MEDIAPLAYER_END_CB = 0
 
int SCOL_MEDIAPLAYER_LOADED_CB = 1
 

Detailed Description

Scol Video Player type and functions. Wraps the MediaPlayer class.

Function Documentation

◆ _BLTmediaPlayer()

int _BLTmediaPlayer ( mmachine  m)

_BLTmediaPlayer : This function blits the current video frame into a bitmap Prototype: fun [ObjMediaPlayer ObjBitmap] ObjBitmap

Parameters
ObjMediaPlayer: media player object from which to get frame
ObjBitmap: bitmap to update with the new frame
Returns
ObjBitmap : return same bitmap if success or NIL otherwise

Definition at line 231 of file MediaPlayerToolkit.cpp.

◆ _BLTmediaPlayerBuffer()

int _BLTmediaPlayerBuffer ( mmachine  m)

_BLTmediaPlayerBuffer : This function blits the current video frame into a buffer Prototype: fun [ObjMediaPlayer ObjBuff I I I] ObjBuff

Parameters
ObjMediaPlayer: media player object from which to get frame
ObjBuff: buffer to update with the new frame
I: buffer width
I: buffer height
I: buffer bytes per pixel
Returns
ObjBuff : return same bitmap buffer if success or NIL otherwise

Definition at line 267 of file MediaPlayerToolkit.cpp.

◆ _CBmediaPlayerEnd()

int _CBmediaPlayerEnd ( mmachine  m)

_CBmediaPlayerEnd : This function set the Callback for end event of a media player content Prototype: fun [ObjMediaPlayer fun [ObjMediaPlayer u0] u1 u0] ObjMediaPlayer

Parameters
ObjMediaPlayer: media player object
Returns
ObjMediaPlayer : the same media player object.

Definition at line 1177 of file MediaPlayerToolkit.cpp.

◆ _CBmediaPlayerLoaded()

int _CBmediaPlayerLoaded ( mmachine  m)

_CBmediaPlayerLoaded : This function set the Callback for loaded event of a media player Prototype: fun [ObjMediaPlayer fun [ObjMediaPlayer u0 I] u1 u0] ObjMediaPlayer

Parameters
ObjMediaPlayer: media player object
Returns
ObjMediaPlayer : the same media player object.

Definition at line 1203 of file MediaPlayerToolkit.cpp.

◆ _CRmediaPlayer()

int _CRmediaPlayer ( mmachine  m)

_CRMediaPlayer : Create an empty media player (no video loaded).

Prototype: fun [Chn] ObjMediaPlayer

Parameters
Chn: Scol channel
Returns
ObjMediaPlayer : new media player, NIL on error

Definition at line 80 of file MediaPlayerToolkit.cpp.

◆ _DSmediaPlayer()

int _DSmediaPlayer ( mmachine  m)

_DSMediaPlayer : Delete a media player object.

Prototype: fun [ObjMediaPlayer] I

Parameters
ObjMediaPlayer: Player to be destroyed.
Returns
0 on success, NIL on error.

Definition at line 116 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerAudio()

int _GETmediaPlayerAudio ( mmachine  m)

_GETmediaPlayerAudio : Get raw audio data from the currently playing video. Prototype: fun [ObjMediaPlayer] S

Parameters
ObjMediaPlayermedia player object
Returns
S : Raw audio data. NIL on failure.

Definition at line 833 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerAudioStreams()

int _GETmediaPlayerAudioStreams ( mmachine  m)

_GETmediaPlayerAudioStreams : Get a list of the current file's audio streams. Prototype: fun [ObjMediaPlayer] [S r1]

Parameters
ObjMediaPlayer: media player object
Returns
[S r1] : list of audio streams, with a description (if any). The position of a stream in the list corresponds to its index, which can be passed to _SETmediaPlayerAudioStream.

Definition at line 1067 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerBuffer()

int _GETmediaPlayerBuffer ( mmachine  m)

_GETmediaPlayerBuffer : This function blits the current video frame into a buffer Prototype: fun [ObjMediaPlayer] [ObjBuff I I I]

Parameters
ObjMediaPlayer: media player object from which to get frame
I: buffer width
I: buffer height
I: buffer bytes per pixel
Returns
return [ObjBuff I I I] : return video buffer, width, height, bytes per pixel if success or NIL otherwise

Definition at line 321 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerHasAudio()

int _GETmediaPlayerHasAudio ( mmachine  m)

_GETmediaPlayerHasAudio : Check whether an audio stream is selected and ready to play. Prototype: fun [ObjMediaPlayer] I

Parameters
ObjMediaPlayer: media player object
Returns
I : 1 if player has audio, 0 if not, NIL on error.

Definition at line 926 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerHasVideo()

int _GETmediaPlayerHasVideo ( mmachine  m)

_GETmediaPlayerHasVideo : Check whether a video stream is selected and ready to play. Prototype: fun [ObjMediaPlayer] I

Parameters
ObjMediaPlayer: media player object
Returns
I : 1 if player has video, 0 if not, NIL on error.

Definition at line 954 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerIsLiveStream()

int _GETmediaPlayerIsLiveStream ( mmachine  m)

_GETmediaPlayerIsLiveStream : Check whether the current media source is a live stream or not. Prototype: fun [ObjMediaPlayer] I

Parameters
ObjMediaPlayer: media player object
Returns
I : 1 if the source is a live stream, 0 if not, NIL on error.

Definition at line 1010 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerIsSeekable()

int _GETmediaPlayerIsSeekable ( mmachine  m)

_GETmediaPlayerIsSeekable : Check whether the current media source supports seeking. Prototype: fun [ObjMediaPlayer] I

Parameters
ObjMediaPlayer: media player object
Returns
I : 1 if the source is seekable, 0 if not, NIL on error.

Definition at line 1038 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerLength()

int _GETmediaPlayerLength ( mmachine  m)

_GETmediaPlayerLength : Get the media player length. Prototype: fun [ObjMediaPlayer] I

Parameters
ObjMediaPlayermedia player object
Returns
I : length in milliseconds on success, -1 if unavailable, NIL otherwise.

Definition at line 634 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerSize()

int _GETmediaPlayerSize ( mmachine  m)

_GETmediaPlayerSize : Get the current video size. Prototype: fun [ObjMediaPlayer] [I I]

Parameters
ObjMediaPlayermedia player object
Returns
[I I] : tuple with width and height of the video in pixels on success, NIL on failure

Definition at line 494 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerSourceSize()

int _GETmediaPlayerSourceSize ( mmachine  m)

_GETmediaPlayerSourceSize : Get the size of the source video, before resize. Prototype: fun [ObjMediaPlayer] [I I]

Parameters
ObjMediaPlayermedia player object
Returns
[I I] : tuple with width and height of the video in pixels on success, NIL on failure

Definition at line 542 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerState()

int _GETmediaPlayerState ( mmachine  m)

_GETmediaPlayerState : Get the current playback state of a MediaPlayer. Prototype: fun [ObjMediaPlayer] I

Parameters
ObjMediaPlayer: media player object
Returns
I : Either MP_STATE_STOPPED, MP_STATE_PLAYING or MP_STATE_PAUSED.

Definition at line 982 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerTime()

int _GETmediaPlayerTime ( mmachine  m)

_GETmediaPlayerTime : Get the playback position in the current video. Prototype: fun [ObjMediaPlayer] I

Parameters
ObjMediaPlayermedia player object
Returns
I : time in milliseconds.

Definition at line 590 of file MediaPlayerToolkit.cpp.

◆ _GETmediaPlayerVideoStreams()

int _GETmediaPlayerVideoStreams ( mmachine  m)

_GETmediaPlayerVideoStreams : Get a list of the current file's video streams. Prototype: fun [ObjMediaPlayer] [S r1]

Parameters
ObjMediaPlayer: media player object
Returns
[S r1] : list of video streams, with a description (if any). The position of a stream in the list corresponds to its index, which can be passed to _SETmediaPlayerStream.

Definition at line 1122 of file MediaPlayerToolkit.cpp.

◆ _OPENmediaPlayerFile()

int _OPENmediaPlayerFile ( mmachine  m)

_OPENmediaPlayerFile : open a media player file.

Prototype: fun [ObjMediaPlayer P] ObjMediaPlayer

Parameters
ObjMediaPlayer: Player to use.
P: File to open
Returns
ObjMediaPlayer : media player object on success, NIL on error.

Definition at line 188 of file MediaPlayerToolkit.cpp.

◆ _OPENmediaPlayerUrl()

int _OPENmediaPlayerUrl ( mmachine  m)

_OPENmediaPlayerUrl : open a media player url.

Prototype: fun [ObjMediaPlayer S] ObjMediaPlayer

Parameters
ObjMediaPlayer: Player to use.
S: Url to open
Returns
same video player object on success, NIL on error.

Definition at line 143 of file MediaPlayerToolkit.cpp.

◆ _PAUSEmediaPlayer()

int _PAUSEmediaPlayer ( mmachine  m)

_PAUSEmediaPlayer : Pause the video. Prototype: fun [ObjMediaPlayer] ObjMediaPlayer

Parameters
ObjMediaPlayer: media player object to pause
Returns
ObjMediaPlayer : Same media player object on success, NIL on failure

Definition at line 399 of file MediaPlayerToolkit.cpp.

◆ _PLAYmediaPlayer()

int _PLAYmediaPlayer ( mmachine  m)

_PLAYmediaPlayer : Play / resume (if paused) the video. Prototype: fun [ObjMediaPlayer] ObjMediaPlayer

Parameters
ObjMediaPlayer: media player object to play
Returns
ObjMediaPlayer : Same media player object on success, NIL on failure

Definition at line 365 of file MediaPlayerToolkit.cpp.

◆ _SEEKmediaPlayer()

int _SEEKmediaPlayer ( mmachine  m)

_SEEKmediaPlayer : Seek to the given position in milliseconds. Prototype: fun [ObjMediaPlayer I] ObjMediaPlayer

Parameters
ObjMediaPlayermedia player object
I: potision in milliseconds to seek to.
Returns
ObjMediaPlayer : same as param, NIL on failure

Definition at line 672 of file MediaPlayerToolkit.cpp.

◆ _SETmediaPlayerAudioFormat()

int _SETmediaPlayerAudioFormat ( mmachine  m)

_SETmediaPlayerAudioFormat : Set the output format for audio. Prototype: fun [ObjMediaPlayer I I] ObjMediaPlayer

Parameters
ObjMediaPlayermedia player object
I: Sample format with channel layout (one of the MP_AUDIO constants)
I: Sample rate in Hz.
Returns
ObjMediaPlayer : same player as input, NIL on failure.

Definition at line 889 of file MediaPlayerToolkit.cpp.

◆ _SETmediaPlayerAudioStream()

int _SETmediaPlayerAudioStream ( mmachine  m)

_SETmediaPlayerAudioStream : Select an audio stream to play in the current file. Prototype: fun [ObjMediaPlayer I] ObjMediaPlayer

Parameters
ObjMediaPlayermedia player object
I: desired audio stream index (-1 for default stream)
Returns
ObjMediaPlayer : same as param, NIL on failure

Definition at line 792 of file MediaPlayerToolkit.cpp.

◆ _SETmediaPlayerLoop()

int _SETmediaPlayerLoop ( mmachine  m)

_SETmediaPlayerLoop : Toggle loop playback mode. Prototype: fun [ObjMediaPlayer I] ObjMediaPlayer

Parameters
ObjMediaPlayermedia player object
I: 1 for loop mode ON, 0 for OFF.
Returns
ObjMediaPlayer : same as param, NIL on failure

Definition at line 716 of file MediaPlayerToolkit.cpp.

◆ _SETmediaPlayerSize()

int _SETmediaPlayerSize ( mmachine  m)

_SETmediaPlayerSize : Change the video size. Prototype: fun [ObjMediaPlayer I I] ObjMediaPlayer

Parameters
ObjMediaPlayermedia player object
Inew width (0 for auto size)
Inew height (0 for auto size)
Returns
ObjMediaPlayer : Same media player object on success, NIL on failure

Definition at line 460 of file MediaPlayerToolkit.cpp.

◆ _SETmediaPlayerStream()

int _SETmediaPlayerStream ( mmachine  m)

_SETmediaPlayerStream : Select a video stream to play in the current file. Prototype: fun [ObjMediaPlayer I] ObjMediaPlayer

Parameters
ObjMediaPlayermedia player object
I: desired video stream index (-1 for default stream)
Returns
ObjMediaPlayer : same as param, NIL on failure

Definition at line 750 of file MediaPlayerToolkit.cpp.

◆ _STOPmediaPlayer()

int _STOPmediaPlayer ( mmachine  m)

_STOPmediaPlayer : Stop the video. Prototype: fun [ObjMediaPlayer] ObjMediaPlayer

Parameters
ObjMediaPlayer: media player object to stop
Returns
ObjMediaPlayer : Same media player object on success, NIL on failure

Definition at line 433 of file MediaPlayerToolkit.cpp.

◆ destroyMediaPlayerObj()

int destroyMediaPlayerObj ( mmachine  m,
SCOL_PTR_TYPE  handsys,
int  objm 
)

Definition at line 61 of file MediaPlayerToolkit.cpp.

◆ getMediaPlayerEndCb()

int getMediaPlayerEndCb ( mmachine  m,
SCOL_PTR_TYPE  id,
SCOL_PTR_TYPE  ret 
)

Definition at line 1182 of file MediaPlayerToolkit.cpp.

◆ getMediaPlayerLoadedCb()

int getMediaPlayerLoadedCb ( mmachine  m,
SCOL_PTR_TYPE  id,
SCOL_PTR_TYPE  ret 
)

Definition at line 1208 of file MediaPlayerToolkit.cpp.

◆ getPlayerFromStack()

MediaPlayer * getPlayerFromStack ( mmachine  m,
int  pos 
)

Definition at line 51 of file MediaPlayerToolkit.cpp.

Variable Documentation

◆ MEDIAPLAYER_END_CB

int MEDIAPLAYER_END_CB

Definition at line 45 of file MediaPlayerToolkit.cpp.

◆ MEDIAPLAYER_LOADED_CB

int MEDIAPLAYER_LOADED_CB

Definition at line 46 of file MediaPlayerToolkit.cpp.

◆ NBMEDIAPLAYER_CALLBACK

int NBMEDIAPLAYER_CALLBACK = 2

Definition at line 44 of file MediaPlayerToolkit.cpp.

◆ OBJMEDIAPLAYERSCOL

int OBJMEDIAPLAYERSCOL

Definition at line 43 of file MediaPlayerToolkit.cpp.

◆ SCOL_MEDIAPLAYER_END_CB

int SCOL_MEDIAPLAYER_END_CB = 0

Definition at line 47 of file MediaPlayerToolkit.cpp.

◆ SCOL_MEDIAPLAYER_LOADED_CB

int SCOL_MEDIAPLAYER_LOADED_CB = 1

Definition at line 48 of file MediaPlayerToolkit.cpp.