From 2d8a59b2620588e19a117fcdbdaa763ec3e02ef4 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 28 Oct 2005 09:56:47 +0000 Subject: [PATCH] gst/playback/gstplaybin.c: first try autovideosink, then xvimagesink, then error out Original commit message from CVS: * gst/playback/gstplaybin.c: (gen_video_element): first try autovideosink, then xvimagesink, then error out * po/POTFILES.in: add translatable file * po/af.po: * po/az.po: * po/cs.po: * po/en_GB.po: * po/hu.po: * po/it.po: * po/nb.po: * po/nl.po: * po/or.po: * po/sq.po: * po/sr.po: * po/sv.po: * po/uk.po: * po/vi.po: update translations --- ChangeLog | 22 ++++++++++++++++++++++ docs/libs/tmpl/gstcolorbalance.sgml | 4 +++- gst/playback/gstplaybin.c | 29 +++++++++++++++++++++-------- po/POTFILES.in | 1 + 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index bceee0b..4e45961 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2005-10-28 Thomas Vander Stichele + + * gst/playback/gstplaybin.c: (gen_video_element): + first try autovideosink, then xvimagesink, then error out + * po/POTFILES.in: + add translatable file + * po/af.po: + * po/az.po: + * po/cs.po: + * po/en_GB.po: + * po/hu.po: + * po/it.po: + * po/nb.po: + * po/nl.po: + * po/or.po: + * po/sq.po: + * po/sr.po: + * po/sv.po: + * po/uk.po: + * po/vi.po: + update translations + 2005-10-27 Philippe Khalaf * gst-libs/gst/rtp/gstbasedepayload.c: diff --git a/docs/libs/tmpl/gstcolorbalance.sgml b/docs/libs/tmpl/gstcolorbalance.sgml index 59fb98a..72db8e8 100644 --- a/docs/libs/tmpl/gstcolorbalance.sgml +++ b/docs/libs/tmpl/gstcolorbalance.sgml @@ -2,18 +2,20 @@ gstcolorbalance -interface for elements that provide color balance operations + + + diff --git a/gst/playback/gstplaybin.c b/gst/playback/gstplaybin.c index cfff34d..971fc9b 100644 --- a/gst/playback/gstplaybin.c +++ b/gst/playback/gstplaybin.c @@ -24,6 +24,8 @@ #include #include +#include + #include "gstplaybasebin.h" GST_DEBUG_CATEGORY_STATIC (gst_play_bin_debug); @@ -373,6 +375,8 @@ handoff (GstElement * identity, GstBuffer * frame, gpointer data) * +----------|--------------------------------------------------+ * handoff */ +/* FIXME: this might return NULL if no videosink was found, handle + * this in callers */ static GstElement * gen_video_element (GstPlayBin * play_bin) { @@ -390,23 +394,32 @@ gen_video_element (GstPlayBin * play_bin) return element; } - element = gst_bin_new ("vbin"); - identity = gst_element_factory_make ("identity", "id"); - g_object_set (identity, "silent", TRUE, NULL); - g_signal_connect (identity, "handoff", G_CALLBACK (handoff), play_bin); - conv = gst_element_factory_make ("ffmpegcolorspace", "vconv"); - scale = gst_element_factory_make ("videoscale", "vscale"); if (play_bin->video_sink) { sink = play_bin->video_sink; } else { - sink = gst_element_factory_make ("xvimagesink", "videosink"); + sink = gst_element_factory_make ("autovideosink", "videosink"); + if (sink == NULL) { + sink = gst_element_factory_make ("xvimagesink", "videosink"); + } + /* FIXME: this warrants adding a CORE error category for missing + * elements/plugins */ if (sink == NULL) { - g_warning ("could not create autovideosink element"); + GST_ELEMENT_ERROR (play_bin, CORE, FAILED, + (_("Both autovideosink and xvimagesink elements are missing.")), + (NULL)); + return NULL; } } gst_object_ref (sink); g_hash_table_insert (play_bin->cache, "video_sink", sink); + + element = gst_bin_new ("vbin"); + identity = gst_element_factory_make ("identity", "id"); + g_object_set (identity, "silent", TRUE, NULL); + g_signal_connect (identity, "handoff", G_CALLBACK (handoff), play_bin); + conv = gst_element_factory_make ("ffmpegcolorspace", "vconv"); + scale = gst_element_factory_make ("videoscale", "vscale"); gst_bin_add (GST_BIN (element), identity); gst_bin_add (GST_BIN (element), conv); gst_bin_add (GST_BIN (element), scale); diff --git a/po/POTFILES.in b/po/POTFILES.in index af5570e..a6f27fb 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -4,3 +4,4 @@ ext/gnomevfs/gstgnomevfssrc.c ext/gnomevfs/gstgnomevfssink.c ext/ogg/gstoggdemux.c gst/playback/gstplaybasebin.c +gst/playback/gstplaybin.c -- 2.7.4