summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcallum_linden <none@none>2016-05-16 10:58:39 -0700
committercallum_linden <none@none>2016-05-16 10:58:39 -0700
commit50ab1e57ec21f2009013b3bc061047887cdd07d5 (patch)
treec5f172cebb154077871d98af91ee8c2ef2f58c14
parent09e68a49535a15f89b2c28e523a81fed1770ee61 (diff)
Added support for some transport controls (pause/play/stop) and setting media volume level.
-rw-r--r--indra/media_plugins/libvlc/media_plugin_libvlc.cpp41
1 files changed, 40 insertions, 1 deletions
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));
+ }
+ }
+ }
}
}