summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Strudel <tstrudel@google.com>2016-11-05 18:31:50 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-11-05 18:31:50 +0000
commit275266864c7d72d9a8def75dc7c5074bc762c33f (patch)
tree6aa13aa27c35a47406079ecbc7a91c9170a5b208
parent3abcc0f1d2061faaa244efa5187071662a919975 (diff)
parent69b56682975340fc17ce9eac3cefd2d6c5bfdd84 (diff)
downloadmedia-275266864c7d72d9a8def75dc7c5074bc762c33f.tar.gz
msmcobalt: Update to 07.00.00.253.039
am: 69b5668297 Change-Id: I1078b39b14c08ca0c1696d6f95ccaa07fa70a8e9
-rw-r--r--msmcobalt/mm-video-v4l2/vidc/vdec/inc/omx_swvdec.h2
-rw-r--r--msmcobalt/mm-video-v4l2/vidc/vdec/src/omx_swvdec_utils.cpp22
-rw-r--r--msmcobalt/mm-video-v4l2/vidc/venc/inc/omx_swvenc_mpeg4.h5
-rw-r--r--msmcobalt/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h4
-rw-r--r--msmcobalt/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp107
-rw-r--r--msmcobalt/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp6
-rw-r--r--msmcobalt/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp23
-rw-r--r--msmcobalt/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp84
8 files changed, 140 insertions, 113 deletions
diff --git a/msmcobalt/mm-video-v4l2/vidc/vdec/inc/omx_swvdec.h b/msmcobalt/mm-video-v4l2/vidc/vdec/inc/omx_swvdec.h
index aaaeae7..2663a2b 100644
--- a/msmcobalt/mm-video-v4l2/vidc/vdec/inc/omx_swvdec.h
+++ b/msmcobalt/mm-video-v4l2/vidc/vdec/inc/omx_swvdec.h
@@ -56,7 +56,7 @@
using namespace android;
/// OMX SwVdec version date
-#define OMX_SWVDEC_VERSION_DATE "2016-05-05T16:09:40+0530"
+#define OMX_SWVDEC_VERSION_DATE "2016-10-12T10:56:30+0530"
#define OMX_SPEC_VERSION 0x00000101 ///< OMX specification version
diff --git a/msmcobalt/mm-video-v4l2/vidc/vdec/src/omx_swvdec_utils.cpp b/msmcobalt/mm-video-v4l2/vidc/vdec/src/omx_swvdec_utils.cpp
index 56c3f30..c69c2c1 100644
--- a/msmcobalt/mm-video-v4l2/vidc/vdec/src/omx_swvdec_utils.cpp
+++ b/msmcobalt/mm-video-v4l2/vidc/vdec/src/omx_swvdec_utils.cpp
@@ -41,6 +41,7 @@
#include <assert.h>
#include <pthread.h>
#include <time.h>
+#include <errno.h>
#include <cutils/properties.h>
@@ -215,8 +216,10 @@ omx_swvdec_diag::omx_swvdec_diag():
property_value,
filename_ip))
{
+ size_t m_filename_ip_size = (strlen(property_value) + 1)*sizeof(char);
+
m_filename_ip =
- (char *) malloc((strlen(property_value) + 1) * sizeof(char));
+ (char *) malloc(m_filename_ip_size);
if (m_filename_ip == NULL)
{
@@ -226,14 +229,14 @@ omx_swvdec_diag::omx_swvdec_diag():
}
else
{
- strlcpy(m_filename_ip, property_value, strlen(m_filename_ip));
+ strlcpy(m_filename_ip, property_value,m_filename_ip_size);
OMX_SWVDEC_LOG_HIGH("omx_swvdec.filename.ip: %s", m_filename_ip);
if ((m_file_ip = fopen(m_filename_ip, "wb")) == NULL)
{
- OMX_SWVDEC_LOG_ERROR("cannot open input file '%s'",
- m_filename_ip);
+ OMX_SWVDEC_LOG_ERROR("cannot open input file '%s' logging erro is : %d",
+ m_filename_ip,errno);
}
}
}
@@ -242,8 +245,10 @@ omx_swvdec_diag::omx_swvdec_diag():
property_value,
filename_op))
{
+ size_t m_filename_op_size = (strlen(property_value) + 1)*sizeof(char);
+
m_filename_op =
- (char *) malloc((strlen(property_value) + 1) * sizeof(char));
+ (char *) malloc(m_filename_op_size);
if (m_filename_op == NULL)
{
@@ -253,14 +258,13 @@ omx_swvdec_diag::omx_swvdec_diag():
}
else
{
- strlcpy(m_filename_op, property_value, strlen(m_filename_op));
+ strlcpy(m_filename_op, property_value,m_filename_op_size);
OMX_SWVDEC_LOG_HIGH("omx_swvdec.filename.op: %s", m_filename_op);
-
if ((m_file_op = fopen(m_filename_op, "wb")) == NULL)
{
- OMX_SWVDEC_LOG_ERROR("cannot open output file '%s'",
- m_filename_op);
+ OMX_SWVDEC_LOG_ERROR("cannot open output file '%s' logging error : %d",
+ m_filename_op,errno);
}
}
}
diff --git a/msmcobalt/mm-video-v4l2/vidc/venc/inc/omx_swvenc_mpeg4.h b/msmcobalt/mm-video-v4l2/vidc/venc/inc/omx_swvenc_mpeg4.h
index 0443c80..41ec9f9 100644
--- a/msmcobalt/mm-video-v4l2/vidc/venc/inc/omx_swvenc_mpeg4.h
+++ b/msmcobalt/mm-video-v4l2/vidc/venc/inc/omx_swvenc_mpeg4.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2014, The Linux Foundation. All rights reserved.
+Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -143,6 +143,8 @@ class omx_venc: public omx_video
bool dev_get_output_log_flag();
int dev_output_log_buffers(const char *buffer_addr, int buffer_len);
int dev_extradata_log_buffers(char *buffer);
+ bool swvenc_color_align(OMX_BUFFERHEADERTYPE *buffer, OMX_U32 width,
+ OMX_U32 height);
SWVENC_STATUS swvenc_set_rc_mode(OMX_VIDEO_CONTROLRATETYPE eControlRate);
SWVENC_STATUS swvenc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel);
@@ -150,6 +152,7 @@ class omx_venc: public omx_video
SWVENC_STATUS swvenc_set_frame_rate(OMX_U32 nFrameRate);
SWVENC_STATUS swvenc_set_bit_rate(OMX_U32 nTargetBitrate);
SWVENC_STATUS swvenc_set_intra_period(OMX_U32 nPFrame,OMX_U32 nBFrame);
+ SWVENC_STATUS swvenc_set_color_format(OMX_COLOR_FORMATTYPE);
SWVENC_STATUS swvenc_get_buffer_req
(
OMX_U32 *min_buff_count,
diff --git a/msmcobalt/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h b/msmcobalt/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h
index e648799..fc26690 100644
--- a/msmcobalt/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h
+++ b/msmcobalt/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h
@@ -31,11 +31,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <unistd.h>
#include "omx_video_base.h"
-#ifdef _MSM8974_
#include "video_encoder_device_v4l2.h"
-#else
-#include "video_encoder_device.h"
-#endif
extern "C" {
OMX_API void * get_omx_component_factory_fn(void);
diff --git a/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp b/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp
index 52d5340..f296704 100644
--- a/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp
+++ b/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp
@@ -699,8 +699,8 @@ OMX_ERRORTYPE omx_venc::set_parameter
{
/* meta_mode = 2 (kMetadataBufferTypeGrallocSource) */
m_sInPortFormat.eColorFormat =
- (OMX_COLOR_FORMATTYPE) QOMX_COLOR_FormatYVU420SemiPlanar;
- color_format = SWVENC_COLOR_FORMAT_NV21;
+ (OMX_COLOR_FORMATTYPE) QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m;
+ color_format = SWVENC_COLOR_FORMAT_NV12;
if (!mUseProxyColorFormat)
{
if (!c2d_conv.init())
@@ -737,8 +737,6 @@ OMX_ERRORTYPE omx_venc::set_parameter
m_input_msg_id = OMX_COMPONENT_GENERATE_ETB;
mUseProxyColorFormat = false;
}
- DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamVideoPortFormat %d",
- portFmt->eColorFormat);
m_sInPortDef.format.video.eColorFormat = m_sInPortFormat.eColorFormat;
/* set the input color format */
Prop.id = SWVENC_PROPERTY_ID_COLOR_FORMAT;
@@ -1834,11 +1832,7 @@ bool omx_venc::dev_empty_buf
(meta_buf->meta_handle->numFds + meta_buf->meta_handle->numInts > 5))
{
format_set = true;
- if (((OMX_COLOR_FORMATTYPE) meta_buf->meta_handle->data[5]) !=
- m_sInPortFormat.eColorFormat)
- {
- return false;
- }
+ m_sInPortFormat.eColorFormat = (OMX_COLOR_FORMATTYPE)meta_buf->meta_handle->data[5];
}
ipbuffer.p_buffer = (unsigned char *)mmap(NULL, size, PROT_READ|PROT_WRITE,MAP_SHARED, fd, offset);
if (ipbuffer.p_buffer == MAP_FAILED)
@@ -1864,17 +1858,6 @@ bool omx_venc::dev_empty_buf
{
m_sInPortFormat.eColorFormat = (OMX_COLOR_FORMATTYPE)
QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m;
- color_format = SWVENC_COLOR_FORMAT_NV12;
- m_sInPortDef.format.video.eColorFormat = m_sInPortFormat.eColorFormat;
- prop.id = SWVENC_PROPERTY_ID_COLOR_FORMAT;
- prop.info.color_format = color_format;
- Ret = swvenc_setproperty(m_hSwVenc, &prop);
- if (Ret != SWVENC_S_SUCCESS)
- {
- DEBUG_PRINT_ERROR("%s, swvenc_setproperty failed (%d)",
- __FUNCTION__, Ret);
- RETURN(OMX_ErrorUnsupportedSetting);
- }
}
else
{
@@ -1900,6 +1883,14 @@ bool omx_venc::dev_empty_buf
ipbuffer.size = bufhdr->nAllocLen;
ipbuffer.filled_length = bufhdr->nFilledLen;
}
+ m_sInPortDef.format.video.eColorFormat = m_sInPortFormat.eColorFormat;
+ Ret = swvenc_set_color_format(m_sInPortFormat.eColorFormat);
+ if (Ret != SWVENC_S_SUCCESS)
+ {
+ DEBUG_PRINT_ERROR("%s, swvenc_setproperty failed (%d)",
+ __FUNCTION__, Ret);
+ RETURN(OMX_ErrorUnsupportedSetting);
+ }
}
}
else
@@ -2278,16 +2269,11 @@ bool omx_venc::dev_color_align(OMX_BUFFERHEADERTYPE *buffer,
{
ENTER_FUNC();
- (void)buffer;
- (void)width;
- (void)height;
if(secure_session) {
DEBUG_PRINT_ERROR("Cannot align colors in secure session.");
RETURN(OMX_FALSE);
}
-
- RETURN(true);
- //return handle->venc_color_align(buffer, width,height);
+ return swvenc_color_align(buffer, width,height);
}
bool omx_venc::is_secure_session()
@@ -2980,3 +2966,72 @@ SWVENC_STATUS omx_venc::swvenc_set_intra_period
RETURN(Ret);
}
+
+bool omx_venc::swvenc_color_align(OMX_BUFFERHEADERTYPE *buffer, OMX_U32 width,
+ OMX_U32 height)
+{
+ OMX_U32 y_stride = VENUS_Y_STRIDE(COLOR_FMT_NV12, width),
+ y_scanlines = VENUS_Y_SCANLINES(COLOR_FMT_NV12, height),
+ uv_stride = VENUS_UV_STRIDE(COLOR_FMT_NV12, width),
+ uv_scanlines = VENUS_UV_SCANLINES(COLOR_FMT_NV12, height),
+ src_chroma_offset = width * height;
+
+ if (buffer->nAllocLen >= VENUS_BUFFER_SIZE(COLOR_FMT_NV12, width, height)) {
+ OMX_U8* src_buf = buffer->pBuffer, *dst_buf = buffer->pBuffer;
+ //Do chroma first, so that we can convert it in-place
+ src_buf += width * height;
+ dst_buf += y_stride * y_scanlines;
+ for (int line = height / 2 - 1; line >= 0; --line) {
+ memmove(dst_buf + line * uv_stride,
+ src_buf + line * width,
+ width);
+ }
+
+ dst_buf = src_buf = buffer->pBuffer;
+ //Copy the Y next
+ for (int line = height - 1; line > 0; --line) {
+ memmove(dst_buf + line * y_stride,
+ src_buf + line * width,
+ width);
+ }
+ } else {
+ DEBUG_PRINT_ERROR("Failed to align Chroma. from %u to %u : \
+ Insufficient bufferLen=%u v/s Required=%u",
+ (unsigned int)(width*height), (unsigned int)src_chroma_offset, (unsigned int)buffer->nAllocLen,
+ VENUS_BUFFER_SIZE(COLOR_FMT_NV12, width, height));
+ return false;
+ }
+
+ return true;
+}
+
+SWVENC_STATUS omx_venc::swvenc_set_color_format
+(
+ OMX_COLOR_FORMATTYPE color_format
+)
+{
+ ENTER_FUNC();
+ SWVENC_STATUS Ret = SWVENC_S_SUCCESS;
+ SWVENC_COLOR_FORMAT swvenc_color_format;
+ SWVENC_PROPERTY Prop;
+ if ((color_format == OMX_COLOR_FormatYUV420SemiPlanar) ||
+ (color_format == ((OMX_COLOR_FORMATTYPE) QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m)))
+ {
+ swvenc_color_format = SWVENC_COLOR_FORMAT_NV12;
+ }
+ else
+ {
+ swvenc_color_format = SWVENC_COLOR_FORMAT_NV21;
+ }
+ /* set the input color format */
+ Prop.id = SWVENC_PROPERTY_ID_COLOR_FORMAT;
+ Prop.info.color_format = swvenc_color_format;
+ Ret = swvenc_setproperty(m_hSwVenc, &Prop);
+ if (Ret != SWVENC_S_SUCCESS)
+ {
+ DEBUG_PRINT_ERROR("%s, swvenc_setproperty failed (%d)",
+ __FUNCTION__, Ret);
+ Ret = SWVENC_S_FAILURE;
+ }
+ RETURN(Ret);
+}
diff --git a/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
index 30fcfcd..6aecd88 100644
--- a/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
+++ b/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
@@ -5114,6 +5114,12 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_opaque(OMX_IN OMX_HANDLETYPE hComp,
#ifdef _MSM8974_
if (!dev_set_format(NV12_128m))
DEBUG_PRINT_ERROR("cannot set color format");
+
+ dev_get_buf_req (&m_sInPortDef.nBufferCountMin,
+ &m_sInPortDef.nBufferCountActual,
+ &m_sInPortDef.nBufferSize,
+ m_sInPortDef.nPortIndex);
+
#endif
}
}
diff --git a/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
index 6c087ff..7dc6968 100644
--- a/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
+++ b/msmcobalt/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
@@ -44,7 +44,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
extern int m_pipe;
static int bframes;
static int entropy;
-static int perfmode;
static int lowlatency;
// factory function executed by the core to create instances
void *get_omx_component_factory_fn(void)
@@ -148,9 +147,6 @@ omx_venc::omx_venc()
property_get("vidc.debug.entropy", property_value, "1");
entropy = !!atoi(property_value);
property_value[0] = '\0';
- property_get("vidc.debug.perf.mode", property_value, "0");
- perfmode = atoi(property_value);
- property_value[0] = '\0';
handle = NULL;
property_get("vidc.debug.lowlatency", property_value, "0");
lowlatency = atoi(property_value);
@@ -608,14 +604,6 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
}
}
- if (perfmode) {
- QOMX_EXTNINDEX_VIDEO_PERFMODE pParam;
- pParam.nPerfMode = perfmode;
- DEBUG_PRINT_LOW("Perfmode = 0x%x", pParam.nPerfMode);
- if (!handle->venc_set_config(&pParam, (OMX_INDEXTYPE)OMX_QcomIndexConfigVideoVencPerfMode))
- DEBUG_PRINT_ERROR("Failed setting PerfMode to %d", pParam.nPerfMode);
- }
-
if (lowlatency)
{
QOMX_ENABLETYPE low_latency;
@@ -1991,17 +1979,6 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
DEBUG_PRINT_ERROR("ERROR: Set OMX_IndexConfigCommonRotate failed");
return OMX_ErrorUnsupportedSetting;
}
- if (nRotation == 90 || nRotation == 270) {
- OMX_U32 nFrameWidth;
- OMX_U32 nFrameHeight;
-
- DEBUG_PRINT_HIGH("set_config: updating port Dims Rotation angle = %d",
- pParam->nRotation);
- nFrameWidth = m_sOutPortDef.format.video.nFrameWidth;
- nFrameHeight = m_sOutPortDef.format.video.nFrameHeight;
- m_sOutPortDef.format.video.nFrameWidth = nFrameHeight;
- m_sOutPortDef.format.video.nFrameHeight = nFrameWidth;
- }
m_sConfigFrameRotation.nRotation = pParam->nRotation;
break;
}
diff --git a/msmcobalt/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/msmcobalt/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
index a6d119d..929c30e 100644
--- a/msmcobalt/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
+++ b/msmcobalt/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
@@ -1501,12 +1501,18 @@ bool venc_dev::venc_open(OMX_U32 codec)
}
#ifdef _PQ_
- if (codec == OMX_VIDEO_CodingAVC) {
+ if (codec == OMX_VIDEO_CodingAVC && !is_pq_force_disable) {
m_pq.init(V4L2_DEFAULT_OUTPUT_COLOR_FMT);
m_pq.get_caps();
}
#endif // _PQ_
+ /* Enable Low power mode by default for better power */
+
+ if (venc_set_perf_mode(V4L2_MPEG_VIDC_VIDEO_PERF_POWER_SAVE) == false) {
+ DEBUG_PRINT_HIGH("Failed to set Perf Mode");
+ }
+
input_extradata_info.port_index = OUTPUT_PORT;
output_extradata_info.port_index = CAPTURE_PORT;
@@ -2706,12 +2712,6 @@ bool venc_dev::venc_set_config(void *configData, OMX_INDEXTYPE index)
DEBUG_PRINT_ERROR("ERROR: Rotation is not supported with deinterlacing");
return false;
}
- if (config_rotation->nRotation == 90 || config_rotation->nRotation == 270) {
- DEBUG_PRINT_HIGH("venc_set_config: updating the new Dims");
- nFrameWidth = m_sVenc_cfg.dvs_width;
- m_sVenc_cfg.dvs_width = m_sVenc_cfg.dvs_height;
- m_sVenc_cfg.dvs_height = nFrameWidth;
- }
if(venc_set_vpe_rotation(config_rotation->nRotation) == false) {
DEBUG_PRINT_ERROR("ERROR: Dimension Change for Rotation failed");
return false;
@@ -4051,10 +4051,10 @@ bool venc_dev::venc_empty_buf(void *buffer, void *pmem_data_buf, unsigned index,
}
#ifdef _PQ_
- if (!streaming[OUTPUT_PORT]) {
+ if (!streaming[OUTPUT_PORT] && !is_pq_force_disable) {
/*
* This is the place where all parameters for deciding
- * PQ enablement are aailable. Evaluate PQ for the final time.
+ * PQ enablement are available. Evaluate PQ for the final time.
*/
m_pq.is_YUV_format_uncertain = false;
m_pq.reinit(m_sVenc_cfg.inputformat);
@@ -4212,7 +4212,7 @@ bool venc_dev::venc_empty_batch(OMX_BUFFERHEADERTYPE *bufhdr, unsigned index)
}
#ifdef _PQ_
- if (!streaming[OUTPUT_PORT]) {
+ if (!streaming[OUTPUT_PORT] && !is_pq_force_disable) {
m_pq.is_YUV_format_uncertain = false;
m_pq.reinit(m_sVenc_cfg.inputformat);
venc_try_enable_pq();
@@ -4936,12 +4936,10 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_4;
break;
case OMX_VIDEO_MPEG4Level5:
+ case OMX_VIDEO_MPEG4LevelMax:
+ default: //Set max level possible as default so that invalid levels are non-fatal
requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_5;
break;
- default:
- return false;
- // TODO update corresponding levels for MPEG4_LEVEL_3b,MPEG4_LEVEL_6
- break;
}
}
} else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263) {
@@ -5004,11 +5002,10 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_6_0;
break;
case OMX_VIDEO_H263Level70:
+ case OMX_VIDEO_H263LevelMax:
+ default: //Set max level possible as default so that invalid levels are non-fatal
requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_7_0;
break;
- default:
- return false;
- break;
}
} else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) {
if (eProfile == OMX_VIDEO_AVCProfileBaseline) {
@@ -5086,16 +5083,10 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_5_1;
break;
case OMX_VIDEO_AVCLevel52:
- requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_5_2;
- break;
case OMX_VIDEO_AVCLevelMax:
+ default: //Set max level possible as default so that invalid levels are non-fatal
requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_5_2;
break;
- default :
- DEBUG_PRINT_ERROR("ERROR: Unsupported H.264 level= %lu",
- requested_level.level);
- return false;
- break;
}
} else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_VP8) {
if (!(eProfile == OMX_VIDEO_VP8ProfileMain)) {
@@ -5110,13 +5101,10 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
requested_level.level = V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_0;
break;
case OMX_VIDEO_VP8Level_Version1:
+ case OMX_VIDEO_VP8LevelMax:
+ default: //Set max level possible as default so that invalid levels are non-fatal
requested_level.level = V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_1;
break;
- default:
- DEBUG_PRINT_ERROR("ERROR: Unsupported VP8 level= %u",
- (unsigned int)eLevel);
- return false;
- break;
}
} else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_HEVC) {
if (eProfile == OMX_VIDEO_HEVCProfileMain) {
@@ -5201,12 +5189,10 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
requested_level.level = V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_6_1;
break;
case OMX_VIDEO_HEVCHighTierLevel61:
+ case OMX_VIDEO_HEVCLevelMax:
+ default: //Set max level possible as default so that invalid levels are non-fatal
requested_level.level = V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_6_1;
break;
- default :
- DEBUG_PRINT_ERROR("ERROR: Unsupported HEVC level= %lu",
- requested_level.level);
- return false;
}
}
@@ -7939,19 +7925,21 @@ void venc_dev::venc_try_enable_pq(void)
is_pq_force_disable, codec_supported, rc_mode_supported, resolution_supported, frame_rate_supported, yuv_format_supported,
is_non_secure_session, is_pq_handle_valid, is_non_vpe_session, enable);
- venc_set_extradata(OMX_ExtraDataEncoderOverrideQPInfo, (OMX_BOOL)enable);
- extradata |= enable;
-
- m_pq.pConfig.algo = ADAPTIVE_QP;
- m_pq.pConfig.height = m_sVenc_cfg.input_height;
- m_pq.pConfig.width = m_sVenc_cfg.input_width;
- m_pq.pConfig.mb_height = 16;
- m_pq.pConfig.mb_width = 16;
- m_pq.pConfig.a_qp.pq_enabled = enable;
- m_pq.pConfig.stride = VENUS_Y_STRIDE(COLOR_FMT_NV12, m_sVenc_cfg.input_width);
- m_pq.configure();
m_pq.is_pq_enabled = enable;
+ if (enable) {
+ venc_set_extradata(OMX_ExtraDataEncoderOverrideQPInfo, (OMX_BOOL)enable);
+ extradata |= enable;
+
+ m_pq.pConfig.algo = ADAPTIVE_QP;
+ m_pq.pConfig.height = m_sVenc_cfg.input_height;
+ m_pq.pConfig.width = m_sVenc_cfg.input_width;
+ m_pq.pConfig.mb_height = 16;
+ m_pq.pConfig.mb_width = 16;
+ m_pq.pConfig.a_qp.pq_enabled = enable;
+ m_pq.pConfig.stride = VENUS_Y_STRIDE(COLOR_FMT_NV12, m_sVenc_cfg.input_width);
+ m_pq.configure();
+ }
return;
}
@@ -8062,14 +8050,12 @@ bool venc_dev::venc_dev_pq::reinit(unsigned long format)
{
bool status = false;
- if (configured_format != format) {
+ if ((configured_format != format) && (is_color_format_supported(format))) {
DEBUG_PRINT_HIGH("New format (%lu) is different from configure format (%lu);"
" reinitializing PQ lib", format, configured_format);
deinit();
- if (is_color_format_supported(format)) {
- status = init(format);
- get_caps();
- }
+ status = init(format);
+ get_caps();
} else {
// ignore if new format is same as configured
}