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);
private void OnNewDecodedPad(object o, NewDecodedPadArgs args)
{
- Pad sinkpad = audioconvert.GetPad("sink");
+ Pad sinkpad = audioconvert.GetStaticPad("sink");
if(sinkpad.IsLinked) {
return;
{
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);
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);
}
{
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:
void OnPadAdded(object o, PadAddedArgs args)
{
Console.WriteLine("Entered OnPadAdded");
- Pad sinkpad = decoder.GetPad("sink");
+ Pad sinkpad = decoder.GetStaticPad("sink");
args.Pad.Link(sinkpad);
}
}
{
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:
typefind = TypeFindElement.Make("typefind");
Element sink = ElementFactory.Make("fakesink", "sink");
- source.SetProperty("location", args[0]);
+ source["location"] = args[0];
typefind.HaveType += OnHaveType;