From 50ab1e57ec21f2009013b3bc061047887cdd07d5 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Mon, 16 May 2016 10:58:39 -0700 Subject: Added support for some transport controls (pause/play/stop) and setting media volume level. --- indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 41 +++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'indra/media_plugins/libvlc') diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index 920c32f1f7..92bfc15113 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -198,7 +198,7 @@ void MediaPluginLibVLC::playMedia() gVLCCallbackContext.mp = gLibVLCMediaPlayer; libvlc_video_set_callbacks(gLibVLCMediaPlayer, lock, unlock, display, &gVLCCallbackContext); - libvlc_video_set_format(gLibVLCMediaPlayer, "RV32", mWidth, mHeight, mWidth * 4); + libvlc_video_set_format(gLibVLCMediaPlayer, "RV32", mWidth, mHeight, mWidth * mDepth); libvlc_media_player_play(gLibVLCMediaPlayer); } @@ -338,6 +338,45 @@ void MediaPluginLibVLC::receiveMessage( const char* message_string ) playMedia(); } } + else + if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME) + { + if (message_name == "stop") + { + if (gLibVLCMediaPlayer) + { + libvlc_media_player_stop(gLibVLCMediaPlayer); + } + } + else if (message_name == "start") + { + if (gLibVLCMediaPlayer) + { + libvlc_media_player_play(gLibVLCMediaPlayer); + } + } + else if (message_name == "pause") + { + if (gLibVLCMediaPlayer) + { + libvlc_media_player_pause(gLibVLCMediaPlayer); + } + } + else if (message_name == "seek") + { + } + else if (message_name == "set_loop") + { + } + else if (message_name == "set_volume") + { + if (gLibVLCMediaPlayer) + { + F64 volume = message_in.getValueReal("volume"); + libvlc_audio_set_volume(gLibVLCMediaPlayer, (int)(volume * 100)); + } + } + } } } -- cgit v1.2.3