Skip to content

Commit

Permalink
MMAL: Add hevc support by allowing 4 planes
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Nov 18, 2019
1 parent 984bf1d commit 3bb1a9b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ void CMMALYUVBuffer::GetStrides(int(&strides)[YuvImage::MAX_PLANES])
strides[0] = geo.getStrideY();
strides[1] = geo.getStrideC();
strides[2] = geo.getStrideC();
if (geo.getStripes() > 1)
strides[3] = geo.getHeightY() + geo.getHeightC(); // abuse: strides[3] = stripe stride
}

void CMMALYUVBuffer::SetDimensions(int width, int height, const int (&strides)[YuvImage::MAX_PLANES], const int (&planeOffsets)[YuvImage::MAX_PLANES])
Expand Down Expand Up @@ -284,6 +286,7 @@ CDVDVideoCodec::VCReturn CDecoder::Decode(AVCodecContext* avctx, AVFrame* frame)
if (frame)
{
if ((frame->format != AV_PIX_FMT_YUV420P && frame->format != AV_PIX_FMT_YUV420P10 && frame->format != AV_PIX_FMT_YUV420P12 && frame->format != AV_PIX_FMT_YUV420P14 && frame->format != AV_PIX_FMT_YUV420P16 &&
frame->format != AV_PIX_FMT_SAND128 && frame->format != AV_PIX_FMT_SAND64_10 && frame->format != AV_PIX_FMT_SAND64_16 &&
frame->format != AV_PIX_FMT_BGR0 && frame->format != AV_PIX_FMT_RGB565LE) ||
frame->buf[1] != nullptr || frame->buf[0] == nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/VideoPlayer/Process/VideoBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern "C" {

struct YuvImage
{
static const int MAX_PLANES = 3;
static const int MAX_PLANES = 4;

uint8_t* plane[MAX_PLANES];
int planesize[MAX_PLANES];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ std::vector<CMMALPool::MMALEncodingTable> CMMALPool::mmal_encoding_table =
{ AV_PIX_FMT_YUV420P12,MMAL_ENCODING_I420_16, },
{ AV_PIX_FMT_YUV420P14,MMAL_ENCODING_I420_16, },
{ AV_PIX_FMT_YUV420P16,MMAL_ENCODING_I420_16, },
{ AV_PIX_FMT_SAND128, MMAL_ENCODING_YUVUV128 },
{ AV_PIX_FMT_SAND64_10,MMAL_ENCODING_YUVUV64_16 },
{ AV_PIX_FMT_SAND64_16,MMAL_ENCODING_YUVUV64_16 },
{ AV_PIX_FMT_RGBA, MMAL_ENCODING_RGBA, },
{ AV_PIX_FMT_BGRA, MMAL_ENCODING_BGRA },
{ AV_PIX_FMT_RGB0, MMAL_ENCODING_RGBA },
Expand Down

0 comments on commit 3bb1a9b

Please sign in to comment.