mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
Add basic tutorial 1 sample
This commit is contained in:
parent
480da892fe
commit
f1ea09aca2
2 changed files with 40 additions and 2 deletions
35
samples/BasicTutorial1.cs
Normal file
35
samples/BasicTutorial1.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Authors
|
||||
// Copyright (C) 2014 Stephan Sundermann <stephansundermann@gmail.com>
|
||||
|
||||
using System;
|
||||
using Gst;
|
||||
|
||||
namespace GstreamerSharp
|
||||
{
|
||||
class Playback
|
||||
{
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
// Initialize Gstreamer
|
||||
Application.Init(ref args);
|
||||
|
||||
// Build the pipeline
|
||||
var pipeline = Parse.Launch("playbin uri=http://download.blender.org/durian/trailer/sintel_trailer-1080p.mp4");
|
||||
|
||||
// Start playing
|
||||
pipeline.SetState(State.Playing);
|
||||
|
||||
// Wait until error or EOS
|
||||
var bus = pipeline.Bus;
|
||||
var msg = bus.TimedPopFiltered (Constants.CLOCK_TIME_NONE, MessageType.Eos | MessageType.Error);
|
||||
|
||||
// Free resources
|
||||
if (msg != null)
|
||||
msg.Dispose ();
|
||||
|
||||
bus.Dispose ();
|
||||
pipeline.SetState (State.Null);
|
||||
pipeline.Dispose ();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
TARGETS = playback.exe video-overlay.exe
|
||||
TARGETS = playback.exe video-overlay.exe basic-tutorial-1.exe
|
||||
|
||||
DEBUGS = $(addsuffix .mdb, $(TARGETS))
|
||||
assemblies = \
|
||||
|
@ -15,7 +15,10 @@ playback.exe: $(srcdir)/Playback.cs $(assemblies)
|
|||
video-overlay.exe: $(srcdir)/VideoOverlay.cs $(assemblies)
|
||||
$(CSC) $(CSFLAGS) -out:video-overlay.exe $(references) $(GTK_SHARP_LIBS) $(srcdir)/VideoOverlay.cs
|
||||
|
||||
basic-tutorial-1.exe: $(srcdir)/BasicTutorial1.cs $(assemblies)
|
||||
$(CSC) $(CSFLAGS) -out:basic-tutorial-1.exe $(references) $(GLIB_SHARP_LIBS) $(srcdir)/BasicTutorial1.cs
|
||||
|
||||
EXTRA_DIST = \
|
||||
Playback.cs \
|
||||
VideoOverlay.cs
|
||||
VideoOverlay.cs \
|
||||
BasicTutorial1.cs
|
||||
|
|
Loading…
Reference in a new issue