Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d6f5851 authored by Wonsik Kim's avatar Wonsik Kim Committed by Gerrit Code Review
Browse files

Merge "Add ApexCodec API" into main

parents 452f390b 96a6ae8e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ apex_defaults {
        "mediaswcodec",
    ],
    native_shared_libs: [
        "libapexcodecs",
        "libcodec2_hidl@1.0",
        "libcodec2_hidl@1.1",
        "libcodec2_hidl@1.2",
+71 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2024 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package {
    default_applicable_licenses: ["frameworks_av_license"],
}

cc_defaults {
    name: "libapexcodecs-defaults",
    header_libs: [
        "libbase_headers",
    ],

    srcs: ["ApexCodecs.cpp"],

    shared_libs: [
        "libbase",
        "libnativewindow",
    ],

    export_include_dirs: ["include"],

    export_shared_lib_headers: [
        "libbase",
        "libnativewindow",
    ],

}

cc_library {
    name: "libapexcodecs-testing",
    defaults: ["libapexcodecs-defaults"],

    visibility: [
        ":__subpackages__",
    ],
}

cc_library {
    name: "libapexcodecs",
    defaults: ["libapexcodecs-defaults"],

    visibility: [
        "//frameworks/av/apex:__subpackages__",
        "//frameworks/av/media/codec2/hal/client",
    ],

    min_sdk_version: "apex_inherit",
    version_script: "libapexcodecs.map.txt",
    stubs: {
        symbol_file: "libapexcodecs.map.txt",
        versions: ["36"],
    },

    apex_available: [
        "com.android.media.swcodec",
    ],
}
+148 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <new>

#include <android-base/no_destructor.h>
#include <apex/ApexCodecs.h>

// TODO: remove when we have real implementations
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"

struct ApexCodec_ComponentStore {
    ApexCodec_ComponentStore() = default;
};

ApexCodec_ComponentStore *ApexCodec_GetComponentStore() {
    ::android::base::NoDestructor<ApexCodec_ComponentStore> store;
    return store.get();
}

ApexCodec_ComponentTraits *ApexCodec_Traits_get(
        ApexCodec_ComponentStore *store, size_t index) {
    return nullptr;
}

ApexCodec_Status ApexCodec_Component_create(
        ApexCodec_ComponentStore *store, const char *name, ApexCodec_Component **comp) {
    *comp = nullptr;
    return APEXCODEC_STATUS_NOT_FOUND;
}

void ApexCodec_Component_destroy(ApexCodec_Component *comp) {}

ApexCodec_Status ApexCodec_Component_start(ApexCodec_Component *comp) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Component_flush(ApexCodec_Component *comp) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Component_reset(ApexCodec_Component *comp) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Configurable *ApexCodec_Component_getConfigurable(
        ApexCodec_Component *comp) {
    return nullptr;
}

ApexCodec_Status ApexCodec_SupportedValues_getTypeAndValues(
        ApexCodec_SupportedValues *supportedValues,
        ApexCodec_SupportedValuesType *type,
        ApexCodec_SupportedValuesNumberType *numberType,
        ApexCodec_Value **values,
        uint32_t *numValues) {
    return APEXCODEC_STATUS_OMITTED;
}

void ApexCodec_SupportedValues_release(ApexCodec_SupportedValues *values) {}

ApexCodec_Status ApexCodec_SettingResults_getResultAtIndex(
        ApexCodec_SettingResults *results,
        size_t index,
        ApexCodec_SettingResultFailure *failure,
        ApexCodec_ParamFieldValues *field,
        ApexCodec_ParamFieldValues **conflicts,
        size_t *numConflicts) {
    return APEXCODEC_STATUS_OMITTED;
}

void ApexCodec_SettingResults_release(ApexCodec_SettingResults *results) {}

ApexCodec_Status ApexCodec_Component_process(
        ApexCodec_Component *comp,
        const ApexCodec_Buffer *input,
        ApexCodec_Buffer *output,
        size_t *consumed,
        size_t *produced) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Configurable_config(
        ApexCodec_Configurable *comp,
        ApexCodec_LinearBuffer *config,
        ApexCodec_SettingResults **results) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Configurable_query(
        ApexCodec_Configurable *comp,
        uint32_t indices[],
        size_t numIndices,
        ApexCodec_LinearBuffer *config,
        size_t *written) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_ParamDescriptors_getIndices(
        ApexCodec_ParamDescriptors *descriptors,
        uint32_t **indices,
        size_t *numIndices) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_ParamDescriptors_getDescriptor(
        ApexCodec_ParamDescriptors *descriptors,
        uint32_t index,
        ApexCodec_ParamAttribute *attr,
        const char **name,
        uint32_t **dependencies,
        size_t *numDependencies) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_ParamDescriptors_release(
        ApexCodec_ParamDescriptors *descriptors) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Configurable_querySupportedParams(
        ApexCodec_Configurable *comp,
        ApexCodec_ParamDescriptors **descriptors) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Configurable_querySupportedValues(
        ApexCodec_Configurable *comp,
        ApexCodec_SupportedValuesQuery *queries,
        size_t numQueries) {
    return APEXCODEC_STATUS_OMITTED;
}

#pragma clang diagnostic pop
 No newline at end of file
+768 −0

File added.

Preview size limit exceeded, changes collapsed.

+26 −0
Original line number Diff line number Diff line
LIBAPEXCODECS_36 { # introduced=36
  global:
    ApexCodec_Component_create; # apex
    ApexCodec_Component_destroy; # apex
    ApexCodec_Component_flush; # apex
    ApexCodec_Component_getConfigurable; # apex
    ApexCodec_Component_process; # apex
    ApexCodec_Component_start; # apex
    ApexCodec_Component_reset; # apex
    ApexCodec_Configurable_config; # apex
    ApexCodec_Configurable_query; # apex
    ApexCodec_Configurable_querySupportedParams; # apex
    ApexCodec_Configurable_querySupportedValues; # apex
    ApexCodec_GetComponentStore; # apex
    ApexCodec_ParamDescriptors_getDescriptor; # apex
    ApexCodec_ParamDescriptors_getIndices; # apex
    ApexCodec_ParamDescriptors_release; # apex
    ApexCodec_SettingResults_getResultAtIndex; # apex
    ApexCodec_SettingResults_release; # apex
    ApexCodec_SupportedValues_getTypeAndValues; # apex
    ApexCodec_SupportedValues_release; # apex
    ApexCodec_Traits_get; # apex

  local:
    *;
};
 No newline at end of file
Loading