summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm-core/src/8960/qc_registry_table_android.c32
-rwxr-xr-xmm-video/vidc/vdec/Android.mk3
-rw-r--r--mm-video/vidc/vdec/inc/omx_vdec.h6
-rw-r--r--mm-video/vidc/vdec/src/omx_vdec.cpp35
4 files changed, 74 insertions, 2 deletions
diff --git a/mm-core/src/8960/qc_registry_table_android.c b/mm-core/src/8960/qc_registry_table_android.c
index f2d7ab9b..130a11c5 100644
--- a/mm-core/src/8960/qc_registry_table_android.c
+++ b/mm-core/src/8960/qc_registry_table_android.c
@@ -57,6 +57,38 @@ omx_core_cb_type core[] =
}
},
{
+ "OMX.qcom.video.decoder.avc.smoothstreaming",
+ NULL, // Create instance function
+ // Unique instance handle
+ {
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ NULL, // Shared object library handle
+ "libOmxVdec.so",
+ {
+ "video_decoder.avc"
+ }
+ },
+ {
+ "OMX.qcom.video.decoder.avc.smoothstreaming.secure",
+ NULL, // Create instance function
+ // Unique instance handle
+ {
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ NULL, // Shared object library handle
+ "libOmxVdec.so",
+ {
+ "video_decoder.avc"
+ }
+ },
+ {
"OMX.qcom.video.decoder.avc.secure",
NULL, // Create instance function
// Unique instance handle
diff --git a/mm-video/vidc/vdec/Android.mk b/mm-video/vidc/vdec/Android.mk
index 28bd3548..36882e98 100755
--- a/mm-video/vidc/vdec/Android.mk
+++ b/mm-video/vidc/vdec/Android.mk
@@ -65,7 +65,7 @@ libmm-vdec-inc += hardware/qcom/media/libc2dcolorconvert
libmm-vdec-inc += hardware/qcom/display/libcopybit
libmm-vdec-inc += frameworks/av/include/media/stagefright
libmm-vdec-inc += hardware/qcom/display/libqservice
-
+libmm-vdec-inc += hardware/qcom/display/libqdutils
LOCAL_MODULE := libOmxVdec
LOCAL_MODULE_TAGS := optional
@@ -77,6 +77,7 @@ LOCAL_SHARED_LIBRARIES := liblog libutils libbinder libcutils libdl
LOCAL_SHARED_LIBRARIES += libdivxdrmdecrypt
LOCAL_SHARED_LIBRARIES += libqservice
+LOCAL_SHARED_LIBRARIES += libqdMetaData
LOCAL_SRC_FILES := src/frameparser.cpp
LOCAL_SRC_FILES += src/h264_utils.cpp
diff --git a/mm-video/vidc/vdec/inc/omx_vdec.h b/mm-video/vidc/vdec/inc/omx_vdec.h
index 59d28f80..f3cfa5b9 100644
--- a/mm-video/vidc/vdec/inc/omx_vdec.h
+++ b/mm-video/vidc/vdec/inc/omx_vdec.h
@@ -45,6 +45,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string.h>
#include <inttypes.h>
#include <cstddef>
+#include <gralloc_priv.h>
static ptrdiff_t x;
@@ -818,6 +819,11 @@ private:
int output_capability;
bool streaming[MAX_PORT];
#endif
+
+ // added for smooth streaming
+ private_handle_t * native_buffer[MAX_NUM_INPUT_OUTPUT_BUFFERS];
+ bool m_use_smoothstreaming;
+
unsigned int m_fill_output_msg;
class allocate_color_convert_buf {
public:
diff --git a/mm-video/vidc/vdec/src/omx_vdec.cpp b/mm-video/vidc/vdec/src/omx_vdec.cpp
index dda6e167..7f029689 100644
--- a/mm-video/vidc/vdec/src/omx_vdec.cpp
+++ b/mm-video/vidc/vdec/src/omx_vdec.cpp
@@ -48,6 +48,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "omx_vdec.h"
#include <fcntl.h>
#include <limits.h>
+#include <qdMetaData.h>
#ifndef _ANDROID_
#include <sys/ioctl.h>
@@ -490,6 +491,7 @@ omx_vdec::omx_vdec(): m_state(OMX_StateInvalid),
#endif
,m_desc_buffer_ptr(NULL)
,m_extradata(NULL)
+ ,m_use_smoothstreaming(false)
{
/* Assumption is that , to begin with , we have all the frames with decoder */
DEBUG_PRINT_HIGH("In OMX vdec Constructor");
@@ -540,6 +542,7 @@ omx_vdec::omx_vdec(): m_state(OMX_StateInvalid),
#endif
m_fill_output_msg = OMX_COMPONENT_GENERATE_FTB;
client_buffers.set_vdec_client(this);
+ memset(native_buffer, 0, sizeof(native_buffer));
}
@@ -1170,6 +1173,17 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
int r;
OMX_STRING device_name = "/dev/msm_vidc_dec";
+ if(!strncmp(role, "OMX.qcom.video.decoder.avc.smoothstreaming",OMX_MAX_STRINGNAME_SIZE)){
+ ALOGI("smooth streaming role");
+ m_use_smoothstreaming = true;
+ role = "OMX.qcom.video.decoder.avc";
+ }
+ if(!strncmp(role, "OMX.qcom.video.decoder.avc.smoothstreaming.secure",OMX_MAX_STRINGNAME_SIZE)){
+ ALOGI("secure smooth streaming role");
+ m_use_smoothstreaming = true;
+ role = "OMX.qcom.video.decoder.avc.secure";
+ }
+
if(!strncmp(role, "OMX.qcom.video.decoder.avc.secure",OMX_MAX_STRINGNAME_SIZE)){
secure_mode = true;
arbitrary_bytes = false;
@@ -1581,6 +1595,13 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
memset(&h264_mv_buff,0,sizeof(struct h264_mv_buffer));
+ if (m_use_smoothstreaming) {
+ int rc = ioctl(drv_ctx.video_driver_fd,
+ VDEC_IOCTL_SET_CONT_ON_RECONFIG);
+ if(rc < 0) {
+ DEBUG_PRINT_ERROR("Failed to enable Smooth Streaming on driver.");
+ }
+ }
cleanup:
if (secure_mode && (eRet == OMX_ErrorNone)) {
@@ -4039,6 +4060,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;
+ native_buffer[i] = handle;
} else
#endif
@@ -6390,7 +6412,6 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
OMX_BUFFERHEADERTYPE * buffer)
{
OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO *pPMEMInfo = NULL;
-
if (!buffer || (buffer - m_out_mem_ptr) >= drv_ctx.op_buf.actualcount)
{
DEBUG_PRINT_ERROR("\n [FBD] ERROR in ptr(%p)", buffer);
@@ -6558,6 +6579,18 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
return OMX_ErrorBadParameter;
}
+ // ss change
+ if (m_use_smoothstreaming) {
+ OMX_U32 buf_index = buffer - m_out_mem_ptr;
+ private_handle_t * handle = NULL;
+ BufferDim_t dim;
+ dim.sliceWidth = m_port_def.format.video.nStride;
+ dim.sliceHeight = m_port_def.format.video.nSliceHeight;
+ handle = (private_handle_t *)native_buffer[buf_index];
+ DEBUG_PRINT_LOW("set metadata: update buffer geo with stride %d slice %d", dim.sliceWidth, dim.sliceHeight);
+ setMetaData(handle, UPDATE_BUFFER_GEOMETRY, (void*)&dim);
+ }
+
return OMX_ErrorNone;
}