diff options
author | Chandu Babu Namburu <chandu@amd.com> | 2016-10-27 15:26:02 +0530 |
---|---|---|
committer | Leo Liu <leo.liu@amd.com> | 2016-10-27 10:42:47 -0400 |
commit | b8a2f3dd5aa0e3fb29ffaf67dcd24b36f6e4c17b (patch) | |
tree | 553933f943b270f959e51584150f8f2c2f88ff7e | |
parent | 4da60fce5dbe7caefe0be5e14e1ac3035ead38c9 (diff) |
gstomxvideodec: don't drop non-sync frames
SPS/PPS can be sent with non-sync frame also in H.264.
Dropping non-sync frames may lead to loosing SPS/PPS NAL units
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
-rw-r--r-- | omx/gstomx.c | 2 | ||||
-rw-r--r-- | omx/gstomx.h | 5 | ||||
-rw-r--r-- | omx/gstomxvideodec.c | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/omx/gstomx.c b/omx/gstomx.c index a5cf562..0b4b05b 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -2526,6 +2526,8 @@ gst_omx_parse_hacks (gchar ** hacks) hacks_flags |= GST_OMX_HACK_DRAIN_MAY_NOT_RETURN; else if (g_str_equal (*hacks, "no-component-role")) hacks_flags |= GST_OMX_HACK_NO_COMPONENT_ROLE; + else if (g_str_equal (*hacks, "no-wait-for-syncframe")) + hacks_flags |= GST_OMX_HACK_NOWAIT_FOR_SYNCFRAME; else GST_WARNING ("Unknown hack: %s", *hacks); hacks++; diff --git a/omx/gstomx.h b/omx/gstomx.h index 9b534bd..cc68bb4 100644 --- a/omx/gstomx.h +++ b/omx/gstomx.h @@ -107,6 +107,11 @@ G_BEGIN_DECLS */ #define GST_OMX_HACK_NO_COMPONENT_ROLE G_GUINT64_CONSTANT (0x0000000000000080) +/* If the component need not to wait for sync frame to start decoding. + * Happens with MESA OpenMAX implementation. + */ +#define GST_OMX_HACK_NOWAIT_FOR_SYNCFRAME G_GUINT64_CONSTANT (0x0000000000000100) + typedef struct _GstOMXCore GstOMXCore; typedef struct _GstOMXPort GstOMXPort; typedef enum _GstOMXPortDirection GstOMXPortDirection; diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 07102a2..3bd5be4 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -2769,7 +2769,8 @@ gst_omx_video_dec_handle_frame (GstVideoDecoder * decoder, return GST_FLOW_EOS; } - if (!self->started && !GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame)) { + if (!self->started && !GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame) + && !(klass->cdata.hacks & GST_OMX_HACK_NOWAIT_FOR_SYNCFRAME)) { gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame); return GST_FLOW_OK; } |