gstreamer/gst/base/gstbasetransform.c

535 lines
14 KiB
C
Raw Normal View History

gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +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>
*
* gstbasetransform.c:
*
* 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.
*/
#include <stdlib.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "../gst-i18n-lib.h"
#include "gstbasetransform.h"
#include <gst/gstmarshal.h>
GST_DEBUG_CATEGORY_STATIC (gst_base_transform_debug);
#define GST_CAT_DEFAULT gst_base_transform_debug
/* BaseTransform signals and args */
enum
{
SIGNAL_HANDOFF,
/* FILL ME */
LAST_SIGNAL
};
enum
{
PROP_0,
};
static GstElementClass *parent_class = NULL;
static void gst_base_transform_base_init (gpointer g_class);
static void gst_base_transform_class_init (GstBaseTransformClass * klass);
static void gst_base_transform_init (GstBaseTransform * trans,
gpointer g_class);
GType
gst_base_transform_get_type (void)
{
static GType base_transform_type = 0;
if (!base_transform_type) {
static const GTypeInfo base_transform_info = {
sizeof (GstBaseTransformClass),
(GBaseInitFunc) gst_base_transform_base_init,
NULL,
(GClassInitFunc) gst_base_transform_class_init,
NULL,
NULL,
sizeof (GstBaseTransform),
0,
(GInstanceInitFunc) gst_base_transform_init,
};
base_transform_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstBaseTransform", &base_transform_info, G_TYPE_FLAG_ABSTRACT);
}
return base_transform_type;
}
static void gst_base_transform_finalize (GObject * object);
static void gst_base_transform_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_base_transform_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. Original commit message from CVS: 2005-06-27 Andy Wingo <wingo@pobox.com> * gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. * gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper, returns a sorted copy of the trace list. (gst_alloc_trace_print_live): New API, only prints traces with live objects. Sort the list. (gst_alloc_trace_print_all): Sort the list. (gst_alloc_trace_print): Align columns. * gst/elements/gstttypefindelement.c: * gst/elements/gsttee.c: * gst/base/gstbasesrc.c: * gst/base/gstbasesink.c: * gst/base/gstbasetransform.c: * gst/gstqueue.c: Adapt for pad activation changes. * gst/gstpipeline.c (gst_pipeline_init): Unref after parenting sched. (gst_pipeline_dispose): Drop ref on sched. * gst/gstpad.c (gst_pad_init): Set the default activate func. (gst_pad_activate_default): Push mode by default. (pre_activate_switch, post_activate_switch): New stubs, things to do before and after switching activation modes on pads. (gst_pad_set_active): Take a boolean and not a mode, dispatch to the pad's activate function to choose which mode to activate. Shortcut on deactivation and call the right function directly. (gst_pad_activate_pull): New API, (de)activates a pad in pull mode. (gst_pad_activate_push): New API, same for push mode. (gst_pad_set_activate_function) (gst_pad_set_activatepull_function) (gst_pad_set_activatepush_function): Setters for new API. * gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free): Trace all miniobjects. (gst_mini_object_make_writable): Unref the arg if we copy, like gst_caps_make_writable. * gst/gstmessage.c (_gst_message_initialize): No trace init. * gst/gstghostpad.c (gst_proxy_pad_do_activate) (gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush): Adapt for new pad API. * gst/gstevent.c (_gst_event_initialize): Don't initialize trace. * gst/gstelement.h: * gst/gstelement.c (gst_element_iterate_src_pads) (gst_element_iterate_sink_pads): New API functions. * gst/gstelement.c (iterator_fold_with_resync): New utility, should fold into gstiterator.c in some form. (gst_element_pads_activate): Simplified via use of fold and delegation of decisions to gstpad->activate. * gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL, help in debugging. * gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type class once in init, like gstmessage. Didn't run into this issue but it seems correct. Don't initialize a trace, gstminiobject does that. * check/pipelines/simple_launch_lines.c (test_stop_from_app): New test, runs fakesrc ! fakesink, stopping on ::handoff via a message to the bus. (assert_live_count): New util function, uses alloc traces to check cleanup. * check/gst/gstghostpad.c (test_ghost_pads): More refcount checks. To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
static gboolean gst_base_transform_src_activate_pull (GstPad * pad,
gboolean active);
static gboolean gst_base_transform_sink_activate_push (GstPad * pad,
gboolean active);
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
static GstElementStateReturn gst_base_transform_change_state (GstElement *
element);
static gboolean gst_base_transform_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_base_transform_getrange (GstPad * pad, guint64 offset,
guint length, GstBuffer ** buffer);
static GstFlowReturn gst_base_transform_chain (GstPad * pad,
GstBuffer * buffer);
static GstFlowReturn gst_base_transform_handle_buffer (GstBaseTransform * trans,
GstBuffer * inbuf, GstBuffer ** outbuf);
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
static GstCaps *gst_base_transform_getcaps (GstPad * pad);
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
static gboolean gst_base_transform_setcaps (GstPad * pad, GstCaps * caps);
/* static guint gst_base_transform_signals[LAST_SIGNAL] = { 0 }; */
static void
gst_base_transform_base_init (gpointer g_class)
{
GST_DEBUG_CATEGORY_INIT (gst_base_transform_debug, "basetransform", 0,
"basetransform element");
}
static void
gst_base_transform_finalize (GObject * object)
{
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gst_base_transform_class_init (GstBaseTransformClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gobject_class = G_OBJECT_CLASS (klass);
gstelement_class = GST_ELEMENT_CLASS (klass);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gobject_class->set_property =
GST_DEBUG_FUNCPTR (gst_base_transform_set_property);
gobject_class->get_property =
GST_DEBUG_FUNCPTR (gst_base_transform_get_property);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_base_transform_finalize);
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_base_transform_change_state);
}
static void
gst_base_transform_init (GstBaseTransform * trans, gpointer g_class)
{
GstPadTemplate *pad_template;
GST_DEBUG ("gst_base_transform_init");
pad_template =
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "sink");
g_return_if_fail (pad_template != NULL);
trans->sinkpad = gst_pad_new_from_template (pad_template, "sink");
gst_pad_set_getcaps_function (trans->sinkpad,
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
GST_DEBUG_FUNCPTR (gst_base_transform_getcaps));
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
gst_pad_set_setcaps_function (trans->sinkpad,
GST_DEBUG_FUNCPTR (gst_base_transform_setcaps));
gst_pad_set_event_function (trans->sinkpad,
GST_DEBUG_FUNCPTR (gst_base_transform_event));
gst_pad_set_chain_function (trans->sinkpad,
GST_DEBUG_FUNCPTR (gst_base_transform_chain));
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. Original commit message from CVS: 2005-06-27 Andy Wingo <wingo@pobox.com> * gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. * gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper, returns a sorted copy of the trace list. (gst_alloc_trace_print_live): New API, only prints traces with live objects. Sort the list. (gst_alloc_trace_print_all): Sort the list. (gst_alloc_trace_print): Align columns. * gst/elements/gstttypefindelement.c: * gst/elements/gsttee.c: * gst/base/gstbasesrc.c: * gst/base/gstbasesink.c: * gst/base/gstbasetransform.c: * gst/gstqueue.c: Adapt for pad activation changes. * gst/gstpipeline.c (gst_pipeline_init): Unref after parenting sched. (gst_pipeline_dispose): Drop ref on sched. * gst/gstpad.c (gst_pad_init): Set the default activate func. (gst_pad_activate_default): Push mode by default. (pre_activate_switch, post_activate_switch): New stubs, things to do before and after switching activation modes on pads. (gst_pad_set_active): Take a boolean and not a mode, dispatch to the pad's activate function to choose which mode to activate. Shortcut on deactivation and call the right function directly. (gst_pad_activate_pull): New API, (de)activates a pad in pull mode. (gst_pad_activate_push): New API, same for push mode. (gst_pad_set_activate_function) (gst_pad_set_activatepull_function) (gst_pad_set_activatepush_function): Setters for new API. * gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free): Trace all miniobjects. (gst_mini_object_make_writable): Unref the arg if we copy, like gst_caps_make_writable. * gst/gstmessage.c (_gst_message_initialize): No trace init. * gst/gstghostpad.c (gst_proxy_pad_do_activate) (gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush): Adapt for new pad API. * gst/gstevent.c (_gst_event_initialize): Don't initialize trace. * gst/gstelement.h: * gst/gstelement.c (gst_element_iterate_src_pads) (gst_element_iterate_sink_pads): New API functions. * gst/gstelement.c (iterator_fold_with_resync): New utility, should fold into gstiterator.c in some form. (gst_element_pads_activate): Simplified via use of fold and delegation of decisions to gstpad->activate. * gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL, help in debugging. * gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type class once in init, like gstmessage. Didn't run into this issue but it seems correct. Don't initialize a trace, gstminiobject does that. * check/pipelines/simple_launch_lines.c (test_stop_from_app): New test, runs fakesrc ! fakesink, stopping on ::handoff via a message to the bus. (assert_live_count): New util function, uses alloc traces to check cleanup. * check/gst/gstghostpad.c (test_ghost_pads): More refcount checks. To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
gst_pad_set_activatepush_function (trans->sinkpad,
GST_DEBUG_FUNCPTR (gst_base_transform_sink_activate_push));
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
gst_element_add_pad (GST_ELEMENT (trans), trans->sinkpad);
pad_template =
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "src");
g_return_if_fail (pad_template != NULL);
trans->srcpad = gst_pad_new_from_template (pad_template, "src");
gst_pad_set_getcaps_function (trans->srcpad,
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
GST_DEBUG_FUNCPTR (gst_base_transform_getcaps));
gst_pad_set_setcaps_function (trans->srcpad,
GST_DEBUG_FUNCPTR (gst_base_transform_setcaps));
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
gst_pad_set_getrange_function (trans->srcpad,
GST_DEBUG_FUNCPTR (gst_base_transform_getrange));
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. Original commit message from CVS: 2005-06-27 Andy Wingo <wingo@pobox.com> * gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. * gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper, returns a sorted copy of the trace list. (gst_alloc_trace_print_live): New API, only prints traces with live objects. Sort the list. (gst_alloc_trace_print_all): Sort the list. (gst_alloc_trace_print): Align columns. * gst/elements/gstttypefindelement.c: * gst/elements/gsttee.c: * gst/base/gstbasesrc.c: * gst/base/gstbasesink.c: * gst/base/gstbasetransform.c: * gst/gstqueue.c: Adapt for pad activation changes. * gst/gstpipeline.c (gst_pipeline_init): Unref after parenting sched. (gst_pipeline_dispose): Drop ref on sched. * gst/gstpad.c (gst_pad_init): Set the default activate func. (gst_pad_activate_default): Push mode by default. (pre_activate_switch, post_activate_switch): New stubs, things to do before and after switching activation modes on pads. (gst_pad_set_active): Take a boolean and not a mode, dispatch to the pad's activate function to choose which mode to activate. Shortcut on deactivation and call the right function directly. (gst_pad_activate_pull): New API, (de)activates a pad in pull mode. (gst_pad_activate_push): New API, same for push mode. (gst_pad_set_activate_function) (gst_pad_set_activatepull_function) (gst_pad_set_activatepush_function): Setters for new API. * gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free): Trace all miniobjects. (gst_mini_object_make_writable): Unref the arg if we copy, like gst_caps_make_writable. * gst/gstmessage.c (_gst_message_initialize): No trace init. * gst/gstghostpad.c (gst_proxy_pad_do_activate) (gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush): Adapt for new pad API. * gst/gstevent.c (_gst_event_initialize): Don't initialize trace. * gst/gstelement.h: * gst/gstelement.c (gst_element_iterate_src_pads) (gst_element_iterate_sink_pads): New API functions. * gst/gstelement.c (iterator_fold_with_resync): New utility, should fold into gstiterator.c in some form. (gst_element_pads_activate): Simplified via use of fold and delegation of decisions to gstpad->activate. * gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL, help in debugging. * gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type class once in init, like gstmessage. Didn't run into this issue but it seems correct. Don't initialize a trace, gstminiobject does that. * check/pipelines/simple_launch_lines.c (test_stop_from_app): New test, runs fakesrc ! fakesink, stopping on ::handoff via a message to the bus. (assert_live_count): New util function, uses alloc traces to check cleanup. * check/gst/gstghostpad.c (test_ghost_pads): More refcount checks. To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
gst_pad_set_activatepull_function (trans->srcpad,
GST_DEBUG_FUNCPTR (gst_base_transform_src_activate_pull));
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
gst_element_add_pad (GST_ELEMENT (trans), trans->srcpad);
}
static GstCaps *
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
gst_base_transform_transform_caps (GstBaseTransform * trans, GstPad * pad,
GstCaps * caps)
{
GstCaps *ret;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
GstBaseTransformClass *klass;
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
GST_DEBUG_OBJECT (trans, "from: %" GST_PTR_FORMAT, caps);
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
if (klass->transform_caps)
ret = klass->transform_caps (trans, pad, caps);
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
else
ret = gst_caps_ref (caps);
GST_DEBUG_OBJECT (trans, "to: %" GST_PTR_FORMAT, ret);
return ret;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
}
static GstCaps *
gst_base_transform_getcaps (GstPad * pad)
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
{
GstBaseTransform *trans;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
GstPad *otherpad;
GstCaps *caps;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
trans = GST_BASE_TRANSFORM (GST_PAD_PARENT (pad));
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
otherpad = (pad == trans->srcpad) ? trans->sinkpad : trans->srcpad;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
/* we can do what the peer can */
caps = gst_pad_peer_get_caps (otherpad);
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
if (caps) {
GstCaps *temp;
temp = gst_caps_intersect (caps, gst_pad_get_pad_template_caps (otherpad));
gst_caps_unref (caps);
caps = gst_base_transform_transform_caps (trans, otherpad, temp);
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
gst_caps_unref (temp);
temp = gst_caps_intersect (caps, gst_pad_get_pad_template_caps (pad));
gst_caps_unref (caps);
caps = temp;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
} else {
/* no peer, our padtemplate is enough then */
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
}
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
return caps;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
}
static gboolean
gst_base_transform_setcaps (GstPad * pad, GstCaps * caps)
{
GstBaseTransform *trans;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
GstBaseTransformClass *klass;
GstPad *otherpad, *otherpeer;
GstCaps *othercaps = NULL;
gboolean ret = TRUE;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
trans = GST_BASE_TRANSFORM (GST_PAD_PARENT (pad));
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
otherpad = (pad == trans->srcpad) ? trans->sinkpad : trans->srcpad;
otherpeer = gst_pad_get_peer (otherpad);
if (GST_PAD_IS_IN_SETCAPS (otherpad)) {
ret = TRUE;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
goto done;
}
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
/* see how we can transform the input caps */
othercaps = gst_base_transform_transform_caps (trans, pad, caps);
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
if (!othercaps) {
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
ret = FALSE;
goto done;
}
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
if (!gst_caps_is_fixed (othercaps)) {
GstCaps *temp;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
temp = gst_caps_intersect (othercaps, caps);
if (temp) {
/* try passthrough. we know it's fixed, because caps is fixed */
if (gst_pad_accept_caps (otherpeer, caps)) {
gst_caps_unref (othercaps);
othercaps = gst_caps_ref (caps);
/* will fall though. calls accept_caps again, should fix that. */
}
gst_caps_unref (temp);
}
}
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
if (!gst_caps_is_fixed (othercaps) && otherpeer) {
/* intersect against what the peer can do */
if (otherpeer) {
GstCaps *peercaps;
GstCaps *intersect;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
peercaps = gst_pad_get_caps (otherpeer);
intersect = gst_caps_intersect (peercaps, othercaps);
gst_caps_unref (peercaps);
gst_caps_unref (othercaps);
othercaps = intersect;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
GST_DEBUG ("filtering against peer yields %" GST_PTR_FORMAT, othercaps);
}
}
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
if (!gst_caps_is_fixed (othercaps)) {
GstCaps *temp;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
/* take first possibility and fixate if necessary */
temp = gst_caps_copy_nth (othercaps, 0);
gst_caps_unref (othercaps);
othercaps = temp;
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
gst_pad_fixate_caps (otherpad, othercaps);
}
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
g_return_val_if_fail (gst_caps_is_fixed (othercaps), FALSE);
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
if (otherpeer && !gst_pad_accept_caps (otherpeer, othercaps)) {
GST_DEBUG ("FAILED to get peer of %" GST_PTR_FORMAT
" to accept %" GST_PTR_FORMAT, otherpad, othercaps);
ret = FALSE;
goto done;
}
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
/* we know this will work, we implement the setcaps */
gst_pad_set_caps (otherpad, othercaps);
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
/* success, let the element know */
if (klass->set_caps) {
if (pad == trans->sinkpad)
ret = klass->set_caps (trans, caps, othercaps);
else
ret = klass->set_caps (trans, othercaps, caps);
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
}
done:
if (otherpeer)
gst_object_unref (otherpeer);
if (othercaps)
gst_caps_unref (othercaps);
tests/network-clock.scm: Commentary update. Original commit message from CVS: 2005-07-01 Andy Wingo <wingo@pobox.com> * tests/network-clock.scm: Commentary update. * gst/elements/gstidentity.c (PROP_DUPLICATE): Gone daddy gone. Didn't really make sense, not implementable with basetransform, etc. (gst_identity_transform): Unref inbuf via make_writable. Feeble attempt at implementing the sync property, needs an unlock method. * gst/base/gstbasetransform.c (gst_base_transform_transform_caps): New func, by default returns the same caps (the identity transformation). (gst_base_transform_getcaps): Uses transform_caps to return something sensible. (gst_base_transform_setcaps): Complicated logic to get caps on both pads, even if they are different, and to call set_caps once for every time both pads get their caps set. (gst_base_transform_handle_buffer): Give the ref to the transform function. Allows in-place modification of the buffer. * gst/base/gstbasetransform.h (transform_caps): New class method. Given caps on one side, what can I do on the other. (set_caps): Take two caps, one for each side of the element. * gst/gstpad.h: * gst/gstpad.c (gst_pad_fixate_caps): Change prototype to modify caps in place. This is safe because we can check the mutability of the caps, and a good idea because fixate functions are just called as a matter of last resort. (Not actually implemented.) (gst_pad_set_caps): If the caps we're setting is actually the same as the existing pad caps, just update the pointer without calling setcaps. Assert that caps is either NULL or fixed, as per the docs. * gst/gstghostpad.c: Update for fixate changes.
2005-07-01 16:46:59 +00:00
return ret;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
}
static gboolean
gst_base_transform_event (GstPad * pad, GstEvent * event)
{
GstBaseTransform *trans;
GstBaseTransformClass *bclass;
gboolean ret = FALSE;
gboolean unlock;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
trans = GST_BASE_TRANSFORM (GST_PAD_PARENT (pad));
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->event)
bclass->event (trans, event);
unlock = FALSE;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH:
if (GST_EVENT_FLUSH_DONE (event)) {
GST_STREAM_LOCK (pad);
unlock = TRUE;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
}
break;
case GST_EVENT_EOS:
GST_STREAM_LOCK (pad);
unlock = TRUE;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
break;
default:
break;
}
ret = gst_pad_event_default (pad, event);
if (unlock)
GST_STREAM_UNLOCK (pad);
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
return ret;
}
static GstFlowReturn
gst_base_transform_getrange (GstPad * pad, guint64 offset,
guint length, GstBuffer ** buffer)
{
GstBaseTransform *trans;
GstFlowReturn ret;
GstBuffer *inbuf;
trans = GST_BASE_TRANSFORM (GST_PAD_PARENT (pad));
GST_STREAM_LOCK (pad);
ret = gst_pad_pull_range (trans->sinkpad, offset, length, &inbuf);
if (ret == GST_FLOW_OK) {
ret = gst_base_transform_handle_buffer (trans, inbuf, buffer);
}
GST_STREAM_UNLOCK (pad);
return ret;
}
static GstFlowReturn
gst_base_transform_chain (GstPad * pad, GstBuffer * buffer)
{
GstBaseTransform *trans;
GstFlowReturn ret = GST_FLOW_OK;
GstBuffer *outbuf;
trans = GST_BASE_TRANSFORM (GST_PAD_PARENT (pad));
GST_STREAM_LOCK (pad);
ret = gst_base_transform_handle_buffer (trans, buffer, &outbuf);
if (ret == GST_FLOW_OK) {
ret = gst_pad_push (trans->srcpad, outbuf);
}
GST_STREAM_UNLOCK (pad);
return ret;
}
static GstFlowReturn
gst_base_transform_handle_buffer (GstBaseTransform * trans, GstBuffer * inbuf,
GstBuffer ** outbuf)
{
GstFlowReturn ret = GST_FLOW_OK;
GstBaseTransformClass *bclass;
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->transform)
ret = bclass->transform (trans, inbuf, outbuf);
return ret;
}
static void
gst_base_transform_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstBaseTransform *trans;
trans = GST_BASE_TRANSFORM (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_base_transform_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstBaseTransform *trans;
trans = GST_BASE_TRANSFORM (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static gboolean
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. Original commit message from CVS: 2005-06-27 Andy Wingo <wingo@pobox.com> * gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. * gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper, returns a sorted copy of the trace list. (gst_alloc_trace_print_live): New API, only prints traces with live objects. Sort the list. (gst_alloc_trace_print_all): Sort the list. (gst_alloc_trace_print): Align columns. * gst/elements/gstttypefindelement.c: * gst/elements/gsttee.c: * gst/base/gstbasesrc.c: * gst/base/gstbasesink.c: * gst/base/gstbasetransform.c: * gst/gstqueue.c: Adapt for pad activation changes. * gst/gstpipeline.c (gst_pipeline_init): Unref after parenting sched. (gst_pipeline_dispose): Drop ref on sched. * gst/gstpad.c (gst_pad_init): Set the default activate func. (gst_pad_activate_default): Push mode by default. (pre_activate_switch, post_activate_switch): New stubs, things to do before and after switching activation modes on pads. (gst_pad_set_active): Take a boolean and not a mode, dispatch to the pad's activate function to choose which mode to activate. Shortcut on deactivation and call the right function directly. (gst_pad_activate_pull): New API, (de)activates a pad in pull mode. (gst_pad_activate_push): New API, same for push mode. (gst_pad_set_activate_function) (gst_pad_set_activatepull_function) (gst_pad_set_activatepush_function): Setters for new API. * gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free): Trace all miniobjects. (gst_mini_object_make_writable): Unref the arg if we copy, like gst_caps_make_writable. * gst/gstmessage.c (_gst_message_initialize): No trace init. * gst/gstghostpad.c (gst_proxy_pad_do_activate) (gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush): Adapt for new pad API. * gst/gstevent.c (_gst_event_initialize): Don't initialize trace. * gst/gstelement.h: * gst/gstelement.c (gst_element_iterate_src_pads) (gst_element_iterate_sink_pads): New API functions. * gst/gstelement.c (iterator_fold_with_resync): New utility, should fold into gstiterator.c in some form. (gst_element_pads_activate): Simplified via use of fold and delegation of decisions to gstpad->activate. * gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL, help in debugging. * gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type class once in init, like gstmessage. Didn't run into this issue but it seems correct. Don't initialize a trace, gstminiobject does that. * check/pipelines/simple_launch_lines.c (test_stop_from_app): New test, runs fakesrc ! fakesink, stopping on ::handoff via a message to the bus. (assert_live_count): New util function, uses alloc traces to check cleanup. * check/gst/gstghostpad.c (test_ghost_pads): More refcount checks. To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
gst_base_transform_sink_activate_push (GstPad * pad, gboolean active)
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
{
gboolean result = TRUE;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
GstBaseTransform *trans;
GstBaseTransformClass *bclass;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
trans = GST_BASE_TRANSFORM (GST_OBJECT_PARENT (pad));
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. Original commit message from CVS: 2005-06-27 Andy Wingo <wingo@pobox.com> * gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. * gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper, returns a sorted copy of the trace list. (gst_alloc_trace_print_live): New API, only prints traces with live objects. Sort the list. (gst_alloc_trace_print_all): Sort the list. (gst_alloc_trace_print): Align columns. * gst/elements/gstttypefindelement.c: * gst/elements/gsttee.c: * gst/base/gstbasesrc.c: * gst/base/gstbasesink.c: * gst/base/gstbasetransform.c: * gst/gstqueue.c: Adapt for pad activation changes. * gst/gstpipeline.c (gst_pipeline_init): Unref after parenting sched. (gst_pipeline_dispose): Drop ref on sched. * gst/gstpad.c (gst_pad_init): Set the default activate func. (gst_pad_activate_default): Push mode by default. (pre_activate_switch, post_activate_switch): New stubs, things to do before and after switching activation modes on pads. (gst_pad_set_active): Take a boolean and not a mode, dispatch to the pad's activate function to choose which mode to activate. Shortcut on deactivation and call the right function directly. (gst_pad_activate_pull): New API, (de)activates a pad in pull mode. (gst_pad_activate_push): New API, same for push mode. (gst_pad_set_activate_function) (gst_pad_set_activatepull_function) (gst_pad_set_activatepush_function): Setters for new API. * gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free): Trace all miniobjects. (gst_mini_object_make_writable): Unref the arg if we copy, like gst_caps_make_writable. * gst/gstmessage.c (_gst_message_initialize): No trace init. * gst/gstghostpad.c (gst_proxy_pad_do_activate) (gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush): Adapt for new pad API. * gst/gstevent.c (_gst_event_initialize): Don't initialize trace. * gst/gstelement.h: * gst/gstelement.c (gst_element_iterate_src_pads) (gst_element_iterate_sink_pads): New API functions. * gst/gstelement.c (iterator_fold_with_resync): New utility, should fold into gstiterator.c in some form. (gst_element_pads_activate): Simplified via use of fold and delegation of decisions to gstpad->activate. * gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL, help in debugging. * gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type class once in init, like gstmessage. Didn't run into this issue but it seems correct. Don't initialize a trace, gstminiobject does that. * check/pipelines/simple_launch_lines.c (test_stop_from_app): New test, runs fakesrc ! fakesink, stopping on ::handoff via a message to the bus. (assert_live_count): New util function, uses alloc traces to check cleanup. * check/gst/gstghostpad.c (test_ghost_pads): More refcount checks. To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
if (active) {
if (bclass->start)
result = bclass->start (trans);
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
}
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
return result;
}
static gboolean
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. Original commit message from CVS: 2005-06-27 Andy Wingo <wingo@pobox.com> * gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. * gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper, returns a sorted copy of the trace list. (gst_alloc_trace_print_live): New API, only prints traces with live objects. Sort the list. (gst_alloc_trace_print_all): Sort the list. (gst_alloc_trace_print): Align columns. * gst/elements/gstttypefindelement.c: * gst/elements/gsttee.c: * gst/base/gstbasesrc.c: * gst/base/gstbasesink.c: * gst/base/gstbasetransform.c: * gst/gstqueue.c: Adapt for pad activation changes. * gst/gstpipeline.c (gst_pipeline_init): Unref after parenting sched. (gst_pipeline_dispose): Drop ref on sched. * gst/gstpad.c (gst_pad_init): Set the default activate func. (gst_pad_activate_default): Push mode by default. (pre_activate_switch, post_activate_switch): New stubs, things to do before and after switching activation modes on pads. (gst_pad_set_active): Take a boolean and not a mode, dispatch to the pad's activate function to choose which mode to activate. Shortcut on deactivation and call the right function directly. (gst_pad_activate_pull): New API, (de)activates a pad in pull mode. (gst_pad_activate_push): New API, same for push mode. (gst_pad_set_activate_function) (gst_pad_set_activatepull_function) (gst_pad_set_activatepush_function): Setters for new API. * gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free): Trace all miniobjects. (gst_mini_object_make_writable): Unref the arg if we copy, like gst_caps_make_writable. * gst/gstmessage.c (_gst_message_initialize): No trace init. * gst/gstghostpad.c (gst_proxy_pad_do_activate) (gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush): Adapt for new pad API. * gst/gstevent.c (_gst_event_initialize): Don't initialize trace. * gst/gstelement.h: * gst/gstelement.c (gst_element_iterate_src_pads) (gst_element_iterate_sink_pads): New API functions. * gst/gstelement.c (iterator_fold_with_resync): New utility, should fold into gstiterator.c in some form. (gst_element_pads_activate): Simplified via use of fold and delegation of decisions to gstpad->activate. * gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL, help in debugging. * gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type class once in init, like gstmessage. Didn't run into this issue but it seems correct. Don't initialize a trace, gstminiobject does that. * check/pipelines/simple_launch_lines.c (test_stop_from_app): New test, runs fakesrc ! fakesink, stopping on ::handoff via a message to the bus. (assert_live_count): New util function, uses alloc traces to check cleanup. * check/gst/gstghostpad.c (test_ghost_pads): More refcount checks. To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
gst_base_transform_src_activate_pull (GstPad * pad, gboolean active)
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
{
gboolean result = FALSE;
GstBaseTransform *trans;
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. Original commit message from CVS: 2005-06-27 Andy Wingo <wingo@pobox.com> * gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. * gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper, returns a sorted copy of the trace list. (gst_alloc_trace_print_live): New API, only prints traces with live objects. Sort the list. (gst_alloc_trace_print_all): Sort the list. (gst_alloc_trace_print): Align columns. * gst/elements/gstttypefindelement.c: * gst/elements/gsttee.c: * gst/base/gstbasesrc.c: * gst/base/gstbasesink.c: * gst/base/gstbasetransform.c: * gst/gstqueue.c: Adapt for pad activation changes. * gst/gstpipeline.c (gst_pipeline_init): Unref after parenting sched. (gst_pipeline_dispose): Drop ref on sched. * gst/gstpad.c (gst_pad_init): Set the default activate func. (gst_pad_activate_default): Push mode by default. (pre_activate_switch, post_activate_switch): New stubs, things to do before and after switching activation modes on pads. (gst_pad_set_active): Take a boolean and not a mode, dispatch to the pad's activate function to choose which mode to activate. Shortcut on deactivation and call the right function directly. (gst_pad_activate_pull): New API, (de)activates a pad in pull mode. (gst_pad_activate_push): New API, same for push mode. (gst_pad_set_activate_function) (gst_pad_set_activatepull_function) (gst_pad_set_activatepush_function): Setters for new API. * gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free): Trace all miniobjects. (gst_mini_object_make_writable): Unref the arg if we copy, like gst_caps_make_writable. * gst/gstmessage.c (_gst_message_initialize): No trace init. * gst/gstghostpad.c (gst_proxy_pad_do_activate) (gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush): Adapt for new pad API. * gst/gstevent.c (_gst_event_initialize): Don't initialize trace. * gst/gstelement.h: * gst/gstelement.c (gst_element_iterate_src_pads) (gst_element_iterate_sink_pads): New API functions. * gst/gstelement.c (iterator_fold_with_resync): New utility, should fold into gstiterator.c in some form. (gst_element_pads_activate): Simplified via use of fold and delegation of decisions to gstpad->activate. * gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL, help in debugging. * gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type class once in init, like gstmessage. Didn't run into this issue but it seems correct. Don't initialize a trace, gstminiobject does that. * check/pipelines/simple_launch_lines.c (test_stop_from_app): New test, runs fakesrc ! fakesink, stopping on ::handoff via a message to the bus. (assert_live_count): New util function, uses alloc traces to check cleanup. * check/gst/gstghostpad.c (test_ghost_pads): More refcount checks. To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
GstBaseTransformClass *bclass;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
trans = GST_BASE_TRANSFORM (GST_OBJECT_PARENT (pad));
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. Original commit message from CVS: 2005-06-27 Andy Wingo <wingo@pobox.com> * gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. * gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper, returns a sorted copy of the trace list. (gst_alloc_trace_print_live): New API, only prints traces with live objects. Sort the list. (gst_alloc_trace_print_all): Sort the list. (gst_alloc_trace_print): Align columns. * gst/elements/gstttypefindelement.c: * gst/elements/gsttee.c: * gst/base/gstbasesrc.c: * gst/base/gstbasesink.c: * gst/base/gstbasetransform.c: * gst/gstqueue.c: Adapt for pad activation changes. * gst/gstpipeline.c (gst_pipeline_init): Unref after parenting sched. (gst_pipeline_dispose): Drop ref on sched. * gst/gstpad.c (gst_pad_init): Set the default activate func. (gst_pad_activate_default): Push mode by default. (pre_activate_switch, post_activate_switch): New stubs, things to do before and after switching activation modes on pads. (gst_pad_set_active): Take a boolean and not a mode, dispatch to the pad's activate function to choose which mode to activate. Shortcut on deactivation and call the right function directly. (gst_pad_activate_pull): New API, (de)activates a pad in pull mode. (gst_pad_activate_push): New API, same for push mode. (gst_pad_set_activate_function) (gst_pad_set_activatepull_function) (gst_pad_set_activatepush_function): Setters for new API. * gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free): Trace all miniobjects. (gst_mini_object_make_writable): Unref the arg if we copy, like gst_caps_make_writable. * gst/gstmessage.c (_gst_message_initialize): No trace init. * gst/gstghostpad.c (gst_proxy_pad_do_activate) (gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush): Adapt for new pad API. * gst/gstevent.c (_gst_event_initialize): Don't initialize trace. * gst/gstelement.h: * gst/gstelement.c (gst_element_iterate_src_pads) (gst_element_iterate_sink_pads): New API functions. * gst/gstelement.c (iterator_fold_with_resync): New utility, should fold into gstiterator.c in some form. (gst_element_pads_activate): Simplified via use of fold and delegation of decisions to gstpad->activate. * gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL, help in debugging. * gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type class once in init, like gstmessage. Didn't run into this issue but it seems correct. Don't initialize a trace, gstminiobject does that. * check/pipelines/simple_launch_lines.c (test_stop_from_app): New test, runs fakesrc ! fakesink, stopping on ::handoff via a message to the bus. (assert_live_count): New util function, uses alloc traces to check cleanup. * check/gst/gstghostpad.c (test_ghost_pads): More refcount checks. To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. Original commit message from CVS: 2005-06-27 Andy Wingo <wingo@pobox.com> * gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. * gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper, returns a sorted copy of the trace list. (gst_alloc_trace_print_live): New API, only prints traces with live objects. Sort the list. (gst_alloc_trace_print_all): Sort the list. (gst_alloc_trace_print): Align columns. * gst/elements/gstttypefindelement.c: * gst/elements/gsttee.c: * gst/base/gstbasesrc.c: * gst/base/gstbasesink.c: * gst/base/gstbasetransform.c: * gst/gstqueue.c: Adapt for pad activation changes. * gst/gstpipeline.c (gst_pipeline_init): Unref after parenting sched. (gst_pipeline_dispose): Drop ref on sched. * gst/gstpad.c (gst_pad_init): Set the default activate func. (gst_pad_activate_default): Push mode by default. (pre_activate_switch, post_activate_switch): New stubs, things to do before and after switching activation modes on pads. (gst_pad_set_active): Take a boolean and not a mode, dispatch to the pad's activate function to choose which mode to activate. Shortcut on deactivation and call the right function directly. (gst_pad_activate_pull): New API, (de)activates a pad in pull mode. (gst_pad_activate_push): New API, same for push mode. (gst_pad_set_activate_function) (gst_pad_set_activatepull_function) (gst_pad_set_activatepush_function): Setters for new API. * gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free): Trace all miniobjects. (gst_mini_object_make_writable): Unref the arg if we copy, like gst_caps_make_writable. * gst/gstmessage.c (_gst_message_initialize): No trace init. * gst/gstghostpad.c (gst_proxy_pad_do_activate) (gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush): Adapt for new pad API. * gst/gstevent.c (_gst_event_initialize): Don't initialize trace. * gst/gstelement.h: * gst/gstelement.c (gst_element_iterate_src_pads) (gst_element_iterate_sink_pads): New API functions. * gst/gstelement.c (iterator_fold_with_resync): New utility, should fold into gstiterator.c in some form. (gst_element_pads_activate): Simplified via use of fold and delegation of decisions to gstpad->activate. * gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL, help in debugging. * gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type class once in init, like gstmessage. Didn't run into this issue but it seems correct. Don't initialize a trace, gstminiobject does that. * check/pipelines/simple_launch_lines.c (test_stop_from_app): New test, runs fakesrc ! fakesink, stopping on ::handoff via a message to the bus. (assert_live_count): New util function, uses alloc traces to check cleanup. * check/gst/gstghostpad.c (test_ghost_pads): More refcount checks. To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
result = gst_pad_activate_pull (trans->sinkpad, active);
if (active) {
if (result && bclass->start)
result &= bclass->start (trans);
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
}
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. Original commit message from CVS: 2005-06-27 Andy Wingo <wingo@pobox.com> * gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer. * gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper, returns a sorted copy of the trace list. (gst_alloc_trace_print_live): New API, only prints traces with live objects. Sort the list. (gst_alloc_trace_print_all): Sort the list. (gst_alloc_trace_print): Align columns. * gst/elements/gstttypefindelement.c: * gst/elements/gsttee.c: * gst/base/gstbasesrc.c: * gst/base/gstbasesink.c: * gst/base/gstbasetransform.c: * gst/gstqueue.c: Adapt for pad activation changes. * gst/gstpipeline.c (gst_pipeline_init): Unref after parenting sched. (gst_pipeline_dispose): Drop ref on sched. * gst/gstpad.c (gst_pad_init): Set the default activate func. (gst_pad_activate_default): Push mode by default. (pre_activate_switch, post_activate_switch): New stubs, things to do before and after switching activation modes on pads. (gst_pad_set_active): Take a boolean and not a mode, dispatch to the pad's activate function to choose which mode to activate. Shortcut on deactivation and call the right function directly. (gst_pad_activate_pull): New API, (de)activates a pad in pull mode. (gst_pad_activate_push): New API, same for push mode. (gst_pad_set_activate_function) (gst_pad_set_activatepull_function) (gst_pad_set_activatepush_function): Setters for new API. * gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free): Trace all miniobjects. (gst_mini_object_make_writable): Unref the arg if we copy, like gst_caps_make_writable. * gst/gstmessage.c (_gst_message_initialize): No trace init. * gst/gstghostpad.c (gst_proxy_pad_do_activate) (gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush): Adapt for new pad API. * gst/gstevent.c (_gst_event_initialize): Don't initialize trace. * gst/gstelement.h: * gst/gstelement.c (gst_element_iterate_src_pads) (gst_element_iterate_sink_pads): New API functions. * gst/gstelement.c (iterator_fold_with_resync): New utility, should fold into gstiterator.c in some form. (gst_element_pads_activate): Simplified via use of fold and delegation of decisions to gstpad->activate. * gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL, help in debugging. * gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type class once in init, like gstmessage. Didn't run into this issue but it seems correct. Don't initialize a trace, gstminiobject does that. * check/pipelines/simple_launch_lines.c (test_stop_from_app): New test, runs fakesrc ! fakesink, stopping on ::handoff via a message to the bus. (assert_live_count): New util function, uses alloc traces to check cleanup. * check/gst/gstghostpad.c (test_ghost_pads): More refcount checks. To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
return result;
}
static GstElementStateReturn
gst_base_transform_change_state (GstElement * element)
{
GstBaseTransform *trans;
GstBaseTransformClass *bclass;
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
GstElementState transition;
GstElementStateReturn result;
trans = GST_BASE_TRANSFORM (element);
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
transition = GST_STATE_TRANSITION (element);
switch (transition) {
case GST_STATE_NULL_TO_READY:
break;
case GST_STATE_READY_TO_PAUSED:
break;
case GST_STATE_PAUSED_TO_PLAYING:
break;
default:
break;
}
result = GST_ELEMENT_CLASS (parent_class)->change_state (element);
switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED:
break;
case GST_STATE_PAUSED_TO_READY:
if (bclass->stop)
result = bclass->stop (trans);
gst/: Simplify pad activation. Original commit message from CVS: * gst/base/Makefile.am: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_type), (gst_basesink_base_init), (gst_basesink_class_init), (gst_basesink_pad_getcaps), (gst_basesink_init), (gst_basesink_activate), (gst_basesink_change_state): * gst/base/gstbasesink.h: * gst/base/gstbasetransform.c: (gst_base_transform_get_type), (gst_base_transform_base_init), (gst_base_transform_finalize), (gst_base_transform_class_init), (gst_base_transform_init), (gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps), (gst_base_transform_event), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_handle_buffer), (gst_base_transform_set_property), (gst_base_transform_get_property), (gst_base_transform_sink_activate), (gst_base_transform_src_activate), (gst_base_transform_change_state): * gst/base/gstbasetransform.h: * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_init), (gst_identity_event), (gst_identity_check_perfect), (gst_identity_transform), (gst_identity_set_property), (gst_identity_get_property), (gst_identity_change_state): * gst/elements/gstidentity.h: * gst/gstelement.c: (gst_element_get_state_func), (gst_element_lost_state), (gst_element_pads_activate): * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_check_pull_range), (gst_pad_pull_range): * gst/gstpad.h: Simplify pad activation. Added function to check if pull_range can be performed. Error out when pulling inactive or flushing pads. Removed const from refcounted types as it does not make sense. Simplify pad templates in basesink Added base class for simple 1-to-1 transforms. Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
break;
case GST_STATE_READY_TO_NULL:
break;
default:
break;
}
return result;
}