omx: Add hack for Qualcomm's OMX implementation to manually reset nOffset in EmptyBufferDone

This commit is contained in:
Sebastian Dröge 2011-09-26 13:04:18 +02:00
parent 7dbf68a232
commit 837fc4ca66
2 changed files with 13 additions and 0 deletions

View file

@ -332,6 +332,12 @@ EmptyBufferDone (OMX_HANDLETYPE hComponent, OMX_PTR pAppData,
GST_DEBUG_OBJECT (comp->parent, "Port %u emptied buffer %p",
port->index, buf);
buf->used = FALSE;
if (comp->hacks & GST_OMX_HACK_NO_NOFFSET_RESET) {
g_assert (buf->omx_buf->nFilledLen == 0);
buf->omx_buf->nOffset = 0;
}
g_queue_push_tail (port->pending_buffers, buf);
g_cond_broadcast (port->port_cond);
g_mutex_unlock (port->port_lock);
@ -1888,6 +1894,8 @@ gst_omx_parse_hacks (gchar ** hacks)
hacks_flags |= GST_OMX_HACK_VIDEO_FRAMERATE_INTEGER;
else if (g_str_equal (*hacks, "syncframe-flag-not-used"))
hacks_flags |= GST_OMX_HACK_SYNCFRAME_FLAG_NOT_USED;
else if (g_str_equal (*hacks, "no-noffset-reset"))
hacks_flags |= GST_OMX_HACK_NO_NOFFSET_RESET;
else
GST_WARNING ("Unknown hack: %s", *hacks);
hacks++;

View file

@ -55,6 +55,11 @@ G_BEGIN_DECLS
* Happens with the Bellagio ffmpegdist video encoder.
*/
#define GST_OMX_HACK_SYNCFRAME_FLAG_NOT_USED G_GUINT64_CONSTANT (0x0000000000000008)
/* If the nOffset field of buffers is not reset in EmptyBufferDone.
* Happens with Qualcomm's OpenMAX implementation.
*/
#define GST_OMX_HACK_NO_NOFFSET_RESET G_GUINT64_CONSTANT (0x0000000000000010)
typedef struct _GstOMXCore GstOMXCore;
typedef struct _GstOMXPort GstOMXPort;