mpegtsdemux,tsdemux: Add byte-stream to h264 caps

Fixes #606662.
This commit is contained in:
David Schleef 2011-04-24 16:42:03 -07:00
parent 50e1a73bbc
commit 40f3b4a651
2 changed files with 17 additions and 9 deletions

View file

@ -110,7 +110,8 @@ enum
"video/mpeg, " \ "video/mpeg, " \
"mpegversion = (int) { 1, 2, 4 }, " \ "mpegversion = (int) { 1, 2, 4 }, " \
"systemstream = (boolean) FALSE; " \ "systemstream = (boolean) FALSE; " \
"video/x-h264;" \ "video/x-h264,stream-format=(string)byte-stream," \
"alignment=(string)nal;" \
"video/x-dirac;" \ "video/x-dirac;" \
"video/x-wmv," \ "video/x-wmv," \
"wmvversion = (int) 3, " \ "wmvversion = (int) 3, " \
@ -697,7 +698,9 @@ gst_mpegts_demux_fill_stream (GstMpegTSStream * stream, guint8 id,
case ST_VIDEO_H264: case ST_VIDEO_H264:
template = klass->video_template; template = klass->video_template;
name = g_strdup_printf ("video_%04x", stream->PID); name = g_strdup_printf ("video_%04x", stream->PID);
caps = gst_caps_new_simple ("video/x-h264", NULL); caps = gst_caps_new_simple ("video/x-h264",
"stream-format", G_TYPE_STRING, "byte-stream",
"alignment", G_TYPE_STRING, "nal", NULL);
break; break;
case ST_VIDEO_DIRAC: case ST_VIDEO_DIRAC:
if (gst_mpegts_is_dirac_stream (stream)) { if (gst_mpegts_is_dirac_stream (stream)) {
@ -1044,8 +1047,8 @@ gst_mpegts_demux_data_cb (GstPESFilter * filter, gboolean first,
* to drop. */ * to drop. */
if (stream->PMT_pid <= MPEGTS_MAX_PID && demux->streams[stream->PMT_pid] if (stream->PMT_pid <= MPEGTS_MAX_PID && demux->streams[stream->PMT_pid]
&& demux->streams[demux->streams[stream->PMT_pid]->PMT.PCR_PID] && demux->streams[demux->streams[stream->PMT_pid]->PMT.PCR_PID]
&& demux->streams[demux->streams[stream->PMT_pid]->PMT.PCR_PID]-> && demux->streams[demux->streams[stream->PMT_pid]->PMT.
discont_PCR) { PCR_PID]->discont_PCR) {
GST_WARNING_OBJECT (demux, "middle of discont, dropping"); GST_WARNING_OBJECT (demux, "middle of discont, dropping");
goto bad_timestamp; goto bad_timestamp;
} }
@ -1067,8 +1070,8 @@ gst_mpegts_demux_data_cb (GstPESFilter * filter, gboolean first,
*/ */
if (stream->PMT_pid <= MPEGTS_MAX_PID && demux->streams[stream->PMT_pid] if (stream->PMT_pid <= MPEGTS_MAX_PID && demux->streams[stream->PMT_pid]
&& demux->streams[demux->streams[stream->PMT_pid]->PMT.PCR_PID] && demux->streams[demux->streams[stream->PMT_pid]->PMT.PCR_PID]
&& demux->streams[demux->streams[stream->PMT_pid]->PMT.PCR_PID]-> && demux->streams[demux->streams[stream->PMT_pid]->PMT.
last_PCR > 0) { PCR_PID]->last_PCR > 0) {
GST_DEBUG_OBJECT (demux, "timestamps wrapped before noticed in PCR"); GST_DEBUG_OBJECT (demux, "timestamps wrapped before noticed in PCR");
time = MPEGTIME_TO_GSTTIME (pts) + stream->base_time + time = MPEGTIME_TO_GSTTIME (pts) + stream->base_time +
MPEGTIME_TO_GSTTIME ((guint64) (1) << 33); MPEGTIME_TO_GSTTIME ((guint64) (1) << 33);

View file

@ -104,7 +104,8 @@ struct _TSDemuxStream
"video/mpeg, " \ "video/mpeg, " \
"mpegversion = (int) { 1, 2, 4 }, " \ "mpegversion = (int) { 1, 2, 4 }, " \
"systemstream = (boolean) FALSE; " \ "systemstream = (boolean) FALSE; " \
"video/x-h264;" \ "video/x-h264,stream-format=(string)byte-stream," \
"alignment=(string)nal;" \
"video/x-dirac;" \ "video/x-dirac;" \
"video/x-wmv," \ "video/x-wmv," \
"wmvversion = (int) 3, " \ "wmvversion = (int) 3, " \
@ -508,7 +509,9 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream,
if (program->program_number == 10510 && bstream->pid == 3401) { if (program->program_number == 10510 && bstream->pid == 3401) {
template = gst_static_pad_template_get (&video_template); template = gst_static_pad_template_get (&video_template);
name = g_strdup_printf ("video_%04x", bstream->pid); name = g_strdup_printf ("video_%04x", bstream->pid);
caps = gst_caps_new_simple ("video/x-h264", NULL); caps = gst_caps_new_simple ("video/x-h264",
"stream-format", G_TYPE_STRING, "byte-stream",
"alignment", G_TYPE_STRING, "nal", NULL);
} }
break; break;
case ST_HDV_AUX_V: case ST_HDV_AUX_V:
@ -548,7 +551,9 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream,
case ST_VIDEO_H264: case ST_VIDEO_H264:
template = gst_static_pad_template_get (&video_template); template = gst_static_pad_template_get (&video_template);
name = g_strdup_printf ("video_%04x", bstream->pid); name = g_strdup_printf ("video_%04x", bstream->pid);
caps = gst_caps_new_simple ("video/x-h264", NULL); caps = gst_caps_new_simple ("video/x-h264",
"stream-format", G_TYPE_STRING, "byte-stream",
"alignment", G_TYPE_STRING, "nal", NULL);
break; break;
case ST_VIDEO_DIRAC: case ST_VIDEO_DIRAC:
desc = desc =