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

Commit 25a0160e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Revert "Remove unused modules made for non-Treble OMX"""

parents 94d28be1 620e4667
Loading
Loading
Loading
Loading
+26 −36
Original line number Diff line number Diff line
@@ -7,16 +7,16 @@ LOCAL_SRC_FILES:= \
        jpeg.cpp        \
        SineSource.cpp

LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

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

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

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

LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
        libstagefright libmedia libmediaextractor liblog libutils libbinder \
        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_MODULE_TAGS := optional
@@ -60,15 +58,13 @@ LOCAL_SRC_FILES:= \
        SineSource.cpp    \
        recordvideo.cpp

LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
        libstagefright libmedia libmediaextractor liblog libutils libbinder \
        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_MODULE_TAGS := optional
@@ -86,14 +82,13 @@ LOCAL_SRC_FILES:= \
        SineSource.cpp    \
        audioloop.cpp

LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

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

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

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall

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

LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

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

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

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall

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

LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

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

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

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall

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

LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
        libstagefright \
        liblog \
@@ -172,14 +168,9 @@ LOCAL_SHARED_LIBRARIES := \
        libcutils \
        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,)
LOCAL_C_INCLUDES += $(intermediates)
LOCAL_C_INCLUDES += frameworks/av/media/libstagefright/filters

LOCAL_STATIC_LIBRARIES:= \
        libstagefright_mediafilter
@@ -202,14 +193,13 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:=               \
        muxer.cpp            \

LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

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

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

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall

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

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

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

using namespace android;

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

    if (listComponents) {
        sp<IOMX> omx;
        if (property_get_bool("persist.media.treble_omx", true)) {
        using ::android::hardware::hidl_vec;
        using ::android::hardware::hidl_string;
        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);

            omx = new utils::LWOmx(tOmx);
        } else {
            sp<IServiceManager> sm = defaultServiceManager();
            sp<IBinder> binder = sm->getService(String16("media.codec"));
            sp<IMediaCodecService> service = interface_cast<IMediaCodecService>(binder);

            CHECK(service.get() != NULL);

            omx = service->getOMX();
        hidl_vec<IOmx::ComponentInfo> nodeList;
        auto transStatus = omx->listNodes([](
                const auto& status, const auto& nodeList) {
                    CHECK(status == Status::OK);
                    for (const auto& info : nodeList) {
                        printf("%s\t Roles: ", info.mName.c_str());
                        for (const auto& role : info.mRoles) {
                            printf("%s\t", role.c_str());
                        }
        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;
+0 −2
Original line number Diff line number Diff line
@@ -45,9 +45,7 @@ cc_library_shared {
        "aidl/android/IOMXBufferSource.aidl",

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