summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorStephan Sundermann <ssundermann@gnome.org>2014-08-01 15:31:52 +0200
committerStephan Sundermann <ssundermann@gnome.org>2014-08-01 15:31:52 +0200
commitf1ea09aca2024017ba5903e28e0089548702e572 (patch)
tree2f7cf40ae7bc74d50cb0e2adfce422f6f4474a54 /samples
parent480da892fe64a371d92d9c52226d23ddbcb3f1b3 (diff)
Add basic tutorial 1 sample
Diffstat (limited to 'samples')
-rw-r--r--samples/BasicTutorial1.cs35
-rw-r--r--samples/Makefile.am7
2 files changed, 40 insertions, 2 deletions
diff --git a/samples/BasicTutorial1.cs b/samples/BasicTutorial1.cs
new file mode 100644
index 0000000..4b2035d
--- /dev/null
+++ b/samples/BasicTutorial1.cs
@@ -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 ();
+ }
+ }
+} \ No newline at end of file
diff --git a/samples/Makefile.am b/samples/Makefile.am
index 38d6445..4fcbb7c 100644
--- a/samples/Makefile.am
+++ b/samples/Makefile.am
@@ -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