mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +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 FileSink filesink;
|
||||||
private Element audioconvert;
|
private Element audioconvert;
|
||||||
private Element encoder;
|
private Element encoder;
|
||||||
private DecodeBin decodebin;
|
private DecodeBin2 decodebin;
|
||||||
|
|
||||||
private uint progress_timeout;
|
private uint progress_timeout;
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ public class DecodeBinTranscoder : IDisposable {
|
||||||
filesink = ElementFactory.Make ("filesink", "filesink") as FileSink;
|
filesink = ElementFactory.Make ("filesink", "filesink") as FileSink;
|
||||||
audioconvert = ElementFactory.Make ("audioconvert", "audioconvert");
|
audioconvert = ElementFactory.Make ("audioconvert", "audioconvert");
|
||||||
encoder = ElementFactory.Make ("wavenc", "wavenc");
|
encoder = ElementFactory.Make ("wavenc", "wavenc");
|
||||||
decodebin = ElementFactory.Make ("decodebin", "decodebin") as DecodeBin;
|
decodebin = ElementFactory.Make ("decodebin2", "decodebin") as DecodeBin2;
|
||||||
decodebin.NewDecodedPad += OnNewDecodedPad;
|
decodebin.NewDecodedPad += OnNewDecodedPad;
|
||||||
|
|
||||||
pipeline.Add (filesrc, decodebin, audioconvert, encoder, filesink);
|
pipeline.Add (filesrc, decodebin, audioconvert, encoder, filesink);
|
||||||
|
@ -99,7 +99,7 @@ public class DecodeBinTranscoder : IDisposable {
|
||||||
pipeline.Bus.AddWatch (new BusFunc (OnBusMessage));
|
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");
|
Pad sinkpad = audioconvert.GetStaticPad ("sink");
|
||||||
|
|
||||||
if (sinkpad.IsLinked) {
|
if (sinkpad.IsLinked) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ public class PlayBinPlayer {
|
||||||
private static MainLoop loop;
|
private static MainLoop loop;
|
||||||
private static string[] songs;
|
private static string[] songs;
|
||||||
private static int song_idx = 0;
|
private static int song_idx = 0;
|
||||||
private static PlayBin play;
|
private static PlayBin2 play;
|
||||||
|
|
||||||
public static void Main (string[] args) {
|
public static void Main (string[] args) {
|
||||||
if (args.Length < 1) {
|
if (args.Length < 1) {
|
||||||
|
@ -20,7 +20,7 @@ public class PlayBinPlayer {
|
||||||
Gst.Application.Init ();
|
Gst.Application.Init ();
|
||||||
loop = new MainLoop ();
|
loop = new MainLoop ();
|
||||||
|
|
||||||
play = ElementFactory.Make ("playbin", "play") as PlayBin;
|
play = ElementFactory.Make ("playbin2", "play") as PlayBin2;
|
||||||
|
|
||||||
if (play == null) {
|
if (play == null) {
|
||||||
Console.WriteLine ("error creating a playbin gstreamer object");
|
Console.WriteLine ("error creating a playbin gstreamer object");
|
||||||
|
|
Loading…
Reference in a new issue