CVS Root: /cvs/gstreamer
Module: gst-plugins-bad
Changes by: slomo
Date: Wed Nov 26 2008 11:30:42 UTC
Log message:
* gst/mxf/mxfdemux.c: (gst_mxf_pad_init),
(gst_mxf_demux_reset_metadata), (gst_mxf_demux_combine_flows),
(gst_mxf_demux_handle_generic_container_essence_element):
Properly combine flow returns of the source pads.
Improve debugging and reset pad fields together with the
metadata to prevent invalid memory references.
* gst/mxf/mxfparse.c: (mxf_metadata_preface_parse):
Fix typo.
Modified files:
. : ChangeLog
gst/mxf : mxfdemux.c mxfparse.c
Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.3746&r2=1.3747
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/mxfdemux.c.diff?r1=1.8&r2=1.9
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/mxfparse.c.diff?r1=1.8&r2=1.9
====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v
retrieving revision 1.3746
retrieving revision 1.3747
diff -u -d -r1.3746 -r1.3747
--- ChangeLog 26 Nov 2008 10:37:31 -0000 1.3746
+++ ChangeLog 26 Nov 2008 11:30:26 -0000 1.3747
@@ -1,5 +1,18 @@
2008-11-26 Sebastian Dröge <[email protected]>
+ * gst/mxf/mxfdemux.c: (gst_mxf_pad_init),
+ (gst_mxf_demux_reset_metadata), (gst_mxf_demux_combine_flows),
+ (gst_mxf_demux_handle_generic_container_essence_element):
+ Properly combine flow returns of the source pads.
+
+ Improve debugging and reset pad fields together with the
+ metadata to prevent invalid memory references.
+ * gst/mxf/mxfparse.c: (mxf_metadata_preface_parse):
+ Fix typo.
+2008-11-26 Sebastian Dröge <[email protected]>
* gst/mxf/mxfaes-bwf.c:
(mxf_metadata_wave_audio_essence_descriptor_reset):
* gst/mxf/mxfmpeg.c: (mxf_metadata_mpeg_video_descriptor_reset):
Index: mxfdemux.c
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/mxf/mxfdemux.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- mxfdemux.c 25 Nov 2008 10:26:11 -0000 1.8
+++ mxfdemux.c 26 Nov 2008 11:30:28 -0000 1.9
@@ -76,6 +76,8 @@
MXFMetadataTrackType track_type;
gboolean need_segment;
+ GstFlowReturn last_flow;
guint64 essence_element_count;
MXFEssenceElementHandler handle_essence_element;
gpointer mapping_data;
@@ -130,7 +132,7 @@
static void
gst_mxf_pad_init (GstMXFPad * pad)
{
-
+ pad->last_flow = GST_FLOW_OK;
}
static gboolean gst_mxf_demux_sink_event (GstPad * pad, GstEvent * event);
@@ -182,6 +184,18 @@
demux->current_package = NULL;
+ if (demux->src) {
+ for (i = 0; i < demux->src->len; i++) {
+ GstMXFPad *pad = g_ptr_array_index (demux->src, i);
+ pad->material_track = NULL;
+ pad->material_package = NULL;
+ pad->component = NULL;
+ pad->source_track = NULL;
+ pad->source_package = NULL;
+ }
+ }
mxf_metadata_preface_reset (&demux->preface);
if (demux->identification) {
@@ -377,6 +391,40 @@
static GstFlowReturn
+gst_mxf_demux_combine_flows (GstMXFDemux * demux,
+ GstMXFPad * pad, GstFlowReturn ret)
+{
+ guint i;
+ /* store the value */
+ pad->last_flow = ret;
+ /* any other error that is not-linked can be returned right away */
+ if (ret != GST_FLOW_NOT_LINKED)
+ goto done;
+ /* only return NOT_LINKED if all other pads returned NOT_LINKED */
+ g_assert (demux->src->len != 0);
+ for (i = 0; i < demux->src->len; i++) {
+ GstMXFPad *opad = g_ptr_array_index (demux->src, i);
+ if (opad == NULL)
+ continue;
+ ret = opad->last_flow;
+ /* some other return value (must be SUCCESS but we can return
+ * other values as well) */
+ if (ret != GST_FLOW_NOT_LINKED)
+ goto done;
+ /* if we get here, all other pads were unlinked and we return
+ * NOT_LINKED then */
+done:
+ GST_LOG_OBJECT (demux, "combined return %s", gst_flow_get_name (ret));
+ return ret;
+}
+static GstFlowReturn
gst_mxf_demux_pull_range (GstMXFDemux * demux, guint64 offset,
guint size, GstBuffer ** buffer)
@@ -1224,9 +1272,8 @@
MXFMetadataEssenceContainerData, i);
for (j = 0; j < demux->content_storage.n_essence_container_data; j++) {
- if (mxf_ul_is_equal (&demux->
- content_storage.essence_container_data_uids[j],
- &data->instance_uid)) {
+ if (mxf_ul_is_equal (&demux->content_storage.
+ essence_container_data_uids[j], &data->instance_uid)) {
demux->content_storage.essence_container_data[j] = data;
break;
}
@@ -1964,6 +2011,11 @@
"Handling generic container essence element of size %u"
" at offset %" G_GUINT64_FORMAT, GST_BUFFER_SIZE (buffer), demux->offset);
+ GST_DEBUG_OBJECT (demux, " type = 0x%02x", key->u[12]);
+ GST_DEBUG_OBJECT (demux, " essence element count = 0x%02x", key->u[13]);
+ GST_DEBUG_OBJECT (demux, " essence element type = 0x%02x", key->u[14]);
+ GST_DEBUG_OBJECT (demux, " essence element number = 0x%02x", key->u[15]);
if (!demux->current_package) {
GST_ERROR_OBJECT (demux, "No package selected yet");
return GST_FLOW_ERROR;
@@ -2055,6 +2107,7 @@
if (outbuf) {
ret = gst_pad_push (GST_PAD_CAST (pad), outbuf);
+ ret = gst_mxf_demux_combine_flows (demux, pad, ret);
}
return ret;
Index: mxfparse.c
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/mxf/mxfparse.c,v
--- mxfparse.c 26 Nov 2008 10:37:33 -0000 1.8
+++ mxfparse.c 26 Nov 2008 11:30:28 -0000 1.9
@@ -769,8 +769,7 @@
if (tag_size < 8)
goto error;
len = GST_READ_UINT32_BE (tag_data);
- GST_DEBUG (" number of identifications = %u",
- preface->n_identifications);
+ GST_DEBUG (" number of identifications = %u", len);
if (len == 0)
if (GST_READ_UINT32_BE (tag_data + 4) != 16)
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.