From fa14d42a1e2d100021ff27ab9b871cf174d8a2d2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 10 Oct 2012 16:43:58 +0200 Subject: [PATCH] manual: talk about playsink Talk about playsink and give an example of its usage. --- docs/manual/highlevel-playback.xml | 205 ++++++++++++++++++++++++++++++++++++- tests/examples/manual/Makefile.am | 8 +- 2 files changed, 205 insertions(+), 8 deletions(-) diff --git a/docs/manual/highlevel-playback.xml b/docs/manual/highlevel-playback.xml index c4526d2..27d2d1f 100644 --- a/docs/manual/highlevel-playback.xml +++ b/docs/manual/highlevel-playback.xml @@ -193,9 +193,12 @@ main (gint argc, responsible for reporting the error to the user. -#include <gst/gst.h> + +]]> -[.. my_bus_callback goes here ..] + +\n", argv[0]); return -1; } @@ -319,8 +323,8 @@ main (gint argc, return 0; } +]]> - Decodebin, similar to playbin, supports the following features: @@ -419,4 +423,195 @@ main (gint argc, ! audioconvert ! audioresample ! autoaudiosink. + + + Playsink + + The playsink element is a powerful sink element. It has request pads + for raw decoded audio, video and text and it will configure itself to + play the media streams. It has the following features: + + + + + It exposes GstStreamVolume, GstVideoOverlay, GstNavigation and + GstColorBalance interfaces and automatically plugs software + elements to implement the interfaces when needed. + + + + + It will automatically plug conversion elements. + + + + + Can optionally render visualizations when there is no video input. + + + + + Configurable sink elements. + + + + + Configurable audio/video sync offset to fine-tune synchronization + in badly muxed files. + + + + + Support for taking a snapshot of the last video frame. + + + + + Below is an example of how you can use playsink. We use a uridecodebin + element to decode into raw audio and video streams which we then link + to the playsink request pads. We only link the first audio and video + pads, you could use an input-selector to link all pads. + + + + +]]> + +[.. my_bus_callback goes here ..] + + + + +\n", argv[0]); + return -1; + } + + /* setup */ + pipeline = gst_pipeline_new ("pipeline"); + + bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); + gst_bus_add_watch (bus, my_bus_callback, loop); + gst_object_unref (bus); + + dec = gst_element_factory_make ("uridecodebin", "source"); + g_object_set (G_OBJECT (dec), "uri", argv[1], NULL); + g_signal_connect (dec, "pad-added", G_CALLBACK (cb_pad_added), NULL); + + /* create audio output */ + sink = gst_element_factory_make ("playsink", "sink"); + gst_util_set_object_arg (G_OBJECT (sink), "flags", + "soft-colorbalance+soft-volume+vis+text+audio+video"); + gst_bin_add_many (GST_BIN (pipeline), dec, sink, NULL); + + /* run */ + gst_element_set_state (pipeline, GST_STATE_PLAYING); + g_main_loop_run (loop); + + /* cleanup */ + gst_element_set_state (pipeline, GST_STATE_NULL); + gst_object_unref (GST_OBJECT (pipeline)); + + return 0; +} +]]> + + + + This example will show audio and video depending on what you + give it. Try this example on an audio file and you will see that + it shows visualizations. You can change the visualization at runtime by + changing the vis-plugin property. + + diff --git a/tests/examples/manual/Makefile.am b/tests/examples/manual/Makefile.am index c20441b..396c100 100644 --- a/tests/examples/manual/Makefile.am +++ b/tests/examples/manual/Makefile.am @@ -42,7 +42,8 @@ EXAMPLES = \ effectswitch \ testrtpool \ playbin \ - decodebin + decodebin \ + playsink BUILT_SOURCES = \ elementmake.c elementcreate.c elementget.c elementlink.c elementfactory.c \ @@ -60,7 +61,8 @@ BUILT_SOURCES = \ dynformat.c \ effectswitch.c \ testrtpool.c \ - playbin.c decodebin.c + playbin.c decodebin.c \ + playsink.c CLEANFILES = core core.* test-registry.* *.gcno *.gcda $(BUILT_SOURCES) @@ -110,7 +112,7 @@ dynformat.c: $(top_srcdir)/docs/manual/advanced-dataaccess.xml effectswitch.c: $(top_srcdir)/docs/manual/advanced-dataaccess.xml $(PERL_PATH) $(srcdir)/extract.pl $@ $< -playbin.c decodebin.c: $(top_srcdir)/docs/manual/highlevel-playback.xml +playbin.c decodebin.c playsink.c: $(top_srcdir)/docs/manual/highlevel-playback.xml $(PERL_PATH) $(srcdir)/extract.pl $@ $< testrtpool.c: $(top_srcdir)/docs/manual/advanced-threads.xml -- 2.7.4