static void gst_mxf_mux_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
-static GstFlowReturn gst_mxf_mux_collected (GstCollectPads * pads,
+static GstFlowReturn gst_mxf_mux_collected (GstCollectPads2 * pads,
gpointer user_data);
static gboolean gst_mxf_mux_handle_src_event (GstPad * pad, GstEvent * event);
gst_caps_unref (caps);
gst_element_add_pad (GST_ELEMENT (mux), mux->srcpad);
- mux->collect = gst_collect_pads_new ();
- gst_collect_pads_set_function (mux->collect,
- (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_mxf_mux_collected), mux);
+ mux->collect = gst_collect_pads2_new ();
+ gst_collect_pads2_set_function (mux->collect,
+ (GstCollectPads2Function) 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_pads_remove_pad (mux->collect, cpad->collect.pad);
+ gst_collect_pads2_remove_pad (mux->collect, cpad->collect.pad);
}
mux->state = GST_MXF_MUX_STATE_HEADER;
break;
}
- /* now GstCollectPads can take care of the rest, e.g. EOS */
+ /* now GstCollectPads2 can take care of the rest, e.g. EOS */
if (ret)
ret = mux->collect_event (pad, event);
gst_object_unref (mux);
for (i = 0; i < mux->preface->content_storage->n_packages; i++) {
MXFMetadataSourcePackage *package;
- if (!MXF_IS_METADATA_SOURCE_PACKAGE (mux->preface->content_storage->
- packages[i]))
+ if (!MXF_IS_METADATA_SOURCE_PACKAGE (mux->preface->
+ content_storage->packages[i]))
continue;
package =
- MXF_METADATA_SOURCE_PACKAGE (mux->preface->content_storage->
- packages[i]);
+ MXF_METADATA_SOURCE_PACKAGE (mux->preface->
+ content_storage->packages[i]);
if (!package->descriptor)
continue;
pad = gst_pad_new_from_template (templ, name);
g_free (name);
cpad = (GstMXFMuxPad *)
- gst_collect_pads_add_pad (mux->collect, pad, sizeof (GstMXFMuxPad));
+ gst_collect_pads2_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
- * GstCollectPads; because it sets its own event function giving the
+ * GstCollectPads2; 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_pads_remove_pad (mux->collect, pad);
+ gst_collect_pads2_remove_pad (mux->collect, pad);
gst_element_remove_pad (element, pad); */
}
if (p->parent.n_tracks == 1) {
p->descriptor = (MXFMetadataGenericDescriptor *) cpad->descriptor;
} else {
- MXF_METADATA_MULTIPLE_DESCRIPTOR (p->descriptor)->
- sub_descriptors[n] =
+ MXF_METADATA_MULTIPLE_DESCRIPTOR (p->
+ descriptor)->sub_descriptors[n] =
(MXFMetadataGenericDescriptor *) cpad->descriptor;
}
g_new0 (MXFMetadataEssenceContainerData *, 1);
cstorage->essence_container_data[0] = (MXFMetadataEssenceContainerData *)
gst_mini_object_new (MXF_TYPE_METADATA_ESSENCE_CONTAINER_DATA);
- mxf_uuid_init (&MXF_METADATA_BASE (cstorage->essence_container_data[0])->
- instance_uid, mux->metadata);
+ mxf_uuid_init (&MXF_METADATA_BASE (cstorage->
+ essence_container_data[0])->instance_uid, mux->metadata);
g_hash_table_insert (mux->metadata,
&MXF_METADATA_BASE (cstorage->essence_container_data[0])->instance_uid,
cstorage->essence_container_data[0]);
GstBuffer *packet;
GstFlowReturn ret = GST_FLOW_OK;
guint8 slen, ber[9];
- gboolean flush =
- (cpad->collect.abidata.ABI.eos && !cpad->have_complete_edit_unit
- && cpad->collect.buffer == NULL);
+ gboolean flush = ((cpad->collect.state & GST_COLLECT_PADS2_STATE_EOS)
+ && !cpad->have_complete_edit_unit && cpad->collect.buffer == NULL);
if (cpad->have_complete_edit_unit) {
GST_DEBUG_OBJECT (cpad->collect.pad,
cpad->source_track->parent.track_id, cpad->pos);
buf = NULL;
} else if (!flush) {
- buf = gst_collect_pads_pop (mux->collect, &cpad->collect);
+ buf = gst_collect_pads2_pop (mux->collect, &cpad->collect);
}
if (buf) {
/* Update durations */
cpad->source_track->parent.sequence->duration = cpad->pos;
- MXF_METADATA_SOURCE_CLIP (cpad->source_track->parent.sequence->
- structural_components[0])->parent.duration = cpad->pos;
+ MXF_METADATA_SOURCE_CLIP (cpad->source_track->parent.
+ sequence->structural_components[0])->parent.duration = cpad->pos;
for (i = 0; i < mux->preface->content_storage->packages[0]->n_tracks; i++) {
MXFMetadataTimelineTrack *track;
- if (!MXF_IS_METADATA_TIMELINE_TRACK (mux->preface->content_storage->
- packages[0]->tracks[i])
- || !MXF_IS_METADATA_SOURCE_CLIP (mux->preface->content_storage->
- packages[0]->tracks[i]->sequence->structural_components[0]))
+ if (!MXF_IS_METADATA_TIMELINE_TRACK (mux->preface->
+ content_storage->packages[0]->tracks[i])
+ || !MXF_IS_METADATA_SOURCE_CLIP (mux->preface->
+ content_storage->packages[0]->tracks[i]->sequence->
+ structural_components[0]))
continue;
track =
- MXF_METADATA_TIMELINE_TRACK (mux->preface->content_storage->
- packages[0]->tracks[i]);
- if (MXF_METADATA_SOURCE_CLIP (track->parent.sequence->
- structural_components[0])->source_track_id ==
+ MXF_METADATA_TIMELINE_TRACK (mux->preface->
+ content_storage->packages[0]->tracks[i]);
+ if (MXF_METADATA_SOURCE_CLIP (track->parent.
+ sequence->structural_components[0])->source_track_id ==
cpad->source_track->parent.track_id) {
track->parent.sequence->structural_components[0]->duration = cpad->pos;
track->parent.sequence->duration = cpad->pos;
/* Update timecode track duration */
{
MXFMetadataTimelineTrack *track =
- MXF_METADATA_TIMELINE_TRACK (mux->preface->content_storage->
- packages[0]->tracks[0]);
+ MXF_METADATA_TIMELINE_TRACK (mux->preface->
+ content_storage->packages[0]->tracks[0]);
MXFMetadataSequence *sequence = track->parent.sequence;
MXFMetadataTimecodeComponent *component =
MXF_METADATA_TIMECODE_COMPONENT (sequence->structural_components[0]);
}
static GstFlowReturn
-gst_mxf_mux_collected (GstCollectPads * pads, gpointer user_data)
+gst_mxf_mux_collected (GstCollectPads2 * pads, gpointer user_data)
{
GstMXFMux *mux = GST_MXF_MUX (user_data);
GstMXFMuxPad *best = NULL;
do {
for (sl = mux->collect->data; sl; sl = sl->next) {
+ gboolean pad_eos;
GstMXFMuxPad *cpad = sl->data;
GstClockTime next_gc_timestamp =
gst_util_uint64_scale ((mux->last_gc_position + 1) * GST_SECOND,
mux->min_edit_rate.d, mux->min_edit_rate.n);
- eos &= cpad->collect.abidata.ABI.eos;
+ pad_eos = cpad->collect.state & GST_COLLECT_PADS2_STATE_EOS;
+ if (!pad_eos)
+ eos = FALSE;
- if ((!cpad->collect.abidata.ABI.eos || cpad->have_complete_edit_unit ||
+ if ((!pad_eos || cpad->have_complete_edit_unit ||
gst_adapter_available (cpad->adapter) > 0 || cpad->collect.buffer)
&& cpad->last_timestamp < next_gc_timestamp) {
best = cpad;
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
- gst_collect_pads_start (mux->collect);
+ gst_collect_pads2_start (mux->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- gst_collect_pads_stop (mux->collect);
+ gst_collect_pads2_stop (mux->collect);
break;
default:
break;