mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
decodebin2: Use static caps for the default raw caps and put them into a separate header
This way we can use the same default raw caps everywhere.
This commit is contained in:
parent
60aa09d28c
commit
0285d77d96
3 changed files with 48 additions and 5 deletions
|
@ -58,7 +58,8 @@ noinst_HEADERS = \
|
|||
gstinputselector.h \
|
||||
gstplay-enum.h \
|
||||
gstscreenshot.h \
|
||||
gststreamselector.h
|
||||
gststreamselector.h \
|
||||
gstrawcaps.h
|
||||
|
||||
noinst_PROGRAMS = test decodetest test2 test3 test4 test5 test6 test7
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@
|
|||
#include "gstplay-marshal.h"
|
||||
#include "gstplay-enum.h"
|
||||
#include "gstfactorylists.h"
|
||||
#include "gstrawcaps.h"
|
||||
|
||||
/* generic templates */
|
||||
static GstStaticPadTemplate decoder_bin_sink_template =
|
||||
|
@ -251,6 +252,8 @@ GST_ELEMENT_DETAILS ("Decoder Bin",
|
|||
"Edward Hervey <edward.hervey@collabora.co.uk>, "
|
||||
"Sebastian Dröge <sebastian.droege@collabora.co.uk>");
|
||||
|
||||
static GstStaticCaps default_raw_caps = GST_STATIC_CAPS (DEFAULT_RAW_CAPS);
|
||||
|
||||
static void do_async_start (GstDecodeBin * dbin);
|
||||
static void do_async_done (GstDecodeBin * dbin);
|
||||
|
||||
|
@ -847,10 +850,7 @@ gst_decode_bin_init (GstDecodeBin * decode_bin)
|
|||
decode_bin->blocked_pads = NULL;
|
||||
|
||||
decode_bin->encoding = g_strdup (DEFAULT_SUBTITLE_ENCODING);
|
||||
decode_bin->caps =
|
||||
gst_caps_from_string ("video/x-raw-yuv;video/x-raw-rgb;video/x-raw-gray;"
|
||||
"audio/x-raw-int;audio/x-raw-float;" "text/plain;text/x-pango-markup;"
|
||||
"video/x-dvd-subpicture; subpicture/x-pgs");
|
||||
decode_bin->caps = gst_static_caps_get (&default_raw_caps);
|
||||
decode_bin->use_buffering = DEFAULT_USE_BUFFERING;
|
||||
decode_bin->low_percent = DEFAULT_LOW_PERCENT;
|
||||
decode_bin->high_percent = DEFAULT_HIGH_PERCENT;
|
||||
|
|
42
gst/playback/gstrawcaps.h
Normal file
42
gst/playback/gstrawcaps.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) <2009> Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __GST_RAW_CAPS_H__
|
||||
#define __GST_RAW_CAPS_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define DEFAULT_RAW_CAPS \
|
||||
"video/x-raw-yuv; " \
|
||||
"video/x-raw-rgb; " \
|
||||
"video/x-raw-gray; " \
|
||||
"audio/x-raw-int; " \
|
||||
"audio/x-raw-float; " \
|
||||
"text/plain; " \
|
||||
"text/x-pango-markup; " \
|
||||
"video/x-dvd-subpicture; " \
|
||||
"subpicture/x-pgs"
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_RAW_CAPS__ */
|
||||
|
Loading…
Reference in a new issue