Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- project hardware/qcom/display/
- diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
- index 196d5a7..fd600f9 100644
- --- a/libgralloc/alloc_controller.cpp
- +++ b/libgralloc/alloc_controller.cpp
- @@ -34,7 +34,9 @@
- #include "gralloc_priv.h"
- #include "alloc_controller.h"
- #include "memalloc.h"
- +#ifdef USE_ION
- #include "ionalloc.h"
- +#endif
- #include "pmemalloc.h"
- #include "ashmemalloc.h"
- #include "gr.h"
- project hardware/qcom/media-caf/
- diff --git a/mm-video/vidc/vdec/Android.mk b/mm-video/vidc/vdec/Android.mk
- index 4ff6290..5da6869 100644
- --- a/mm-video/vidc/vdec/Android.mk
- +++ b/mm-video/vidc/vdec/Android.mk
- @@ -43,9 +43,9 @@ endif
- libOmxVdec-def += -D_ANDROID_ICS_
- -#ifeq ($(TARGET_USES_ION),true)
- +ifeq ($(TARGET_USES_ION),true)
- libOmxVdec-def += -DUSE_ION
- -#endif
- +endif
- # ---------------------------------------------------------------------------------
- # Make the Shared library (libOmxVdec)
- @@ -78,9 +78,7 @@ libmm-vdec-inc += frameworks/av/include/media/stagefright
- libmm-vdec-inc += hardware/qcom/$(DISPLAY)/libqservice
- libmm-vdec-inc += frameworks/av/media/libmediaplayerservice
- libmm-vdec-inc += frameworks/native/include/binder
- -ifeq ($(DISPLAY),display-caf)
- libmm-vdec-inc += hardware/qcom/$(DISPLAY)/libqdutils
- -endif
- LOCAL_MODULE := libOmxVdec
- diff --git a/mm-video/vidc/vdec/inc/omx_vdec.h b/mm-video/vidc/vdec/inc/omx_vdec.h
- index d2e8a55..02f7388 100644
- --- a/mm-video/vidc/vdec/inc/omx_vdec.h
- +++ b/mm-video/vidc/vdec/inc/omx_vdec.h
- @@ -886,7 +886,9 @@ private:
- OMX_QCOM_PLATFORM_PRIVATE_ENTRY m_platform_entry_client[MAX_COUNT];
- OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO m_pmem_info_client[MAX_COUNT];
- OMX_BUFFERHEADERTYPE m_out_mem_ptr_client[MAX_COUNT];
- +#ifdef USE_ION
- struct vdec_ion op_buf_ion_info[MAX_COUNT];
- +#endif
- unsigned char *pmem_baseaddress[MAX_COUNT];
- int pmem_fd[MAX_COUNT];
- struct vidc_heap
- diff --git a/mm-video/vidc/vdec/src/omx_vdec.cpp b/mm-video/vidc/vdec/src/omx_vdec.cpp
- index b3df6b5..33af484 100644
- --- a/mm-video/vidc/vdec/src/omx_vdec.cpp
- +++ b/mm-video/vidc/vdec/src/omx_vdec.cpp
- @@ -1317,11 +1317,13 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
- goto cleanup;
- }
- +#if 0
- ioctl_msg = {NULL,NULL};
- ioctl_msg.out = (void*)¤t_performance;
- (void)(ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_GET_PERF_LEVEL, &ioctl_msg));
- DEBUG_PRINT_HIGH("component_init: current performance level = %u ",
- current_performance);
- +#endif
- #ifdef _ANDROID_
- if(is_secure)
- @@ -4351,7 +4353,7 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
- drv_ctx.ptr_outputbuffer[i].bufferaddr = buff;
- drv_ctx.ptr_outputbuffer[i].mmaped_size =
- drv_ctx.ptr_outputbuffer[i].buffer_len = drv_ctx.op_buf.buffer_size;
- -#if defined(_ANDROID_ICS_)
- +#if 0
- if (drv_ctx.interlace != VDEC_InterlaceFrameProgressive) {
- int enable = 1;
- setMetaData(handle, PP_PARAM_INTERLACED, (void*)&enable);
- @@ -7121,11 +7123,9 @@ int omx_vdec::async_message_process (void *context, void* message)
- }
- DEBUG_PRINT_LOW("[RespBufDone] Buf(%p), Data_len(%d), Ts(%lld), Pic_type(%u), "\
- - "Flags(0x%x), MetadataInfo: len(%d), offset(%d)", omxhdr,
- + "Flags(0x%x)", omxhdr,
- vdec_msg->msgdata.output_frame.len, vdec_msg->msgdata.output_frame.time_stamp,
- - vdec_msg->msgdata.output_frame.pic_type, vdec_msg->msgdata.output_frame.flags,
- - vdec_msg->msgdata.output_frame.metadata_len,
- - vdec_msg->msgdata.output_frame.metadata_offset);
- + vdec_msg->msgdata.output_frame.pic_type, vdec_msg->msgdata.output_frame.flags);
- if (omxhdr && omxhdr->pOutputPortPrivate &&
- ((omxhdr - omx->m_out_mem_ptr) < omx->drv_ctx.op_buf.actualcount) &&
- @@ -7171,8 +7171,6 @@ int omx_vdec::async_message_process (void *context, void* message)
- vdec_msg->msgdata.output_frame.framesize.top;
- output_respbuf->len = vdec_msg->msgdata.output_frame.len;
- output_respbuf->offset = vdec_msg->msgdata.output_frame.offset;
- - output_respbuf->metadata_len = vdec_msg->msgdata.output_frame.metadata_len;
- - output_respbuf->metadata_offset = vdec_msg->msgdata.output_frame.metadata_offset;
- output_respbuf->time_stamp = vdec_msg->msgdata.output_frame.time_stamp;
- output_respbuf->flags = vdec_msg->msgdata.output_frame.flags;
- output_respbuf->pic_type = vdec_msg->msgdata.output_frame.pic_type;
- @@ -8734,12 +8732,6 @@ void omx_vdec::handle_extradata(OMX_BUFFERHEADERTYPE *p_buf_hdr)
- if (drv_ctx.extradata && (p_buf_hdr->nFlags & OMX_BUFFERFLAG_EXTRADATA))
- {
- - if (output_respbuf->metadata_offset != p_buf_hdr->nFilledLen)
- - {
- - DEBUG_PRINT_HIGH("WARN: metadata_offset(%d) != nAllocLen(%d)",
- - output_respbuf->metadata_offset, p_buf_hdr->nFilledLen);
- - p_extra = NULL;
- - }
- // Process driver extradata
- while(p_extra && p_extra->eType != VDEC_EXTRADATA_NONE)
- {
- @@ -9146,7 +9138,7 @@ void omx_vdec::append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
- interlace_format->bInterlaceFormat = OMX_FALSE;
- interlace_format->nInterlaceFormats = OMX_InterlaceFrameProgressive;
- drv_ctx.interlace = VDEC_InterlaceFrameProgressive;
- -#if defined(_ANDROID_ICS_)
- +#if 0
- if(handle)
- {
- setMetaData(handle, PP_PARAM_INTERLACED, (void*)&enable);
- @@ -9158,7 +9150,7 @@ void omx_vdec::append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
- interlace_format->bInterlaceFormat = OMX_TRUE;
- interlace_format->nInterlaceFormats = OMX_InterlaceInterleaveFrameTopFieldFirst;
- drv_ctx.interlace = VDEC_InterlaceInterleaveFrameTopFieldFirst;
- -#if defined(_ANDROID_ICS_)
- +#if 0
- enable = 1;
- if(handle)
- {
- @@ -9844,7 +9836,9 @@ void omx_vdec::allocate_color_convert_buf::init_members() {
- memset(m_platform_entry_client,0,sizeof(m_platform_entry_client));
- memset(m_pmem_info_client,0,sizeof(m_pmem_info_client));
- memset(m_out_mem_ptr_client,0,sizeof(m_out_mem_ptr_client));
- +#ifdef USE_ION
- memset(op_buf_ion_info,0,sizeof(m_platform_entry_client));
- +#endif
- for (int i = 0; i < MAX_COUNT;i++)
- pmem_fd[i] = -1;
- }
- @@ -10037,7 +10031,9 @@ OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::free_output_buffer(
- close(pmem_fd[index]);
- }
- pmem_fd[index] = -1;
- +#ifdef USE_ION
- omx->free_ion_memory(&op_buf_ion_info[index]);
- +#endif
- m_heap_ptr[index].video_heap_ptr = NULL;
- if (allocated_count > 0)
- allocated_count--;
- @@ -10087,6 +10083,7 @@ OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::allocate_buffers_color_conve
- return OMX_ErrorUndefined;
- }
- unsigned int i = allocated_count;
- +#ifdef USE_ION
- op_buf_ion_info[i].ion_device_fd = omx->alloc_map_ion_memory(
- buffer_size_req,buffer_alignment_req,
- &op_buf_ion_info[i].ion_alloc_data,&op_buf_ion_info[i].fd_ion_data,
- @@ -10097,18 +10094,23 @@ OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::allocate_buffers_color_conve
- DEBUG_PRINT_ERROR("\n alloc_map_ion failed in color_convert");
- return OMX_ErrorInsufficientResources;
- }
- +#endif
- pmem_baseaddress[i] = (unsigned char *)mmap(NULL,buffer_size_req,
- PROT_READ|PROT_WRITE,MAP_SHARED,pmem_fd[i],0);
- if (pmem_baseaddress[i] == MAP_FAILED) {
- DEBUG_PRINT_ERROR("\n MMAP failed for Size %d",buffer_size_req);
- close(pmem_fd[i]);
- +#ifdef USE_ION
- omx->free_ion_memory(&op_buf_ion_info[i]);
- +#endif
- return OMX_ErrorInsufficientResources;
- }
- +#ifdef USE_ION
- m_heap_ptr[i].video_heap_ptr = new VideoHeap (
- op_buf_ion_info[i].ion_device_fd,buffer_size_req,
- pmem_baseaddress[i],op_buf_ion_info[i].ion_alloc_data.handle,pmem_fd[i]);
- +#endif
- m_pmem_info_client[i].pmem_fd = (OMX_U32)m_heap_ptr[i].video_heap_ptr.get();
- m_pmem_info_client[i].offset = 0;
- m_platform_entry_client[i].entry = (void *)&m_pmem_info_client[i];
- @@ -10202,11 +10204,13 @@ int omx_vdec::set_turbo_mode(bool mode)
- if (mode == (int)true) {
- struct vdec_ioctl_msg ioctl_msg;
- DEBUG_PRINT_HIGH("Enable Turbo mode");
- +#if 0
- if (ioctl(drv_ctx.video_driver_fd,VDEC_IOCTL_SET_PERF_CLK,
- &ioctl_msg) < 0) {
- DEBUG_PRINT_ERROR("ioctl VDEC_IOCTL_SET_PERF_CLK failed");
- return 1;
- }
- +#endif
- } else {
- DEBUG_PRINT_HIGH("Disable Turbo mode not suported");
- return 1;
- diff --git a/mm-video/vidc/venc/src/omx_video_base.cpp b/mm-video/vidc/venc/src/omx_video_base.cpp
- index 6c5350f..6671495 100644
- --- a/mm-video/vidc/venc/src/omx_video_base.cpp
- +++ b/mm-video/vidc/venc/src/omx_video_base.cpp
- @@ -2970,11 +2970,13 @@ OMX_ERRORTYPE omx_video::allocate_output_buffer(
- m_out_bm_count = BITMASK_SET_U32(m_out_bm_count,i);
- +#ifdef USE_ION
- DEBUG_PRINT_HIGH("alloc_output: idx = %d, fd = %d, addr = %p, offset = %d, "
- "ion_device_fd = %d, ion_handle = %p, length = %d", i,
- m_pOutput_pmem[i].fd, m_pOutput_pmem[i].buffer, m_pOutput_pmem[i].offset,
- m_pOutput_ion[i].ion_device_fd, m_pOutput_ion[i].ion_alloc_data.handle,
- m_pOutput_pmem[i].size);
- +#endif
- if(dev_use_buf(&m_pOutput_pmem[i],PORT_INDEX_OUT,i) != true)
- {
- diff --git a/mm-video/vidc/venc/src/omx_video_encoder.cpp b/mm-video/vidc/venc/src/omx_video_encoder.cpp
- index df5c720..508bc28 100644
- --- a/mm-video/vidc/venc/src/omx_video_encoder.cpp
- +++ b/mm-video/vidc/venc/src/omx_video_encoder.cpp
- @@ -1710,8 +1710,10 @@ int omx_venc::async_message_process (void *context, void* message)
- omxhdr->nOffset = m_sVenc_msg->buf.offset;
- omxhdr->nTimeStamp = m_sVenc_msg->buf.timestamp;
- omxhdr->nFlags = m_sVenc_msg->buf.flags;
- +#if 0
- omx->extradata_len[idx] = m_sVenc_msg->buf.metadata_len;
- omx->extradata_offset[idx] = m_sVenc_msg->buf.metadata_offset;
- +#endif
- DEBUG_PRINT_LOW("[RespBufDone]: pBuffer = 0x%x, nFilledLen = %d, "\
- "nAllocLen = %d, Ts = %lld, nFlags = 0x%x, nOffset = %d, "\
- "Extradata Info: Idx = %d, Offset(%d), len(%d)",
- diff --git a/mm-video/vidc/venc/src/video_encoder_device.cpp b/mm-video/vidc/venc/src/video_encoder_device.cpp
- index 385d6df..6e81a34 100644
- --- a/mm-video/vidc/venc/src/video_encoder_device.cpp
- +++ b/mm-video/vidc/venc/src/video_encoder_device.cpp
- @@ -556,6 +556,7 @@ bool venc_dev::venc_get_buf_req(unsigned long *min_buff_count,
- bool venc_dev::venc_get_curr_perf_lvl(OMX_PTR curr_perf)
- {
- +#if 0
- struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
- ioctl_msg.out = (void*)curr_perf;
- if (ioctl(m_nDriver_fd, VEN_IOCTL_GET_PERF_LEVEL, &ioctl_msg) < 0)
- @@ -564,6 +565,7 @@ bool venc_dev::venc_get_curr_perf_lvl(OMX_PTR curr_perf)
- return false;
- }
- DEBUG_PRINT_HIGH("get_curr_perf_lvl = %u", *(OMX_U32 *)(curr_perf));
- +#endif
- return true;
- }
Add Comment
Please, Sign In to add comment