summaryrefslogtreecommitdiffstats
path: root/mm-video-v4l2/vidc
diff options
context:
space:
mode:
authorVineeta Srivastava <vsrivastava@google.com>2014-10-03 22:10:29 +0000
committerVineeta Srivastava <vsrivastava@google.com>2014-10-03 22:12:46 +0000
commit2fc7c73e45bf960e778b85d2d6de6e3ba92891b0 (patch)
tree6049bac0d40657ee96f227523e4e5cbac0e46c16 /mm-video-v4l2/vidc
parentfe8c0a39b2870dd9eab298998fabd17ce7923c06 (diff)
downloadandroid_hardware_qcom_media-2fc7c73e45bf960e778b85d2d6de6e3ba92891b0.tar.gz
android_hardware_qcom_media-2fc7c73e45bf960e778b85d2d6de6e3ba92891b0.tar.bz2
android_hardware_qcom_media-2fc7c73e45bf960e778b85d2d6de6e3ba92891b0.zip
Revert "mm-video-v4l2: venc: Correct buffer index selection"
This reverts commit df87813cb87f16ed2d909b9adf0e442879f3f495. Bug: 17811061 Change-Id: I5604e0760b1067873b6d6760eda05003409c706b
Diffstat (limited to 'mm-video-v4l2/vidc')
-rwxr-xr-xmm-video-v4l2/vidc/venc/inc/omx_video_base.h8
-rwxr-xr-xmm-video-v4l2/vidc/venc/src/omx_video_base.cpp15
-rwxr-xr-xmm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp6
3 files changed, 12 insertions, 17 deletions
diff --git a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
index 413782b8..3c482e87 100755
--- a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
+++ b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
@@ -155,6 +155,9 @@ class omx_video: public qc_omx_component
bool c2d_opened;
encoder_media_buffer_type meta_buffers[MAX_NUM_INPUT_BUFFERS];
OMX_BUFFERHEADERTYPE *opaque_buffer_hdr[MAX_NUM_INPUT_BUFFERS];
+ bool mUseProxyColorFormat;
+ //RGB or non-native input, and we have pre-allocated conversion buffers
+ bool mUsesColorConversion;
bool get_syntaxhdr_enable;
OMX_BUFFERHEADERTYPE *psource_frame;
OMX_BUFFERHEADERTYPE *pdest_frame;
@@ -187,11 +190,6 @@ class omx_video: public qc_omx_component
omx_c2d_conv c2d_conv;
#endif
public:
-
- bool mUseProxyColorFormat;
- //RGB or non-native input, and we have pre-allocated conversion buffers
- bool mUsesColorConversion;
-
omx_video(); // constructor
virtual ~omx_video(); // destructor
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
index e7cf5f24..e7cd0fb9 100755
--- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
@@ -210,6 +210,7 @@ VideoHeap::VideoHeap(int fd, size_t size, void* base)
========================================================================== */
omx_video::omx_video():
c2d_opened(false),
+ mUsesColorConversion(false),
psource_frame(NULL),
pdest_frame(NULL),
secure_session(false),
@@ -247,7 +248,6 @@ omx_video::omx_video():
async_thread_created = false;
msg_thread_created = false;
- mUsesColorConversion = false;
pthread_mutex_init(&m_lock, NULL);
sem_init(&m_cmd_lock,0,0);
}
@@ -2497,7 +2497,7 @@ OMX_ERRORTYPE omx_video::free_input_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
return OMX_ErrorBadParameter;
}
- index = bufferHdr - ((!meta_mode_enable)?m_inp_mem_ptr:meta_buffer_hdr);
+ index = bufferHdr - ((!mUseProxyColorFormat)?m_inp_mem_ptr:meta_buffer_hdr);
#ifdef _ANDROID_ICS_
if (meta_mode_enable) {
if (index < m_sInPortDef.nBufferCountActual) {
@@ -3102,7 +3102,7 @@ OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
if (port == PORT_INDEX_IN) {
// check if the buffer is valid
- nPortIndex = buffer - ((!meta_mode_enable)?m_inp_mem_ptr:meta_buffer_hdr);
+ nPortIndex = buffer - ((!mUseProxyColorFormat)?m_inp_mem_ptr:meta_buffer_hdr);
DEBUG_PRINT_LOW("free_buffer on i/p port - Port idx %u, actual cnt %u",
nPortIndex, (unsigned int)m_sInPortDef.nBufferCountActual);
@@ -3267,7 +3267,7 @@ OMX_ERRORTYPE omx_video::empty_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
return OMX_ErrorIncorrectStateOperation;
}
- nBufferIndex = buffer - ((!meta_mode_enable)?m_inp_mem_ptr:meta_buffer_hdr);
+ nBufferIndex = buffer - ((!mUseProxyColorFormat)?m_inp_mem_ptr:meta_buffer_hdr);
if (nBufferIndex > m_sInPortDef.nBufferCountActual ) {
DEBUG_PRINT_ERROR("ERROR: ETB: Invalid buffer index[%d]", nBufferIndex);
@@ -3997,9 +3997,10 @@ OMX_ERRORTYPE omx_video::empty_buffer_done(OMX_HANDLETYPE hComp,
} else {
// We are not dealing with color-conversion, Buffer being returned
// here is client's buffer, return it back to client
- if (m_pCallbacks.EmptyBufferDone && buffer) {
- m_pCallbacks.EmptyBufferDone(hComp, m_app_data, buffer);
- DEBUG_PRINT_LOW("empty_buffer_done: Returning client buf %p", buffer);
+ OMX_BUFFERHEADERTYPE* il_buffer = &meta_buffer_hdr[buffer_index];
+ if (m_pCallbacks.EmptyBufferDone && il_buffer) {
+ m_pCallbacks.EmptyBufferDone(hComp, m_app_data, il_buffer);
+ DEBUG_PRINT_LOW("empty_buffer_done: Returning client buf %p",il_buffer);
}
}
} else if (m_pCallbacks.EmptyBufferDone) {
diff --git a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
index 2df32b3f..83949eea 100755
--- a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
+++ b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
@@ -347,11 +347,7 @@ void* venc_dev::async_venc_message_thread (void *input)
while (!ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf)) {
venc_msg.msgcode=VEN_MSG_INPUT_BUFFER_DONE;
venc_msg.statuscode=VEN_S_SUCCESS;
- if (omx_venc_base->mUseProxyColorFormat && !omx_venc_base->mUsesColorConversion)
- omxhdr = &omx_venc_base->meta_buffer_hdr[v4l2_buf.index];
- else
- omxhdr = &omx_venc_base->m_inp_mem_ptr[v4l2_buf.index];
-
+ omxhdr=omx_venc_base->m_inp_mem_ptr+v4l2_buf.index;
venc_msg.buf.clientdata=(void*)omxhdr;
omx->handle->ebd++;