aboutsummaryrefslogtreecommitdiff
path: root/videodecoder
diff options
context:
space:
mode:
Diffstat (limited to 'videodecoder')
-rw-r--r--videodecoder/Android.mk4
-rw-r--r--videodecoder/VideoDecoderAVC.cpp7
-rw-r--r--videodecoder/VideoDecoderBase.cpp2
-rw-r--r--videodecoder/VideoDecoderDefs.h2
-rw-r--r--videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp22
5 files changed, 31 insertions, 6 deletions
diff --git a/videodecoder/Android.mk b/videodecoder/Android.mk
index b8ef199..c9eaeb4 100644
--- a/videodecoder/Android.mk
+++ b/videodecoder/Android.mk
@@ -2,8 +2,8 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-ifeq ($(TARGET_HAS_VPP),true)
-LOCAL_CFLAGS += -DTARGET_HAS_VPP
+ifeq ($(TARGET_HAS_ISV),true)
+LOCAL_CFLAGS += -DTARGET_HAS_ISV
endif
LOCAL_SRC_FILES := \
diff --git a/videodecoder/VideoDecoderAVC.cpp b/videodecoder/VideoDecoderAVC.cpp
index 8ed91f9..ad4ad33 100644
--- a/videodecoder/VideoDecoderAVC.cpp
+++ b/videodecoder/VideoDecoderAVC.cpp
@@ -517,6 +517,13 @@ Decode_Status VideoDecoderAVC::updateReferenceFrames(vbp_picture_data_h264 *picD
VAPictureH264 *dpb = picParam->ReferenceFrames;
VAPictureH264 *refFrame = NULL;
+ for(int i = 0; i < picParam->num_ref_frames; i++) {
+ dpb->picture_id = findSurface(dpb);
+ dpb++;
+ }
+
+ return DECODE_SUCCESS;
+
// invalidate DPB in the picture buffer
memset(picParam->ReferenceFrames, 0xFF, sizeof(picParam->ReferenceFrames));
picParam->num_ref_frames = 0;
diff --git a/videodecoder/VideoDecoderBase.cpp b/videodecoder/VideoDecoderBase.cpp
index d1383fc..74670e8 100644
--- a/videodecoder/VideoDecoderBase.cpp
+++ b/videodecoder/VideoDecoderBase.cpp
@@ -773,7 +773,7 @@ Decode_Status VideoDecoderBase::setupVA(uint32_t numSurface, VAProfile profile,
mRotationDegrees = 0;
if (mConfigBuffer.flag & USE_NATIVE_GRAPHIC_BUFFER){
-#ifdef TARGET_HAS_VPP
+#ifdef TARGET_HAS_ISV
if (mVideoFormatInfo.actualBufferNeeded > mConfigBuffer.surfaceNumber - mConfigBuffer.vppBufferNum)
#else
if (mVideoFormatInfo.actualBufferNeeded > mConfigBuffer.surfaceNumber)
diff --git a/videodecoder/VideoDecoderDefs.h b/videodecoder/VideoDecoderDefs.h
index c9b5d30..708725b 100644
--- a/videodecoder/VideoDecoderDefs.h
+++ b/videodecoder/VideoDecoderDefs.h
@@ -153,7 +153,7 @@ struct VideoConfigBuffer {
VideoExtensionBuffer *ext;
void* nativeWindow;
uint32_t rotationDegrees;
-#ifdef TARGET_HAS_VPP
+#ifdef TARGET_HAS_ISV
uint32_t vppBufferNum;
#endif
};
diff --git a/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp b/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
index eb16e38..5b36d7e 100644
--- a/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
+++ b/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
@@ -151,6 +151,16 @@ Decode_Status VideoDecoderAVCSecure::processModularInputBuffer(VideoDecodeBuffer
VTRACE("nalu_type = 0x%x, nalu_size = %d, nalu_offset = 0x%x", nalu_type, nalu_size, nalu_offset);
+ // FIXME: this is a w/a to handle the case when two frame data was wrongly packed into one buffer
+ // especially IDR + Slice. let it gracefully quit.
+ if ((naluType == h264_NAL_UNIT_TYPE_SLICE) && (i > 0)) {
+ uint8_t former_naluType = pFrameInfo->nalus[i-1].type & NALU_TYPE_MASK;
+ if (former_naluType == h264_NAL_UNIT_TYPE_IDR) {
+ ETRACE("Invalid parameter: IDR slice + SLICE in one buffer");
+ break; // abandon this slice
+ }
+ }
+
if (naluType >= h264_NAL_UNIT_TYPE_SLICE && naluType <= h264_NAL_UNIT_TYPE_IDR) {
mIsEncryptData = 1;
@@ -382,14 +392,18 @@ Decode_Status VideoDecoderAVCSecure::decodeFrame(VideoDecodeBuffer *buffer, vbp_
CHECK_STATUS("acquireSurfaceBuffer");
if (mModularMode) {
- parseModularSliceHeader(data);
+ status = parseModularSliceHeader(data);
}
else {
- parseClassicSliceHeader(data);
+ status = parseClassicSliceHeader(data);
}
if (status != DECODE_SUCCESS) {
endDecodingFrame(true);
+ if (status == DECODE_PARSER_FAIL) {
+ ETRACE("parse frame failed with DECODE_PARSER_FAIL");
+ status = DECODE_INVALID_DATA;
+ }
return status;
}
@@ -459,6 +473,10 @@ Decode_Status VideoDecoderAVCSecure::continueDecodingFrame(vbp_data_h264 *data)
return DECODE_FAIL;
}
VTRACE("picData->num_slices = %d", picData->num_slices);
+ if ((picData->num_slices > 1) && mModularMode) {
+ ETRACE("MDRM multi-slice not supported yet!");
+ return DECODE_PARSER_FAIL;
+ }
for (uint32_t sliceIndex = 0; sliceIndex < picData->num_slices; sliceIndex++) {
status = decodeSlice(data, picIndex, sliceIndex);
if (status != DECODE_SUCCESS) {