[rygel] examples: Fix C renderer plugin



commit 950501ade6f98fbd569dcba0789d89fbeaf856c5
Author: Richard Röjfors <richard rojfors gmail com>
Date:   Mon Nov 18 20:39:40 2013 +0100

    examples: Fix C renderer plugin
    
    Add new properties.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712336

 examples/renderer-plugins/C/example-player.c |   59 +++++++++++++++++++++++++-
 1 files changed, 58 insertions(+), 1 deletions(-)
---
diff --git a/examples/renderer-plugins/C/example-player.c b/examples/renderer-plugins/C/example-player.c
index 4ae3348..75accc4 100644
--- a/examples/renderer-plugins/C/example-player.c
+++ b/examples/renderer-plugins/C/example-player.c
@@ -32,7 +32,10 @@ enum  {
   RYGEL_EXAMPLE_PLAYER_DURATION,
   RYGEL_EXAMPLE_PLAYER_POSITION,
   RYGEL_EXAMPLE_PLAYER_PLAYBACK_SPEED,
-  RYGEL_EXAMPLE_PLAYER_ALLOWED_PLAYBACK_SPEEDS
+  RYGEL_EXAMPLE_PLAYER_ALLOWED_PLAYBACK_SPEEDS,
+  RYGEL_EXAMPLE_PLAYER_CAN_SEEK_BYTES,
+  RYGEL_EXAMPLE_PLAYER_BYTE_POSITION,
+  RYGEL_EXAMPLE_PLAYER_SIZE
 };
 
 static void rygel_example_player_rygel_media_player_interface_init (RygelMediaPlayerIface  *iface);
@@ -100,6 +103,15 @@ rygel_example_player_real_set_playback_speed (RygelMediaPlayer *base, const char
 static gchar *
 rygel_example_player_real_get_playback_speed (RygelMediaPlayer *base);
 
+static gint64
+rygel_example_player_real_get_byte_position (RygelMediaPlayer* base);
+
+static gint64
+rygel_example_player_real_get_size (RygelMediaPlayer* base);
+
+static gboolean
+rygel_example_player_real_get_can_seek_bytes (RygelMediaPlayer* base);
+
 static void
 _rygel_example_player_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
 
@@ -158,6 +170,9 @@ rygel_example_player_rygel_media_player_interface_init (RygelMediaPlayerIface *i
   iface->get_allowed_playback_speeds = rygel_example_player_real_get_allowed_playback_speeds;
   iface->get_playback_speed = rygel_example_player_real_get_playback_speed;
   iface->set_playback_speed = rygel_example_player_real_set_playback_speed;
+  iface->get_can_seek_bytes = rygel_example_player_real_get_can_seek_bytes;
+  iface->get_size = rygel_example_player_real_get_size;
+  iface->get_byte_position = rygel_example_player_real_get_byte_position;
 }
 
 static void
@@ -213,6 +228,18 @@ rygel_example_player_class_init (RygelExamplePlayerClass *klass) {
   g_object_class_override_property (gobject_class,
                                     RYGEL_EXAMPLE_PLAYER_ALLOWED_PLAYBACK_SPEEDS,
                                     "allowed-playback-speeds");
+
+  g_object_class_override_property (gobject_class,
+                                    RYGEL_EXAMPLE_PLAYER_CAN_SEEK_BYTES,
+                                    "can-seek-bytes");
+
+  g_object_class_override_property (gobject_class,
+                                    RYGEL_EXAMPLE_PLAYER_BYTE_POSITION,
+                                    "byte-position");
+
+  g_object_class_override_property (gobject_class,
+                                    RYGEL_EXAMPLE_PLAYER_SIZE,
+                                    "size");
 }
 
 static void
@@ -431,6 +458,27 @@ rygel_example_player_real_get_playback_speed (RygelMediaPlayer *base)
   return g_strdup (self->priv->playback_speed);
 }
 
+static gint64
+rygel_example_player_real_get_byte_position (RygelMediaPlayer* base)
+{
+       RygelExamplePlayer *self = RYGEL_EXAMPLE_PLAYER (base);
+       return 0;
+}
+
+static gint64
+rygel_example_player_real_get_size (RygelMediaPlayer* base)
+{
+       RygelExamplePlayer *self = RYGEL_EXAMPLE_PLAYER (base);
+       return 0;
+}
+
+static gboolean
+rygel_example_player_real_get_can_seek_bytes (RygelMediaPlayer* base)
+{
+       RygelExamplePlayer *self = RYGEL_EXAMPLE_PLAYER (base);
+       return FALSE;
+}
+
 static void
 _rygel_example_player_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) {
   RygelMediaPlayer *base = RYGEL_MEDIA_PLAYER (object);
@@ -473,6 +521,15 @@ _rygel_example_player_get_property (GObject *object, guint property_id, GValue *
         g_value_take_boxed (value, rygel_media_player_get_allowed_playback_speeds (base, &length));
       }
       break;
+    case RYGEL_EXAMPLE_PLAYER_CAN_SEEK_BYTES:
+      g_value_set_boolean (value, rygel_media_player_get_can_seek_bytes (base));
+      break;
+    case RYGEL_EXAMPLE_PLAYER_BYTE_POSITION:
+      g_value_set_int64 (value, rygel_media_player_get_byte_position (base));
+      break;
+    case RYGEL_EXAMPLE_PLAYER_SIZE:
+      g_value_set_int64 (value, rygel_media_player_get_size (base));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;


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