mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
compare: port to GstCollectPads2
This commit is contained in:
parent
4db6f8f7f2
commit
c826a197ce
2 changed files with 15 additions and 15 deletions
|
@ -26,7 +26,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstcollectpads.h>
|
||||
#include <gst/base/gstcollectpads2.h>
|
||||
#include <gst/video/video.h>
|
||||
|
||||
#include "gstcompare.h"
|
||||
|
@ -109,7 +109,7 @@ static void gst_compare_get_property (GObject * object,
|
|||
static void gst_compare_reset (GstCompare * overlay);
|
||||
|
||||
static GstCaps *gst_compare_getcaps (GstPad * pad);
|
||||
static GstFlowReturn gst_compare_collect_pads (GstCollectPads * cpads,
|
||||
static GstFlowReturn gst_compare_collect_pads (GstCollectPads2 * cpads,
|
||||
GstCompare * comp);
|
||||
|
||||
static GstStateChangeReturn gst_compare_change_state (GstElement * element,
|
||||
|
@ -187,9 +187,9 @@ gst_compare_class_init (GstCompareClass * klass)
|
|||
static void
|
||||
gst_compare_init (GstCompare * comp, GstCompareClass * klass)
|
||||
{
|
||||
comp->cpads = gst_collect_pads_new ();
|
||||
gst_collect_pads_set_function (comp->cpads,
|
||||
(GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_compare_collect_pads),
|
||||
comp->cpads = gst_collect_pads2_new ();
|
||||
gst_collect_pads2_set_function (comp->cpads,
|
||||
(GstCollectPads2Function) GST_DEBUG_FUNCPTR (gst_compare_collect_pads),
|
||||
comp);
|
||||
|
||||
comp->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
|
||||
|
@ -201,10 +201,10 @@ gst_compare_init (GstCompare * comp, GstCompareClass * klass)
|
|||
gst_pad_set_getcaps_function (comp->checkpad, gst_compare_getcaps);
|
||||
gst_element_add_pad (GST_ELEMENT (comp), comp->checkpad);
|
||||
|
||||
gst_collect_pads_add_pad_full (comp->cpads, comp->sinkpad,
|
||||
sizeof (GstCollectData), NULL);
|
||||
gst_collect_pads_add_pad_full (comp->cpads, comp->checkpad,
|
||||
sizeof (GstCollectData), NULL);
|
||||
gst_collect_pads2_add_pad_full (comp->cpads, comp->sinkpad,
|
||||
sizeof (GstCollectData2), NULL, TRUE);
|
||||
gst_collect_pads2_add_pad_full (comp->cpads, comp->checkpad,
|
||||
sizeof (GstCollectData2), NULL, TRUE);
|
||||
|
||||
comp->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
|
||||
gst_pad_set_getcaps_function (comp->srcpad, gst_compare_getcaps);
|
||||
|
@ -537,14 +537,14 @@ gst_compare_buffers (GstCompare * comp, GstBuffer * buf1, GstBuffer * buf2)
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_compare_collect_pads (GstCollectPads * cpads, GstCompare * comp)
|
||||
gst_compare_collect_pads (GstCollectPads2 * cpads, GstCompare * comp)
|
||||
{
|
||||
GstBuffer *buf1, *buf2;
|
||||
|
||||
buf1 = gst_collect_pads_pop (comp->cpads,
|
||||
buf1 = gst_collect_pads2_pop (comp->cpads,
|
||||
gst_pad_get_element_private (comp->sinkpad));
|
||||
|
||||
buf2 = gst_collect_pads_pop (comp->cpads,
|
||||
buf2 = gst_collect_pads2_pop (comp->cpads,
|
||||
gst_pad_get_element_private (comp->checkpad));
|
||||
|
||||
if (!buf1 && !buf2) {
|
||||
|
@ -636,10 +636,10 @@ gst_compare_change_state (GstElement * element, GstStateChange transition)
|
|||
switch (transition) {
|
||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
gst_collect_pads_start (comp->cpads);
|
||||
gst_collect_pads2_start (comp->cpads);
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
gst_collect_pads_stop (comp->cpads);
|
||||
gst_collect_pads2_stop (comp->cpads);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -52,7 +52,7 @@ struct _GstCompare {
|
|||
GstPad *sinkpad;
|
||||
GstPad *checkpad;
|
||||
|
||||
GstCollectPads *cpads;
|
||||
GstCollectPads2 *cpads;
|
||||
|
||||
gint count;
|
||||
|
||||
|
|
Loading…
Reference in a new issue