aboutsummaryrefslogtreecommitdiffstats
path: root/videocodec/OMXVideoEncoderVP8.cpp
diff options
context:
space:
mode:
authorLiu Bolun <bolun.liu@intel.com>2014-01-03 14:41:37 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 22:02:57 -0700
commit8b2ba82826c315930fee3fe174b18abbfada5250 (patch)
tree8206a75da997772843c48f76ffb13d4a238e9fb0 /videocodec/OMXVideoEncoderVP8.cpp
parent63ee173ed94850f02f22d0c1143ebfecb1066597 (diff)
downloadandroid_hardware_intel_common_omx-components-8b2ba82826c315930fee3fe174b18abbfada5250.tar.gz
android_hardware_intel_common_omx-components-8b2ba82826c315930fee3fe174b18abbfada5250.tar.bz2
android_hardware_intel_common_omx-components-8b2ba82826c315930fee3fe174b18abbfada5250.zip
Enable Max Frame Size setting for VP8 encode
BZ: 162278 Add the related handler in OMX components. Change-Id: I613e7376da76ed91bcfc71917e6410698788b50a Signed-off-by: Liu Bolun <bolun.liu@intel.com>
Diffstat (limited to 'videocodec/OMXVideoEncoderVP8.cpp')
-rw-r--r--videocodec/OMXVideoEncoderVP8.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/videocodec/OMXVideoEncoderVP8.cpp b/videocodec/OMXVideoEncoderVP8.cpp
index bb69900..f04cbec 100644
--- a/videocodec/OMXVideoEncoderVP8.cpp
+++ b/videocodec/OMXVideoEncoderVP8.cpp
@@ -195,6 +195,7 @@ OMX_ERRORTYPE OMXVideoEncoderVP8::BuildHandlerList(void) {
AddHandler((OMX_INDEXTYPE)OMX_IndexParamVideoVp8, GetParamVideoVp8, SetParamVideoVp8);
AddHandler((OMX_INDEXTYPE)OMX_IndexConfigVideoVp8ReferenceFrame, GetConfigVideoVp8ReferenceFrame, SetConfigVideoVp8ReferenceFrame);
AddHandler((OMX_INDEXTYPE)OMX_IndexExtVP8ForceKFrame, GetConfigVp8ForceKFrame, SetConfigVp8ForceKFrame);
+ AddHandler((OMX_INDEXTYPE)OMX_IndexExtVP8MaxFrameSize, GetConfigVp8MaxFrameSize, SetConfigVp8MaxFrameSize);
return OMX_ErrorNone;
}
@@ -249,7 +250,7 @@ OMX_ERRORTYPE OMXVideoEncoderVP8::SetConfigVideoVp8ReferenceFrame(OMX_PTR pStruc
retStatus = mVideoEncoder->setConfig(&configVP8ReferenceFrame);
if(retStatus != ENCODE_SUCCESS) {
- LOGW("Failed to set refresh config");
+ LOGW("Failed to set reference frame");
}
return OMX_ErrorNone;
}
@@ -276,11 +277,34 @@ OMX_ERRORTYPE OMXVideoEncoderVP8::SetConfigVp8ForceKFrame(OMX_PTR pStructure) {
retStatus = mVideoEncoder->setConfig(&configVP8);
if(retStatus != ENCODE_SUCCESS) {
- LOGW("Failed to set refresh config");
+ LOGW("Failed to set vp8 force frame");
}
return OMX_ErrorNone;
}
+OMX_ERRORTYPE OMXVideoEncoderVP8::GetConfigVp8MaxFrameSize(OMX_PTR pStructure) {
+ return OMX_ErrorNone;
+}
+
+OMX_ERRORTYPE OMXVideoEncoderVP8::SetConfigVp8MaxFrameSize(OMX_PTR pStructure) {
+ OMX_ERRORTYPE ret;
+ Encode_Status retStatus = ENCODE_SUCCESS;
+ OMX_VIDEO_CONFIG_INTEL_VP8_MAX_FRAME_SIZE *p = (OMX_VIDEO_CONFIG_INTEL_VP8_MAX_FRAME_SIZE*)pStructure;
+ CHECK_TYPE_HEADER(p);
+ CHECK_PORT_INDEX(p, OUTPORT_INDEX);
+
+ CHECK_SET_CONFIG_STATE();
+
+ VideoConfigVP8MaxFrameSize configVP8MaxFrameSize;
+ configVP8MaxFrameSize.max_frame_size = p->nMaxFrameSize;
+
+ retStatus = mVideoEncoder->setConfig(&configVP8MaxFrameSize);
+ if(retStatus != ENCODE_SUCCESS) {
+ LOGW("Failed to set vp8 max frame size");
+ }
+
+ return OMX_ErrorNone;
+}
DECLARE_OMX_COMPONENT("OMX.Intel.VideoEncoder.VP8", "video_encoder.vp8", OMXVideoEncoderVP8);