diff options
author | popcornmix <popcornmix@gmail.com> | 2017-07-14 18:51:16 +0100 |
---|---|---|
committer | popcornmix <popcornmix@gmail.com> | 2018-02-27 20:27:19 +0000 |
commit | 055ff82ea795b49199873a5fc564bd4ccd8f9c2e (patch) | |
tree | 25ba087034dd2ba35932f25d0161c37eb89d9111 | |
parent | 35aefa444ae809dffef84ca9b3099db9d5db85f9 (diff) |
MMAL: Fixup after planeOffsets change
4 files changed, 17 insertions, 7 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp index 338de08c76..c369fdd365 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp @@ -94,11 +94,17 @@ void CMMALYUVBuffer::GetStrides(int(&strides)[YuvImage::MAX_PLANES]) strides[2] = geo.stride_c; } -void CMMALYUVBuffer::SetDimensions(int width, int height, const int (&strides)[YuvImage::MAX_PLANES]) +void CMMALYUVBuffer::SetDimensions(int width, int height, const int (&strides)[YuvImage::MAX_PLANES], const int (&planeOffsets)[YuvImage::MAX_PLANES]) { std::shared_ptr<CMMALPool> pool = std::dynamic_pointer_cast<CMMALPool>(m_pool); assert(pool); - pool->SetDimensions(width, height, strides[0], height); + pool->SetDimensions(width, height, strides, planeOffsets); +} + +void CMMALYUVBuffer::SetDimensions(int width, int height, const int (&strides)[YuvImage::MAX_PLANES]) +{ + const int (&planeOffsets)[YuvImage::MAX_PLANES] = {}; + SetDimensions(width, height, strides, planeOffsets); } //----------------------------------------------------------------------------- diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h index 93082424ca..fdc90b69f6 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h @@ -40,9 +40,10 @@ public: CMMALYUVBuffer(int id); virtual ~CMMALYUVBuffer(); uint8_t* GetMemPtr() override; - virtual void GetPlanes(uint8_t*(&planes)[YuvImage::MAX_PLANES]); - virtual void GetStrides(int(&strides)[YuvImage::MAX_PLANES]); - virtual void SetDimensions(int width, int height, const int (&strides)[YuvImage::MAX_PLANES]); + virtual void GetPlanes(uint8_t*(&planes)[YuvImage::MAX_PLANES]) override; + virtual void GetStrides(int(&strides)[YuvImage::MAX_PLANES]) override; + virtual void SetDimensions(int width, int height, const int (&strides)[YuvImage::MAX_PLANES]) override; + virtual void SetDimensions(int width, int height, const int (&strides)[YuvImage::MAX_PLANES], const int (&planeOffsets)[YuvImage::MAX_PLANES]) override; CGPUMEM *Allocate(int size, void *opaque) { m_gmem = new CGPUMEM(size, true); if (m_gmem) m_gmem->m_opaque = opaque; return m_gmem; } CGPUMEM *GetMem() { return m_gmem; } protected: diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp index fd0328d048..fa53c5ba44 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp @@ -268,8 +268,11 @@ void CMMALPool::Configure(AVPixelFormat format, int size) Configure(format, 0, 0, 0, 0, size); } -void CMMALPool::SetDimensions(int width, int height, int alignedWidth, int alignedHeight) +void CMMALPool::SetDimensions(int width, int height, const int (&strides)[YuvImage::MAX_PLANES], const int (&planeOffsets)[YuvImage::MAX_PLANES]) { + assert(m_geo.bytes_per_pixel); + int alignedWidth = strides[0] ? strides[0] / m_geo.bytes_per_pixel : width; + int alignedHeight = planeOffsets[1] ? planeOffsets[1] / strides[0] : height; Configure(AV_PIX_FMT_NONE, width, height, alignedWidth, alignedHeight, 0); } diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h index 9fbefc7e72..71ea46a5d0 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h @@ -58,7 +58,7 @@ public: virtual bool IsConfigured() override; virtual bool IsCompatible(AVPixelFormat format, int size) override; - void SetDimensions(int width, int height, int alignedWidth, int alignedHeight); + void SetDimensions(int width, int height, const int (&strides)[YuvImage::MAX_PLANES], const int (&planeOffsets)[YuvImage::MAX_PLANES]); MMAL_COMPONENT_T *GetComponent() { return m_component; } CMMALBuffer *GetBuffer(uint32_t timeout); void Prime(); |