multipartmux: port to GstCollectPads2

This commit is contained in:
Vincent Penquerc'h 2011-12-14 19:10:53 +00:00
parent c422a4e2e6
commit 738ee836f3
2 changed files with 13 additions and 13 deletions

View file

@ -88,7 +88,7 @@ static GstPad *gst_multipart_mux_request_new_pad (GstElement * element,
static GstStateChangeReturn gst_multipart_mux_change_state (GstElement *
element, GstStateChange transition);
static GstFlowReturn gst_multipart_mux_collected (GstCollectPads * pads,
static GstFlowReturn gst_multipart_mux_collected (GstCollectPads2 * pads,
GstMultipartMux * mux);
static void gst_multipart_mux_set_property (GObject * object, guint prop_id,
@ -180,9 +180,9 @@ gst_multipart_mux_init (GstMultipartMux * multipart_mux)
multipart_mux->boundary = g_strdup (DEFAULT_BOUNDARY);
multipart_mux->collect = gst_collect_pads_new ();
gst_collect_pads_set_function (multipart_mux->collect,
(GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_multipart_mux_collected),
multipart_mux->collect = gst_collect_pads2_new ();
gst_collect_pads2_set_function (multipart_mux->collect,
(GstCollectPads2Function) GST_DEBUG_FUNCPTR (gst_multipart_mux_collected),
multipart_mux);
}
@ -226,7 +226,7 @@ gst_multipart_mux_request_new_pad (GstElement * element,
GstMultipartPadData *multipartpad;
multipartpad = (GstMultipartPadData *)
gst_collect_pads_add_pad (multipart_mux->collect, newpad,
gst_collect_pads2_add_pad (multipart_mux->collect, newpad,
sizeof (GstMultipartPadData));
/* save a pointer to our data in the pad */
@ -375,7 +375,7 @@ gst_multipart_mux_queue_pads (GstMultipartMux * mux)
/* try to make sure we have a buffer from each usable pad first */
walk = mux->collect->data;
while (walk) {
GstCollectData *data = (GstCollectData *) walk->data;
GstCollectData2 *data = (GstCollectData2 *) walk->data;
GstMultipartPadData *pad = (GstMultipartPadData *) data;
walk = g_slist_next (walk);
@ -384,7 +384,7 @@ gst_multipart_mux_queue_pads (GstMultipartMux * mux)
if (pad->buffer == NULL) {
GstBuffer *buf = NULL;
buf = gst_collect_pads_pop (mux->collect, data);
buf = gst_collect_pads2_pop (mux->collect, data);
/* Store timestamp with segment_start and preroll */
if (buf && GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
@ -418,7 +418,7 @@ gst_multipart_mux_queue_pads (GstMultipartMux * mux)
* 3) push both buffers on best pad, go to 1
*/
static GstFlowReturn
gst_multipart_mux_collected (GstCollectPads * pads, GstMultipartMux * mux)
gst_multipart_mux_collected (GstCollectPads2 * pads, GstMultipartMux * mux)
{
GstMultipartPadData *best;
GstFlowReturn ret = GST_FLOW_OK;
@ -648,11 +648,11 @@ gst_multipart_mux_change_state (GstElement * element, GstStateChange transition)
multipart_mux->negotiated = FALSE;
multipart_mux->need_segment = TRUE;
GST_DEBUG_OBJECT (multipart_mux, "starting collect pads");
gst_collect_pads_start (multipart_mux->collect);
gst_collect_pads2_start (multipart_mux->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
GST_DEBUG_OBJECT (multipart_mux, "stopping collect pads");
gst_collect_pads_stop (multipart_mux->collect);
gst_collect_pads2_stop (multipart_mux->collect);
break;
default:
break;

View file

@ -23,7 +23,7 @@
#define __GST_MULTIPART_MUX__
#include <gst/gst.h>
#include <gst/base/gstcollectpads.h>
#include <gst/base/gstcollectpads2.h>
#include <string.h>
@ -42,7 +42,7 @@ typedef struct _GstMultipartMuxClass GstMultipartMuxClass;
/* all information needed for one multipart stream */
typedef struct
{
GstCollectData collect; /* we extend the CollectData */
GstCollectData2 collect; /* we extend the CollectData2 */
GstBuffer *buffer; /* the queued buffer for this pad */
GstClockTime timestamp; /* its timestamp, converted to running_time so that we can
@ -63,7 +63,7 @@ struct _GstMultipartMux
GstPad *srcpad;
/* sinkpads */
GstCollectPads *collect;
GstCollectPads2 *collect;
gint numpads;