diff options
author | Surajit Podder <spodder@codeaurora.org> | 2015-06-25 01:44:06 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-09-23 05:12:38 -0700 |
commit | f0fc3d015cd84f599ce8353814c1b7b899b0e41b (patch) | |
tree | 8f0f251773741aece73469a792589e415d65bc8c | |
parent | 6ecc67f43cb06b2d3402d6735d0aaf8bfad9698f (diff) | |
download | android_hardware_qcom_media-f0fc3d015cd84f599ce8353814c1b7b899b0e41b.tar.gz android_hardware_qcom_media-f0fc3d015cd84f599ce8353814c1b7b899b0e41b.tar.bz2 android_hardware_qcom_media-f0fc3d015cd84f599ce8353814c1b7b899b0e41b.zip |
mm-video: Disable downscalar for non-display usecase
private handle flags indicate whether the buffer consumer
is display. Disable downscalar for non-display case.
Change-Id: I19321559ec6ed22f3e866a065340e2cb3f061ef1
-rw-r--r-- | mm-video-v4l2/vidc/vdec/inc/omx_vdec.h | 1 | ||||
-rw-r--r-- | mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp | 19 |
2 files changed, 16 insertions, 4 deletions
diff --git a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h index d632ec5d..ec94f706 100644 --- a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h +++ b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h @@ -1077,6 +1077,7 @@ class omx_vdec: public qc_omx_component OMX_TICKS m_last_rendered_TS; volatile int32_t m_queued_codec_config_count; bool secure_scaling_to_non_secure_opb; + bool m_is_display_session; class perf_lock { private: pthread_mutex_t mlock; diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp index 26401473..298854da 100644 --- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp +++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp @@ -66,6 +66,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endif #include <qdMetaData.h> +#include <gralloc_priv.h> #ifdef ANDROID_JELLYBEAN_MR2 #include "QComOMXMetadata.h" @@ -594,7 +595,8 @@ omx_vdec::omx_vdec(): m_error_propogated(false), stereo_output_mode(HAL_NO_3D), m_last_rendered_TS(-1), m_queued_codec_config_count(0), - secure_scaling_to_non_secure_opb(false) + secure_scaling_to_non_secure_opb(false), + m_is_display_session(false) { /* Assumption is that , to begin with , we have all the frames with decoder */ DEBUG_PRINT_HIGH("In %u bit OMX vdec Constructor", (unsigned int)sizeof(long) * 8); @@ -930,10 +932,11 @@ int omx_vdec::decide_downscalar() return rc; } - DEBUG_PRINT_HIGH("%s: driver wxh = %dx%d, downscalar wxh = %dx%d", __func__, - fmt.fmt.pix_mp.width, fmt.fmt.pix_mp.height, m_downscalar_width, m_downscalar_height); + DEBUG_PRINT_HIGH("%s: driver wxh = %dx%d, downscalar wxh = %dx%d m_is_display_session = %d", __func__, + fmt.fmt.pix_mp.width, fmt.fmt.pix_mp.height, m_downscalar_width, m_downscalar_height, m_is_display_session); - if (fmt.fmt.pix_mp.width * fmt.fmt.pix_mp.height > m_downscalar_width * m_downscalar_height) { + if ((fmt.fmt.pix_mp.width * fmt.fmt.pix_mp.height > m_downscalar_width * m_downscalar_height) && + m_is_display_session) { rc = enable_downscalar(); if (rc < 0) return rc; @@ -6584,6 +6587,14 @@ OMX_ERRORTYPE omx_vdec::fill_this_buffer(OMX_IN OMX_HANDLETYPE hComp, //We'll restore this size later on, so that it's transparent to client buffer->nFilledLen = 0; buffer->nAllocLen = handle->size; + + if (handle->flags & private_handle_t::PRIV_FLAGS_DISP_CONSUMER) { + m_is_display_session = true; + } else { + m_is_display_session = false; + } + DEBUG_PRINT_LOW("%s: m_is_display_session = %d", __func__, m_is_display_session); + } |