Loading media/aconfig/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -12,5 +12,11 @@ java_aconfig_library { cc_aconfig_library { name: "aconfig_mediacodec_flags_c_lib", min_sdk_version: "30", vendor_available: true, apex_available: [ "//apex_available:platform", "com.android.media.swcodec", ], aconfig_declarations: "aconfig_mediacodec_flags", } media/aconfig/mediacodec_flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,10 @@ flag { description: "Feature flags for media codec importance" bug: "297929011" } flag { name: "aidl_hal" namespace: "codec_fwk" description: "Feature flags for enabling AIDL HAL handling" bug: "251850069" } media/codec2/hal/aidl/Android.bp +8 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,10 @@ package { cc_library { name: "libcodec2_aidl_client", defaults: [ "libcodec2_hal_selection", ], srcs: [ "BufferTypes.cpp", "ParamTypes.cpp", Loading Loading @@ -58,7 +62,10 @@ cc_library { apex_available: [ "//apex_available:platform", "com.android.media.swcodec", "test_com.android.media.swcodec", ], defaults: [ "libcodec2_hal_selection", ], srcs: [ Loading media/codec2/hal/aidl/ParamTypes.cpp +2 −34 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ // #include <android/sysprop/MediaProperties.sysprop.h> #include <android-base/properties.h> #include <codec2/aidl/ParamTypes.h> #include <codec2/common/HalSelection.h> #include <codec2/common/ParamTypes.h> #include "ParamTypes-specialization.h" Loading Loading @@ -162,40 +163,7 @@ namespace c2 { namespace utils { bool IsSelected() { // TODO: read from aconfig flags const bool enabled = false; if (!enabled) { // Cannot select AIDL if not enabled return false; } #if 0 // NOTE: due to dependency from mainline modules cannot use libsysprop using ::android::sysprop::MediaProperties::codec2_hal_selection; using ::android::sysprop::MediaProperties::codec2_hal_selection_values; constexpr codec2_hal_selection_values AIDL = codec2_hal_selection_values::AIDL; constexpr codec2_hal_selection_values HIDL = codec2_hal_selection_values::HIDL; codec2_hal_selection_values selection = codec2_hal_selection().value_or(HIDL); switch (selection) { case AIDL: return true; case HIDL: return false; default: LOG(FATAL) << "Unexpected codec2 HAL selection value: " << (int)selection; } #else std::string selection = ::android::base::GetProperty("media.c2.hal.selection", "hidl"); if (selection == "aidl") { return true; } else if (selection == "hidl") { return false; } else { LOG(FATAL) << "Unexpected codec2 HAL selection value: " << selection; } #endif return false; return ::android::IsCodec2AidlHalSelected(); } const char* asString(Status status, const char* def) { Loading media/codec2/hal/common/Android.bp +37 −0 Original line number Diff line number Diff line Loading @@ -28,3 +28,40 @@ cc_library { "libstagefright_foundation", ], } cc_library_static { name: "libcodec2_hal_selection_static", double_loadable: true, vendor_available: true, apex_available: [ "//apex_available:platform", "com.android.media", "com.android.media.swcodec", ], min_sdk_version: "29", srcs: [ "HalSelection.cpp", ], export_include_dirs: ["include/"], shared_libs: [ "libbase", "server_configurable_flags", ], static_libs: ["aconfig_mediacodec_flags_c_lib"], } cc_defaults { name: "libcodec2_hal_selection", static_libs: [ "aconfig_mediacodec_flags_c_lib", "libcodec2_hal_selection_static", ], shared_libs: [ "libbase", "server_configurable_flags", ], } Loading
media/aconfig/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -12,5 +12,11 @@ java_aconfig_library { cc_aconfig_library { name: "aconfig_mediacodec_flags_c_lib", min_sdk_version: "30", vendor_available: true, apex_available: [ "//apex_available:platform", "com.android.media.swcodec", ], aconfig_declarations: "aconfig_mediacodec_flags", }
media/aconfig/mediacodec_flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,10 @@ flag { description: "Feature flags for media codec importance" bug: "297929011" } flag { name: "aidl_hal" namespace: "codec_fwk" description: "Feature flags for enabling AIDL HAL handling" bug: "251850069" }
media/codec2/hal/aidl/Android.bp +8 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,10 @@ package { cc_library { name: "libcodec2_aidl_client", defaults: [ "libcodec2_hal_selection", ], srcs: [ "BufferTypes.cpp", "ParamTypes.cpp", Loading Loading @@ -58,7 +62,10 @@ cc_library { apex_available: [ "//apex_available:platform", "com.android.media.swcodec", "test_com.android.media.swcodec", ], defaults: [ "libcodec2_hal_selection", ], srcs: [ Loading
media/codec2/hal/aidl/ParamTypes.cpp +2 −34 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ // #include <android/sysprop/MediaProperties.sysprop.h> #include <android-base/properties.h> #include <codec2/aidl/ParamTypes.h> #include <codec2/common/HalSelection.h> #include <codec2/common/ParamTypes.h> #include "ParamTypes-specialization.h" Loading Loading @@ -162,40 +163,7 @@ namespace c2 { namespace utils { bool IsSelected() { // TODO: read from aconfig flags const bool enabled = false; if (!enabled) { // Cannot select AIDL if not enabled return false; } #if 0 // NOTE: due to dependency from mainline modules cannot use libsysprop using ::android::sysprop::MediaProperties::codec2_hal_selection; using ::android::sysprop::MediaProperties::codec2_hal_selection_values; constexpr codec2_hal_selection_values AIDL = codec2_hal_selection_values::AIDL; constexpr codec2_hal_selection_values HIDL = codec2_hal_selection_values::HIDL; codec2_hal_selection_values selection = codec2_hal_selection().value_or(HIDL); switch (selection) { case AIDL: return true; case HIDL: return false; default: LOG(FATAL) << "Unexpected codec2 HAL selection value: " << (int)selection; } #else std::string selection = ::android::base::GetProperty("media.c2.hal.selection", "hidl"); if (selection == "aidl") { return true; } else if (selection == "hidl") { return false; } else { LOG(FATAL) << "Unexpected codec2 HAL selection value: " << selection; } #endif return false; return ::android::IsCodec2AidlHalSelected(); } const char* asString(Status status, const char* def) { Loading
media/codec2/hal/common/Android.bp +37 −0 Original line number Diff line number Diff line Loading @@ -28,3 +28,40 @@ cc_library { "libstagefright_foundation", ], } cc_library_static { name: "libcodec2_hal_selection_static", double_loadable: true, vendor_available: true, apex_available: [ "//apex_available:platform", "com.android.media", "com.android.media.swcodec", ], min_sdk_version: "29", srcs: [ "HalSelection.cpp", ], export_include_dirs: ["include/"], shared_libs: [ "libbase", "server_configurable_flags", ], static_libs: ["aconfig_mediacodec_flags_c_lib"], } cc_defaults { name: "libcodec2_hal_selection", static_libs: [ "aconfig_mediacodec_flags_c_lib", "libcodec2_hal_selection_static", ], shared_libs: [ "libbase", "server_configurable_flags", ], }