diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-06 09:53:13 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-06 09:53:13 +0100 |
commit | 6208795598029c4e902c923434100e91d3ce2398 (patch) | |
tree | 2102e4cde4a92a8f43ed896eeead4aa7cc92af15 /gst/mxf/mxfd10.c | |
parent | c9f6a8b58664319d7db5f90166012c55c92a3191 (diff) | |
download | gst-plugins-bad-6208795598029c4e902c923434100e91d3ce2398.tar.gz gst-plugins-bad-6208795598029c4e902c923434100e91d3ce2398.tar.bz2 gst-plugins-bad-6208795598029c4e902c923434100e91d3ce2398.zip |
mxfdemux: Add keyframe detection for MPEG2 video streams
This is useful for seeking as we usually want to seek to the previous
keyframe. The keyframe detection is done by parsing the MPEG2
elementary stream and if a GOP or I-frame packet is found we
assume a keyframe in this edit unit.
Diffstat (limited to 'gst/mxf/mxfd10.c')
-rw-r--r-- | gst/mxf/mxfd10.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gst/mxf/mxfd10.c b/gst/mxf/mxfd10.c index c24d163c..1195d3b4 100644 --- a/gst/mxf/mxfd10.c +++ b/gst/mxf/mxfd10.c @@ -30,6 +30,8 @@ #include "mxfd10.h" +#include "mxfmpeg.h" + GST_DEBUG_CATEGORY_EXTERN (mxf_debug); #define GST_CAT_DEFAULT mxf_debug @@ -81,6 +83,11 @@ mxf_d10_picture_handle_essence_element (const MXFUL * key, GstBuffer * buffer, return GST_FLOW_ERROR; } + if (mxf_mpeg_is_mpeg2_keyframe (buffer)) + GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); + else + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); + return GST_FLOW_OK; } |