[gnome-dvb-daemon/gst-1.0: 4/4] Convert to GStreamer 1.0



commit fe1468ca7a4c9ad928a173bf0b594660f29a500c
Author: Sebastian Pölsterl <sebp k-d-w org>
Date:   Sat Mar 16 18:05:30 2013 +0100

    Convert to GStreamer 1.0

 src/Cable/CableScanner.vala             |   12 +++++-----
 src/ChannelFactory.vala                 |    4 +-
 src/EPGScanner.vala                     |    8 +++---
 src/Main.vala                           |    2 +-
 src/Manager.vala                        |    2 +-
 src/Satellite/SatelliteScanner.vala     |   10 ++++----
 src/Scanner.vala                        |   34 +++++++++++++++---------------
 src/Terrestrial/TerrestrialScanner.vala |   20 +++++++++---------
 src/rtsp/MediaFactory.vala              |    4 +-
 src/rtsp/MediaMapping.vala              |    2 +-
 src/rtsp/Server.vala                    |    2 +-
 11 files changed, 50 insertions(+), 50 deletions(-)
---
diff --git a/src/Cable/CableScanner.vala b/src/Cable/CableScanner.vala
index c0b803c..fd594a7 100644
--- a/src/Cable/CableScanner.vala
+++ b/src/Cable/CableScanner.vala
@@ -59,11 +59,11 @@ namespace DVB {
 
         private inline void add_scanning_data (uint frequency, string modulation,
                 uint symbol_rate, string code_rate) {
-            var tuning_params = new Gst.Structure ("tuning_params",
-            "frequency", typeof(uint), frequency,
-            "symbol-rate", typeof(uint), symbol_rate,
-            "inner-fec", typeof(string), code_rate,
-            "modulation", typeof(string), modulation);
+            var tuning_params = new Gst.Structure.empty ("tuning_params");
+            tuning_params.set_value ("frequency", frequency);
+            tuning_params.set_value ("symbol-rate", symbol_rate);
+            tuning_params.set_value ("inner-fec", code_rate);
+            tuning_params.set_value ("modulation", modulation);
 
             base.add_structure_to_scan (tuning_params);
         }
@@ -94,7 +94,7 @@ namespace DVB {
             };
 
             foreach (string key in keys) {
-                this.set_uint_property (dvbsrc, this.current_tuning_params, key);
+                set_uint_property (dvbsrc, this.current_tuning_params, key);
             }
 
             dvbsrc.set ("modulation",
diff --git a/src/ChannelFactory.vala b/src/ChannelFactory.vala
index 5ca26f6..4325ec0 100644
--- a/src/ChannelFactory.vala
+++ b/src/ChannelFactory.vala
@@ -228,7 +228,7 @@ namespace DVB {
             Element queue = ElementFactory.make ("queue", null);
             queue.set ("max-size-buffers", 0);
 
-            Gst.Element bin = new Gst.Bin (null);
+            Gst.Element bin = new Gst.Bin ("sink_bin");
             ((Gst.Bin)bin).add_many (queue, sink_element);
             if (!queue.link (sink_element)) {
                 log.error ("Could not link elements %s and %s", queue.get_name (),
@@ -266,7 +266,7 @@ namespace DVB {
                 ChannelElements? celems = this.elements_map.get (sid);
                 if (celems != null) {
                     foreach (Gst.Element sink_bin in celems.sinks) {
-                        Gst.Iterator<Gst.Element> it = ((Gst.Bin)sink_bin).iterate_elements ();
+                        Gst.Iterator it = ((Gst.Bin)sink_bin).iterate_elements ();
                         Gst.Element element = it.find_custom (find_element, sink);
                         if (element != null) {
                             result = sink_bin;
diff --git a/src/EPGScanner.vala b/src/EPGScanner.vala
index 68c0d65..31db27e 100644
--- a/src/EPGScanner.vala
+++ b/src/EPGScanner.vala
@@ -268,10 +268,10 @@ namespace DVB {
         public void on_eit_structure (Gst.Structure structure) {
             Value events = structure.get_value ("events");
 
-            if (!(events.holds (Value.list_get_type ())))
+            if (!events.holds (typeof(Gst.ValueList)))
                 return;
 
-            uint size = events.list_get_size ();
+            uint size = Gst.ValueList.get_size (events);
             Value val;
             weak Gst.Structure event;
             // Iterate over events
@@ -284,8 +284,8 @@ namespace DVB {
                 HashSet<Event> list = this.channel_events.get (sid);
 
                 for (uint i=0; i<size; i++) {
-                    val = events.list_get_value (i);
-                    event = val.get_structure ();
+                    val = Gst.ValueList.get_value (events, i);
+                    event = Gst.Value.get_structure (val);
 
                     var event_class = new Event ();
                     event_class.id = get_uint_val (event, "event-id");
diff --git a/src/Main.vala b/src/Main.vala
index aeedda9..ec03b75 100644
--- a/src/Main.vala
+++ b/src/Main.vala
@@ -88,7 +88,7 @@ namespace Main {
 
     private static bool check_feature_version (string name, uint major,
             uint minor, uint micro) {
-        Gst.Registry reg = Gst.Registry.get_default ();
+        Gst.Registry reg = Gst.Registry.get ();
         Gst.PluginFeature feature = reg.lookup_feature (name);
         bool ret;
         if (feature == null)
diff --git a/src/Manager.vala b/src/Manager.vala
index 8fc41d4..040f712 100644
--- a/src/Manager.vala
+++ b/src/Manager.vala
@@ -387,7 +387,7 @@ namespace DVB {
             dvbelement.set("adapter", adapter);
             dvbelement.set("frontend", frontend);
 
-            Gst.Element pipeline = new Gst.Pipeline(null);
+            Gst.Element pipeline = new Gst.Pipeline("get-adapter-info");
             ((Gst.Bin)pipeline).add(dvbelement);
             pipeline.set_state(Gst.State.READY);
 
diff --git a/src/Satellite/SatelliteScanner.vala b/src/Satellite/SatelliteScanner.vala
index 5cc8cff..a119fb4 100644
--- a/src/Satellite/SatelliteScanner.vala
+++ b/src/Satellite/SatelliteScanner.vala
@@ -83,10 +83,10 @@ namespace DVB {
 
         private inline void add_scanning_data (uint frequency,
                 string polarization, uint symbol_rate) {
-            var tuning_params = new Gst.Structure ("tuning_params",
-            "frequency", typeof(uint), frequency,
-            "symbol-rate", typeof(uint), symbol_rate,
-            "polarization", typeof(string), polarization);
+            var tuning_params = new Gst.Structure.empty ("tuning_params");
+            tuning_params.set_value ("frequency", frequency);
+            tuning_params.set_value ("symbol-rate", symbol_rate);
+            tuning_params.set_value ("polarization", polarization);
 
             base.add_structure_to_scan (tuning_params);
         }
@@ -123,7 +123,7 @@ namespace DVB {
             string[] uint_keys = new string[] {"frequency", "symbol-rate"};
 
             foreach (string key in uint_keys) {
-                base.set_uint_property (dvbsrc, base.current_tuning_params, key);
+                set_uint_property (dvbsrc, base.current_tuning_params, key);
             }
 
             string polarity =
diff --git a/src/Scanner.vala b/src/Scanner.vala
index 0cfa00e..4705588 100644
--- a/src/Scanner.vala
+++ b/src/Scanner.vala
@@ -526,13 +526,13 @@ namespace DVB {
             pid_set.add (17);
 
             Value programs = structure.get_value ("programs");
-            uint size = programs.list_get_size ();
+            uint size = Gst.ValueList.get_size (programs);
             Value val;
             weak Gst.Structure program;
             // Iterate over programs
             for (uint i=0; i<size; i++) {
-                val = programs.list_get_value (i);
-                program = val.get_structure ();
+                val = Gst.ValueList.get_value (programs, i);
+                program = Gst.Value.get_structure (val);
 
                 uint sid;
                 program.get_uint ("program-number", out sid);
@@ -568,14 +568,14 @@ namespace DVB {
             log.debug("Received SDT (0x%x)", tsid);
 
             Value services = structure.get_value ("services");
-            uint size = services.list_get_size ();
+            uint size = Gst.ValueList.get_size (services);
 
             Value val;
             weak Gst.Structure service;
             // Iterate over services
             for (uint i=0; i<size; i++) {
-                val = services.list_get_value (i);
-                service = val.get_structure ();
+                val = Gst.ValueList.get_value (services, i);
+                service = Gst.Value.get_structure (val);
 
                 // Returns "service-%d"
                 string name = service.get_name ();
@@ -637,21 +637,21 @@ namespace DVB {
             log.debug ("Network name '%s'", name);
 
             Value transports = structure.get_value ("transports");
-            uint size = transports.list_get_size ();
+            uint size = Gst.ValueList.get_size (transports);
             Value val;
             weak Gst.Structure transport;
             // Iterate over transports
             for (uint i=0; i<size; i++) {
-                val = transports.list_get_value (i);
-                transport = val.get_structure ();
+                val = Gst.ValueList.get_value (transports, i);
+                transport = Gst.Value.get_structure (val);
 
                 uint tsid;
                 transport.get_uint ("transport-stream-id", out tsid);
 
                 if (transport.has_field ("delivery")) {
                     Value delivery_val = transport.get_value ("delivery");
-                    weak Gst.Structure delivery =
-                        delivery_val.get_structure ();
+                    weak Gst.Structure delivery = Gst.Value.get_structure (
+                        delivery_val);
 
                     log.debug ("Received TS 0x%x", tsid);
 
@@ -663,14 +663,14 @@ namespace DVB {
 
                 if (transport.has_field ("channels")) {
                     Value channels = transport.get_value ("channels");
-                    uint channels_size = channels.list_get_size ();
+                    uint channels_size = Gst.ValueList.get_size (channels);
 
                     Value channel_val;
                     weak Gst.Structure channel_struct;
                     // Iterate over channels
                     for (int j=0; j<channels_size; j++) {
-                        channel_val = channels.list_get_value (j);
-                        channel_struct = channel_val.get_structure ();
+                        channel_val = Gst.ValueList.get_value (channels, j);
+                        channel_struct = Gst.Value.get_structure (channel_val);
 
                         uint sid;
                         channel_struct.get_uint ("service-id", out sid);
@@ -710,14 +710,14 @@ namespace DVB {
             Channel dvb_channel = this.channels.get_channel (program_number);
 
             Value streams = structure.get_value ("streams");
-            uint size = streams.list_get_size ();
+            uint size = Gst.ValueList.get_size (streams);
 
             Value stream_val;
             weak Gst.Structure stream;
             // Iterate over streams
             for (int i=0; i<size; i++) {
-                stream_val = streams.list_get_value (i);
-                stream = stream_val.get_structure ();
+                stream_val = Gst.ValueList.get_value (streams, i);
+                stream = Gst.Value.get_structure (stream_val);
 
                 uint pid;
                 stream.get_uint ("pid", out pid);
diff --git a/src/Terrestrial/TerrestrialScanner.vala b/src/Terrestrial/TerrestrialScanner.vala
index 599bb25..e20b095 100644
--- a/src/Terrestrial/TerrestrialScanner.vala
+++ b/src/Terrestrial/TerrestrialScanner.vala
@@ -88,15 +88,15 @@ namespace DVB {
                 uint bandwidth, string transmode, string code_rate_hp,
                 string code_rate_lp, string constellation, uint guard) {
 
-            Gst.Structure tuning_params = new Gst.Structure ("tuning_params",
-                "frequency", typeof(uint), frequency,
-                "hierarchy", typeof(uint), hierarchy,
-                "bandwidth", typeof(uint), bandwidth,
-                "transmission-mode", typeof(string), transmode,
-                "code-rate-hp", typeof(string), code_rate_hp,
-                "code-rate-lp", typeof(string), code_rate_lp,
-                "constellation", typeof(string), constellation,
-                "guard-interval", typeof(uint), guard);
+            Gst.Structure tuning_params = new Gst.Structure.empty ("tuning_params");
+            tuning_params.set_value ("frequency", frequency);
+            tuning_params.set_value ("hierarchy", hierarchy);
+            tuning_params.set_value ("bandwidth", bandwidth);
+            tuning_params.set_value ("ransmission-mode", transmode);
+            tuning_params.set_value ("code-rate-hp", code_rate_hp);
+            tuning_params.set_value ("code-rate-lp", code_rate_lp);
+            tuning_params.set_value ("constellation", constellation);
+            tuning_params.set_value ("guard-interval", guard);
 
             base.add_structure_to_scan (tuning_params);
         }
@@ -147,7 +147,7 @@ namespace DVB {
 
             Gst.Element dvbsrc = ((Gst.Bin)base.pipeline).get_by_name ("dvbsrc");
 
-            base.set_uint_property (dvbsrc, base.current_tuning_params, "frequency");
+            set_uint_property (dvbsrc, base.current_tuning_params, "frequency");
 
             uint bandwidth;
             this.current_tuning_params.get_uint ("bandwidth", out bandwidth);
diff --git a/src/rtsp/MediaFactory.vala b/src/rtsp/MediaFactory.vala
index 2a4a93b..456518e 100644
--- a/src/rtsp/MediaFactory.vala
+++ b/src/rtsp/MediaFactory.vala
@@ -85,7 +85,7 @@ namespace DVB {
             // Set pipeline
             media.pipeline = player.get_pipeline ();
 
-            this.collect_streams (url, media);
+            media.collect_streams ();
 
             return media;
         }
@@ -110,7 +110,7 @@ namespace DVB {
         }
 
         public override bool unprepare () {
-            this.remove_elements ();
+            base.unprepare ();
             ChannelFactory channels_factory = this.group.channel_factory;
             channels_factory.stop_channel (this.channel, this.payloader);
             return true;
diff --git a/src/rtsp/MediaMapping.vala b/src/rtsp/MediaMapping.vala
index c51a0a4..ee1b1e4 100644
--- a/src/rtsp/MediaMapping.vala
+++ b/src/rtsp/MediaMapping.vala
@@ -25,7 +25,7 @@ namespace DVB {
 
         private static Gst.RTSPMediaFactory factory_instance = new MediaFactory ();
 
-        public override Gst.RTSPMediaFactory? find_media (Gst.RTSP.Url url) {
+        public override Gst.RTSPMediaFactory? find_factory (Gst.RTSP.Url url) {
             return factory_instance;
         }
 
diff --git a/src/rtsp/Server.vala b/src/rtsp/Server.vala
index cc966c5..f7616ab 100644
--- a/src/rtsp/Server.vala
+++ b/src/rtsp/Server.vala
@@ -79,7 +79,7 @@ namespace DVB.RTSPServer {
         private Gst.RTSP.Url url;
 
         public StopChannelHelper (string url_str) {
-            Gst.RTSPUrl.parse (url_str, out this.url);
+            Gst.RTSP.url_parse (url_str, out this.url);
         }
 
         public Gst.RTSPFilterResult session_filter_func (Gst.RTSPSessionPool pool,


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