aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistair Strachan <alistair.strachan@imgtec.com>2016-06-02 20:45:52 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-06-02 20:45:52 +0000
commite57872a25271f414c8b231bc735f9092fc6c217f (patch)
treeb21839be5d84b73b3b2bdb02c05c5024af3bbc3b
parent58d68daf09e52b0d603b0c41f0bd95fcfd0c454c (diff)
parentbb7b551f976e85040c4ddfb92100830c8c36d479 (diff)
downloadlibmix-e57872a25271f414c8b231bc735f9092fc6c217f.tar.gz
Introduce independent hstride and vstride, and use them.
am: bb7b551f97 * commit 'bb7b551f976e85040c4ddfb92100830c8c36d479': Introduce independent hstride and vstride, and use them. Change-Id: Ibb3ab85b0856e2469b79e287ced0b667d8e13561
-rw-r--r--videodecoder/VideoDecoderBase.cpp16
-rw-r--r--videodecoder/VideoDecoderDefs.h3
2 files changed, 10 insertions, 9 deletions
diff --git a/videodecoder/VideoDecoderBase.cpp b/videodecoder/VideoDecoderBase.cpp
index ceb7b60..6d214bb 100644
--- a/videodecoder/VideoDecoderBase.cpp
+++ b/videodecoder/VideoDecoderBase.cpp
@@ -913,14 +913,14 @@ Decode_Status VideoDecoderBase::setupVA(uint32_t numSurface, VAProfile profile,
mVASurfaceAttrib->pixel_format = VA_FOURCC_NV12;
mVASurfaceAttrib->width = mVideoFormatInfo.surfaceWidth;
mVASurfaceAttrib->height = mVideoFormatInfo.surfaceHeight;
- mVASurfaceAttrib->data_size = mConfigBuffer.graphicBufferStride * mVideoFormatInfo.surfaceHeight * 1.5;
+ mVASurfaceAttrib->data_size = mConfigBuffer.graphicBufferHStride * mConfigBuffer.graphicBufferVStride * 1.5;
mVASurfaceAttrib->num_planes = 2;
- mVASurfaceAttrib->pitches[0] = mConfigBuffer.graphicBufferStride;
- mVASurfaceAttrib->pitches[1] = mConfigBuffer.graphicBufferStride;
+ mVASurfaceAttrib->pitches[0] = mConfigBuffer.graphicBufferHStride;
+ mVASurfaceAttrib->pitches[1] = mConfigBuffer.graphicBufferHStride;
mVASurfaceAttrib->pitches[2] = 0;
mVASurfaceAttrib->pitches[3] = 0;
mVASurfaceAttrib->offsets[0] = 0;
- mVASurfaceAttrib->offsets[1] = mConfigBuffer.graphicBufferStride * mVideoFormatInfo.surfaceHeight;
+ mVASurfaceAttrib->offsets[1] = mConfigBuffer.graphicBufferHStride * mConfigBuffer.graphicBufferVStride;
mVASurfaceAttrib->offsets[2] = 0;
mVASurfaceAttrib->offsets[3] = 0;
mVASurfaceAttrib->private_data = (void *)mConfigBuffer.nativeWindow;
@@ -1325,14 +1325,14 @@ Decode_Status VideoDecoderBase::createSurfaceFromHandle(int index) {
surfExtBuf.pixel_format = VA_FOURCC_NV12;
surfExtBuf.width = mVideoFormatInfo.surfaceWidth;
surfExtBuf.height = mVideoFormatInfo.surfaceHeight;
- surfExtBuf.data_size = mConfigBuffer.graphicBufferStride * mVideoFormatInfo.surfaceHeight * 1.5;
+ surfExtBuf.data_size = mConfigBuffer.graphicBufferHStride * mConfigBuffer.graphicBufferVStride * 1.5;
surfExtBuf.num_planes = 2;
- surfExtBuf.pitches[0] = mConfigBuffer.graphicBufferStride;
- surfExtBuf.pitches[1] = mConfigBuffer.graphicBufferStride;
+ surfExtBuf.pitches[0] = mConfigBuffer.graphicBufferHStride;
+ surfExtBuf.pitches[1] = mConfigBuffer.graphicBufferHStride;
surfExtBuf.pitches[2] = 0;
surfExtBuf.pitches[3] = 0;
surfExtBuf.offsets[0] = 0;
- surfExtBuf.offsets[1] = mConfigBuffer.graphicBufferStride * mVideoFormatInfo.surfaceHeight;
+ surfExtBuf.offsets[1] = mConfigBuffer.graphicBufferHStride * mConfigBuffer.graphicBufferVStride;
surfExtBuf.offsets[2] = 0;
surfExtBuf.offsets[3] = 0;
surfExtBuf.private_data = (void *)mConfigBuffer.nativeWindow;
diff --git a/videodecoder/VideoDecoderDefs.h b/videodecoder/VideoDecoderDefs.h
index 70d2319..76451a4 100644
--- a/videodecoder/VideoDecoderDefs.h
+++ b/videodecoder/VideoDecoderDefs.h
@@ -148,7 +148,8 @@ struct VideoConfigBuffer {
VAProfile profile;
uint32_t flag;
void *graphicBufferHandler[MAX_GRAPHIC_BUFFER_NUM];
- uint32_t graphicBufferStride;
+ uint32_t graphicBufferHStride;
+ uint32_t graphicBufferVStride;
uint32_t graphicBufferColorFormat;
uint32_t graphicBufferWidth;
uint32_t graphicBufferHeight;