gst_pad_use_fixed_caps (asfmux->srcpad);
gst_element_add_pad (GST_ELEMENT (asfmux), asfmux->srcpad);
- asfmux->collect = gst_collect_pads2_new ();
- gst_collect_pads2_set_function (asfmux->collect,
- (GstCollectPads2Function) GST_DEBUG_FUNCPTR (gst_asf_mux_collected),
+ asfmux->collect = gst_collect_pads_new ();
+ gst_collect_pads_set_function (asfmux->collect,
+ (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_asf_mux_collected),
asfmux);
asfmux->payloads = NULL;
AsfPayload *payload;
payload = g_malloc0 (sizeof (AsfPayload));
- payload->pad = (GstCollectData2 *) pad;
+ payload->pad = (GstCollectData *) pad;
payload->data = buf;
GST_LOG_OBJECT (asfmux,
}
static GstFlowReturn
-gst_asf_mux_collected (GstCollectPads2 * collect, gpointer data)
+gst_asf_mux_collected (GstCollectPads * collect, gpointer data)
{
GstAsfMux *asfmux = GST_ASF_MUX_CAST (data);
GstFlowReturn ret = GST_FLOW_OK;
walk = asfmux->collect->data;
while (walk) {
GstAsfPad *pad;
- GstCollectData2 *data;
+ GstCollectData *data;
GstClockTime time;
- data = (GstCollectData2 *) walk->data;
+ data = (GstCollectData *) walk->data;
pad = (GstAsfPad *) data;
walk = g_slist_next (walk);
- buf = gst_collect_pads2_peek (collect, data);
+ buf = gst_collect_pads_peek (collect, data);
if (buf == NULL) {
GST_LOG_OBJECT (asfmux, "Pad %s has no buffers",
GST_PAD_NAME (pad->collect.pad));
/* we have data */
GST_LOG_OBJECT (asfmux, "selected pad %s with time %" GST_TIME_FORMAT,
GST_PAD_NAME (best_pad->collect.pad), GST_TIME_ARGS (best_time));
- buf = gst_collect_pads2_pop (collect, &best_pad->collect);
+ buf = gst_collect_pads_pop (collect, &best_pad->collect);
ret = gst_asf_mux_process_buffer (asfmux, best_pad, buf);
} else {
/* no data, let's finish it up */
collect_size = sizeof (GstAsfVideoPad);
}
collect_pad = (GstAsfPad *)
- gst_collect_pads2_add_pad_full (asfmux->collect, newpad, collect_size,
- (GstCollectData2DestroyNotify) (gst_asf_mux_pad_reset), TRUE);
+ gst_collect_pads_add_pad_full (asfmux->collect, newpad, collect_size,
+ (GstCollectDataDestroyNotify) (gst_asf_mux_pad_reset), TRUE);
/* set up pad */
collect_pad->is_audio = is_audio;
collect_pad->stream_number = asfmux->stream_number;
/* FIXME: hacked way to override/extend the event function of
- * GstCollectPads2; because it sets its own event function giving
+ * GstCollectPads; because it sets its own event function giving
* the element no access to events.
*/
asfmux->collect_event = (GstPadEventFunction) GST_PAD_EVENTFUNC (newpad);
asfmux->packet_size = asfmux->prop_packet_size;
asfmux->preroll = asfmux->prop_preroll;
asfmux->merge_stream_tags = asfmux->prop_merge_stream_tags;
- gst_collect_pads2_start (asfmux->collect);
+ gst_collect_pads_start (asfmux->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- gst_collect_pads2_stop (asfmux->collect);
+ gst_collect_pads_stop (asfmux->collect);
asfmux->state = GST_ASF_MUX_STATE_NONE;
break;
default:
#include <gst/gst.h>
-#include <gst/base/gstcollectpads2.h>
+#include <gst/base/gstcollectpads.h>
#include <gst/riff/riff-media.h>
#include "gstasfobjects.h"
struct _GstAsfPad
{
- GstCollectData2 collect;
+ GstCollectData collect;
gboolean is_audio;
guint8 stream_number;
/* pads */
GstPad *srcpad;
- GstCollectPads2 *collect;
+ GstCollectPads *collect;
GstPadEventFunction collect_event;
};
#include <glib.h>
#include <gst/gst.h>
#include <gst/base/gstbytereader.h>
-#include <gst/base/gstcollectpads2.h>
+#include <gst/base/gstcollectpads.h>
#define ASF_PAYLOAD_IS_KEYFRAME(pay) ((pay->stream_number & 0x80) != 0)
#define ASF_MILI_TO_100NANO(v) (v * 10000)
guint32 presentation_time;
GstBuffer *data;
- GstCollectData2 *pad;
+ GstCollectData *pad;
/* simple index info */
gboolean has_packet_info;
#include <string.h>
#include <gst/gst.h>
-#include <gst/base/gstcollectpads2.h>
+#include <gst/base/gstcollectpads.h>
#include <gst/video/video.h>
#include "gstcompare.h"
static gboolean gst_compare_query (GstPad * pad, GstObject * parent,
GstQuery * query);
-static GstFlowReturn gst_compare_collect_pads (GstCollectPads2 * cpads,
+static GstFlowReturn gst_compare_collect_pads (GstCollectPads * cpads,
GstCompare * comp);
static GstStateChangeReturn gst_compare_change_state (GstElement * element,
static void
gst_compare_init (GstCompare * comp)
{
- comp->cpads = gst_collect_pads2_new ();
- gst_collect_pads2_set_function (comp->cpads,
- (GstCollectPads2Function) GST_DEBUG_FUNCPTR (gst_compare_collect_pads),
+ comp->cpads = gst_collect_pads_new ();
+ gst_collect_pads_set_function (comp->cpads,
+ (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_compare_collect_pads),
comp);
comp->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
gst_pad_set_query_function (comp->checkpad, gst_compare_query);
gst_element_add_pad (GST_ELEMENT (comp), comp->checkpad);
- 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);
+ gst_collect_pads_add_pad_full (comp->cpads, comp->sinkpad,
+ sizeof (GstCollectData), NULL, TRUE);
+ gst_collect_pads_add_pad_full (comp->cpads, comp->checkpad,
+ sizeof (GstCollectData), NULL, TRUE);
comp->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
gst_pad_set_query_function (comp->srcpad, gst_compare_query);
}
static GstFlowReturn
-gst_compare_collect_pads (GstCollectPads2 * cpads, GstCompare * comp)
+gst_compare_collect_pads (GstCollectPads * cpads, GstCompare * comp)
{
GstBuffer *buf1, *buf2;
GstCaps *caps1, *caps2;
- buf1 = gst_collect_pads2_pop (comp->cpads,
+ buf1 = gst_collect_pads_pop (comp->cpads,
gst_pad_get_element_private (comp->sinkpad));
caps1 = gst_pad_get_current_caps (comp->sinkpad);
- buf2 = gst_collect_pads2_pop (comp->cpads,
+ buf2 = gst_collect_pads_pop (comp->cpads,
gst_pad_get_element_private (comp->checkpad));
caps2 = gst_pad_get_current_caps (comp->checkpad);
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
case GST_STATE_CHANGE_READY_TO_PAUSED:
- gst_collect_pads2_start (comp->cpads);
+ gst_collect_pads_start (comp->cpads);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- gst_collect_pads2_stop (comp->cpads);
+ gst_collect_pads_stop (comp->cpads);
break;
default:
break;
GstPad *sinkpad;
GstPad *checkpad;
- GstCollectPads2 *cpads;
+ GstCollectPads *cpads;
gint count;
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
- gst_collect_pads2_start (self->collect);
+ gst_collect_pads_start (self->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
}
/* Stop before calling the parent's state change function as
- * GstCollectPads2 might take locks and we would deadlock in that
+ * GstCollectPads might take locks and we would deadlock in that
* case
*/
if (transition == GST_STATE_CHANGE_PAUSED_TO_READY)
- gst_collect_pads2_stop (self->collect);
+ gst_collect_pads_stop (self->collect);
ret =
GST_ELEMENT_CLASS (g_type_class_peek_parent (klass))->change_state
/* check if we are flushing */
if (flags & GST_SEEK_FLAG_FLUSH) {
/* make sure we accept nothing anymore and return WRONG_STATE */
- gst_collect_pads2_set_flushing (self->collect, TRUE);
+ gst_collect_pads_set_flushing (self->collect, TRUE);
/* flushing seek, start flush downstream, the flush will be done
* when all pads received a FLUSH_STOP. */
break;
}
- /* now GstCollectPads2 can take care of the rest, e.g. EOS */
+ /* now GstCollectPads can take care of the rest, e.g. EOS */
ret = self->collect_event (pad, event);
gst_object_unref (self);
}
static GstFlowReturn
-gst_frei0r_mixer_collected (GstCollectPads2 * pads, GstFrei0rMixer * self)
+gst_frei0r_mixer_collected (GstCollectPads * pads, GstFrei0rMixer * self)
{
GstBuffer *inbuf0 = NULL, *inbuf1 = NULL, *inbuf2 = NULL;
GstBuffer *outbuf = NULL;
return ret;
for (l = pads->data; l; l = l->next) {
- GstCollectData2 *cdata = l->data;
+ GstCollectData *cdata = l->data;
if (cdata->pad == self->sink0) {
- inbuf0 = gst_collect_pads2_pop (pads, cdata);
+ inbuf0 = gst_collect_pads_pop (pads, cdata);
segment = &cdata->segment;
} else if (cdata->pad == self->sink1) {
- inbuf1 = gst_collect_pads2_pop (pads, cdata);
+ inbuf1 = gst_collect_pads_pop (pads, cdata);
} else if (cdata->pad == self->sink2) {
- inbuf2 = gst_collect_pads2_pop (pads, cdata);
+ inbuf2 = gst_collect_pads_pop (pads, cdata);
}
}
self->property_cache =
gst_frei0r_property_cache_init (klass->properties, klass->n_properties);
- self->collect = gst_collect_pads2_new ();
- gst_collect_pads2_set_function (self->collect,
- (GstCollectPads2Function) gst_frei0r_mixer_collected, self);
+ self->collect = gst_collect_pads_new ();
+ gst_collect_pads_set_function (self->collect,
+ (GstCollectPadsFunction) gst_frei0r_mixer_collected, self);
self->src =
gst_pad_new_from_template (gst_element_class_get_pad_template
GST_DEBUG_FUNCPTR (gst_frei0r_mixer_set_caps));
gst_pad_set_query_function (self->sink0,
GST_DEBUG_FUNCPTR (gst_frei0r_mixer_sink_query));
- gst_collect_pads2_add_pad (self->collect, self->sink0,
- sizeof (GstCollectData2));
+ gst_collect_pads_add_pad (self->collect, self->sink0,
+ sizeof (GstCollectData));
self->collect_event = (GstPadEventFunction) GST_PAD_EVENTFUNC (self->sink0);
gst_pad_set_event_function (self->sink0,
GST_DEBUG_FUNCPTR (gst_frei0r_mixer_sink0_event));
GST_DEBUG_FUNCPTR (gst_frei0r_mixer_set_caps));
gst_pad_set_query_function (self->sink0,
GST_DEBUG_FUNCPTR (gst_frei0r_mixer_sink_query));
- gst_collect_pads2_add_pad (self->collect, self->sink1,
- sizeof (GstCollectData2));
+ gst_collect_pads_add_pad (self->collect, self->sink1,
+ sizeof (GstCollectData));
gst_element_add_pad (GST_ELEMENT_CAST (self), self->sink1);
if (klass->info->plugin_type == F0R_PLUGIN_TYPE_MIXER3) {
GST_DEBUG_FUNCPTR (gst_frei0r_mixer_set_caps));
gst_pad_set_query_function (self->sink0,
GST_DEBUG_FUNCPTR (gst_frei0r_mixer_sink_query));
- gst_collect_pads2_add_pad (self->collect, self->sink2,
- sizeof (GstCollectData2));
+ gst_collect_pads_add_pad (self->collect, self->sink2,
+ sizeof (GstCollectData));
gst_element_add_pad (GST_ELEMENT_CAST (self), self->sink2);
}
#include <gst/gst.h>
#include <gst/video/video.h>
-#include <gst/base/gstcollectpads2.h>
+#include <gst/base/gstcollectpads.h>
#include "frei0r.h"
#include "gstfrei0r.h"
struct _GstFrei0rMixer {
GstElement parent;
- GstCollectPads2 *collect;
+ GstCollectPads *collect;
GstPad *src;
GstPad *sink0, *sink1, *sink2;
static void release_buffer_cb (guint8 * data, void *user_data);
static gboolean mpegpsdemux_prepare_srcpad (MpegPsMux * mux);
-static GstFlowReturn mpegpsmux_collected (GstCollectPads2 * pads,
+static GstFlowReturn mpegpsmux_collected (GstCollectPads * pads,
MpegPsMux * mux);
static GstPad *mpegpsmux_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name);
gst_pad_use_fixed_caps (mux->srcpad);
gst_element_add_pad (GST_ELEMENT (mux), mux->srcpad);
- mux->collect = gst_collect_pads2_new ();
- gst_collect_pads2_set_function (mux->collect,
- (GstCollectPads2Function) GST_DEBUG_FUNCPTR (mpegpsmux_collected), mux);
+ mux->collect = gst_collect_pads_new ();
+ gst_collect_pads_set_function (mux->collect,
+ (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (mpegpsmux_collected), mux);
mux->psmux = psmux_new ();
psmux_set_write_func (mux->psmux, new_packet_cb, mux);
/* Create the streams */
while (walk) {
- GstCollectData2 *c_data = (GstCollectData2 *) walk->data;
+ GstCollectData *c_data = (GstCollectData *) walk->data;
MpegPsPadData *ps_data = (MpegPsPadData *) walk->data;
walk = g_slist_next (walk);
/* Choose from which stream to mux with */
MpegPsPadData *best = NULL;
- GstCollectData2 *c_best = NULL;
+ GstCollectData *c_best = NULL;
GSList *walk;
for (walk = mux->collect->data; walk != NULL; walk = g_slist_next (walk)) {
- GstCollectData2 *c_data = (GstCollectData2 *) walk->data;
+ GstCollectData *c_data = (GstCollectData *) walk->data;
MpegPsPadData *ps_data = (MpegPsPadData *) walk->data;
if (ps_data->eos == FALSE) {
GstBuffer *buf;
ps_data->queued_buf = buf =
- gst_collect_pads2_peek (mux->collect, c_data);
+ gst_collect_pads_peek (mux->collect, c_data);
if (buf != NULL) {
if (ps_data->prepare_func) {
}
}
if (c_best) {
- gst_buffer_unref (gst_collect_pads2_pop (mux->collect, c_best));
+ gst_buffer_unref (gst_collect_pads_pop (mux->collect, c_best));
}
return best;
}
static GstFlowReturn
-mpegpsmux_collected (GstCollectPads2 * pads, MpegPsMux * mux)
+mpegpsmux_collected (GstCollectPads * pads, MpegPsMux * mux)
{
/* main muxing function */
pad = gst_pad_new_from_template (templ, name);
- pad_data = (MpegPsPadData *) gst_collect_pads2_add_pad (mux->collect, pad,
+ pad_data = (MpegPsPadData *) gst_collect_pads_add_pad (mux->collect, pad,
sizeof (MpegPsPadData));
if (pad_data == NULL)
goto pad_failure;
could_not_add:
GST_ELEMENT_ERROR (element, STREAM, FAILED,
("Internal data stream error."), ("Could not add pad to element"));
- gst_collect_pads2_remove_pad (mux->collect, pad);
+ gst_collect_pads_remove_pad (mux->collect, pad);
gst_object_unref (pad);
return NULL;
pad_failure:
mux->video_stream_id = 0;
GST_OBJECT_UNLOCK (pad);
- gst_collect_pads2_remove_pad (mux->collect, pad);
+ gst_collect_pads_remove_pad (mux->collect, pad);
}
static void
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
- gst_collect_pads2_start (mux->collect);
+ gst_collect_pads_start (mux->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- gst_collect_pads2_stop (mux->collect);
+ gst_collect_pads_stop (mux->collect);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
break;
#define __MPEGPSMUX_H__
#include <gst/gst.h>
-#include <gst/base/gstcollectpads2.h>
+#include <gst/base/gstcollectpads.h>
#include <gst/base/gstadapter.h>
G_BEGIN_DECLS
guint video_stream_id; /* stream id of primary video stream */
- GstCollectPads2 *collect; /* pads collector */
+ GstCollectPads *collect; /* pads collector */
PsMux *psmux;
};
struct MpegPsPadData {
- GstCollectData2 collect; /* Parent */
+ GstCollectData collect; /* Parent */
guint8 stream_id;
guint8 stream_id_ext;
static void release_buffer_cb (guint8 * data, void *user_data);
static void mpegtsdemux_prepare_srcpad (MpegTsMux * mux);
-static GstFlowReturn mpegtsmux_collected (GstCollectPads2 * pads,
+static GstFlowReturn mpegtsmux_collected (GstCollectPads * pads,
MpegTsMux * mux);
static GstPad *mpegtsmux_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name);
gst_pad_set_event_function (mux->srcpad, mpegtsmux_src_event);
gst_element_add_pad (GST_ELEMENT (mux), mux->srcpad);
- mux->collect = gst_collect_pads2_new ();
- gst_collect_pads2_set_function (mux->collect,
- (GstCollectPads2Function) GST_DEBUG_FUNCPTR (mpegtsmux_collected), mux);
+ mux->collect = gst_collect_pads_new ();
+ gst_collect_pads_set_function (mux->collect,
+ (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (mpegtsmux_collected), mux);
mux->tsmux = tsmux_new ();
tsmux_set_write_func (mux->tsmux, new_packet_cb, mux);
/* Create the streams */
while (walk) {
- GstCollectData2 *c_data = (GstCollectData2 *) walk->data;
+ GstCollectData *c_data = (GstCollectData *) walk->data;
MpegTsPadData *ts_data = (MpegTsPadData *) walk->data;
gchar *name = NULL;
mpegtsmux_choose_best_stream (MpegTsMux * mux)
{
MpegTsPadData *best = NULL;
- GstCollectData2 *c_best = NULL;
+ GstCollectData *c_best = NULL;
GSList *walk;
for (walk = mux->collect->data; walk != NULL; walk = g_slist_next (walk)) {
- GstCollectData2 *c_data = (GstCollectData2 *) walk->data;
+ GstCollectData *c_data = (GstCollectData *) walk->data;
MpegTsPadData *ts_data = (MpegTsPadData *) walk->data;
if (ts_data->eos == FALSE) {
GstBuffer *buf;
ts_data->queued_buf = buf =
- gst_collect_pads2_peek (mux->collect, c_data);
+ gst_collect_pads_peek (mux->collect, c_data);
if (buf != NULL) {
if (ts_data->prepare_func) {
}
if (c_best) {
GstBuffer *buffer;
- if ((buffer = gst_collect_pads2_pop (mux->collect, c_best)))
+ if ((buffer = gst_collect_pads_pop (mux->collect, c_best)))
gst_buffer_unref (buffer);
}
return best;
}
-#define COLLECT_DATA_PAD(collect_data) (((GstCollectData2 *)(collect_data))->pad)
+#define COLLECT_DATA_PAD(collect_data) (((GstCollectData *)(collect_data))->pad)
static gboolean
mpegtsmux_sink_event (GstPad * pad, GstEvent * event)
}
static GstFlowReturn
-mpegtsmux_collected (GstCollectPads2 * pads, MpegTsMux * mux)
+mpegtsmux_collected (GstCollectPads * pads, MpegTsMux * mux)
{
GstFlowReturn ret = GST_FLOW_OK;
MpegTsPadData *best = NULL;
pad = gst_pad_new_from_template (templ, pad_name);
g_free (pad_name);
- pad_data = (MpegTsPadData *) gst_collect_pads2_add_pad (mux->collect, pad,
+ pad_data = (MpegTsPadData *) gst_collect_pads_add_pad (mux->collect, pad,
sizeof (MpegTsPadData));
if (pad_data == NULL)
goto pad_failure;
could_not_add:
GST_ELEMENT_ERROR (element, STREAM, FAILED,
("Internal data stream error."), ("Could not add pad to element"));
- gst_collect_pads2_remove_pad (mux->collect, pad);
+ gst_collect_pads_remove_pad (mux->collect, pad);
gst_object_unref (pad);
return NULL;
pad_failure:
GST_DEBUG_OBJECT (mux, "Pad %" GST_PTR_FORMAT " being released", pad);
if (mux->collect) {
- gst_collect_pads2_remove_pad (mux->collect, pad);
+ gst_collect_pads_remove_pad (mux->collect, pad);
}
/* chain up */
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
- gst_collect_pads2_start (mux->collect);
+ gst_collect_pads_start (mux->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- gst_collect_pads2_stop (mux->collect);
+ gst_collect_pads_stop (mux->collect);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
if (mux->adapter)
#define __MPEGTSMUX_H__
#include <gst/gst.h>
-#include <gst/base/gstcollectpads2.h>
+#include <gst/base/gstcollectpads.h>
#include <gst/base/gstadapter.h>
G_BEGIN_DECLS
GstPad *srcpad;
- GstCollectPads2 *collect;
+ GstCollectPads *collect;
TsMux *tsmux;
TsMuxProgram **programs;
#define MPEG_TS_PAD_DATA(data) ((MpegTsPadData *)(data))
struct MpegTsPadData {
- GstCollectData2 collect; /* Parent */
+ GstCollectData collect; /* Parent */
gint pid;
TsMuxStream *stream;
gst_caps_unref (caps);
gst_element_add_pad (GST_ELEMENT (mux), mux->srcpad);
- mux->collect = gst_collect_pads2_new ();
- gst_collect_pads2_set_function (mux->collect,
- (GstCollectPads2Function) GST_DEBUG_FUNCPTR (gst_mxf_mux_collected), mux);
+ mux->collect = gst_collect_pads_new ();
+ gst_collect_pads_set_function (mux->collect,
+ (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_mxf_mux_collected), mux);
gst_mxf_mux_reset (mux);
}
g_object_unref (cpad->adapter);
g_free (cpad->mapping_data);
- gst_collect_pads2_remove_pad (mux->collect, cpad->collect.pad);
+ gst_collect_pads_remove_pad (mux->collect, cpad->collect.pad);
}
mux->state = GST_MXF_MUX_STATE_HEADER;
break;
}
- /* now GstCollectPads2 can take care of the rest, e.g. EOS */
+ /* now GstCollectPads can take care of the rest, e.g. EOS */
if (ret)
ret = mux->collect_event (pad, event);
gst_object_unref (mux);
pad = gst_pad_new_from_template (templ, name);
g_free (name);
cpad = (GstMXFMuxPad *)
- gst_collect_pads2_add_pad (mux->collect, pad, sizeof (GstMXFMuxPad));
+ gst_collect_pads_add_pad (mux->collect, pad, sizeof (GstMXFMuxPad));
cpad->last_timestamp = 0;
cpad->adapter = gst_adapter_new ();
cpad->writer = writer;
/* FIXME: hacked way to override/extend the event function of
- * GstCollectPads2; because it sets its own event function giving the
+ * GstCollectPads; because it sets its own event function giving the
* element no access to events.
*/
mux->collect_event = (GstPadEventFunction) GST_PAD_EVENTFUNC (pad);
g_object_unref (cpad->adapter);
g_free (cpad->mapping_data);
- gst_collect_pads2_remove_pad (mux->collect, pad);
+ gst_collect_pads_remove_pad (mux->collect, pad);
gst_element_remove_pad (element, pad); */
}
GstBuffer *packet;
GstFlowReturn ret = GST_FLOW_OK;
guint8 slen, ber[9];
- gboolean flush = ((cpad->collect.state & GST_COLLECT_PADS2_STATE_EOS)
+ gboolean flush = ((cpad->collect.state & GST_COLLECT_PADS_STATE_EOS)
&& !cpad->have_complete_edit_unit && cpad->collect.buffer == NULL);
if (cpad->have_complete_edit_unit) {
cpad->source_track->parent.track_id, cpad->pos);
buf = NULL;
} else if (!flush) {
- buf = gst_collect_pads2_pop (mux->collect, &cpad->collect);
+ buf = gst_collect_pads_pop (mux->collect, &cpad->collect);
}
if (buf) {
}
static GstFlowReturn
-gst_mxf_mux_collected (GstCollectPads2 * pads, gpointer user_data)
+gst_mxf_mux_collected (GstCollectPads * pads, gpointer user_data)
{
GstMXFMux *mux = GST_MXF_MUX (user_data);
GstMXFMuxPad *best = NULL;
gst_util_uint64_scale ((mux->last_gc_position + 1) * GST_SECOND,
mux->min_edit_rate.d, mux->min_edit_rate.n);
- pad_eos = cpad->collect.state & GST_COLLECT_PADS2_STATE_EOS;
+ pad_eos = cpad->collect.state & GST_COLLECT_PADS_STATE_EOS;
if (!pad_eos)
eos = FALSE;
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
- gst_collect_pads2_start (mux->collect);
+ gst_collect_pads_start (mux->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- gst_collect_pads2_stop (mux->collect);
+ gst_collect_pads_stop (mux->collect);
break;
default:
break;
#include <gst/gst.h>
#include <gst/base/gstadapter.h>
-#include <gst/base/gstcollectpads2.h>
+#include <gst/base/gstcollectpads.h>
#include "mxfessence.h"
typedef struct
{
- GstCollectData2 collect;
+ GstCollectData collect;
guint64 pos;
GstClockTime last_timestamp;
GstElement element;
GstPad *srcpad;
- GstCollectPads2 *collect;
+ GstCollectPads *collect;
/* <private> */
GstPadEventFunction collect_event;
static GstStateChangeReturn gst_ssim_change_state (GstElement * element,
GstStateChange transition);
-static GstFlowReturn gst_ssim_collected (GstCollectPads2 * pads,
+static GstFlowReturn gst_ssim_collected (GstCollectPads * pads,
gpointer user_data);
static GstElementClass *parent_class = NULL;
/* check if we are flushing */
if (flags & GST_SEEK_FLAG_FLUSH) {
/* make sure we accept nothing anymore and return WRONG_STATE */
- gst_collect_pads2_set_flushing (ssim->collect, TRUE);
+ gst_collect_pads_set_flushing (ssim->collect, TRUE);
/* flushing seek, start flush downstream, the flush will be done
* when all pads received a FLUSH_STOP. */
break;
}
- /* now GstCollectPads2 can take care of the rest, e.g. EOS */
+ /* now GstCollectPads can take care of the rest, e.g. EOS */
GST_DEBUG ("Dispatching %s event on pad %s:%s", GST_EVENT_TYPE_NAME (event),
GST_DEBUG_PAD_NAME (pad));
ret = ssim->collect_event (pad, event);
gst_pad_set_getcaps_function (newpad,
GST_DEBUG_FUNCPTR (gst_ssim_sink_getcaps));
gst_pad_set_setcaps_function (newpad, GST_DEBUG_FUNCPTR (gst_ssim_setcaps));
- gst_collect_pads2_add_pad (ssim->collect, newpad, sizeof (GstCollectData2));
+ gst_collect_pads_add_pad (ssim->collect, newpad, sizeof (GstCollectData));
/* FIXME: hacked way to override/extend the event function of
- * GstCollectPads2; because it sets its own event function giving the
+ * GstCollectPads; because it sets its own event function giving the
* element no access to events
*/
GST_DEBUG_OBJECT (ssim, "Current collect_event is %p, changing to %p",
could_not_add_sink:
{
GST_DEBUG_OBJECT (ssim, "could not add sink pad");
- gst_collect_pads2_remove_pad (ssim->collect, newpad);
+ gst_collect_pads_remove_pad (ssim->collect, newpad);
gst_object_unref (newpad);
return NULL;
}
GST_DEBUG_OBJECT (ssim, "release pad %s:%s", GST_DEBUG_PAD_NAME (pad));
- gst_collect_pads2_remove_pad (ssim->collect, pad);
+ gst_collect_pads_remove_pad (ssim->collect, pad);
gst_element_remove_pad (element, pad);
}
ssim->sinkcaps = NULL;
/* keep track of the sinkpads requested */
- ssim->collect = gst_collect_pads2_new ();
- gst_collect_pads2_set_function (ssim->collect,
+ ssim->collect = gst_collect_pads_new ();
+ gst_collect_pads_set_function (ssim->collect,
GST_DEBUG_FUNCPTR (gst_ssim_collected), ssim);
}
}
static GstFlowReturn
-gst_ssim_collected (GstCollectPads2 * pads, gpointer user_data)
+gst_ssim_collected (GstCollectPads * pads, gpointer user_data)
{
GstSSim *ssim;
GSList *collected;
}
for (collected = pads->data; collected; collected = g_slist_next (collected)) {
- GstCollectData2 *collect_data;
+ GstCollectData *collect_data;
GstBuffer *inbuf;
- collect_data = (GstCollectData2 *) collected->data;
+ collect_data = (GstCollectData *) collected->data;
- inbuf = gst_collect_pads2_peek (pads, collect_data);
+ inbuf = gst_collect_pads_peek (pads, collect_data);
if (inbuf == NULL) {
GST_LOG_OBJECT (ssim, "channel %p: no bytes available", collect_data);
for (collected = pads->data; collected;
collected = g_slist_next (collected)) {
- GstCollectData2 *collect_data;
+ GstCollectData *collect_data;
- collect_data = (GstCollectData2 *) collected->data;
+ collect_data = (GstCollectData *) collected->data;
if (collect_data->pad == ssim->orig) {
- orgbuf = gst_collect_pads2_pop (pads, collect_data);;
+ orgbuf = gst_collect_pads_pop (pads, collect_data);;
GST_DEBUG_OBJECT (ssim, "Original stream - flags(0x%x), timestamp(%"
GST_TIME_FORMAT "), duration(%" GST_TIME_FORMAT ")",
GST_LOG_OBJECT (ssim, "starting to cycle through streams");
for (collected = pads->data; collected; collected = g_slist_next (collected)) {
- GstCollectData2 *collect_data;
+ GstCollectData *collect_data;
GstBuffer *inbuf;
guint8 *indata;
- collect_data = (GstCollectData2 *) collected->data;
+ collect_data = (GstCollectData *) collected->data;
if (collect_data->pad != ssim->orig) {
- inbuf = gst_collect_pads2_pop (pads, collect_data);
+ inbuf = gst_collect_pads_pop (pads, collect_data);
indata = GST_BUFFER_DATA (inbuf);
ssim->segment_position = 0;
ssim->segment_rate = 1.0;
gst_segment_init (&ssim->segment, GST_FORMAT_UNDEFINED);
- gst_collect_pads2_start (ssim->collect);
+ gst_collect_pads_start (ssim->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
/* need to unblock the collectpads before calling the
* parent change_state so that streaming can finish
*/
- gst_collect_pads2_stop (ssim->collect);
+ gst_collect_pads_stop (ssim->collect);
break;
default:
break;
#define __GST_SSIM_H__\r
\r
#include <gst/gst.h>\r
-#include <gst/base/gstcollectpads2.h>\r
+#include <gst/base/gstcollectpads.h>\r
#include <gst/video/video.h>\r
\r
G_BEGIN_DECLS\r
\r
gint padcount;\r
\r
- GstCollectPads2 *collect;\r
+ GstCollectPads *collect;\r
GstPad *orig;\r
\r
gint frame_rate;\r
ks_guid_to_string (const GUID * guid)
{
return g_strdup_printf ("{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
- guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1],
+ guid->Data1, guid->Data, guid->Data3, guid->Data4[0], guid->Data4[1],
guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5],
guid->Data4[6], guid->Data4[7]);
}
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('d', 'v', 's', 'd'),
NULL);
}
- } else if (memcmp (&subtype_guid.Data2, &MEDIASUBTYPE_FOURCC.Data2,
+ } else if (memcmp (&subtype_guid.Data, &MEDIASUBTYPE_FOURCC.Data,
sizeof (subtype_guid) - sizeof (subtype_guid.Data1)) == 0) {
guint8 *p = (guint8 *) & subtype_guid.Data1;
if (!structure) {
GST_DEBUG ("Unknown DirectShow Video GUID %08x-%04x-%04x-%04x-%08x%04x",
- subtype_guid.Data1, subtype_guid.Data2, subtype_guid.Data3,
+ subtype_guid.Data1, subtype_guid.Data, subtype_guid.Data3,
*(WORD *) subtype_guid.Data4, *(DWORD *) & subtype_guid.Data4[2],
*(WORD *) & subtype_guid.Data4[6]);
}