Skip to content

Commit

Permalink
fix(decoder): hardware decoder not support if format is yuv422
Browse files Browse the repository at this point in the history
  • Loading branch information
I-m-SuperMan authored and pingkai committed Mar 18, 2020
1 parent fe4c440 commit 6fecf02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions framework/codec/Android/mediaCodecDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ namespace Cicada {

int mediaCodecDecoder::init_decoder(const Stream_meta *meta, void *voutObsr, uint64_t flags)
{
if (meta->pixel_fmt == AF_PIX_FMT_YUV422P || meta->pixel_fmt == AF_PIX_FMT_YUVJ422P) {
return -ENOSPC;
}

if (!checkSupport(meta->codec, flags, max(meta->height, meta->width))) {
return -ENOSPC;
}
Expand Down
4 changes: 4 additions & 0 deletions framework/codec/Apple/AppleVideoToolBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ namespace Cicada {

int AFVTBDecoder::init_decoder(const Stream_meta *meta, void *voutObsr, uint64_t flags)
{
if (meta->pixel_fmt == AF_PIX_FMT_YUV422P || meta->pixel_fmt == AF_PIX_FMT_YUVJ422P) {
return -ENOSPC;
}

mPInMeta = unique_ptr<streamMeta>(new streamMeta(meta));
((Stream_meta *) (*(mPInMeta)))->extradata = new uint8_t[meta->extradata_size];
memcpy(((Stream_meta *) (*(mPInMeta)))->extradata, meta->extradata, ((Stream_meta *) (*(mPInMeta)))->extradata_size);
Expand Down

0 comments on commit 6fecf02

Please sign in to comment.