diff options
author | Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com> | 2009-04-22 23:35:07 +0200 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-06-20 15:21:31 +0100 |
commit | 035b5f4efb4d57fccf2a5fa220c0d034f4d777a3 (patch) | |
tree | 13eb43a6ebf3465990422418fe8fd26ef8b19815 /sys/vdpau | |
parent | 17102ad0fadef83a0d8b0d807d698a104bc428b5 (diff) | |
download | gst-plugins-bad-035b5f4efb4d57fccf2a5fa220c0d034f4d777a3.tar.gz gst-plugins-bad-035b5f4efb4d57fccf2a5fa220c0d034f4d777a3.tar.bz2 gst-plugins-bad-035b5f4efb4d57fccf2a5fa220c0d034f4d777a3.zip |
vdpaumpegdec: handle broken_gop field
Diffstat (limited to 'sys/vdpau')
-rw-r--r-- | sys/vdpau/gstvdpmpegdecoder.c | 10 | ||||
-rw-r--r-- | sys/vdpau/gstvdpmpegdecoder.h | 2 | ||||
-rw-r--r-- | sys/vdpau/mpegutil.c | 15 | ||||
-rw-r--r-- | sys/vdpau/mpegutil.h | 6 |
4 files changed, 22 insertions, 11 deletions
diff --git a/sys/vdpau/gstvdpmpegdecoder.c b/sys/vdpau/gstvdpmpegdecoder.c index 978d0497..d9b74706 100644 --- a/sys/vdpau/gstvdpmpegdecoder.c +++ b/sys/vdpau/gstvdpmpegdecoder.c @@ -158,6 +158,12 @@ gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec) if (mpeg_dec->vdp_info.picture_coding_type == B_FRAME) { GstVdpBFrame *b_frame; + if (mpeg_dec->broken_gop) { + gst_buffer_unref (buffer); + mpeg_dec->broken_gop = FALSE; + return GST_FLOW_OK; + } + b_frame = g_slice_new (GstVdpBFrame); b_frame->buffer = buffer; @@ -336,6 +342,8 @@ gst_vdp_mpeg_decoder_parse_gop (GstVdpMpegDecoder * mpeg_dec, guint8 * data, if (!mpeg_util_parse_picture_gop (&gop, data, end)) return FALSE; + mpeg_dec->broken_gop = gop.broken_gop; + return TRUE; } @@ -497,6 +505,8 @@ gst_vdp_mpeg_decoder_init (GstVdpMpegDecoder * mpeg_dec, mpeg_dec->b_frames = NULL; + mpeg_dec->broken_gop = FALSE; + mpeg_dec->adapter = gst_adapter_new (); gst_pad_set_chain_function (dec->sink, gst_vdp_mpeg_decoder_chain); diff --git a/sys/vdpau/gstvdpmpegdecoder.h b/sys/vdpau/gstvdpmpegdecoder.h index a03c17c2..aac79f31 100644 --- a/sys/vdpau/gstvdpmpegdecoder.h +++ b/sys/vdpau/gstvdpmpegdecoder.h @@ -49,6 +49,8 @@ struct _GstVdpMpegDecoder /* holds B_FRAMES */ GSList *b_frames; + + gboolean broken_gop; GstAdapter *adapter; }; diff --git a/sys/vdpau/mpegutil.c b/sys/vdpau/mpegutil.c index a1323f68..6f59b841 100644 --- a/sys/vdpau/mpegutil.c +++ b/sys/vdpau/mpegutil.c @@ -348,7 +348,6 @@ gboolean mpeg_util_parse_picture_gop (MPEGPictureGOP * gop, guint8 * data, guint8 * end) { guint32 code; - gint hour, minute, second; if (G_UNLIKELY ((end - data) < 8)) return FALSE; /* Packet too small */ @@ -363,16 +362,14 @@ mpeg_util_parse_picture_gop (MPEGPictureGOP * gop, guint8 * data, guint8 * end) gop->drop_frame_flag = read_bits (data, 0, 1); - hour = read_bits (data, 1, 5); - minute = read_bits (data, 6, 6); - second = read_bits (data + 1, 4, 6); - - gop->timestamp = hour * 3600 * GST_SECOND; - gop->timestamp += minute * 60 * GST_SECOND; - gop->timestamp += second * GST_SECOND; - + gop->hour = read_bits (data, 1, 5); + gop->minute = read_bits (data, 6, 6); + gop->second = read_bits (data + 1, 4, 6); gop->frame = read_bits (data + 2, 3, 6); + gop->closed_gop = read_bits (data + 3, 1, 1); + gop->broken_gop = read_bits (data + 3, 2, 1); + return TRUE; } diff --git a/sys/vdpau/mpegutil.h b/sys/vdpau/mpegutil.h index 24a29a35..43f34a59 100644 --- a/sys/vdpau/mpegutil.h +++ b/sys/vdpau/mpegutil.h @@ -96,9 +96,11 @@ struct MPEGPictureExt struct MPEGPictureGOP { guint8 drop_frame_flag; - guint8 frame; - GstClockTime timestamp; + guint8 hour, minute, second, frame; + + guint8 closed_gop; + guint8 broken_gop; }; struct MPEGQuantMatrix |