[rygel/wip/gobject: 39/39] server, engine-gst: Make transcoder's properties construct-only.



commit d8e51d91ce15a653e8ed9a2a2d7c071aacfb3cff
Author: Krzesimir Nowak <krnowak openismus com>
Date:   Wed Jan 16 14:15:13 2013 +0100

    server,engine-gst: Make transcoder's properties construct-only.

 src/librygel-server/rygel-transcoder.vala          |    8 ++++----
 .../gstreamer/rygel-gst-transcoder.vala            |   11 ++++++++---
 2 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/librygel-server/rygel-transcoder.vala b/src/librygel-server/rygel-transcoder.vala
index aaeff40..439997c 100644
--- a/src/librygel-server/rygel-transcoder.vala
+++ b/src/librygel-server/rygel-transcoder.vala
@@ -29,14 +29,14 @@ using GUPnP;
  * The base Transcoder class. Each implementation derives from it and must
  * implement create_source() and get_distance().
  *
- * Transcoders are obtained from rygel_media_engine_get_transcoders() and 
+ * Transcoders are obtained from rygel_media_engine_get_transcoders() and
  * are only expected to support the derived #RygelDataSource types provided
  * by the same media engine.
  */
 public abstract class Rygel.Transcoder : GLib.Object {
-    public string mime_type { get; protected set; }
-    public string dlna_profile { get; protected set; }
-    public string extension { get; protected set; }
+    public string mime_type { get; construct; }
+    public string dlna_profile { get; construct; }
+    public string extension { get; construct; }
 
     /**
      * Creates a transcoding source.
diff --git a/src/media-engines/gstreamer/rygel-gst-transcoder.vala b/src/media-engines/gstreamer/rygel-gst-transcoder.vala
index a201580..4c121ef 100644
--- a/src/media-engines/gstreamer/rygel-gst-transcoder.vala
+++ b/src/media-engines/gstreamer/rygel-gst-transcoder.vala
@@ -52,10 +52,15 @@ internal abstract class Rygel.GstTranscoder : Rygel.Transcoder {
     public GstTranscoder (string mime_type,
                           string dlna_profile,
                           string extension) {
-        this.mime_type = mime_type;
-        this.dlna_profile = dlna_profile;
+        GLib.Object (mime_type : mime_type,
+                     dlna_profile : dlna_profile,
+                     extension : extension);
+    }
+
+    public override void constructed () {
+        base.constructed ();
+
         this.link_failed = true;
-        this.extension = extension;
     }
 
     /**



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