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

Commit 43b0d00c authored by Colin Cross's avatar Colin Cross Committed by Android (Google) Code Review
Browse files

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

parents 73af62a5 85e88d9b
Loading
Loading
Loading
Loading
+36 −25
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 libmediaextractor libutils libbinder \
        libstagefright_foundation libjpeg libui libgui libcutils liblog \
        libhidlbase \
        libhidlmemory \
        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,13 +35,15 @@ 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
@@ -58,13 +60,15 @@ 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
@@ -82,13 +86,14 @@ 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
@@ -104,13 +109,14 @@ 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
@@ -127,13 +133,14 @@ LOCAL_SRC_FILES:= \
        codec.cpp               \
        SimplePlayer.cpp        \

LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
        libstagefright liblog libutils libbinder libstagefright_foundation \
        libmedia 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
@@ -152,9 +159,6 @@ LOCAL_SRC_FILES:= \
        filters/saturation.rs \
        mediafilter.cpp \

LOCAL_HEADER_LIBRARIES := \
        media_plugin_headers \

LOCAL_SHARED_LIBRARIES := \
        libstagefright \
        liblog \
@@ -167,6 +171,12 @@ 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)

@@ -191,13 +201,14 @@ 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 <ColorConvert.h>
#include <filters/ColorConvert.h>
#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>
#include <gui/Surface.h>
+34 −19
Original line number Diff line number Diff line
@@ -36,12 +36,13 @@
#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 <NuCachedSource2.h>
#include "include/NuCachedSource2.h"
#include <media/stagefright/AudioPlayer.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/JPEGSource.h>
@@ -67,6 +68,7 @@
#include <gui/SurfaceComposerClient.h>

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

using namespace android;

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

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

        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(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();
        }
        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;
+2 −0
Original line number Diff line number Diff line
@@ -43,7 +43,9 @@ cc_defaults {
        "aidl/android/IOMXBufferSource.aidl",

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