diff options
author | Alistair Strachan <alistair.strachan@imgtec.com> | 2016-06-02 20:48:22 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-06-02 20:48:22 +0000 |
commit | c72674b85a805ae303eeb4071a10bd735ae6b984 (patch) | |
tree | b21839be5d84b73b3b2bdb02c05c5024af3bbc3b | |
parent | d423b47187bf66ec861dcfc85bb41ff00f123b07 (diff) | |
parent | e57872a25271f414c8b231bc735f9092fc6c217f (diff) | |
download | libmix-c72674b85a805ae303eeb4071a10bd735ae6b984.tar.gz |
Introduce independent hstride and vstride, and use them. am: bb7b551f97
am: e57872a252
* commit 'e57872a25271f414c8b231bc735f9092fc6c217f':
Introduce independent hstride and vstride, and use them.
Change-Id: Id9fd574f0ea3563283a64638caa523647198f7d4
-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; |