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

Commit 37c79ffe authored by Pawin Vongmasa's avatar Pawin Vongmasa
Browse files

Remove unused modules made for non-Treble OMX

All devices should use Treble with OMX hals now.

This CL removes
1. Non-Treble implementations of OMX and OMXStore
2. MediaCodecService
3. All dependencies on sysprop system.persist.treble_omx

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Test: make vts -j123 && vts-tradefed run commandAndExit vts \
--skip-all-system-status-check \
--skip-preconditions -m VtsHalMediaOmxV1_0Host \
-l INFO

Bug: 67990472
Change-Id: I245ecf89d30d532f232e05e362e1cea76f5c37de
parent 7f5b7818
Loading
Loading
Loading
Loading
+25 −36
Original line number Original line Diff line number Diff line
@@ -7,16 +7,16 @@ LOCAL_SRC_FILES:= \
        jpeg.cpp        \
        jpeg.cpp        \
        SineSource.cpp
        SineSource.cpp


LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
        libstagefright libmedia libmediaextractor libutils libbinder \
        libstagefright libmedia libmediaextractor libutils libbinder \
        libstagefright_foundation libjpeg libui libgui libcutils liblog \
        libstagefright_foundation libjpeg libui libgui libcutils liblog \
        libhidlmemory \
        libhidlbase \
        android.hardware.media.omx@1.0 \
        android.hardware.media.omx@1.0 \


LOCAL_C_INCLUDES:= \
LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        frameworks/av/media/libstagefright/include \
        frameworks/native/include/media/openmax \
        external/jpeg \
        external/jpeg \


LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
@@ -35,15 +35,13 @@ LOCAL_SRC_FILES:= \
        SineSource.cpp    \
        SineSource.cpp    \
        record.cpp
        record.cpp


LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
        libstagefright libmedia libmediaextractor liblog libutils libbinder \
        libstagefright libmedia libmediaextractor liblog libutils libbinder \
        libstagefright_foundation
        libstagefright_foundation


LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        frameworks/native/include/media/openmax \
        frameworks/native/include/media/hardware

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CFLAGS += -Wno-multichar -Werror -Wall


LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_TAGS := optional
@@ -60,15 +58,13 @@ LOCAL_SRC_FILES:= \
        SineSource.cpp    \
        SineSource.cpp    \
        recordvideo.cpp
        recordvideo.cpp


LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
        libstagefright libmedia libmediaextractor liblog libutils libbinder \
        libstagefright libmedia libmediaextractor liblog libutils libbinder \
        libstagefright_foundation
        libstagefright_foundation


LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        frameworks/native/include/media/openmax \
        frameworks/native/include/media/hardware

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CFLAGS += -Wno-multichar -Werror -Wall


LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_TAGS := optional
@@ -86,14 +82,13 @@ LOCAL_SRC_FILES:= \
        SineSource.cpp    \
        SineSource.cpp    \
        audioloop.cpp
        audioloop.cpp


LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
        libstagefright libmedia libmediaextractor liblog libutils libbinder \
        libstagefright libmedia libmediaextractor liblog libutils libbinder \
        libstagefright_foundation
        libstagefright_foundation


LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        frameworks/native/include/media/openmax

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CFLAGS += -Wno-multichar -Werror -Wall


LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_TAGS := optional
@@ -109,14 +104,13 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:=         \
LOCAL_SRC_FILES:=         \
        stream.cpp    \
        stream.cpp    \


LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
        libstagefright liblog libutils libbinder libui libgui \
        libstagefright liblog libutils libbinder libui libgui \
        libstagefright_foundation libmedia libcutils
        libstagefright_foundation libmedia libcutils


LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        frameworks/native/include/media/openmax

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CFLAGS += -Wno-multichar -Werror -Wall


LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_TAGS := optional
@@ -133,14 +127,13 @@ LOCAL_SRC_FILES:= \
        codec.cpp               \
        codec.cpp               \
        SimplePlayer.cpp        \
        SimplePlayer.cpp        \


LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
        libstagefright liblog libutils libbinder libstagefright_foundation \
        libstagefright liblog libutils libbinder libstagefright_foundation \
        libmedia libaudioclient libui libgui libcutils
        libmedia libaudioclient libui libgui libcutils


LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        frameworks/native/include/media/openmax

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CFLAGS += -Wno-multichar -Werror -Wall


LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_TAGS := optional
@@ -159,6 +152,9 @@ LOCAL_SRC_FILES:= \
        filters/saturation.rs \
        filters/saturation.rs \
        mediafilter.cpp \
        mediafilter.cpp \


LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
        libstagefright \
        libstagefright \
        liblog \
        liblog \
@@ -171,12 +167,6 @@ LOCAL_SHARED_LIBRARIES := \
        libcutils \
        libcutils \
        libRScpp \
        libRScpp \


LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        frameworks/native/include/media/openmax \
        frameworks/rs/cpp \
        frameworks/rs \

intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
LOCAL_C_INCLUDES += $(intermediates)
LOCAL_C_INCLUDES += $(intermediates)


@@ -201,14 +191,13 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:=               \
LOCAL_SRC_FILES:=               \
        muxer.cpp            \
        muxer.cpp            \


LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
        libstagefright liblog libutils libbinder libstagefright_foundation \
        libstagefright liblog libutils libbinder libstagefright_foundation \
        libcutils libc
        libcutils libc


LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        frameworks/native/include/media/openmax

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CFLAGS += -Wno-multichar -Werror -Wall


LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_TAGS := optional
+1 −1
Original line number Original line Diff line number Diff line
@@ -20,7 +20,7 @@
#include <inttypes.h>
#include <inttypes.h>


#include <binder/ProcessState.h>
#include <binder/ProcessState.h>
#include <filters/ColorConvert.h>
#include <ColorConvert.h>
#include <gui/ISurfaceComposer.h>
#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>
#include <gui/SurfaceComposerClient.h>
#include <gui/Surface.h>
#include <gui/Surface.h>
+19 −34
Original line number Original line Diff line number Diff line
@@ -36,13 +36,12 @@
#include <media/MediaSource.h>
#include <media/MediaSource.h>
#include <media/ICrypto.h>
#include <media/ICrypto.h>
#include <media/IMediaHTTPService.h>
#include <media/IMediaHTTPService.h>
#include <media/IMediaCodecService.h>
#include <media/IMediaPlayerService.h>
#include <media/IMediaPlayerService.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/foundation/AUtils.h>
#include <media/stagefright/foundation/AUtils.h>
#include "include/NuCachedSource2.h"
#include <NuCachedSource2.h>
#include <media/stagefright/AudioPlayer.h>
#include <media/stagefright/AudioPlayer.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/JPEGSource.h>
#include <media/stagefright/JPEGSource.h>
@@ -68,7 +67,6 @@
#include <gui/SurfaceComposerClient.h>
#include <gui/SurfaceComposerClient.h>


#include <android/hardware/media/omx/1.0/IOmx.h>
#include <android/hardware/media/omx/1.0/IOmx.h>
#include <media/omx/1.0/WOmx.h>


using namespace android;
using namespace android;


