Loading media/codec2/sfplugin/CCodecConfig.cpp +17 −1 Original line number Diff line number Diff line Loading @@ -969,7 +969,23 @@ void CCodecConfig::initializeStandardParams() { .limitTo(D::ENCODER & D::VIDEO & D::READ)); add(ConfigMapper(KEY_PICTURE_TYPE, C2_PARAMKEY_PICTURE_TYPE, "value") .limitTo(D::ENCODER & D::VIDEO & D::READ)); .limitTo(D::ENCODER & D::VIDEO & D::READ) .withMappers([](C2Value v) -> C2Value { int32_t sdk; C2Config::picture_type_t c2; if (v.get(&sdk) && C2Mapper::map(sdk, &c2)) { return C2Value(c2); } return C2Value(); }, [](C2Value v) -> C2Value { C2Config::picture_type_t c2; int32_t sdk = PICTURE_TYPE_UNKNOWN; using C2ValueType=typename _c2_reduce_enum_to_underlying_type<decltype(c2)>::type; if (v.get((C2ValueType*)&c2) && C2Mapper::map(c2, &sdk)) { return sdk; } return C2Value(); })); /* still to do not yet used by MediaCodec, but defined as MediaFormat Loading media/codec2/sfplugin/utils/Codec2Mapper.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -460,6 +460,13 @@ ALookup<uint32_t, int32_t> sPixelFormats = { { HAL_PIXEL_FORMAT_RGBA_FP16, COLOR_Format64bitABGRFloat }, }; ALookup<C2Config::picture_type_t, int32_t> sPictureType = { { C2Config::picture_type_t::SYNC_FRAME, PICTURE_TYPE_I }, { C2Config::picture_type_t::I_FRAME, PICTURE_TYPE_I }, { C2Config::picture_type_t::P_FRAME, PICTURE_TYPE_P }, { C2Config::picture_type_t::B_FRAME, PICTURE_TYPE_B }, }; /** * A helper that passes through vendor extension profile and level values. */ Loading Loading @@ -1075,3 +1082,13 @@ bool C2Mapper::mapPixelFormatCodecToFramework( } return true; } // static bool C2Mapper::map(C2Config::picture_type_t from, int32_t *to) { return sPictureType.map(from, to); } // static bool C2Mapper::map(int32_t from, C2Config::picture_type_t *to) { return sPictureType.map(from, to); } Loading
media/codec2/sfplugin/CCodecConfig.cpp +17 −1 Original line number Diff line number Diff line Loading @@ -969,7 +969,23 @@ void CCodecConfig::initializeStandardParams() { .limitTo(D::ENCODER & D::VIDEO & D::READ)); add(ConfigMapper(KEY_PICTURE_TYPE, C2_PARAMKEY_PICTURE_TYPE, "value") .limitTo(D::ENCODER & D::VIDEO & D::READ)); .limitTo(D::ENCODER & D::VIDEO & D::READ) .withMappers([](C2Value v) -> C2Value { int32_t sdk; C2Config::picture_type_t c2; if (v.get(&sdk) && C2Mapper::map(sdk, &c2)) { return C2Value(c2); } return C2Value(); }, [](C2Value v) -> C2Value { C2Config::picture_type_t c2; int32_t sdk = PICTURE_TYPE_UNKNOWN; using C2ValueType=typename _c2_reduce_enum_to_underlying_type<decltype(c2)>::type; if (v.get((C2ValueType*)&c2) && C2Mapper::map(c2, &sdk)) { return sdk; } return C2Value(); })); /* still to do not yet used by MediaCodec, but defined as MediaFormat Loading
media/codec2/sfplugin/utils/Codec2Mapper.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -460,6 +460,13 @@ ALookup<uint32_t, int32_t> sPixelFormats = { { HAL_PIXEL_FORMAT_RGBA_FP16, COLOR_Format64bitABGRFloat }, }; ALookup<C2Config::picture_type_t, int32_t> sPictureType = { { C2Config::picture_type_t::SYNC_FRAME, PICTURE_TYPE_I }, { C2Config::picture_type_t::I_FRAME, PICTURE_TYPE_I }, { C2Config::picture_type_t::P_FRAME, PICTURE_TYPE_P }, { C2Config::picture_type_t::B_FRAME, PICTURE_TYPE_B }, }; /** * A helper that passes through vendor extension profile and level values. */ Loading Loading @@ -1075,3 +1082,13 @@ bool C2Mapper::mapPixelFormatCodecToFramework( } return true; } // static bool C2Mapper::map(C2Config::picture_type_t from, int32_t *to) { return sPictureType.map(from, to); } // static bool C2Mapper::map(int32_t from, C2Config::picture_type_t *to) { return sPictureType.map(from, to); }