diff options
author | Alistair Strachan <alistair.strachan@imgtec.com> | 2016-06-02 20:55:23 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-06-02 20:55:23 +0000 |
commit | ab2d5862d4f8b3dceda524d86e6bbe58c457e96e (patch) | |
tree | b21839be5d84b73b3b2bdb02c05c5024af3bbc3b | |
parent | 488b2d5529f554491f3b42f7cca765bee3e39a1f (diff) | |
parent | c72674b85a805ae303eeb4071a10bd735ae6b984 (diff) | |
download | libmix-ab2d5862d4f8b3dceda524d86e6bbe58c457e96e.tar.gz |
Introduce independent hstride and vstride, and use them. am: bb7b551f97 am: e57872a252
am: c72674b85a
* commit 'c72674b85a805ae303eeb4071a10bd735ae6b984':
Introduce independent hstride and vstride, and use them.
Change-Id: I7d1110da52c7d56bdc29b3b9b35d31cd3deacbd5
-rw-r--r-- | videodecoder/VideoDecoderBase.cpp | 16 | ||||
-rw-r--r-- | videodecoder/VideoDecoderDefs.h | 3 |
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; |