mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 03:45:39 +00:00
Update samples to use decodebin2/playbin2
This commit is contained in:
parent
0ec40a54ee
commit
78f518f4ca
2 changed files with 5 additions and 5 deletions
|
@ -30,7 +30,7 @@ public class DecodeBinTranscoder : IDisposable {
|
|||
private FileSink filesink;
|
||||
private Element audioconvert;
|
||||
private Element encoder;
|
||||
private DecodeBin decodebin;
|
||||
private DecodeBin2 decodebin;
|
||||
|
||||
private uint progress_timeout;
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class DecodeBinTranscoder : IDisposable {
|
|||
filesink = ElementFactory.Make ("filesink", "filesink") as FileSink;
|
||||
audioconvert = ElementFactory.Make ("audioconvert", "audioconvert");
|
||||
encoder = ElementFactory.Make ("wavenc", "wavenc");
|
||||
decodebin = ElementFactory.Make ("decodebin", "decodebin") as DecodeBin;
|
||||
decodebin = ElementFactory.Make ("decodebin2", "decodebin") as DecodeBin2;
|
||||
decodebin.NewDecodedPad += OnNewDecodedPad;
|
||||
|
||||
pipeline.Add (filesrc, decodebin, audioconvert, encoder, filesink);
|
||||
|
@ -99,7 +99,7 @@ public class DecodeBinTranscoder : IDisposable {
|
|||
pipeline.Bus.AddWatch (new BusFunc (OnBusMessage));
|
||||
}
|
||||
|
||||
private void OnNewDecodedPad (object o, DecodeBin.NewDecodedPadArgs args) {
|
||||
private void OnNewDecodedPad (object o, DecodeBin2.NewDecodedPadArgs args) {
|
||||
Pad sinkpad = audioconvert.GetStaticPad ("sink");
|
||||
|
||||
if (sinkpad.IsLinked) {
|
||||
|
|
|
@ -7,7 +7,7 @@ public class PlayBinPlayer {
|
|||
private static MainLoop loop;
|
||||
private static string[] songs;
|
||||
private static int song_idx = 0;
|
||||
private static PlayBin play;
|
||||
private static PlayBin2 play;
|
||||
|
||||
public static void Main (string[] args) {
|
||||
if (args.Length < 1) {
|
||||
|
@ -20,7 +20,7 @@ public class PlayBinPlayer {
|
|||
Gst.Application.Init ();
|
||||
loop = new MainLoop ();
|
||||
|
||||
play = ElementFactory.Make ("playbin", "play") as PlayBin;
|
||||
play = ElementFactory.Make ("playbin2", "play") as PlayBin2;
|
||||
|
||||
if (play == null) {
|
||||
Console.WriteLine ("error creating a playbin gstreamer object");
|
||||
|
|
Loading…
Reference in a new issue