am 758a9e8f: libmix: fix out of order decode issue on FUGU
* commit '758a9e8f240d094c4cbc2cf0be6721ff97aae1fb':
libmix: fix out of order decode issue on FUGU
diff --git a/videodecoder/Android.mk b/videodecoder/Android.mk
index d3ff4f2..c9eaeb4 100644
--- a/videodecoder/Android.mk
+++ b/videodecoder/Android.mk
@@ -14,6 +14,10 @@
VideoDecoderAVC.cpp \
VideoDecoderTrace.cpp
+# VideoDecoderHost.cpp includes VideoDecoderWMV.h,
+# which hides overloaded virtual function parseBuffer.
+LOCAL_CLANG_CFLAGS += -Wno-overloaded-virtual
+
LOCAL_C_INCLUDES := \
$(TARGET_OUT_HEADERS)/libva \
$(TARGET_OUT_HEADERS)/libmixvbp
diff --git a/videodecoder/VideoDecoderBase.cpp b/videodecoder/VideoDecoderBase.cpp
index 19b3c5e..291441f 100644
--- a/videodecoder/VideoDecoderBase.cpp
+++ b/videodecoder/VideoDecoderBase.cpp
@@ -259,7 +259,6 @@
}
const VideoRenderBuffer* VideoDecoderBase::getOutput(bool draining, VideoErrorBuffer *outErrBuf) {
- VAStatus vaStatus;
if (mVAStarted == false) {
return NULL;
}
@@ -282,7 +281,7 @@
if (mOutputHead == NULL) {
mOutputTail = NULL;
}
- vaStatus = vaSetTimestampForSurface(mVADisplay, outputByPos->renderBuffer.surface, outputByPos->renderBuffer.timeStamp);
+ vaSetTimestampForSurface(mVADisplay, outputByPos->renderBuffer.surface, outputByPos->renderBuffer.timeStamp);
if (useGraphicBuffer && !mUseGEN) {
vaSyncSurface(mVADisplay, outputByPos->renderBuffer.surface);
fillDecodingErrors(&(outputByPos->renderBuffer));
@@ -327,7 +326,7 @@
}
}
//VTRACE("Output POC %d for display (pts = %.2f)", output->pictureOrder, output->renderBuffer.timeStamp/1E6);
- vaStatus = vaSetTimestampForSurface(mVADisplay, output->renderBuffer.surface, output->renderBuffer.timeStamp);
+ vaSetTimestampForSurface(mVADisplay, output->renderBuffer.surface, output->renderBuffer.timeStamp);
if (useGraphicBuffer && !mUseGEN) {
vaSyncSurface(mVADisplay, output->renderBuffer.surface);
@@ -757,7 +756,6 @@
Decode_Status VideoDecoderBase::setupVA(uint32_t numSurface, VAProfile profile, uint32_t numExtraSurface) {
VAStatus vaStatus = VA_STATUS_SUCCESS;
Decode_Status status;
- VAConfigAttrib attrib;
if (mVAStarted) {
return DECODE_SUCCESS;
@@ -836,6 +834,7 @@
status = getCodecSpecificConfigs(profile, &mVAConfig);
CHECK_STATUS("getCodecSpecificAttributes");
#else
+ VAConfigAttrib attrib;
//We are requesting RT attributes
attrib.type = VAConfigAttribRTFormat;
attrib.value = VA_RT_FORMAT_YUV420;
@@ -1137,7 +1136,6 @@
}
VAStatus vaStatus;
- VAImageFormat imageFormat;
VAImage vaImage;
vaStatus = vaSyncSurface(renderBuffer->display, renderBuffer->surface);
CHECK_VA_STATUS("vaSyncSurface");
diff --git a/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp b/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
index 029484c..3313c40 100644
--- a/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
+++ b/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
@@ -22,6 +22,8 @@
#include "VideoDecoderAVCSecure.h"
#include "VideoFrameInfo.h"
+#include <string.h>
+
#define MAX_SLICEHEADER_BUFFER_SIZE 4096
#define STARTCODE_PREFIX_LEN 3
#define NALU_TYPE_MASK 0x1F
@@ -233,7 +235,6 @@
uint8_t naluType = 0;
int32_t num_nalus;
- int32_t nalu_offset;
int32_t offset;
uint8_t *data_src;
uint8_t *nalu_data;
diff --git a/videoencoder/Android.mk b/videoencoder/Android.mk
index 487ebfc..cb8528f 100644
--- a/videoencoder/Android.mk
+++ b/videoencoder/Android.mk
@@ -21,6 +21,12 @@
VideoEncoderUtils.cpp \
VideoEncoderHost.cpp
+# VideoEncoderAVC.cpp has extraneous parentheses and
+# uses va_enc_h264.h with empty union.
+LOCAL_CLANG_CFLAGS += \
+ -Wno-parentheses-equality \
+ -Wno-extern-c-compat
+
ifeq ($(ENABLE_IMG_GRAPHICS),)
LOCAL_SRC_FILES += PVSoftMPEG4Encoder.cpp
endif
diff --git a/videoencoder/IntelMetadataBuffer.cpp b/videoencoder/IntelMetadataBuffer.cpp
index 28f8e63..41bded7 100644
--- a/videoencoder/IntelMetadataBuffer.cpp
+++ b/videoencoder/IntelMetadataBuffer.cpp
@@ -140,7 +140,7 @@
sp<IMemoryHeap> heap = smem->membase->getMemory(&offset, &size);
data.writeInt32(offset);
data.writeInt32(size);
- data.writeStrongBinder(heap->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(heap));
#ifdef TEST
ALOGI("membase heapID:%d pointer:%x data:%x", \
heap->getHeapID(), smem->membase->pointer(), *((int *)(smem->membase->pointer())));
diff --git a/videoencoder/VideoEncoderAVC.cpp b/videoencoder/VideoEncoderAVC.cpp
index b5eab88..dfb226b 100644
--- a/videoencoder/VideoEncoderAVC.cpp
+++ b/videoencoder/VideoEncoderAVC.cpp
@@ -1096,7 +1096,7 @@
VAEncSequenceParameterBufferH264 *avcSeqParams;
VAEncPackedHeaderParameterBuffer packed_header_param_buffer;
unsigned char *packed_seq_buffer = NULL;
- unsigned int length_in_bits, offset_in_bytes;
+ unsigned int length_in_bits;
LOG_V("Begin\n");
@@ -1215,7 +1215,7 @@
VAEncPictureParameterBufferH264 *avcPicParams;
VAEncPackedHeaderParameterBuffer packed_header_param_buffer;
unsigned char *packed_pic_buffer = NULL;
- unsigned int length_in_bits, offset_in_bytes;
+ unsigned int length_in_bits;
LOG_V("Begin\n");
diff --git a/videoencoder/VideoEncoderBase.cpp b/videoencoder/VideoEncoderBase.cpp
index f383253..268e79e 100644
--- a/videoencoder/VideoEncoderBase.cpp
+++ b/videoencoder/VideoEncoderBase.cpp
@@ -825,6 +825,8 @@
attrib_list.value = VA_ATTRIB_NOT_SUPPORTED;
vaStatus = vaGetConfigAttributes(mVADisplay, profile, VAEntrypointEncSlice, &attrib_list, 1);
+ CHECK_VA_STATUS_RETURN("vaQueryConfigAttributes");
+
if(attrib_list.value == VA_ATTRIB_NOT_SUPPORTED )
mAutoReference = false;
else
@@ -1190,7 +1192,7 @@
}
}
- return ENCODE_SUCCESS;
+ return ret;
}
Encode_Status VideoEncoderBase::setConfig(VideoParamConfigSet *videoEncConfig) {
diff --git a/videoencoder/VideoEncoderUtils.cpp b/videoencoder/VideoEncoderUtils.cpp
index 6eda981..5f78879 100644
--- a/videoencoder/VideoEncoderUtils.cpp
+++ b/videoencoder/VideoEncoderUtils.cpp
@@ -427,7 +427,6 @@
Encode_Status VASurfaceMap::MappingSurfaceID(intptr_t value) {
VAStatus vaStatus = VA_STATUS_SUCCESS;
- VASurfaceID surface;
//try to get kbufhandle from SurfaceID
uint32_t fourCC = 0;
@@ -627,7 +626,6 @@
}
uint8_t *srcY, *dstY;
- uint8_t *srcU, *srcV;
uint8_t *srcUV, *dstUV;
srcY = pSrcBuffer + srcY_offset;
diff --git a/videoencoder/VideoEncoderVP8.cpp b/videoencoder/VideoEncoderVP8.cpp
index d65b385..4e79361 100644
--- a/videoencoder/VideoEncoderVP8.cpp
+++ b/videoencoder/VideoEncoderVP8.cpp
@@ -103,7 +103,7 @@
CHECK_VA_STATUS_RETURN("vaRenderPicture");
LOG_V( "End\n");
- return ret;
+ return ret;
}
Encode_Status VideoEncoderVP8::renderPictureParams(EncodeTask *task) {
@@ -287,9 +287,9 @@
uint32_t i;
vaStatus = vaCreateBuffer(mVADisplay, mVAContext,
- VAEncMiscParameterBufferType,
- sizeof(VAEncMiscParameterBuffer) + sizeof(VAEncMiscParameterTemporalLayerStructure),
- 1, NULL, &layer_struc_buf);
+ VAEncMiscParameterBufferType,
+ sizeof(VAEncMiscParameterBuffer) + sizeof(VAEncMiscParameterTemporalLayerStructure),
+ 1, NULL, &layer_struc_buf);
CHECK_VA_STATUS_RETURN("vaCreateBuffer");
vaMapBuffer(mVADisplay, layer_struc_buf, (void **)&misc_param);
@@ -379,24 +379,24 @@
Encode_Status VideoEncoderVP8::derivedSetParams(VideoParamConfigSet *videoEncParams) {
- CHECK_NULL_RETURN_IFFAIL(videoEncParams);
- VideoParamsVP8 *encParamsVP8 = reinterpret_cast <VideoParamsVP8*> (videoEncParams);
+ CHECK_NULL_RETURN_IFFAIL(videoEncParams);
+ VideoParamsVP8 *encParamsVP8 = reinterpret_cast <VideoParamsVP8*> (videoEncParams);
- if (encParamsVP8->size != sizeof(VideoParamsVP8)) {
- return ENCODE_INVALID_PARAMS;
- }
+ if (encParamsVP8->size != sizeof(VideoParamsVP8)) {
+ return ENCODE_INVALID_PARAMS;
+ }
- mVideoParamsVP8 = *encParamsVP8;
- return ENCODE_SUCCESS;
+ mVideoParamsVP8 = *encParamsVP8;
+ return ENCODE_SUCCESS;
}
Encode_Status VideoEncoderVP8::derivedGetParams(VideoParamConfigSet *videoEncParams) {
- CHECK_NULL_RETURN_IFFAIL(videoEncParams);
- VideoParamsVP8 *encParamsVP8 = reinterpret_cast <VideoParamsVP8*> (videoEncParams);
+ CHECK_NULL_RETURN_IFFAIL(videoEncParams);
+ VideoParamsVP8 *encParamsVP8 = reinterpret_cast <VideoParamsVP8*> (videoEncParams);
- if (encParamsVP8->size != sizeof(VideoParamsVP8)) {
- return ENCODE_INVALID_PARAMS;
+ if (encParamsVP8->size != sizeof(VideoParamsVP8)) {
+ return ENCODE_INVALID_PARAMS;
}
*encParamsVP8 = mVideoParamsVP8;
@@ -405,7 +405,6 @@
Encode_Status VideoEncoderVP8::derivedGetConfig(VideoParamConfigSet *videoEncConfig) {
- int layer_id;
CHECK_NULL_RETURN_IFFAIL(videoEncConfig);
switch (videoEncConfig->type)
@@ -460,7 +459,6 @@
Encode_Status VideoEncoderVP8::derivedSetConfig(VideoParamConfigSet *videoEncConfig) {
- int layer_id;
CHECK_NULL_RETURN_IFFAIL(videoEncConfig);
switch (videoEncConfig->type)
@@ -500,13 +498,10 @@
mVideoParamsVP8.max_frame_size_ratio = encConfigVP8MaxFrameSizeRatio->max_frame_size_ratio;
mRenderMaxFrameSize = true;
- }
+ }
break;
case VideoConfigTypeIDRRequest:{
- VideoParamConfigSet *encConfigVP8KFrameRequest =
- reinterpret_cast<VideoParamConfigSet*> (videoEncConfig);
-
mVideoConfigVP8.force_kf = 1;
mForceKFrame = true;
}