diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-05-01 15:28:34 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-05-01 15:28:34 +0200 |
commit | 3f74ddbae3437cbd81543a588a0dfa7b27145903 (patch) | |
tree | e2274cbd9e45dfe4d4857dec2dfadd798df545f2 | |
parent | d543e568dfabf3b4c41f041bd4a0a0d56965cb55 (diff) |
Fix samples for all the API changes
-rw-r--r-- | samples/DecodeBinTranscoder.cs | 17 | ||||
-rw-r--r-- | samples/HelloWorld.cs | 9 | ||||
-rw-r--r-- | samples/PlayBinPlayer.cs | 7 | ||||
-rw-r--r-- | samples/TypeFind.cs | 2 |
4 files changed, 19 insertions, 16 deletions
diff --git a/samples/DecodeBinTranscoder.cs b/samples/DecodeBinTranscoder.cs index e5cf426..eb4c29d 100644 --- a/samples/DecodeBinTranscoder.cs +++ b/samples/DecodeBinTranscoder.cs @@ -46,8 +46,8 @@ public class DecodeBinTranscoder : IDisposable public void Transcode(string inputFile, string outputFile) { - filesrc.SetProperty("location", inputFile); - filesink.SetProperty("location", outputFile); + filesrc["location"] = inputFile; + filesink["location"] = outputFile; pipeline.SetState(State.Playing); progress_timeout = GLib.Timeout.Add(250, OnProgressTimeout); @@ -109,7 +109,7 @@ public class DecodeBinTranscoder : IDisposable private void OnNewDecodedPad(object o, NewDecodedPadArgs args) { - Pad sinkpad = audioconvert.GetPad("sink"); + Pad sinkpad = audioconvert.GetStaticPad("sink"); if(sinkpad.IsLinked) { return; @@ -129,10 +129,11 @@ public class DecodeBinTranscoder : IDisposable { switch(message.Type) { case MessageType.Error: - string error; - message.ParseError(out error); + string msg; + Enum err; + message.ParseError(out err, out msg); GLib.Source.Remove(progress_timeout); - OnError(error); + OnError(msg); break; case MessageType.Eos: pipeline.SetState(State.Null); @@ -147,9 +148,9 @@ public class DecodeBinTranscoder : IDisposable private bool OnProgressTimeout() { long duration, position; + Gst.Format fmt = Gst.Format.Time; - if(pipeline.QueryDuration(Gst.Format.Time, out duration) && - encoder.QueryPosition(Gst.Format.Time, out position)) { + if(pipeline.QueryDuration(ref fmt, out duration) && fmt == Gst.Format.Time && encoder.QueryPosition(ref fmt, out position) && fmt == Gst.Format.Time) { OnProgress(position, duration); } diff --git a/samples/HelloWorld.cs b/samples/HelloWorld.cs index 8119fb4..69c6a63 100644 --- a/samples/HelloWorld.cs +++ b/samples/HelloWorld.cs @@ -69,9 +69,10 @@ public class HelloWorld { switch(message.Type) { case MessageType.Error: - string err = String.Empty; - message.ParseError(out err); - Console.WriteLine ("Gstreamer error: {0}", err); + string msg; + Enum err; + message.ParseError(out err, out msg); + Console.WriteLine ("Gstreamer error: {0}", msg); loop.Quit(); break; case MessageType.Eos: @@ -95,7 +96,7 @@ public class HelloWorld void OnPadAdded(object o, PadAddedArgs args) { Console.WriteLine("Entered OnPadAdded"); - Pad sinkpad = decoder.GetPad("sink"); + Pad sinkpad = decoder.GetStaticPad("sink"); args.Pad.Link(sinkpad); } } diff --git a/samples/PlayBinPlayer.cs b/samples/PlayBinPlayer.cs index 9dcbe64..23ca5d4 100644 --- a/samples/PlayBinPlayer.cs +++ b/samples/PlayBinPlayer.cs @@ -43,9 +43,10 @@ public class PlayBinPlayer { switch (message.Type) { case MessageType.Error: - string err = String.Empty; - message.ParseError (out err); - Console.WriteLine ("Gstreamer error: {0}", err); + Enum err; + string msg; + message.ParseError (out err, out msg); + Console.WriteLine ("Gstreamer error: {0}", msg); loop.Quit (); break; case MessageType.Eos: diff --git a/samples/TypeFind.cs b/samples/TypeFind.cs index 94849f0..47a8575 100644 --- a/samples/TypeFind.cs +++ b/samples/TypeFind.cs @@ -14,7 +14,7 @@ public static class GstTypefindTest typefind = TypeFindElement.Make("typefind"); Element sink = ElementFactory.Make("fakesink", "sink"); - source.SetProperty("location", args[0]); + source["location"] = args[0]; typefind.HaveType += OnHaveType; |