Commit 6cf110c1 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

gst/matroska/matroska-demux.c: Improve debug output everywhere and fix the EOS logic.

Original commit message from CVS:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_reset),
(gst_matroska_demux_stream_from_num),
(gst_matroska_demux_encoding_cmp),
(gst_matroska_demux_encoding_order_unique),
(gst_matroska_demux_read_track_encoding),
(gst_matroska_demux_read_track_encodings),
(gst_matroska_demux_tracknumber_unique),
(gst_matroska_demux_add_stream), (gst_matroska_demux_init_stream),
(gst_matroska_demux_parse_tracks),
(gst_matroska_demux_parse_index_cuetrack),
(gst_matroska_demux_parse_index_pointentry),
(gst_matroska_demux_parse_index), (gst_matroska_demux_parse_info),
(gst_matroska_demux_parse_metadata_id_simple_tag),
(gst_matroska_demux_parse_metadata_id_tag),
(gst_matroska_demux_parse_metadata),
(gst_matroska_demux_parse_attached_file),
(gst_matroska_demux_parse_attachments),
(gst_matroska_demux_parse_chapters),
(gst_matroska_demux_sync_streams), (gst_matroska_decode_buffer),
(gst_matroska_demux_parse_blockgroup_or_simpleblock),
(gst_matroska_demux_parse_cluster),
(gst_matroska_demux_parse_contents_seekentry),
(gst_matroska_demux_parse_contents),
(gst_matroska_demux_loop_stream_parse_id),
(gst_matroska_demux_loop):
Improve debug output everywhere and fix the EOS logic.
Check the values of the ContentEncoding elements more strictly and
don't use tracks for which it's invalid.
Check that the track number is unique for this stream.
Check that seek positions are below G_MAXINT64 as our seeks are
int64-based and overflows will fail badly.
After seeks also don't push SimpleBlocks until the first one
containing a keyframe is found. Before this was done only for normal
Blocks.
Update some FIXME/TODOs.
* gst/matroska/ebml-read.c: (gst_ebml_read_peek_bytes),
(gst_ebml_read_utf8), (gst_ebml_read_header):
Improve debug output.
* gst/matroska/matroska-ids.c:
(gst_matroska_track_init_video_context):
* gst/matroska/matroska-ids.h:
* gst/matroska/matroska-mux.c:
(gst_matroska_mux_video_pad_setcaps):
Remove eye mode and don't parse it anymore. We can't use that
information in GStreamer yet so it's useless.
parent e3141bbb
2008-06-18 Sebastian Dröge <slomo@circular-chaos.org>
* gst/matroska/matroska-demux.c: (gst_matroska_demux_reset),
(gst_matroska_demux_stream_from_num),
(gst_matroska_demux_encoding_cmp),
(gst_matroska_demux_encoding_order_unique),
(gst_matroska_demux_read_track_encoding),
(gst_matroska_demux_read_track_encodings),
(gst_matroska_demux_tracknumber_unique),
(gst_matroska_demux_add_stream), (gst_matroska_demux_init_stream),
(gst_matroska_demux_parse_tracks),
(gst_matroska_demux_parse_index_cuetrack),
(gst_matroska_demux_parse_index_pointentry),
(gst_matroska_demux_parse_index), (gst_matroska_demux_parse_info),
(gst_matroska_demux_parse_metadata_id_simple_tag),
(gst_matroska_demux_parse_metadata_id_tag),
(gst_matroska_demux_parse_metadata),
(gst_matroska_demux_parse_attached_file),
(gst_matroska_demux_parse_attachments),
(gst_matroska_demux_parse_chapters),
(gst_matroska_demux_sync_streams), (gst_matroska_decode_buffer),
(gst_matroska_demux_parse_blockgroup_or_simpleblock),
(gst_matroska_demux_parse_cluster),
(gst_matroska_demux_parse_contents_seekentry),
(gst_matroska_demux_parse_contents),
(gst_matroska_demux_loop_stream_parse_id),
(gst_matroska_demux_loop):
Improve debug output everywhere and fix the EOS logic.
Check the values of the ContentEncoding elements more strictly and
don't use tracks for which it's invalid.
Check that the track number is unique for this stream.
Check that seek positions are below G_MAXINT64 as our seeks are
int64-based and overflows will fail badly.
After seeks also don't push SimpleBlocks until the first one
containing a keyframe is found. Before this was done only for normal
Blocks.
Update some FIXME/TODOs.
* gst/matroska/ebml-read.c: (gst_ebml_read_peek_bytes),
(gst_ebml_read_utf8), (gst_ebml_read_header):
Improve debug output.
* gst/matroska/matroska-ids.c:
(gst_matroska_track_init_video_context):
* gst/matroska/matroska-ids.h:
* gst/matroska/matroska-mux.c:
(gst_matroska_mux_video_pad_setcaps):
Remove eye mode and don't parse it anymore. We can't use that
information in GStreamer yet so it's useless.
2008-06-18 Wim Taymans <wim.taymans@collabora.co.uk>
 
