compare: port to GstCollectPads2

This commit is contained in:
Vincent Penquerc'h 2011-12-15 13:02:16 +00:00
parent 4db6f8f7f2
commit c826a197ce
2 changed files with 15 additions and 15 deletions

View file

@ -26,7 +26,7 @@
#include <string.h> #include <string.h>
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/base/gstcollectpads.h> #include <gst/base/gstcollectpads2.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstcompare.h" #include "gstcompare.h"
@ -109,7 +109,7 @@ static void gst_compare_get_property (GObject * object,
static void gst_compare_reset (GstCompare * overlay); static void gst_compare_reset (GstCompare * overlay);
static GstCaps *gst_compare_getcaps (GstPad * pad); 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); GstCompare * comp);
static GstStateChangeReturn gst_compare_change_state (GstElement * element, static GstStateChangeReturn gst_compare_change_state (GstElement * element,
@ -187,9 +187,9 @@ gst_compare_class_init (GstCompareClass * klass)
static void static void
gst_compare_init (GstCompare * comp, GstCompareClass * klass) gst_compare_init (GstCompare * comp, GstCompareClass * klass)
{ {
comp->cpads = gst_collect_pads_new (); comp->cpads = gst_collect_pads2_new ();
gst_collect_pads_set_function (comp->cpads, gst_collect_pads2_set_function (comp->cpads,
(GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_compare_collect_pads), (GstCollectPads2Function) GST_DEBUG_FUNCPTR (gst_compare_collect_pads),
comp); comp);
comp->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); 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_pad_set_getcaps_function (comp->checkpad, gst_compare_getcaps);
gst_element_add_pad (GST_ELEMENT (comp), comp->checkpad); gst_element_add_pad (GST_ELEMENT (comp), comp->checkpad);
gst_collect_pads_add_pad_full (comp->cpads, comp->sinkpad, gst_collect_pads2_add_pad_full (comp->cpads, comp->sinkpad,
sizeof (GstCollectData), NULL); sizeof (GstCollectData2), NULL, TRUE);
gst_collect_pads_add_pad_full (comp->cpads, comp->checkpad, gst_collect_pads2_add_pad_full (comp->cpads, comp->checkpad,
sizeof (GstCollectData), NULL); sizeof (GstCollectData2), NULL, TRUE);
comp->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); comp->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
gst_pad_set_getcaps_function (comp->srcpad, gst_compare_getcaps); 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 static GstFlowReturn
gst_compare_collect_pads (GstCollectPads * cpads, GstCompare * comp) gst_compare_collect_pads (GstCollectPads2 * cpads, GstCompare * comp)
{ {
GstBuffer *buf1, *buf2; GstBuffer *buf1, *buf2;
buf1 = gst_collect_pads_pop (comp->cpads, buf1 = gst_collect_pads2_pop (comp->cpads,
gst_pad_get_element_private (comp->sinkpad)); 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)); gst_pad_get_element_private (comp->checkpad));
if (!buf1 && !buf2) { if (!buf1 && !buf2) {
@ -636,10 +636,10 @@ gst_compare_change_state (GstElement * element, GstStateChange transition)
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
case GST_STATE_CHANGE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_collect_pads_start (comp->cpads); gst_collect_pads2_start (comp->cpads);
break; break;
case GST_STATE_CHANGE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_collect_pads_stop (comp->cpads); gst_collect_pads2_stop (comp->cpads);
break; break;
default: default:
break; break;

View file

@ -52,7 +52,7 @@ struct _GstCompare {
GstPad *sinkpad; GstPad *sinkpad;
GstPad *checkpad; GstPad *checkpad;
GstCollectPads *cpads; GstCollectPads2 *cpads;
gint count; gint count;