@@ -912,37 +910,24 @@ int main(int argc, char **argv) {
    }
    }


    if (listComponents) {
    if (listComponents) {
        sp<IOMX> omx;
        using ::android::hardware::hidl_vec;
        if (property_get_bool("persist.media.treble_omx", true)) {
        using ::android::hardware::hidl_string;
        using namespace ::android::hardware::media::omx::V1_0;
        using namespace ::android::hardware::media::omx::V1_0;
            sp<IOmx> tOmx = IOmx::getService();
        sp<IOmx> omx = IOmx::getService();
        CHECK(omx.get() != nullptr);


            CHECK(tOmx.get() != NULL);
        hidl_vec<IOmx::ComponentInfo> nodeList;

        auto transStatus = omx->listNodes([](
            omx = new utils::LWOmx(tOmx);
                const auto& status, const auto& nodeList) {
        } else {
                    CHECK(status == Status::OK);
            sp<IServiceManager> sm = defaultServiceManager();
                    for (const auto& info : nodeList) {
            sp<IBinder> binder = sm->getService(String16("media.codec"));
                        printf("%s\t Roles: ", info.mName.c_str());
            sp<IMediaCodecService> service = interface_cast<IMediaCodecService>(binder);
                        for (const auto& role : info.mRoles) {

                            printf("%s\t", role.c_str());
            CHECK(service.get() != NULL);

            omx = service->getOMX();
                        }
                        }
        CHECK(omx.get() != NULL);

        List<IOMX::ComponentInfo> list;
        omx->listNodes(&list);

        for (List<IOMX::ComponentInfo>::iterator it = list.begin();
             it != list.end(); ++it) {
            printf("%s\t Roles: ", (*it).mName.string());
            for (List<String8>::iterator itRoles = (*it).mRoles.begin() ;
                    itRoles != (*it).mRoles.end() ; ++itRoles) {
                printf("%s\t", (*itRoles).string());
            }
            printf("\n");
                    }
                    }
                });
        CHECK(transStatus.isOk());
    }
    }


    sp<SurfaceComposerClient> composerClient;
    sp<SurfaceComposerClient> composerClient;
+0 −2
Original line number Original line Diff line number Diff line
@@ -43,9 +43,7 @@ cc_defaults {
        "aidl/android/IOMXBufferSource.aidl",
        "aidl/android/IOMXBufferSource.aidl",


        "IMediaCodecList.cpp",
        "IMediaCodecList.cpp",
        "IMediaCodecService.cpp",
        "IOMX.cpp",
        "IOMX.cpp",
        "IOMXStore.cpp",
        "MediaCodecBuffer.cpp",
        "MediaCodecBuffer.cpp",
        "MediaCodecInfo.cpp",
        "MediaCodecInfo.cpp",
        "OMXBuffer.cpp",
        "OMXBuffer.cpp",
+0 −86
Original line number Original line Diff line number Diff line
/*
**
** Copyright 2015, 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.
*/

#define LOG_TAG "IMediaCodecService"
//#define LOG_NDEBUG 0

#include <utils/Log.h>
#include <stdint.h>
#include <sys/types.h>
#include <binder/Parcel.h>
#include <media/IMediaCodecService.h>

namespace android {

enum {
    GET_OMX = IBinder::FIRST_CALL_TRANSACTION,
    GET_OMX_STORE
};

class BpMediaCodecService : public BpInterface<IMediaCodecService>
{
public:
    explicit BpMediaCodecService(const sp<IBinder>& impl)
        : BpInterface<IMediaCodecService>(impl)
    {
    }

    virtual sp<IOMX> getOMX() {
        Parcel data, reply;
        data.writeInterfaceToken(IMediaCodecService::getInterfaceDescriptor());
        remote()->transact(GET_OMX, data, &reply);
        return interface_cast<IOMX>(reply.readStrongBinder());
    }

    virtual sp<IOMXStore> getOMXStore() {
        Parcel data, reply;
        data.writeInterfaceToken(IMediaCodecService::getInterfaceDescriptor());
        remote()->transact(GET_OMX_STORE, data, &reply);
        return interface_cast<IOMXStore>(reply.readStrongBinder());
    }

};

IMPLEMENT_META_INTERFACE(MediaCodecService, "android.media.IMediaCodecService");

// ----------------------------------------------------------------------

status_t BnMediaCodecService::onTransact(
    uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
    switch (code) {

        case GET_OMX: {
            CHECK_INTERFACE(IMediaCodecService, data, reply);
            sp<IOMX> omx = getOMX();
            reply->writeStrongBinder(IInterface::asBinder(omx));
            return NO_ERROR;
        }
        case GET_OMX_STORE: {
            CHECK_INTERFACE(IMediaCodecService, data, reply);
            sp<IOMXStore> omxStore = getOMXStore();
            reply->writeStrongBinder(IInterface::asBinder(omxStore));
            return NO_ERROR;
        }
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }
}

// ----------------------------------------------------------------------------

} // namespace android
Loading