2005-04-23 23:29:47 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wtay@chello.be>
|
|
|
|
* 2005 Wim Taymans <wim@fluendo.com>
|
|
|
|
* 2005 David Schleef <ds@schleef.org>
|
|
|
|
*
|
|
|
|
* 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
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2005-04-23 23:29:47 +00:00
|
|
|
*/
|
docs/: Correct fixxrefs options.
Original commit message from CVS:
* docs/gst/Makefile.am:
* docs/libs/Makefile.am:
Correct fixxrefs options.
* docs/plugins/Makefile.am:
* docs/plugins/gstreamer-plugins-docs.sgml:
* docs/plugins/gstreamer-plugins-sections.txt:
* plugins/elements/Makefile.am:
* plugins/elements/gstcapsfilter.c (gst_capsfilter_details):
* plugins/elements/gstcapsfilter.h (__GST_CAPSFILTER_H__,
GST_TYPE_CAPSFILTER, GST_CAPSFILTER, GST_CAPSFILTER_CLASS,
GST_IS_CAPSFILTER, GST_IS_CAPSFILTER_CLASS, GstCapsFilter,
GstCapsFilterClass, _GstCapsFilter, trans, filter_caps,
_GstCapsFilterClass, trans_class):
* plugins/elements/gstelements.c (name, rank, type, _elements):
* plugins/elements/gstidentity.c
(gst_identity_check_imperfect_timestamp,
gst_identity_check_imperfect_offset):
Document capsfilter and add doc-blurb to identity.
2007-05-06 18:27:25 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-capsfilter
|
|
|
|
*
|
2009-01-01 21:27:06 +00:00
|
|
|
* The element does not modify data as such, but can enforce limitations on the
|
docs/: Correct fixxrefs options.
Original commit message from CVS:
* docs/gst/Makefile.am:
* docs/libs/Makefile.am:
Correct fixxrefs options.
* docs/plugins/Makefile.am:
* docs/plugins/gstreamer-plugins-docs.sgml:
* docs/plugins/gstreamer-plugins-sections.txt:
* plugins/elements/Makefile.am:
* plugins/elements/gstcapsfilter.c (gst_capsfilter_details):
* plugins/elements/gstcapsfilter.h (__GST_CAPSFILTER_H__,
GST_TYPE_CAPSFILTER, GST_CAPSFILTER, GST_CAPSFILTER_CLASS,
GST_IS_CAPSFILTER, GST_IS_CAPSFILTER_CLASS, GstCapsFilter,
GstCapsFilterClass, _GstCapsFilter, trans, filter_caps,
_GstCapsFilterClass, trans_class):
* plugins/elements/gstelements.c (name, rank, type, _elements):
* plugins/elements/gstidentity.c
(gst_identity_check_imperfect_timestamp,
gst_identity_check_imperfect_offset):
Document capsfilter and add doc-blurb to identity.
2007-05-06 18:27:25 +00:00
|
|
|
* data format.
|
2010-08-16 15:01:27 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
|
|
|
* <title>Example launch line</title>
|
|
|
|
* |[
|
2015-05-08 13:08:42 +00:00
|
|
|
* gst-launch-1.0 videotestsrc ! capsfilter caps=video/x-raw,format=GRAY8 ! videoconvert ! autovideosink
|
|
|
|
* ]| Limits acceptable video from videotestsrc to be grayscale. Equivalent to
|
|
|
|
* |[
|
|
|
|
* gst-launch-1.0 videotestsrc ! video/x-raw,format=GRAY8 ! videoconvert ! autovideosink
|
|
|
|
* ]| which is a short notation for the capsfilter element.
|
2010-08-16 15:01:27 +00:00
|
|
|
* </refsect2>
|
docs/: Correct fixxrefs options.
Original commit message from CVS:
* docs/gst/Makefile.am:
* docs/libs/Makefile.am:
Correct fixxrefs options.
* docs/plugins/Makefile.am:
* docs/plugins/gstreamer-plugins-docs.sgml:
* docs/plugins/gstreamer-plugins-sections.txt:
* plugins/elements/Makefile.am:
* plugins/elements/gstcapsfilter.c (gst_capsfilter_details):
* plugins/elements/gstcapsfilter.h (__GST_CAPSFILTER_H__,
GST_TYPE_CAPSFILTER, GST_CAPSFILTER, GST_CAPSFILTER_CLASS,
GST_IS_CAPSFILTER, GST_IS_CAPSFILTER_CLASS, GstCapsFilter,
GstCapsFilterClass, _GstCapsFilter, trans, filter_caps,
_GstCapsFilterClass, trans_class):
* plugins/elements/gstelements.c (name, rank, type, _elements):
* plugins/elements/gstidentity.c
(gst_identity_check_imperfect_timestamp,
gst_identity_check_imperfect_offset):
Document capsfilter and add doc-blurb to identity.
2007-05-06 18:27:25 +00:00
|
|
|
*/
|
2005-04-23 23:29:47 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
2005-08-04 19:40:43 +00:00
|
|
|
#include "config.h"
|
2005-04-23 23:29:47 +00:00
|
|
|
#endif
|
|
|
|
|
2005-11-29 18:00:15 +00:00
|
|
|
#include "../../gst/gst-i18n-lib.h"
|
docs/: Correct fixxrefs options.
Original commit message from CVS:
* docs/gst/Makefile.am:
* docs/libs/Makefile.am:
Correct fixxrefs options.
* docs/plugins/Makefile.am:
* docs/plugins/gstreamer-plugins-docs.sgml:
* docs/plugins/gstreamer-plugins-sections.txt:
* plugins/elements/Makefile.am:
* plugins/elements/gstcapsfilter.c (gst_capsfilter_details):
* plugins/elements/gstcapsfilter.h (__GST_CAPSFILTER_H__,
GST_TYPE_CAPSFILTER, GST_CAPSFILTER, GST_CAPSFILTER_CLASS,
GST_IS_CAPSFILTER, GST_IS_CAPSFILTER_CLASS, GstCapsFilter,
GstCapsFilterClass, _GstCapsFilter, trans, filter_caps,
_GstCapsFilterClass, trans_class):
* plugins/elements/gstelements.c (name, rank, type, _elements):
* plugins/elements/gstidentity.c
(gst_identity_check_imperfect_timestamp,
gst_identity_check_imperfect_offset):
Document capsfilter and add doc-blurb to identity.
2007-05-06 18:27:25 +00:00
|
|
|
#include "gstcapsfilter.h"
|
2005-08-04 19:40:43 +00:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
2014-10-22 12:07:09 +00:00
|
|
|
PROP_FILTER_CAPS,
|
|
|
|
PROP_CAPS_CHANGE_MODE
|
2005-08-04 19:40:43 +00:00
|
|
|
};
|
|
|
|
|
2014-10-22 12:07:09 +00:00
|
|
|
#define DEFAULT_CAPS_CHANGE_MODE (GST_CAPS_FILTER_CAPS_CHANGE_MODE_IMMEDIATE)
|
2005-04-23 23:29:47 +00:00
|
|
|
|
|
|
|
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS_ANY);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS_ANY);
|
|
|
|
|
2005-08-04 19:40:43 +00:00
|
|
|
|
2005-04-23 23:29:47 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (gst_capsfilter_debug);
|
|
|
|
#define GST_CAT_DEFAULT gst_capsfilter_debug
|
|
|
|
|
2014-10-22 12:07:09 +00:00
|
|
|
/* TODO: Add a drop-buffers mode */
|
|
|
|
#define GST_TYPE_CAPS_FILTER_CAPS_CHANGE_MODE (gst_caps_filter_caps_change_mode_get_type())
|
|
|
|
static GType
|
|
|
|
gst_caps_filter_caps_change_mode_get_type (void)
|
|
|
|
{
|
|
|
|
static GType type = 0;
|
|
|
|
static const GEnumValue data[] = {
|
|
|
|
{GST_CAPS_FILTER_CAPS_CHANGE_MODE_IMMEDIATE,
|
|
|
|
"Only accept the current filter caps", "immediate"},
|
|
|
|
{GST_CAPS_FILTER_CAPS_CHANGE_MODE_DELAYED,
|
|
|
|
"Temporarily accept previous filter caps", "delayed"},
|
|
|
|
{0, NULL, NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
if (!type) {
|
|
|
|
type = g_enum_register_static ("GstCapsFilterCapsChangeMode", data);
|
|
|
|
}
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2011-04-18 16:07:06 +00:00
|
|
|
#define _do_init \
|
2005-08-04 19:40:43 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_capsfilter_debug, "capsfilter", 0, \
|
|
|
|
"capsfilter element");
|
2011-04-18 16:07:06 +00:00
|
|
|
#define gst_capsfilter_parent_class parent_class
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GstCapsFilter, gst_capsfilter, GST_TYPE_BASE_TRANSFORM,
|
|
|
|
_do_init);
|
2005-04-23 23:29:47 +00:00
|
|
|
|
Revert previous changes to the behaviour of GstPadTemplates, etc and the possiblity to call them in class_init as it ...
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_get_type), (gst_bin_base_init),
(gst_bin_class_init):
* gst/gstelement.c: (gst_element_base_class_init),
(gst_element_class_add_pad_template):
* gst/gstpadtemplate.c: (gst_pad_template_init):
* gst/gstpipeline.c: (gst_pipeline_get_type),
(gst_pipeline_base_init), (gst_pipeline_class_init):
* libs/gst/base/gstbasesink.c:
* libs/gst/base/gstbasesrc.c: (gst_base_src_get_type),
(gst_base_src_base_init), (gst_base_src_class_init):
* plugins/elements/gstcapsfilter.c: (gst_capsfilter_base_init),
(gst_capsfilter_class_init):
* plugins/elements/gstfakesink.c: (gst_fake_sink_base_init),
(gst_fake_sink_class_init):
* plugins/elements/gstfakesrc.c: (gst_fake_src_base_init),
(gst_fake_src_class_init):
* plugins/elements/gstfdsink.c: (gst_fd_sink_base_init),
(gst_fd_sink_class_init):
* plugins/elements/gstfdsrc.c: (gst_fd_src_base_init),
(gst_fd_src_class_init):
* plugins/elements/gstfilesink.c: (gst_file_sink_base_init),
(gst_file_sink_class_init):
* plugins/elements/gstfilesrc.c: (gst_file_src_base_init),
(gst_file_src_class_init):
* plugins/elements/gstidentity.c: (gst_identity_base_init),
(gst_identity_class_init):
* plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init),
(gst_multi_queue_class_init):
* plugins/elements/gstqueue.c: (gst_queue_base_init),
(gst_queue_class_init):
* plugins/elements/gsttee.c: (gst_tee_base_init),
(gst_tee_class_init):
* plugins/elements/gsttypefindelement.c:
(gst_type_find_element_base_init),
(gst_type_find_element_class_init):
* tests/check/gst/gstelement.c: (gst_element_suite):
Revert previous changes to the behaviour of GstPadTemplates, etc
and the possiblity to call them in class_init as it breaks too
many elements. Reopens bug #491501.
Should be applied again for 0.11, thus added a few FIXME 0.11 at
several places.
2008-02-05 14:15:15 +00:00
|
|
|
|
2005-04-23 23:29:47 +00:00
|
|
|
static void gst_capsfilter_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_capsfilter_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
2005-08-04 19:40:43 +00:00
|
|
|
static void gst_capsfilter_dispose (GObject * object);
|
2008-08-05 11:12:29 +00:00
|
|
|
|
2005-08-04 19:40:43 +00:00
|
|
|
static GstCaps *gst_capsfilter_transform_caps (GstBaseTransform * base,
|
2011-05-11 13:38:09 +00:00
|
|
|
GstPadDirection direction, GstCaps * caps, GstCaps * filter);
|
2010-06-14 10:39:47 +00:00
|
|
|
static gboolean gst_capsfilter_accept_caps (GstBaseTransform * base,
|
|
|
|
GstPadDirection direction, GstCaps * caps);
|
2005-08-04 19:40:43 +00:00
|
|
|
static GstFlowReturn gst_capsfilter_transform_ip (GstBaseTransform * base,
|
|
|
|
GstBuffer * buf);
|
2005-09-09 23:45:15 +00:00
|
|
|
static GstFlowReturn gst_capsfilter_prepare_buf (GstBaseTransform * trans,
|
2011-07-21 11:56:11 +00:00
|
|
|
GstBuffer * input, GstBuffer ** buf);
|
2013-05-09 01:45:08 +00:00
|
|
|
static gboolean gst_capsfilter_sink_event (GstBaseTransform * trans,
|
|
|
|
GstEvent * event);
|
2013-05-09 07:32:49 +00:00
|
|
|
static gboolean gst_capsfilter_stop (GstBaseTransform * trans);
|
2005-04-23 23:29:47 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gst_capsfilter_class_init (GstCapsFilterClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
2011-04-18 16:07:06 +00:00
|
|
|
GstElementClass *gstelement_class;
|
2005-08-04 19:40:43 +00:00
|
|
|
GstBaseTransformClass *trans_class;
|
2005-04-23 23:29:47 +00:00
|
|
|
|
2006-05-11 18:10:34 +00:00
|
|
|
gobject_class = G_OBJECT_CLASS (klass);
|
2005-08-04 19:40:43 +00:00
|
|
|
gobject_class->set_property = gst_capsfilter_set_property;
|
|
|
|
gobject_class->get_property = gst_capsfilter_get_property;
|
|
|
|
gobject_class->dispose = gst_capsfilter_dispose;
|
2005-04-23 23:29:47 +00:00
|
|
|
|
2006-05-11 18:10:34 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_FILTER_CAPS,
|
2005-09-29 12:37:38 +00:00
|
|
|
g_param_spec_boxed ("caps", _("Filter caps"),
|
2007-06-27 11:24:08 +00:00
|
|
|
_("Restrict the possible allowed capabilities (NULL means ANY). "
|
|
|
|
"Setting this property takes a reference to the supplied GstCaps "
|
2008-03-22 14:56:17 +00:00
|
|
|
"object."), GST_TYPE_CAPS,
|
2014-09-13 19:12:52 +00:00
|
|
|
G_PARAM_READWRITE | GST_PARAM_MUTABLE_PLAYING |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2005-04-23 23:29:47 +00:00
|
|
|
|
2014-10-22 12:07:09 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_CAPS_CHANGE_MODE,
|
|
|
|
g_param_spec_enum ("caps-change-mode", _("Caps Change Mode"),
|
|
|
|
_("Filter caps change behaviour"),
|
|
|
|
GST_TYPE_CAPS_FILTER_CAPS_CHANGE_MODE, DEFAULT_CAPS_CHANGE_MODE,
|
|
|
|
G_PARAM_READWRITE | GST_PARAM_MUTABLE_PLAYING |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
2011-04-18 16:07:06 +00:00
|
|
|
gstelement_class = GST_ELEMENT_CLASS (klass);
|
2012-04-09 12:05:07 +00:00
|
|
|
gst_element_class_set_static_metadata (gstelement_class,
|
2011-04-18 16:07:06 +00:00
|
|
|
"CapsFilter",
|
|
|
|
"Generic",
|
|
|
|
"Pass data without modification, limiting formats",
|
|
|
|
"David Schleef <ds@schleef.org>");
|
2016-02-27 15:36:28 +00:00
|
|
|
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
|
|
|
|
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
|
2011-04-18 16:07:06 +00:00
|
|
|
|
2006-05-11 18:10:34 +00:00
|
|
|
trans_class = GST_BASE_TRANSFORM_CLASS (klass);
|
2009-10-28 00:07:48 +00:00
|
|
|
trans_class->transform_caps =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_capsfilter_transform_caps);
|
|
|
|
trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_capsfilter_transform_ip);
|
2010-06-14 10:39:47 +00:00
|
|
|
trans_class->accept_caps = GST_DEBUG_FUNCPTR (gst_capsfilter_accept_caps);
|
2009-10-28 00:07:48 +00:00
|
|
|
trans_class->prepare_output_buffer =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_capsfilter_prepare_buf);
|
2013-05-09 01:45:08 +00:00
|
|
|
trans_class->sink_event = GST_DEBUG_FUNCPTR (gst_capsfilter_sink_event);
|
2013-05-09 07:32:49 +00:00
|
|
|
trans_class->stop = GST_DEBUG_FUNCPTR (gst_capsfilter_stop);
|
2005-04-23 23:29:47 +00:00
|
|
|
}
|
|
|
|
|
2005-08-04 19:40:43 +00:00
|
|
|
static void
|
2011-04-18 16:07:06 +00:00
|
|
|
gst_capsfilter_init (GstCapsFilter * filter)
|
2005-04-23 23:29:47 +00:00
|
|
|
{
|
2009-06-23 10:56:59 +00:00
|
|
|
GstBaseTransform *trans = GST_BASE_TRANSFORM (filter);
|
|
|
|
gst_base_transform_set_gap_aware (trans, TRUE);
|
2012-10-04 09:18:19 +00:00
|
|
|
gst_base_transform_set_prefer_passthrough (trans, FALSE);
|
2005-08-04 19:40:43 +00:00
|
|
|
filter->filter_caps = gst_caps_new_any ();
|
2015-07-28 09:19:04 +00:00
|
|
|
filter->filter_caps_used = FALSE;
|
2016-03-08 19:08:16 +00:00
|
|
|
filter->got_sink_caps = FALSE;
|
2014-10-22 12:07:09 +00:00
|
|
|
filter->caps_change_mode = DEFAULT_CAPS_CHANGE_MODE;
|
2005-04-23 23:29:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_capsfilter_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
2015-07-03 10:37:54 +00:00
|
|
|
GstCapsFilter *capsfilter = GST_CAPS_FILTER (object);
|
2005-04-23 23:29:47 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2005-06-02 15:45:16 +00:00
|
|
|
case PROP_FILTER_CAPS:{
|
2005-08-07 13:37:08 +00:00
|
|
|
GstCaps *new_caps;
|
2012-02-24 10:00:21 +00:00
|
|
|
GstCaps *old_caps;
|
2005-11-28 14:02:54 +00:00
|
|
|
const GstCaps *new_caps_val = gst_value_get_caps (value);
|
2005-06-02 15:45:16 +00:00
|
|
|
|
2005-08-07 13:37:08 +00:00
|
|
|
if (new_caps_val == NULL) {
|
2005-06-16 17:50:16 +00:00
|
|
|
new_caps = gst_caps_new_any ();
|
2005-08-07 13:37:08 +00:00
|
|
|
} else {
|
2007-06-27 11:24:08 +00:00
|
|
|
new_caps = (GstCaps *) new_caps_val;
|
|
|
|
gst_caps_ref (new_caps);
|
2005-06-16 17:50:16 +00:00
|
|
|
}
|
2005-06-02 15:45:16 +00:00
|
|
|
|
2008-07-31 09:55:14 +00:00
|
|
|
GST_OBJECT_LOCK (capsfilter);
|
2005-06-16 17:50:16 +00:00
|
|
|
old_caps = capsfilter->filter_caps;
|
2005-06-02 15:45:16 +00:00
|
|
|
capsfilter->filter_caps = new_caps;
|
2015-07-28 09:19:04 +00:00
|
|
|
if (old_caps && capsfilter->filter_caps_used &&
|
|
|
|
capsfilter->caps_change_mode ==
|
2014-10-22 12:07:09 +00:00
|
|
|
GST_CAPS_FILTER_CAPS_CHANGE_MODE_DELAYED) {
|
|
|
|
capsfilter->previous_caps =
|
|
|
|
g_list_prepend (capsfilter->previous_caps, gst_caps_ref (old_caps));
|
|
|
|
} else if (capsfilter->caps_change_mode !=
|
|
|
|
GST_CAPS_FILTER_CAPS_CHANGE_MODE_DELAYED) {
|
|
|
|
g_list_free_full (capsfilter->previous_caps,
|
|
|
|
(GDestroyNotify) gst_caps_unref);
|
|
|
|
capsfilter->previous_caps = NULL;
|
|
|
|
}
|
2015-07-28 09:19:04 +00:00
|
|
|
capsfilter->filter_caps_used = FALSE;
|
2008-07-31 09:55:14 +00:00
|
|
|
GST_OBJECT_UNLOCK (capsfilter);
|
|
|
|
|
2005-06-16 17:50:16 +00:00
|
|
|
gst_caps_unref (old_caps);
|
2005-06-02 15:45:16 +00:00
|
|
|
|
2005-11-28 14:02:54 +00:00
|
|
|
GST_DEBUG_OBJECT (capsfilter, "set new caps %" GST_PTR_FORMAT, new_caps);
|
|
|
|
|
2012-02-24 10:00:21 +00:00
|
|
|
gst_base_transform_reconfigure_sink (GST_BASE_TRANSFORM (object));
|
2005-04-23 23:29:47 +00:00
|
|
|
break;
|
2005-06-02 15:45:16 +00:00
|
|
|
}
|
2015-07-28 09:16:12 +00:00
|
|
|
case PROP_CAPS_CHANGE_MODE:{
|
|
|
|
GstCapsFilterCapsChangeMode old_change_mode;
|
|
|
|
|
|
|
|
GST_OBJECT_LOCK (capsfilter);
|
|
|
|
old_change_mode = capsfilter->caps_change_mode;
|
2014-10-22 12:07:09 +00:00
|
|
|
capsfilter->caps_change_mode = g_value_get_enum (value);
|
2015-07-28 09:16:12 +00:00
|
|
|
|
|
|
|
if (capsfilter->caps_change_mode != old_change_mode) {
|
|
|
|
g_list_free_full (capsfilter->previous_caps,
|
|
|
|
(GDestroyNotify) gst_caps_unref);
|
|
|
|
capsfilter->previous_caps = NULL;
|
|
|
|
}
|
|
|
|
GST_OBJECT_UNLOCK (capsfilter);
|
2014-10-22 12:07:09 +00:00
|
|
|
break;
|
2015-07-28 09:16:12 +00:00
|
|
|
}
|
2005-04-23 23:29:47 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_capsfilter_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
|
|
|
{
|
2015-07-03 10:37:54 +00:00
|
|
|
GstCapsFilter *capsfilter = GST_CAPS_FILTER (object);
|
2005-04-23 23:29:47 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_FILTER_CAPS:
|
2008-07-31 09:55:14 +00:00
|
|
|
GST_OBJECT_LOCK (capsfilter);
|
2005-04-23 23:29:47 +00:00
|
|
|
gst_value_set_caps (value, capsfilter->filter_caps);
|
2008-07-31 09:55:14 +00:00
|
|
|
GST_OBJECT_UNLOCK (capsfilter);
|
2005-04-23 23:29:47 +00:00
|
|
|
break;
|
2014-10-22 12:07:09 +00:00
|
|
|
case PROP_CAPS_CHANGE_MODE:
|
|
|
|
g_value_set_enum (value, capsfilter->caps_change_mode);
|
|
|
|
break;
|
2005-04-23 23:29:47 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2005-08-04 19:40:43 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gst_capsfilter_dispose (GObject * object)
|
|
|
|
{
|
2015-07-03 10:37:54 +00:00
|
|
|
GstCapsFilter *filter = GST_CAPS_FILTER (object);
|
2005-08-04 19:40:43 +00:00
|
|
|
|
|
|
|
gst_caps_replace (&filter->filter_caps, NULL);
|
2013-05-09 07:32:49 +00:00
|
|
|
g_list_free_full (filter->pending_events, (GDestroyNotify) gst_event_unref);
|
|
|
|
filter->pending_events = NULL;
|
2005-08-04 19:40:43 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstCaps *
|
2005-08-24 13:33:21 +00:00
|
|
|
gst_capsfilter_transform_caps (GstBaseTransform * base,
|
2011-05-11 13:38:09 +00:00
|
|
|
GstPadDirection direction, GstCaps * caps, GstCaps * filter)
|
2005-08-04 19:40:43 +00:00
|
|
|
{
|
2015-07-03 10:37:54 +00:00
|
|
|
GstCapsFilter *capsfilter = GST_CAPS_FILTER (base);
|
2011-05-11 13:38:09 +00:00
|
|
|
GstCaps *ret, *filter_caps, *tmp;
|
2014-10-22 12:07:09 +00:00
|
|
|
gboolean retried = FALSE;
|
|
|
|
GstCapsFilterCapsChangeMode caps_change_mode;
|
2008-07-31 09:55:14 +00:00
|
|
|
|
|
|
|
GST_OBJECT_LOCK (capsfilter);
|
|
|
|
filter_caps = gst_caps_ref (capsfilter->filter_caps);
|
2015-07-28 09:19:04 +00:00
|
|
|
capsfilter->filter_caps_used = TRUE;
|
2014-10-22 12:07:09 +00:00
|
|
|
caps_change_mode = capsfilter->caps_change_mode;
|
2008-07-31 09:55:14 +00:00
|
|
|
GST_OBJECT_UNLOCK (capsfilter);
|
|
|
|
|
2014-10-22 12:07:09 +00:00
|
|
|
retry:
|
2011-05-16 16:29:29 +00:00
|
|
|
if (filter) {
|
|
|
|
tmp =
|
|
|
|
gst_caps_intersect_full (filter, filter_caps, GST_CAPS_INTERSECT_FIRST);
|
|
|
|
gst_caps_unref (filter_caps);
|
|
|
|
filter_caps = tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = gst_caps_intersect_full (filter_caps, caps, GST_CAPS_INTERSECT_FIRST);
|
2011-05-11 13:38:09 +00:00
|
|
|
|
2009-03-10 19:08:34 +00:00
|
|
|
GST_DEBUG_OBJECT (capsfilter, "input: %" GST_PTR_FORMAT, caps);
|
2011-05-11 13:38:09 +00:00
|
|
|
GST_DEBUG_OBJECT (capsfilter, "filter: %" GST_PTR_FORMAT, filter);
|
|
|
|
GST_DEBUG_OBJECT (capsfilter, "caps filter: %" GST_PTR_FORMAT,
|
|
|
|
filter_caps);
|
2008-07-31 09:55:14 +00:00
|
|
|
GST_DEBUG_OBJECT (capsfilter, "intersect: %" GST_PTR_FORMAT, ret);
|
2005-08-04 19:40:43 +00:00
|
|
|
|
2014-10-22 12:07:09 +00:00
|
|
|
if (gst_caps_is_empty (ret)
|
|
|
|
&& caps_change_mode ==
|
|
|
|
GST_CAPS_FILTER_CAPS_CHANGE_MODE_DELAYED && capsfilter->previous_caps
|
|
|
|
&& !retried) {
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (capsfilter,
|
|
|
|
"Current filter caps are not compatible, retry with previous");
|
|
|
|
GST_OBJECT_LOCK (capsfilter);
|
|
|
|
gst_caps_unref (filter_caps);
|
|
|
|
gst_caps_unref (ret);
|
|
|
|
filter_caps = gst_caps_new_empty ();
|
|
|
|
for (l = capsfilter->previous_caps; l; l = l->next) {
|
|
|
|
filter_caps = gst_caps_merge (filter_caps, gst_caps_ref (l->data));
|
|
|
|
}
|
|
|
|
GST_OBJECT_UNLOCK (capsfilter);
|
|
|
|
retried = TRUE;
|
|
|
|
goto retry;
|
|
|
|
}
|
|
|
|
|
2008-07-31 09:55:14 +00:00
|
|
|
gst_caps_unref (filter_caps);
|
2005-08-04 19:40:43 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2010-06-14 10:39:47 +00:00
|
|
|
static gboolean
|
|
|
|
gst_capsfilter_accept_caps (GstBaseTransform * base,
|
|
|
|
GstPadDirection direction, GstCaps * caps)
|
|
|
|
{
|
2015-07-03 10:37:54 +00:00
|
|
|
GstCapsFilter *capsfilter = GST_CAPS_FILTER (base);
|
2010-06-14 10:39:47 +00:00
|
|
|
GstCaps *filter_caps;
|
|
|
|
gboolean ret;
|
|
|
|
|
|
|
|
GST_OBJECT_LOCK (capsfilter);
|
|
|
|
filter_caps = gst_caps_ref (capsfilter->filter_caps);
|
2015-07-28 09:19:04 +00:00
|
|
|
capsfilter->filter_caps_used = TRUE;
|
2010-06-14 10:39:47 +00:00
|
|
|
GST_OBJECT_UNLOCK (capsfilter);
|
|
|
|
|
|
|
|
ret = gst_caps_can_intersect (caps, filter_caps);
|
2010-06-14 11:01:55 +00:00
|
|
|
GST_DEBUG_OBJECT (capsfilter, "can intersect: %d", ret);
|
2014-10-22 12:07:09 +00:00
|
|
|
if (!ret
|
|
|
|
&& capsfilter->caps_change_mode ==
|
|
|
|
GST_CAPS_FILTER_CAPS_CHANGE_MODE_DELAYED) {
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
GST_OBJECT_LOCK (capsfilter);
|
|
|
|
for (l = capsfilter->previous_caps; l; l = l->next) {
|
|
|
|
ret = gst_caps_can_intersect (caps, l->data);
|
|
|
|
if (ret)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
GST_OBJECT_UNLOCK (capsfilter);
|
|
|
|
|
|
|
|
/* Tell upstream to reconfigure, it's still
|
|
|
|
* looking at old caps */
|
|
|
|
if (ret)
|
|
|
|
gst_base_transform_reconfigure_sink (base);
|
|
|
|
}
|
|
|
|
|
2010-06-14 10:39:47 +00:00
|
|
|
gst_caps_unref (filter_caps);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2005-08-04 19:40:43 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_capsfilter_transform_ip (GstBaseTransform * base, GstBuffer * buf)
|
|
|
|
{
|
2005-09-09 23:45:15 +00:00
|
|
|
/* No actual work here. It's all done in the prepare output buffer
|
|
|
|
* func. */
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
|
2014-01-28 14:12:56 +00:00
|
|
|
static void
|
|
|
|
gst_capsfilter_push_pending_events (GstCapsFilter * filter, GList * events)
|
|
|
|
{
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
for (l = g_list_last (events); l; l = l->prev) {
|
|
|
|
GST_LOG_OBJECT (filter, "Forwarding %s event",
|
|
|
|
GST_EVENT_TYPE_NAME (l->data));
|
|
|
|
GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (GST_BASE_TRANSFORM_CAST
|
|
|
|
(filter), l->data);
|
|
|
|
}
|
|
|
|
g_list_free (events);
|
|
|
|
}
|
|
|
|
|
2013-05-09 01:45:08 +00:00
|
|
|
/* Ouput buffer preparation ... if the buffer has no caps, and our allowed
|
|
|
|
* output caps is fixed, then send the caps downstream, making sure caps are
|
|
|
|
* sent before segment event.
|
|
|
|
*
|
|
|
|
* This ensures that caps event is sent if we can, so that pipelines like:
|
2005-10-15 15:30:24 +00:00
|
|
|
* gst-launch filesrc location=rawsamples.raw !
|
2012-09-13 09:35:41 +00:00
|
|
|
* audio/x-raw,format=S16LE,rate=48000,channels=2 ! alsasink
|
2005-09-09 23:45:15 +00:00
|
|
|
* will work.
|
|
|
|
*/
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_capsfilter_prepare_buf (GstBaseTransform * trans, GstBuffer * input,
|
2011-07-21 11:56:11 +00:00
|
|
|
GstBuffer ** buf)
|
2005-09-09 23:45:15 +00:00
|
|
|
{
|
2008-09-28 21:19:15 +00:00
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
2015-07-03 10:37:54 +00:00
|
|
|
GstCapsFilter *filter = GST_CAPS_FILTER (trans);
|
2008-09-28 21:19:15 +00:00
|
|
|
|
2011-07-21 15:42:08 +00:00
|
|
|
/* always return the input as output buffer */
|
2011-05-08 10:46:17 +00:00
|
|
|
*buf = input;
|
|
|
|
|
2014-01-16 17:16:35 +00:00
|
|
|
if (GST_PAD_MODE (trans->srcpad) == GST_PAD_MODE_PUSH
|
2016-03-08 19:08:16 +00:00
|
|
|
&& !filter->got_sink_caps) {
|
2014-01-28 14:12:56 +00:00
|
|
|
|
2013-05-09 01:45:08 +00:00
|
|
|
/* No caps. See if the output pad only supports fixed caps */
|
2005-09-09 23:45:15 +00:00
|
|
|
GstCaps *out_caps;
|
2013-05-09 07:32:49 +00:00
|
|
|
GList *pending_events = filter->pending_events;
|
2005-09-09 23:45:15 +00:00
|
|
|
|
2011-05-08 10:46:17 +00:00
|
|
|
GST_LOG_OBJECT (trans, "Input pad does not have caps");
|
|
|
|
|
2013-05-09 07:32:49 +00:00
|
|
|
filter->pending_events = NULL;
|
2013-05-09 01:45:08 +00:00
|
|
|
|
2011-05-06 17:04:54 +00:00
|
|
|
out_caps = gst_pad_get_current_caps (trans->srcpad);
|
|
|
|
if (out_caps == NULL) {
|
2005-09-09 23:45:15 +00:00
|
|
|
out_caps = gst_pad_get_allowed_caps (trans->srcpad);
|
|
|
|
g_return_val_if_fail (out_caps != NULL, GST_FLOW_ERROR);
|
|
|
|
}
|
|
|
|
|
2012-03-12 10:38:37 +00:00
|
|
|
out_caps = gst_caps_simplify (out_caps);
|
2006-05-18 09:07:55 +00:00
|
|
|
|
2005-09-09 23:45:15 +00:00
|
|
|
if (gst_caps_is_fixed (out_caps) && !gst_caps_is_empty (out_caps)) {
|
|
|
|
GST_DEBUG_OBJECT (trans, "Have fixed output caps %"
|
2011-05-08 10:46:17 +00:00
|
|
|
GST_PTR_FORMAT " to apply to srcpad", out_caps);
|
2005-09-09 23:45:15 +00:00
|
|
|
|
2013-05-09 07:50:41 +00:00
|
|
|
if (!gst_pad_has_current_caps (trans->srcpad)) {
|
|
|
|
if (gst_pad_set_caps (trans->srcpad, out_caps)) {
|
|
|
|
if (pending_events) {
|
2014-01-28 14:12:56 +00:00
|
|
|
gst_capsfilter_push_pending_events (filter, pending_events);
|
2013-05-09 07:50:41 +00:00
|
|
|
pending_events = NULL;
|
|
|
|
}
|
|
|
|
} else {
|
2012-06-08 13:45:38 +00:00
|
|
|
ret = GST_FLOW_NOT_NEGOTIATED;
|
2013-05-09 07:32:49 +00:00
|
|
|
}
|
2014-10-02 07:13:28 +00:00
|
|
|
} else {
|
|
|
|
gst_capsfilter_push_pending_events (filter, pending_events);
|
|
|
|
pending_events = NULL;
|
2013-05-09 07:32:49 +00:00
|
|
|
}
|
2013-05-09 01:45:08 +00:00
|
|
|
|
2013-05-09 07:50:41 +00:00
|
|
|
g_list_free_full (pending_events, (GDestroyNotify) gst_event_unref);
|
2011-10-12 12:34:24 +00:00
|
|
|
gst_caps_unref (out_caps);
|
2005-09-09 23:45:15 +00:00
|
|
|
} else {
|
2008-09-28 21:19:15 +00:00
|
|
|
gchar *caps_str = gst_caps_to_string (out_caps);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (trans, "Cannot choose caps. Have unfixed output caps %"
|
|
|
|
GST_PTR_FORMAT, out_caps);
|
2005-09-09 23:45:15 +00:00
|
|
|
gst_caps_unref (out_caps);
|
2008-09-28 21:19:15 +00:00
|
|
|
|
|
|
|
GST_ELEMENT_ERROR (trans, STREAM, FORMAT,
|
|
|
|
("Filter caps do not completely specify the output format"),
|
|
|
|
("Output caps are unfixed: %s", caps_str));
|
2013-05-09 01:45:08 +00:00
|
|
|
|
2008-09-28 21:19:15 +00:00
|
|
|
g_free (caps_str);
|
2013-05-09 07:38:35 +00:00
|
|
|
g_list_free_full (pending_events, (GDestroyNotify) gst_event_unref);
|
2013-05-09 01:45:08 +00:00
|
|
|
|
|
|
|
ret = GST_FLOW_ERROR;
|
2005-09-09 23:45:15 +00:00
|
|
|
}
|
2014-01-28 14:12:56 +00:00
|
|
|
} else if (G_UNLIKELY (filter->pending_events)) {
|
|
|
|
GList *events = filter->pending_events;
|
|
|
|
|
|
|
|
filter->pending_events = NULL;
|
|
|
|
|
|
|
|
/* push pending events before a buffer */
|
|
|
|
gst_capsfilter_push_pending_events (filter, events);
|
check/elements/identity.c: Make the error a little clearer when the test fails because identity made a copy of the bu...
Original commit message from CVS:
* check/elements/identity.c: (GST_START_TEST):
Make the error a little clearer when the test fails because
identity made a copy of the buffer.
* docs/gst/gstreamer-sections.txt:
New symbols in gstbasetransform.h
* gst/base/gstbasetransform.c: (gst_base_transform_class_init),
(gst_base_transform_init), (gst_base_transform_transform_size),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_default_prepare_buf),
(gst_base_transform_get_unit_size),
(gst_base_transform_buffer_alloc),
(gst_base_transform_handle_buffer), (gst_base_transform_chain),
(gst_base_transform_change_state),
(gst_base_transform_set_passthrough),
(gst_base_transform_set_in_place),
(gst_base_transform_is_in_place):
* gst/base/gstbasetransform.h:
Change BaseTransform to separate in_place operate from same_caps
output. in_place implies that the element can perform the transform
on incoming buffers in-place, even if the caps on the output are
different.
Sub-class elements can now implement special buffer allocation
methods for outgoing buffers if they wish to.
Big documentation addition.
* gst/elements/gstcapsfilter.c: (gst_capsfilter_transform_ip):
* gst/elements/gstelements.c:
Changes for basetransform modifications.
* gst/elements/Makefile.am:
* gst/elements/gstfdsrc.c: (gst_fdsrc_init), (gst_fdsrc_create):
Compile fix. Extra debug output.
2005-09-09 17:42:20 +00:00
|
|
|
}
|
|
|
|
|
2008-09-28 21:19:15 +00:00
|
|
|
return ret;
|
2005-08-04 19:40:43 +00:00
|
|
|
}
|
2013-05-09 01:45:08 +00:00
|
|
|
|
|
|
|
/* Queue the segment event if there was no caps event */
|
|
|
|
static gboolean
|
|
|
|
gst_capsfilter_sink_event (GstBaseTransform * trans, GstEvent * event)
|
|
|
|
{
|
2015-07-03 10:37:54 +00:00
|
|
|
GstCapsFilter *filter = GST_CAPS_FILTER (trans);
|
2014-10-22 12:07:09 +00:00
|
|
|
gboolean ret;
|
2013-05-09 07:32:49 +00:00
|
|
|
|
|
|
|
if (GST_EVENT_TYPE (event) == GST_EVENT_FLUSH_STOP) {
|
|
|
|
GList *l;
|
|
|
|
|
2013-08-29 21:18:31 +00:00
|
|
|
for (l = filter->pending_events; l; l = l->next) {
|
2014-06-03 12:23:30 +00:00
|
|
|
if (GST_EVENT_TYPE (l->data) == GST_EVENT_SEGMENT ||
|
|
|
|
GST_EVENT_TYPE (l->data) == GST_EVENT_EOS) {
|
2013-05-09 07:32:49 +00:00
|
|
|
gst_event_unref (l->data);
|
2013-08-29 21:18:31 +00:00
|
|
|
filter->pending_events = g_list_delete_link (filter->pending_events, l);
|
|
|
|
break;
|
2013-05-09 07:32:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-29 21:18:31 +00:00
|
|
|
if (!GST_EVENT_IS_STICKY (event)
|
|
|
|
|| GST_EVENT_TYPE (event) <= GST_EVENT_CAPS)
|
2013-05-09 01:45:08 +00:00
|
|
|
goto done;
|
|
|
|
|
2013-05-09 07:32:49 +00:00
|
|
|
/* If we get EOS before any buffers, just push all pending events */
|
|
|
|
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
for (l = g_list_last (filter->pending_events); l; l = l->prev) {
|
2013-05-09 07:50:41 +00:00
|
|
|
GST_LOG_OBJECT (trans, "Forwarding %s event",
|
|
|
|
GST_EVENT_TYPE_NAME (l->data));
|
2013-05-09 07:32:49 +00:00
|
|
|
GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, l->data);
|
|
|
|
}
|
|
|
|
g_list_free (filter->pending_events);
|
|
|
|
filter->pending_events = NULL;
|
2016-03-08 19:08:16 +00:00
|
|
|
} else if (!filter->got_sink_caps) {
|
2013-05-09 07:32:49 +00:00
|
|
|
GST_LOG_OBJECT (trans, "Got %s event before caps, queueing",
|
|
|
|
GST_EVENT_TYPE_NAME (event));
|
|
|
|
|
|
|
|
filter->pending_events = g_list_prepend (filter->pending_events, event);
|
|
|
|
|
2013-05-09 01:45:08 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
done:
|
2013-05-09 07:50:41 +00:00
|
|
|
|
|
|
|
GST_LOG_OBJECT (trans, "Forwarding %s event", GST_EVENT_TYPE_NAME (event));
|
2014-10-22 12:07:09 +00:00
|
|
|
ret =
|
|
|
|
GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans,
|
|
|
|
gst_event_ref (event));
|
|
|
|
|
2016-03-08 19:08:16 +00:00
|
|
|
if (GST_EVENT_TYPE (event) == GST_EVENT_CAPS) {
|
|
|
|
filter->got_sink_caps = TRUE;
|
|
|
|
if (filter->caps_change_mode == GST_CAPS_FILTER_CAPS_CHANGE_MODE_DELAYED) {
|
|
|
|
GList *l;
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
gst_event_parse_caps (event, &caps);
|
|
|
|
|
|
|
|
/* Remove all previous caps up to one that works.
|
|
|
|
* Note that this might keep some leftover caps if there
|
|
|
|
* are multiple compatible caps */
|
|
|
|
GST_OBJECT_LOCK (filter);
|
|
|
|
for (l = g_list_last (filter->previous_caps); l; l = l->prev) {
|
|
|
|
if (gst_caps_can_intersect (caps, l->data)) {
|
|
|
|
while (l->next) {
|
|
|
|
gst_caps_unref (l->next->data);
|
|
|
|
l = g_list_delete_link (l, l->next);
|
|
|
|
}
|
|
|
|
break;
|
2014-10-22 12:07:09 +00:00
|
|
|
}
|
|
|
|
}
|
2016-03-08 19:08:16 +00:00
|
|
|
if (!l && gst_caps_can_intersect (caps, filter->filter_caps)) {
|
|
|
|
g_list_free_full (filter->previous_caps,
|
|
|
|
(GDestroyNotify) gst_caps_unref);
|
|
|
|
filter->previous_caps = NULL;
|
|
|
|
filter->filter_caps_used = TRUE;
|
|
|
|
}
|
|
|
|
GST_OBJECT_UNLOCK (filter);
|
2014-10-22 12:07:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
gst_event_unref (event);
|
|
|
|
|
|
|
|
return ret;
|
2013-05-09 01:45:08 +00:00
|
|
|
}
|
2013-05-09 07:32:49 +00:00
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_capsfilter_stop (GstBaseTransform * trans)
|
|
|
|
{
|
2015-07-03 10:37:54 +00:00
|
|
|
GstCapsFilter *filter = GST_CAPS_FILTER (trans);
|
2013-05-09 07:32:49 +00:00
|
|
|
|
|
|
|
g_list_free_full (filter->pending_events, (GDestroyNotify) gst_event_unref);
|
|
|
|
filter->pending_events = NULL;
|
|
|
|
|
2014-10-22 12:07:09 +00:00
|
|
|
GST_OBJECT_LOCK (filter);
|
|
|
|
g_list_free_full (filter->previous_caps, (GDestroyNotify) gst_caps_unref);
|
|
|
|
filter->previous_caps = NULL;
|
|
|
|
GST_OBJECT_UNLOCK (filter);
|
|
|
|
|
2016-03-08 19:08:16 +00:00
|
|
|
filter->got_sink_caps = FALSE;
|
|
|
|
|
2013-05-09 07:32:49 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|