Loading media/codec2/components/gav1/C2SoftGav1Dec.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -195,6 +195,11 @@ class C2SoftGav1Dec::IntfImpl : public SimpleInterface<void>::BaseParams { if (isHalPixelFormatSupported((AHardwareBuffer_Format)HAL_PIXEL_FORMAT_YCBCR_P010)) { pixelFormats.push_back(HAL_PIXEL_FORMAT_YCBCR_P010); } // If color format surface isn't added to supported formats, there is no way to know // when the color-format is configured to surface. This is necessary to be able to // choose 10-bit format while decoding 10-bit clips in surface mode. pixelFormats.push_back(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED); // TODO: support more formats? addParameter( DefineParam(mPixelFormat, C2_PARAMKEY_PIXEL_FORMAT) Loading Loading @@ -323,6 +328,9 @@ class C2SoftGav1Dec::IntfImpl : public SimpleInterface<void>::BaseParams { return C2R::Ok(); } // unsafe getters std::shared_ptr<C2StreamPixelFormatInfo::output> getPixelFormat_l() const { return mPixelFormat; } private: std::shared_ptr<C2StreamProfileLevelInfo::input> mProfileLevel; std::shared_ptr<C2StreamPictureSizeInfo::output> mSize; Loading Loading @@ -411,6 +419,10 @@ bool C2SoftGav1Dec::initDecoder() { mSignalledError = false; mSignalledOutputEos = false; mHalPixelFormat = HAL_PIXEL_FORMAT_YV12; { IntfImpl::Lock lock = mIntf->lock(); mPixelFormatInfo = mIntf->getPixelFormat_l(); } mCodecCtx.reset(new libgav1::Decoder()); if (mCodecCtx == nullptr) { Loading Loading @@ -635,7 +647,7 @@ bool C2SoftGav1Dec::outputBuffer(const std::shared_ptr<C2BlockPool> &pool, std::shared_ptr<C2GraphicBlock> block; uint32_t format = HAL_PIXEL_FORMAT_YV12; std::shared_ptr<C2StreamColorAspectsInfo::output> codedColorAspects; if (buffer->bitdepth == 10) { if (buffer->bitdepth == 10 && mPixelFormatInfo->value != HAL_PIXEL_FORMAT_YCBCR_420_888) { IntfImpl::Lock lock = mIntf->lock(); codedColorAspects = mIntf->getColorAspects_l(); bool allowRGBA1010102 = false; Loading media/codec2/components/gav1/C2SoftGav1Dec.h +4 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,10 @@ struct C2SoftGav1Dec : public SimpleC2Component { std::shared_ptr<IntfImpl> mIntf; std::unique_ptr<libgav1::Decoder> mCodecCtx; // configurations used by component in process // (TODO: keep this in intf but make them internal only) std::shared_ptr<C2StreamPixelFormatInfo::output> mPixelFormatInfo; uint32_t mHalPixelFormat; uint32_t mWidth; uint32_t mHeight; Loading media/codec2/components/vpx/C2SoftVpxDec.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -223,6 +223,10 @@ public: if (isHalPixelFormatSupported((AHardwareBuffer_Format)HAL_PIXEL_FORMAT_YCBCR_P010)) { pixelFormats.push_back(HAL_PIXEL_FORMAT_YCBCR_P010); } // If color format surface isn't added to supported formats, there is no way to know // when the color-format is configured to surface. This is necessary to be able to // choose 10-bit format while decoding 10-bit clips in surface mode pixelFormats.push_back(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED); #endif addParameter( DefineParam(mPixelFormat, C2_PARAMKEY_PIXEL_FORMAT) Loading Loading @@ -307,6 +311,11 @@ public: return C2R::Ok(); } // unsafe getters std::shared_ptr<C2StreamPixelFormatInfo::output> getPixelFormat_l() const { return mPixelFormat; } private: std::shared_ptr<C2StreamProfileLevelInfo::input> mProfileLevel; std::shared_ptr<C2StreamPictureSizeInfo::output> mSize; Loading Loading @@ -434,6 +443,11 @@ status_t C2SoftVpxDec::initDecoder() { mMode = MODE_VP8; #endif mHalPixelFormat = HAL_PIXEL_FORMAT_YV12; { IntfImpl::Lock lock = mIntf->lock(); mPixelFormatInfo = mIntf->getPixelFormat_l(); } mWidth = 320; mHeight = 240; mFrameParallelMode = false; Loading Loading @@ -689,7 +703,8 @@ status_t C2SoftVpxDec::outputBuffer( std::shared_ptr<C2GraphicBlock> block; uint32_t format = HAL_PIXEL_FORMAT_YV12; std::shared_ptr<C2StreamColorAspectsTuning::output> defaultColorAspects; if (img->fmt == VPX_IMG_FMT_I42016) { if (img->fmt == VPX_IMG_FMT_I42016 && mPixelFormatInfo->value != HAL_PIXEL_FORMAT_YCBCR_420_888) { IntfImpl::Lock lock = mIntf->lock(); defaultColorAspects = mIntf->getDefaultColorAspects_l(); bool allowRGBA1010102 = false; Loading media/codec2/components/vpx/C2SoftVpxDec.h +4 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,10 @@ struct C2SoftVpxDec : public SimpleC2Component { std::shared_ptr<Mutexed<ConversionQueue>> mQueue; }; // configurations used by component in process // (TODO: keep this in intf but make them internal only) std::shared_ptr<C2StreamPixelFormatInfo::output> mPixelFormatInfo; std::shared_ptr<IntfImpl> mIntf; vpx_codec_ctx_t *mCodecCtx; bool mFrameParallelMode; // Frame parallel is only supported by VP9 decoder. Loading Loading
media/codec2/components/gav1/C2SoftGav1Dec.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -195,6 +195,11 @@ class C2SoftGav1Dec::IntfImpl : public SimpleInterface<void>::BaseParams { if (isHalPixelFormatSupported((AHardwareBuffer_Format)HAL_PIXEL_FORMAT_YCBCR_P010)) { pixelFormats.push_back(HAL_PIXEL_FORMAT_YCBCR_P010); } // If color format surface isn't added to supported formats, there is no way to know // when the color-format is configured to surface. This is necessary to be able to // choose 10-bit format while decoding 10-bit clips in surface mode. pixelFormats.push_back(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED); // TODO: support more formats? addParameter( DefineParam(mPixelFormat, C2_PARAMKEY_PIXEL_FORMAT) Loading Loading @@ -323,6 +328,9 @@ class C2SoftGav1Dec::IntfImpl : public SimpleInterface<void>::BaseParams { return C2R::Ok(); } // unsafe getters std::shared_ptr<C2StreamPixelFormatInfo::output> getPixelFormat_l() const { return mPixelFormat; } private: std::shared_ptr<C2StreamProfileLevelInfo::input> mProfileLevel; std::shared_ptr<C2StreamPictureSizeInfo::output> mSize; Loading Loading @@ -411,6 +419,10 @@ bool C2SoftGav1Dec::initDecoder() { mSignalledError = false; mSignalledOutputEos = false; mHalPixelFormat = HAL_PIXEL_FORMAT_YV12; { IntfImpl::Lock lock = mIntf->lock(); mPixelFormatInfo = mIntf->getPixelFormat_l(); } mCodecCtx.reset(new libgav1::Decoder()); if (mCodecCtx == nullptr) { Loading Loading @@ -635,7 +647,7 @@ bool C2SoftGav1Dec::outputBuffer(const std::shared_ptr<C2BlockPool> &pool, std::shared_ptr<C2GraphicBlock> block; uint32_t format = HAL_PIXEL_FORMAT_YV12; std::shared_ptr<C2StreamColorAspectsInfo::output> codedColorAspects; if (buffer->bitdepth == 10) { if (buffer->bitdepth == 10 && mPixelFormatInfo->value != HAL_PIXEL_FORMAT_YCBCR_420_888) { IntfImpl::Lock lock = mIntf->lock(); codedColorAspects = mIntf->getColorAspects_l(); bool allowRGBA1010102 = false; Loading
media/codec2/components/gav1/C2SoftGav1Dec.h +4 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,10 @@ struct C2SoftGav1Dec : public SimpleC2Component { std::shared_ptr<IntfImpl> mIntf; std::unique_ptr<libgav1::Decoder> mCodecCtx; // configurations used by component in process // (TODO: keep this in intf but make them internal only) std::shared_ptr<C2StreamPixelFormatInfo::output> mPixelFormatInfo; uint32_t mHalPixelFormat; uint32_t mWidth; uint32_t mHeight; Loading
media/codec2/components/vpx/C2SoftVpxDec.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -223,6 +223,10 @@ public: if (isHalPixelFormatSupported((AHardwareBuffer_Format)HAL_PIXEL_FORMAT_YCBCR_P010)) { pixelFormats.push_back(HAL_PIXEL_FORMAT_YCBCR_P010); } // If color format surface isn't added to supported formats, there is no way to know // when the color-format is configured to surface. This is necessary to be able to // choose 10-bit format while decoding 10-bit clips in surface mode pixelFormats.push_back(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED); #endif addParameter( DefineParam(mPixelFormat, C2_PARAMKEY_PIXEL_FORMAT) Loading Loading @@ -307,6 +311,11 @@ public: return C2R::Ok(); } // unsafe getters std::shared_ptr<C2StreamPixelFormatInfo::output> getPixelFormat_l() const { return mPixelFormat; } private: std::shared_ptr<C2StreamProfileLevelInfo::input> mProfileLevel; std::shared_ptr<C2StreamPictureSizeInfo::output> mSize; Loading Loading @@ -434,6 +443,11 @@ status_t C2SoftVpxDec::initDecoder() { mMode = MODE_VP8; #endif mHalPixelFormat = HAL_PIXEL_FORMAT_YV12; { IntfImpl::Lock lock = mIntf->lock(); mPixelFormatInfo = mIntf->getPixelFormat_l(); } mWidth = 320; mHeight = 240; mFrameParallelMode = false; Loading Loading @@ -689,7 +703,8 @@ status_t C2SoftVpxDec::outputBuffer( std::shared_ptr<C2GraphicBlock> block; uint32_t format = HAL_PIXEL_FORMAT_YV12; std::shared_ptr<C2StreamColorAspectsTuning::output> defaultColorAspects; if (img->fmt == VPX_IMG_FMT_I42016) { if (img->fmt == VPX_IMG_FMT_I42016 && mPixelFormatInfo->value != HAL_PIXEL_FORMAT_YCBCR_420_888) { IntfImpl::Lock lock = mIntf->lock(); defaultColorAspects = mIntf->getDefaultColorAspects_l(); bool allowRGBA1010102 = false; Loading
media/codec2/components/vpx/C2SoftVpxDec.h +4 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,10 @@ struct C2SoftVpxDec : public SimpleC2Component { std::shared_ptr<Mutexed<ConversionQueue>> mQueue; }; // configurations used by component in process // (TODO: keep this in intf but make them internal only) std::shared_ptr<C2StreamPixelFormatInfo::output> mPixelFormatInfo; std::shared_ptr<IntfImpl> mIntf; vpx_codec_ctx_t *mCodecCtx; bool mFrameParallelMode; // Frame parallel is only supported by VP9 decoder. Loading