summaryrefslogtreecommitdiffstats
path: root/mm-video-v4l2/vidc/vdec
diff options
context:
space:
mode:
authorSurajit Podder <spodder@codeaurora.org>2015-06-25 01:44:06 +0530
committerSurajit Podder <spodder@codeaurora.org>2015-09-10 14:51:13 +0530
commit1fc82f09876df1839bca2d29aaba0b10a1d66be8 (patch)
tree1145a0566aa45a9bb467f570805001c72411c912 /mm-video-v4l2/vidc/vdec
parent9b00c8f5ef1533182fe59f75007411ecc03b8de4 (diff)
downloadandroid_hardware_qcom_media-1fc82f09876df1839bca2d29aaba0b10a1d66be8.tar.gz
android_hardware_qcom_media-1fc82f09876df1839bca2d29aaba0b10a1d66be8.tar.bz2
android_hardware_qcom_media-1fc82f09876df1839bca2d29aaba0b10a1d66be8.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
Diffstat (limited to 'mm-video-v4l2/vidc/vdec')
-rw-r--r--mm-video-v4l2/vidc/vdec/inc/omx_vdec.h1
-rw-r--r--mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp19
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 73cd9f09..e27ff96f 100644
--- a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
+++ b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
@@ -1076,6 +1076,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 c3a7f1af..8edc78f5 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;
@@ -6544,6 +6547,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);
+
}