diff options
author | Xin Li <delphij@google.com> | 2017-11-13 14:35:40 -0800 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2017-11-13 14:35:40 -0800 |
commit | 92cada0bf0ced6454b1d3e7b1c282d35999367df (patch) | |
tree | 65e8ee628974cd66c40f315bd52b0f252e0fb0c5 /msm8998 | |
parent | 2f628ab2675eae30c8bd4d0ace0e2b00fd7acb3d (diff) | |
parent | d9d9536f69e1520ac78ec7cd5829d0dff872eab1 (diff) | |
download | media-92cada0bf0ced6454b1d3e7b1c282d35999367df.tar.gz |
Merge commit 'd9d9536f69e1520ac78ec7cd5829d0dff872eab1' into HEAD
Change-Id: I0a257e39860a60dce90e4f6c2c701144b7f89702
Diffstat (limited to 'msm8998')
-rw-r--r-- | msm8998/libstagefrighthw/Android.mk | 3 | ||||
-rw-r--r-- | msm8998/mm-core/inc/OMX_VideoExt.h | 6 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/common/Android.mk | 4 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/vdec/Android.mk | 5 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/vdec/inc/omx_swvdec_utils.h | 2 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h | 1 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/vdec/inc/ts_parser.h | 1 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp | 6 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/venc/Android.mk | 3 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/venc/inc/omx_video_base.h | 1 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp | 34 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp | 11 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp | 7 |
13 files changed, 59 insertions, 25 deletions
diff --git a/msm8998/libstagefrighthw/Android.mk b/msm8998/libstagefrighthw/Android.mk index ce24863..16931e8 100644 --- a/msm8998/libstagefrighthw/Android.mk +++ b/msm8998/libstagefrighthw/Android.mk @@ -50,6 +50,9 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ libdl \ +LOCAL_HEADER_LIBRARIES := \ + media_plugin_headers + LOCAL_MODULE := libstagefrighthw LOCAL_VENDOR_MODULE := true diff --git a/msm8998/mm-core/inc/OMX_VideoExt.h b/msm8998/mm-core/inc/OMX_VideoExt.h index 79561c5..000a78c 100644 --- a/msm8998/mm-core/inc/OMX_VideoExt.h +++ b/msm8998/mm-core/inc/OMX_VideoExt.h @@ -58,6 +58,12 @@ typedef struct OMX_NALSTREAMFORMATTYPE{ OMX_NALUFORMATSTYPE eNaluFormat; } OMX_NALSTREAMFORMATTYPE; +/** AVC additional profiles */ +typedef enum OMX_VIDEO_AVCPROFILEEXTTYPE { + OMX_VIDEO_AVCProfileConstrainedBaseline = 0x10000, /**< Constrained baseline profile */ + OMX_VIDEO_AVCProfileConstrainedHigh = 0x80000, /**< Constrained high profile */ +} OMX_VIDEO_AVCPROFILEEXTTYPE; + /** VP8 profiles */ typedef enum OMX_VIDEO_VP8PROFILETYPE { OMX_VIDEO_VP8ProfileMain = 0x01, diff --git a/msm8998/mm-video-v4l2/vidc/common/Android.mk b/msm8998/mm-video-v4l2/vidc/common/Android.mk index be7989a..962950b 100644 --- a/msm8998/mm-video-v4l2/vidc/common/Android.mk +++ b/msm8998/mm-video-v4l2/vidc/common/Android.mk @@ -30,11 +30,15 @@ endif LOCAL_MODULE := libOmxVidcCommon LOCAL_MODULE_TAGS := optional +LOCAL_PROPRIETARY_MODULE := true LOCAL_CFLAGS := $(libmm-vidc-def) LOCAL_C_INCLUDES := $(libmm-vidc-inc) LOCAL_PRELINK_MODULE := false LOCAL_SHARED_LIBRARIES := liblog libcutils libdl +LOCAL_HEADER_LIBRARIES := \ + libutils_headers \ + libhardware_headers \ LOCAL_SRC_FILES := src/extra_data_handler.cpp LOCAL_SRC_FILES += src/vidc_color_converter.cpp diff --git a/msm8998/mm-video-v4l2/vidc/vdec/Android.mk b/msm8998/mm-video-v4l2/vidc/vdec/Android.mk index 60b07cb..5976add 100644 --- a/msm8998/mm-video-v4l2/vidc/vdec/Android.mk +++ b/msm8998/mm-video-v4l2/vidc/vdec/Android.mk @@ -113,7 +113,10 @@ LOCAL_VENDOR_MODULE := true LOCAL_CFLAGS := $(libmm-vdec-def) -Werror LOCAL_C_INCLUDES += $(libmm-vdec-inc) LOCAL_ADDITIONAL_DEPENDENCIES := $(libmm-vdec-add-dep) -LOCAL_HEADER_LIBRARIES := libnativebase_headers +LOCAL_HEADER_LIBRARIES := \ + libnativebase_headers \ + libhardware_headers \ + media_plugin_headers \ LOCAL_PRELINK_MODULE := false LOCAL_SHARED_LIBRARIES := liblog libcutils libdl libutils diff --git a/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_swvdec_utils.h b/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_swvdec_utils.h index a6502ab..083eb23 100644 --- a/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_swvdec_utils.h +++ b/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_swvdec_utils.h @@ -42,7 +42,7 @@ #include <queue> #include <pthread.h> -#include <cutils/log.h> +#include <log/log.h> extern unsigned int g_omx_swvdec_logmask; ///< global OMX SwVdec logmask variable extern declaration diff --git a/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h b/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h index 71dfc5a..8ae35a4 100644 --- a/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h +++ b/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h @@ -68,7 +68,6 @@ static ptrdiff_t x; //#include <binder/MemoryHeapIon.h> //#else #endif -#include <ui/ANativeObjectBase.h> extern "C" { #include <utils/Log.h> } diff --git a/msm8998/mm-video-v4l2/vidc/vdec/inc/ts_parser.h b/msm8998/mm-video-v4l2/vidc/vdec/inc/ts_parser.h index 2d5d1a4..6d576ad 100644 --- a/msm8998/mm-video-v4l2/vidc/vdec/inc/ts_parser.h +++ b/msm8998/mm-video-v4l2/vidc/vdec/inc/ts_parser.h @@ -36,6 +36,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <stdio.h> #include <inttypes.h> +#include <pthread.h> #ifdef _ANDROID_ extern "C" { diff --git a/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp index 52905d0..a973998 100644 --- a/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp +++ b/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp @@ -3606,8 +3606,12 @@ OMX_ERRORTYPE omx_vdec::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVEL } else if (profileLevelType->nProfileIndex == 2) { profileLevelType->eProfile = OMX_VIDEO_AVCProfileHigh; } else if (profileLevelType->nProfileIndex == 3) { - profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline; + profileLevelType->eProfile = OMX_VIDEO_AVCProfileConstrainedBaseline; } else if (profileLevelType->nProfileIndex == 4) { + profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline; + } else if (profileLevelType->nProfileIndex == 5) { + profileLevelType->eProfile = OMX_VIDEO_AVCProfileConstrainedHigh; + } else if (profileLevelType->nProfileIndex == 6) { profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedHigh; } else { DEBUG_PRINT_LOW("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %u", diff --git a/msm8998/mm-video-v4l2/vidc/venc/Android.mk b/msm8998/mm-video-v4l2/vidc/venc/Android.mk index 024355d..fbd9d78 100644 --- a/msm8998/mm-video-v4l2/vidc/venc/Android.mk +++ b/msm8998/mm-video-v4l2/vidc/venc/Android.mk @@ -118,6 +118,9 @@ LOCAL_ADDITIONAL_DEPENDENCIES := $(libmm-venc-add-dep) LOCAL_PRELINK_MODULE := false LOCAL_SHARED_LIBRARIES := liblog libcutils libdl +LOCAL_HEADER_LIBRARIES := \ + media_plugin_headers \ + libhardware_headers \ ifeq ($(BOARD_USES_ADRENO), true) LOCAL_SHARED_LIBRARIES += libc2dcolorconvert diff --git a/msm8998/mm-video-v4l2/vidc/venc/inc/omx_video_base.h b/msm8998/mm-video-v4l2/vidc/venc/inc/omx_video_base.h index 13b5025..8643e3f 100644 --- a/msm8998/mm-video-v4l2/vidc/venc/inc/omx_video_base.h +++ b/msm8998/mm-video-v4l2/vidc/venc/inc/omx_video_base.h @@ -690,7 +690,6 @@ class omx_video: public qc_omx_component omx_cmd_queue m_opq_meta_q; omx_cmd_queue m_opq_pmem_q; OMX_BUFFERHEADERTYPE meta_buffer_hdr[MAX_NUM_INPUT_BUFFERS]; - pthread_mutex_t m_buf_lock; bool input_flush_progress; bool output_flush_progress; diff --git a/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp index 4493fa6..c091162 100644 --- a/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp +++ b/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp @@ -287,6 +287,7 @@ omx_video::omx_video(): output_use_buffer (false), pending_input_buffers(0), pending_output_buffers(0), + allocate_native_handle(false), m_out_bm_count(0), m_inp_bm_count(0), m_flags(0), @@ -319,8 +320,6 @@ omx_video::omx_video(): property_get("ro.board.platform", platform_name, "0"); strlcpy(m_platform, platform_name, sizeof(m_platform)); #endif - - pthread_mutex_init(&m_buf_lock, NULL); } @@ -362,8 +361,6 @@ omx_video::~omx_video() sem_destroy(&m_cmd_lock); DEBUG_PRINT_HIGH("m_etb_count = %" PRIu64 ", m_fbd_count = %" PRIu64, m_etb_count, m_fbd_count); - - pthread_mutex_destroy(&m_buf_lock); DEBUG_PRINT_HIGH("omx_video: Destructor exit"); DEBUG_PRINT_HIGH("Exiting OMX Video Encoder ..."); } @@ -1566,6 +1563,11 @@ OMX_ERRORTYPE omx_video::get_parameter(OMX_IN OMX_HANDLETYPE hComp, (unsigned int)m_sOutPortDef.nBufferSize, (unsigned int)m_sOutPortDef.nBufferCountMin, (unsigned int)m_sOutPortDef.nBufferCountActual); memcpy(portDefn, &m_sOutPortDef, sizeof(m_sOutPortDef)); + + if (secure_session || allocate_native_handle) { + portDefn->nBufferSize = + sizeof(native_handle_t) + (sizeof(int) * (1/*numFds*/ + 3/*numInts*/)); + } } else { DEBUG_PRINT_ERROR("ERROR: GetParameter called on Bad Port Index"); eRet = OMX_ErrorBadPortIndex; @@ -2745,7 +2747,6 @@ OMX_ERRORTYPE omx_video::use_output_buffer( return OMX_ErrorBadParameter; } - auto_lock l(m_buf_lock); if (!m_out_mem_ptr) { output_use_buffer = true; int nBufHdrSize = 0; @@ -2934,6 +2935,7 @@ OMX_ERRORTYPE omx_video::use_buffer( return OMX_ErrorInvalidState; } if (port == PORT_INDEX_IN) { + auto_lock l(m_lock); eRet = use_input_buffer(hComp,bufferHdr,port,appData,bytes,buffer); } else if (port == PORT_INDEX_OUT) { eRet = use_output_buffer(hComp,bufferHdr,port,appData,bytes,buffer); @@ -3135,7 +3137,9 @@ OMX_ERRORTYPE omx_video::allocate_input_meta_buffer( meta_buffer_hdr, m_inp_mem_ptr); } for (index = 0; ((index < m_sInPortDef.nBufferCountActual) && - meta_buffer_hdr[index].pBuffer); index++); + meta_buffer_hdr[index].pBuffer && + BITMASK_PRESENT(&m_inp_bm_count, index)); index++); + if (index == m_sInPortDef.nBufferCountActual) { DEBUG_PRINT_ERROR("All buffers are allocated input_meta_buffer"); return OMX_ErrorBadParameter; @@ -3559,6 +3563,7 @@ OMX_ERRORTYPE omx_video::allocate_buffer(OMX_IN OMX_HANDLETYPE h // What if the client calls again. if (port == PORT_INDEX_IN) { + auto_lock l(m_lock); #ifdef _ANDROID_ICS_ if (meta_mode_enable) eRet = allocate_input_meta_buffer(hComp,bufferHdr,appData,bytes); @@ -3653,10 +3658,12 @@ OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp, DEBUG_PRINT_LOW("free_buffer on i/p port - Port idx %u, actual cnt %u", nPortIndex, (unsigned int)m_sInPortDef.nBufferCountActual); + pthread_mutex_lock(&m_lock); if (nPortIndex < m_sInPortDef.nBufferCountActual && BITMASK_PRESENT(&m_inp_bm_count, nPortIndex)) { // Clear the bit associated with it. BITMASK_CLEAR(&m_inp_bm_count,nPortIndex); + pthread_mutex_unlock(&m_lock); free_input_buffer (buffer); m_sInPortDef.bPopulated = OMX_FALSE; @@ -3684,6 +3691,7 @@ OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp, #endif } } else { + pthread_mutex_unlock(&m_lock); DEBUG_PRINT_ERROR("ERROR: free_buffer ,Port Index Invalid"); eRet = OMX_ErrorBadPortIndex; } @@ -3704,7 +3712,6 @@ OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp, nPortIndex, (unsigned int)m_sOutPortDef.nBufferCountActual); if (nPortIndex < m_sOutPortDef.nBufferCountActual && BITMASK_PRESENT(&m_out_bm_count, nPortIndex)) { - auto_lock l(m_buf_lock); // Clear the bit associated with it. BITMASK_CLEAR(&m_out_bm_count,nPortIndex); m_sOutPortDef.bPopulated = OMX_FALSE; @@ -3986,7 +3993,7 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE hComp, auto_lock l(m_lock); pmem_data_buf = (OMX_U8 *)m_pInput_pmem[nBufIndex].buffer; - if (pmem_data_buf) { + if (pmem_data_buf && BITMASK_PRESENT(&m_inp_bm_count, nBufIndex)) { memcpy (pmem_data_buf, (buffer->pBuffer + buffer->nOffset), buffer->nFilledLen); } @@ -4736,9 +4743,15 @@ OMX_ERRORTYPE omx_video::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVE profileLevelType->eProfile = OMX_VIDEO_AVCProfileHigh; profileLevelType->eLevel = OMX_VIDEO_AVCLevel52; } else if (profileLevelType->nProfileIndex == 3) { - profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline; + profileLevelType->eProfile = OMX_VIDEO_AVCProfileConstrainedBaseline; profileLevelType->eLevel = OMX_VIDEO_AVCLevel52; } else if (profileLevelType->nProfileIndex == 4) { + profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline; + profileLevelType->eLevel = OMX_VIDEO_AVCLevel52; + } else if (profileLevelType->nProfileIndex == 5) { + profileLevelType->eProfile = OMX_VIDEO_AVCProfileConstrainedHigh; + profileLevelType->eLevel = OMX_VIDEO_AVCLevel52; + } else if (profileLevelType->nProfileIndex == 6) { profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedHigh; profileLevelType->eLevel = OMX_VIDEO_AVCLevel52; } else { @@ -4759,6 +4772,9 @@ OMX_ERRORTYPE omx_video::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVE profileLevelType->eLevel = OMX_VIDEO_AVCLevel4; #ifdef _MSM8226_ } else if (profileLevelType->nProfileIndex == 3) { + profileLevelType->eProfile = OMX_VIDEO_AVCProfileConstrainedBaseline; + profileLevelType->eLevel = OMX_VIDEO_AVCLevel4; + } else if (profileLevelType->nProfileIndex == 4) { profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline; profileLevelType->eLevel = OMX_VIDEO_AVCLevel4; #endif diff --git a/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp index 2f26281..f0468bf 100644 --- a/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp +++ b/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp @@ -1989,6 +1989,7 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp, } else { m_sParamAVC.nPFrames = pParam->nPFrames; if ((m_sParamAVC.eProfile != OMX_VIDEO_AVCProfileBaseline) && + (m_sParamAVC.eProfile != (OMX_VIDEO_AVCPROFILETYPE) OMX_VIDEO_AVCProfileConstrainedBaseline) && (m_sParamAVC.eProfile != (OMX_VIDEO_AVCPROFILETYPE) QOMX_VIDEO_AVCProfileConstrainedBaseline)) m_sParamAVC.nBFrames = pParam->nBFrames; else @@ -2705,17 +2706,10 @@ int omx_venc::async_message_process (void *context, void* message) OMX_COMPONENT_GENERATE_EBD); break; case VEN_MSG_OUTPUT_BUFFER_DONE: - { omxhdr = (OMX_BUFFERHEADERTYPE*)m_sVenc_msg->buf.clientdata; - OMX_U32 bufIndex = (OMX_U32)(omxhdr - omx->m_out_mem_ptr); if ( (omxhdr != NULL) && - (bufIndex < omx->m_sOutPortDef.nBufferCountActual)) { - auto_lock l(omx->m_buf_lock); - if (BITMASK_ABSENT(&(omx->m_out_bm_count), bufIndex)) { - DEBUG_PRINT_ERROR("Recieved FBD for buffer that is already freed !"); - break; - } + ((OMX_U32)(omxhdr - omx->m_out_mem_ptr) < omx->m_sOutPortDef.nBufferCountActual)) { if (!omx->is_secure_session() && (m_sVenc_msg->buf.len <= omxhdr->nAllocLen)) { omxhdr->nFilledLen = m_sVenc_msg->buf.len; omxhdr->nOffset = m_sVenc_msg->buf.offset; @@ -2758,7 +2752,6 @@ int omx_venc::async_message_process (void *context, void* message) omx->post_event ((unsigned long)omxhdr,m_sVenc_msg->statuscode, OMX_COMPONENT_GENERATE_FBD); break; - } case VEN_MSG_NEED_OUTPUT_BUFFER: //TBD what action needs to be done here?? break; diff --git a/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp index 49797ca..0bdd914 100644 --- a/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp +++ b/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp @@ -2087,6 +2087,7 @@ bool venc_dev::venc_set_param(void *paramData, OMX_INDEXTYPE index) return false; } else { if ((pParam->eProfile != OMX_VIDEO_AVCProfileBaseline) && + (pParam->eProfile != (OMX_VIDEO_AVCPROFILETYPE) OMX_VIDEO_AVCProfileConstrainedBaseline) && (pParam->eProfile != (OMX_VIDEO_AVCPROFILETYPE) QOMX_VIDEO_AVCProfileConstrainedBaseline)) { if (pParam->nBFrames) { bFrames = pParam->nBFrames; @@ -5136,9 +5137,11 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel) } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) { if (eProfile == OMX_VIDEO_AVCProfileBaseline) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE; - } else if(eProfile == QOMX_VIDEO_AVCProfileConstrainedBaseline) { + } else if(eProfile == QOMX_VIDEO_AVCProfileConstrainedBaseline || + eProfile == OMX_VIDEO_AVCProfileConstrainedBaseline) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE; - } else if(eProfile == QOMX_VIDEO_AVCProfileConstrainedHigh) { + } else if(eProfile == QOMX_VIDEO_AVCProfileConstrainedHigh || + eProfile == OMX_VIDEO_AVCProfileConstrainedHigh) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH; } else if (eProfile == OMX_VIDEO_AVCProfileMain) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_MAIN; |