[rygel-gst-0-10-fullscreen-renderer] Implement supported-profiles property



commit 965c64c4fcd56d93dd84e2d24ee4b15b070c8856
Author: Jens Georg <mail jensge org>
Date:   Tue Oct 8 12:19:56 2013 +0200

    Implement supported-profiles property

 src/gstreamer-legacy-renderer-plugin.c |   14 ++++++++
 src/rygel-playbin-player.c             |   55 ++++++++++++++++++++++++++++++-
 src/rygel-playbin-player.h             |    1 +
 3 files changed, 68 insertions(+), 2 deletions(-)
---
diff --git a/src/gstreamer-legacy-renderer-plugin.c b/src/gstreamer-legacy-renderer-plugin.c
index 47e07f4..af5fb18 100644
--- a/src/gstreamer-legacy-renderer-plugin.c
+++ b/src/gstreamer-legacy-renderer-plugin.c
@@ -77,11 +77,25 @@ rygel_gstreamer_legacy_renderer_plugin_get_player (RygelMediaRendererPlugin* plu
 }
 
 static void
+rygel_gstreamer_legacy_renderer_plugin_constructed (GObject* base) {
+    RygelMediaRendererPlugin *self = RYGEL_MEDIA_RENDERER_PLUGIN (base);
+    RygelPlaybinPlayer *player;
+    GList *supported_profiles;
+
+    G_OBJECT_CLASS(rygel_gstreamer_legacy_renderer_plugin_parent_class)->constructed (base);
+
+    player = rygel_playbin_player_get_default ();
+    supported_profiles = rygel_playbin_player_get_supported_profiles (player);
+    rygel_media_renderer_plugin_set_supported_profiles (self, supported_profiles);
+}
+
+static void
 rygel_gstreamer_legacy_renderer_plugin_class_init (RygelGStreamerLegacyRendererPluginClass *klass) {
     RygelMediaRendererPluginClass *plugin_class;
 
     plugin_class = RYGEL_MEDIA_RENDERER_PLUGIN_CLASS (klass);
     plugin_class->get_player = rygel_gstreamer_legacy_renderer_plugin_get_player;
+    G_OBJECT_CLASS(plugin_class)->constructed = rygel_gstreamer_legacy_renderer_plugin_constructed;
 }
 
 
diff --git a/src/rygel-playbin-player.c b/src/rygel-playbin-player.c
index e87839c..6fa4e53 100644
--- a/src/rygel-playbin-player.c
+++ b/src/rygel-playbin-player.c
@@ -1,8 +1,8 @@
 /*
  * Copyright (C) 2008 OpenedHand Ltd.
  * Copyright (C) 2009,2010,2011,2012 Nokia Corporation.
- * Copyright (C) 2012 Openismus GmbH
  * Copyright (C) 2012 Intel Corporation.
+ * Copyright (C) 2012,2013 Openismus GmbH
  *
  * Author: Jorn Baayen <jorn openedhand com>
  *         Zeeshan Ali (Khattak) <zeeshanak gnome org>
@@ -64,6 +64,7 @@ struct _RygelPlaybinPlayerPrivate {
   gchar *_metadata;
   gchar *_content_features;
   GUPnPProtocolInfo *protocol_info;
+  GList *_supported_profiles;
 };
 
 static RygelMediaPlayerIface* rygel_playbin_player_rygel_media_player_parent_iface = NULL;
@@ -82,7 +83,8 @@ enum  {
   RYGEL_PLAYBIN_PLAYER_CONTENT_FEATURES,
   RYGEL_PLAYBIN_PLAYER_VOLUME,
   RYGEL_PLAYBIN_PLAYER_DURATION,
-  RYGEL_PLAYBIN_PLAYER_POSITION
+  RYGEL_PLAYBIN_PLAYER_POSITION,
+  RYGEL_PLAYBIN_PLAYER_SUPPORTED_PROFILES
 };
 
 #define RYGEL_PLAYBIN_PLAYER_TRANSFER_MODE_STREAMING "Streaming"
@@ -859,6 +861,52 @@ rygel_playbin_player_real_get_position (RygelMediaPlayer *base) {
   }
 }
 
+GList *
+rygel_playbin_player_get_supported_profiles (RygelPlaybinPlayer *self) {
+  if (self->priv->_supported_profiles == NULL) {
+    RygelRendererDLNAProfile *profile = NULL;
+
+    profile = rygel_renderer_dlna_profile_new ("JPEG_SM", "image/jpeg");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("JPEG_MED", "image/jpeg");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("JPEG_LRG", "image/jpeg");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("PNG_LRG", "image/png");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("MP3", "audio/mpeg");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("MP3X", "audio/mpeg");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("AAC_ADTS_320", "audio/vnd.dlna.adts");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("AAC_ISO_320", "audio/mp4");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("AAC_ISO_320", "audio/3gpp");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("LPCM", "audio/l16;rate=44100;channels=2");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("LPCM", "audio/l16;rate=44100;channels=1");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("WMABASE", "audio/x-ms-wma");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("WMAFULL", "audio/x-ms-wma");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("WMAPRO", "audio/x-ms-wma");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("MPEG_TS_SD_EU_ISO", "video/mpeg");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("MPEG_TS_SD_NA_ISO", "video/mpeg");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("MPEG_TS_HD_NA_ISO", "video/mpeg");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+    profile = rygel_renderer_dlna_profile_new ("AVC_MP4_BL_CIF15_AAC_520", "video/mp4");
+    self->priv->_supported_profiles = g_list_prepend (self->priv->_supported_profiles, profile);
+  }
+
+  return self->priv->_supported_profiles;
+}
+
 
 static void rygel_playbin_player_class_init (RygelPlaybinPlayerClass *klass) {
   rygel_playbin_player_parent_class = g_type_class_peek_parent (klass);
@@ -1063,6 +1111,9 @@ static void _vala_rygel_playbin_player_get_property (GObject *object, guint prop
     case RYGEL_PLAYBIN_PLAYER_POSITION:
       g_value_set_int64 (value, rygel_media_player_get_position (RYGEL_MEDIA_PLAYER (self)));
       break;
+    case RYGEL_PLAYBIN_PLAYER_SUPPORTED_PROFILES:
+      g_value_set_pointer (value, rygel_playbin_player_get_supported_profiles (self));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
     break;
diff --git a/src/rygel-playbin-player.h b/src/rygel-playbin-player.h
index 495acc6..8687f13 100644
--- a/src/rygel-playbin-player.h
+++ b/src/rygel-playbin-player.h
@@ -53,6 +53,7 @@ rygel_playbin_player_get_type (void) G_GNUC_CONST;
 
 RygelPlaybinPlayer* rygel_playbin_player_get_default (void);
 GstElement* rygel_playbin_player_get_playbin (RygelPlaybinPlayer *self);
+GList * rygel_playbin_player_get_supported_profiles (RygelPlaybinPlayer *self);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]