From cd7e7667e50398c406b920c56c78064624d4e2a8 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 26 Mar 2012 21:32:06 +0200 Subject: [PATCH] FIRE-5761; Patch from Melancholy Lemon: Enable meta data extraction for Linux non standalone builds. --- .../llmediaimplgstreamer_syms_raw.inc | 8 ++++++++ .../gstreamer010/media_plugin_gstreamer010.cpp | 17 ++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc index b33e59363d..251428002d 100644 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc +++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc @@ -49,3 +49,11 @@ LL_GST_SYM(false, gst_version, void, guint *major, guint *minor, guint *micro, g // GStreamer 'internal' symbols which may not be visible in some runtimes but are still used in expanded GStreamer header macros - yuck! We'll substitute our own stubs for these. //LL_GST_SYM(true, _gst_debug_register_funcptr, void, GstDebugFuncPtr func, gchar* ptrname); //LL_GST_SYM(true, _gst_debug_category_new, GstDebugCategory *, gchar *name, guint color, gchar *description); + +// [ML] Symbols needed to make "Now playing" work in standard builds +LL_GST_SYM(true, gst_message_parse_tag, void, GstMessage *, GstTagList **); +LL_GST_SYM(true, gst_tag_list_foreach, void, const GstTagList *, GstTagForeachFunc, gpointer); +LL_GST_SYM(true, gst_tag_list_free, void, GstTagList *); +LL_GST_SYM(true, gst_tag_list_get_tag_size, guint, const GstTagList *, const gchar *); +LL_GST_SYM(true, gst_tag_list_get_value_index, const GValue *, const GstTagList *, const gchar *, guint); +// [/ML] diff --git a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp index 6ebf9f596e..33c7309cea 100644 --- a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp +++ b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp @@ -49,7 +49,7 @@ extern "C" { #include "llmediaimplgstreamer_syms.h" // extract stream metadata so we can report back into the client what's playing -#ifdef LL_STANDALONE +// Fix this to use llgst symbols so it will work in standard builds struct ndStreamMetadata { std::string mArtist; @@ -74,16 +74,15 @@ static void extractMetadata (const GstTagList * list, const gchar * tag, gpointe if( !pStrOut ) return; - num = gst_tag_list_get_tag_size (list, tag); + num = llgst_tag_list_get_tag_size (list, tag); for (i = 0; i < num; ++i) { - const GValue *val( gst_tag_list_get_value_index (list, tag, i) ); + const GValue *val( llgst_tag_list_get_value_index (list, tag, i) ); if (G_VALUE_HOLDS_STRING (val)) pStrOut->assign( g_value_get_string(val) ); } } -#endif // ////////////////////////////////////////////////////////////////////////////// @@ -282,22 +281,22 @@ MediaPluginGStreamer010::processGSTEvents(GstBus *bus, } break; } -#ifdef LL_STANDALONE // In case of metadata upate, extract it, then send it back to the client +// In case of metadata upate, extract it, then send it back to the client case GST_MESSAGE_TAG: { ndStreamMetadata oMData; GstTagList *tags(0); - gst_message_parse_tag (message, &tags); - gst_tag_list_foreach (tags, extractMetadata, &oMData ); - gst_tag_list_free (tags); + llgst_message_parse_tag (message, &tags); + llgst_tag_list_foreach (tags, extractMetadata, &oMData ); + llgst_tag_list_free (tags); LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "ndMediadata_change"); message.setValue("title", oMData.mTitle ); message.setValue("artist", oMData.mArtist ); sendMessage(message); } -#endif // +// case GST_MESSAGE_ERROR: { GError *err = NULL; gchar *debug = NULL;