Patch by: mersad <mersad at axis dot com>
......
......@@ -247,7 +247,7 @@ gst_ebml_read_peek_bytes (GstEbmlRead * ebml, guint size, GstBuffer ** p_buf,
gst_pad_pull_range (ebml->sinkpad, ebml->offset, size,
&ebml->cached_buffer);
if (ret != GST_FLOW_OK) {
GST_DEBUG ("pull_range returned %d", ret);
GST_DEBUG_OBJECT (ebml, "pull_range returned %d", ret);
if (p_buf)
*p_buf = NULL;
if (bytes)
......@@ -804,7 +804,8 @@ gst_ebml_read_utf8 (GstEbmlRead * ebml, guint32 * id, gchar ** str)
if (str != NULL && *str != NULL && **str != '\0' &&
!g_utf8_validate (*str, -1, NULL)) {
GST_WARNING ("Invalid UTF-8 string at offset %" G_GUINT64_FORMAT, oldoff);
GST_WARNING_OBJECT (ebml,
"Invalid UTF-8 string at offset %" G_GUINT64_FORMAT, oldoff);
}
return ret;
......@@ -942,6 +943,8 @@ gst_ebml_read_header (GstEbmlRead * ebml, gchar ** doctype, guint * version)
GST_ELEMENT_ERROR (ebml, STREAM, WRONG_TYPE, (NULL), (NULL));
return GST_FLOW_ERROR;
}
GST_DEBUG_OBJECT (ebml, "EbmlReadVersion: %" G_GUINT64_FORMAT, num);
break;
}
......@@ -957,6 +960,7 @@ gst_ebml_read_header (GstEbmlRead * ebml, gchar ** doctype, guint * version)
GST_ELEMENT_ERROR (ebml, STREAM, WRONG_TYPE, (NULL), (NULL));
return GST_FLOW_ERROR;
}
GST_DEBUG_OBJECT (ebml, "EbmlMaxSizeLength: %" G_GUINT64_FORMAT, num);
break;
}
......@@ -972,6 +976,7 @@ gst_ebml_read_header (GstEbmlRead * ebml, gchar ** doctype, guint * version)
GST_ELEMENT_ERROR (ebml, STREAM, WRONG_TYPE, (NULL), (NULL));
return GST_FLOW_ERROR;
}
GST_DEBUG_OBJECT (ebml, "EbmlMaxIdLength: %" G_GUINT64_FORMAT, num);
break;
}
......@@ -982,6 +987,9 @@ gst_ebml_read_header (GstEbmlRead * ebml, gchar ** doctype, guint * version)
if (ret != GST_FLOW_OK)
return ret;
g_assert (id == GST_EBML_ID_DOCTYPE);
GST_DEBUG_OBJECT (ebml, "EbmlDocType: %s", GST_STR_NULL (text));
if (doctype) {
g_free (*doctype);
*doctype = text;
......@@ -999,11 +1007,13 @@ gst_ebml_read_header (GstEbmlRead * ebml, gchar ** doctype, guint * version)
g_assert (id == GST_EBML_ID_DOCTYPEREADVERSION);
if (version)
*version = num;
GST_DEBUG_OBJECT (ebml, "EbmlReadVersion: %" G_GUINT64_FORMAT, num);
break;
}
default:
GST_WARNING ("Unknown data type 0x%x in EBML header (ignored)", id);
GST_WARNING_OBJECT (ebml,
"Unknown data type 0x%x in EBML header (ignored)", id);
/* pass-through */
/* we ignore these two, as they don't tell us anything we care about */
......
This diff is collapsed.
......@@ -53,7 +53,6 @@ gst_matroska_track_init_video_context (GstMatroskaTrackContext ** p_context)
video_context->display_height = 0;
video_context->pixel_width = 0;
video_context->pixel_height = 0;
video_context->eye_mode = 0;
video_context->asr_mode = 0;
video_context->fourcc = 0;
video_context->default_fps = 0.0;
......
......@@ -429,13 +429,6 @@ typedef enum {
GST_MATROSKA_TRACK_TYPE_CONTROL = 0x20,
} GstMatroskaTrackType;
typedef enum {
GST_MATROSKA_EYE_MODE_MONO = 0x0,
GST_MATROSKA_EYE_MODE_RIGHT = 0x1,
GST_MATROSKA_EYE_MODE_LEFT = 0x2,
GST_MATROSKA_EYE_MODE_BOTH = 0x3,
} GstMatroskaEyeMode;
typedef enum {
GST_MATROSKA_ASPECT_RATIO_MODE_FREE = 0x0,
GST_MATROSKA_ASPECT_RATIO_MODE_KEEP = 0x1,
......@@ -512,7 +505,6 @@ typedef struct _GstMatroskaTrackVideoContext {
guint pixel_width, pixel_height;
guint display_width, display_height;
gdouble default_fps;
GstMatroskaEyeMode eye_mode;
GstMatroskaAspectRatioMode asr_mode;
guint32 fourcc;
} GstMatroskaTrackVideoContext;
......
......@@ -589,7 +589,6 @@ gst_matroska_mux_video_pad_setcaps (GstPad * pad, GstCaps * caps)
skip_details:
videocontext->asr_mode = GST_MATROSKA_ASPECT_RATIO_MODE_FREE;
videocontext->eye_mode = GST_MATROSKA_EYE_MODE_MONO;
videocontext->fourcc = 0;
/* TODO: - check if we handle all codecs by the spec, i.e. codec private
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment