summaryrefslogtreecommitdiffstats
path: root/mm-video-v4l2/vidc/vdec
diff options
context:
space:
mode:
authorPraveen Chavan <pchavan@codeaurora.org>2015-04-20 18:52:19 -0700
committerSurajit Podder <spodder@codeaurora.org>2015-07-30 12:41:48 +0530
commita2c6f09ac7e2bbdf65cb4ad5c4967082b39c57b3 (patch)
tree212eb926874c33151bc8870026aad793e78544f9 /mm-video-v4l2/vidc/vdec
parent5c1d7b9c12e2d5c582a5dbd3c447823425e824c2 (diff)
downloadandroid_hardware_qcom_media-a2c6f09ac7e2bbdf65cb4ad5c4967082b39c57b3.tar.gz
android_hardware_qcom_media-a2c6f09ac7e2bbdf65cb4ad5c4967082b39c57b3.tar.bz2
android_hardware_qcom_media-a2c6f09ac7e2bbdf65cb4ad5c4967082b39c57b3.zip
mm-video-v4l2: Add extended config to set instance priority
Enable priority as hinted by the client: priority = 0 => real-time = 1 => non-realtime Also add the OMX extension for priority and operating-rate. Amended by Ashray Kulkarni <ashrayk@codeaurora.org> Default sessions to non-realtime. bug: 20131548 Change-Id: I37532404a4a3ab5647b3490c3e3ecba2ed604bbf
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.cpp24
2 files changed, 25 insertions, 0 deletions
diff --git a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
index 06522424..50de50e4 100644
--- a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
+++ b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
@@ -93,6 +93,7 @@ extern "C" {
#include "OMX_Core.h"
#include "OMX_QCOMExtns.h"
#include "OMX_VideoExt.h"
+#include "OMX_IndexExt.h"
#include "qc_omx_component.h"
#include <linux/msm_vidc_dec.h>
#include <media/msm_vidc.h>
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 95df3311..3d7eb53a 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
@@ -2230,6 +2230,13 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
drv_ctx.video_driver_fd);
}
//memset(&h264_mv_buff,0,sizeof(struct h264_mv_buffer));
+ control.id = V4L2_CID_MPEG_VIDC_VIDEO_PRIORITY;
+ control.value = V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_DISABLE;
+
+ if (ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
+ DEBUG_PRINT_ERROR("Failed to set Default Priority");
+ eRet = OMX_ErrorUnsupportedSetting;
+ }
return eRet;
}
@@ -4620,6 +4627,23 @@ OMX_ERRORTYPE omx_vdec::set_config(OMX_IN OMX_HANDLETYPE hComp,
}
return ret;
+ } else if ((int)configIndex == (int)OMX_IndexConfigPriority) {
+ OMX_PARAM_U32TYPE *priority = (OMX_PARAM_U32TYPE *)configData;
+ DEBUG_PRINT_LOW("Set_config: priority %d", priority->nU32);
+
+ struct v4l2_control control;
+
+ control.id = V4L2_CID_MPEG_VIDC_VIDEO_PRIORITY;
+ if (priority->nU32 == 0)
+ control.value = V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_ENABLE;
+ else
+ control.value = V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_DISABLE;
+
+ if (ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
+ DEBUG_PRINT_ERROR("Failed to set Priority");
+ ret = OMX_ErrorUnsupportedSetting;
+ }
+ return ret;
}
return OMX_ErrorNotImplemented;