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

Commit 1619e596 authored by Sungtak Lee's avatar Sungtak Lee
Browse files

C2HIDL: delete non used InputSurface

InputSurface has been never used from C2HIDL, and will be never used
either. Delete the non used codes.

Bug: 201479783
Test: presubmit
Flag: EXEMPT refactor
Change-Id: I6a58ed6b2d0372d662a1ef7a0332e534cad01036
parent 870cb0e1
Loading
Loading
Loading
Loading
+0 −70
Original line number Diff line number Diff line
/*
 * Copyright 2018, 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.
 */

#ifndef ANDROID_HARDWARE_MEDIA_C2_V1_0_INPUT_SURFACE_H
#define ANDROID_HARDWARE_MEDIA_C2_V1_0_INPUT_SURFACE_H

#include <memory>

#include <C2Component.h>
#include <media/stagefright/codec2/1.0/InputSurfaceConnection.h>

namespace android {

class GraphicBufferSource;

namespace hardware {
namespace media {
namespace c2 {
namespace V1_0 {
namespace implementation {

using ::android::sp;

typedef ::android::hardware::graphics::bufferqueue::V1_0::IGraphicBufferProducer
        HGraphicBufferProducer;
typedef ::android::IGraphicBufferProducer BGraphicBufferProducer;

// TODO: ::android::TWGraphicBufferProducer<IInputSurface>
typedef ::android::TWGraphicBufferProducer<HGraphicBufferProducer> InputSurfaceBase;

class InputSurface : public InputSurfaceBase {
public:
    virtual ~InputSurface() = default;

    // Methods from IInputSurface
    sp<InputSurfaceConnection> connectToComponent(
            const std::shared_ptr<::C2Component> &comp);
    // TODO: intf()

    static sp<InputSurface> Create();

private:
    InputSurface(
            const sp<BGraphicBufferProducer> &base,
            const sp<::android::GraphicBufferSource> &source);

    sp<::android::GraphicBufferSource> mSource;
};

}  // namespace implementation
}  // namespace V1_0
}  // namespace c2
}  // namespace media
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_MEDIA_C2_V1_0_INPUT_SURFACE_H
+0 −66
Original line number Diff line number Diff line
/*
 * Copyright 2018, 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.
 */

#ifndef ANDROID_HARDWARE_MEDIA_C2_V1_0_INPUT_SURFACE_CONNECTION_H
#define ANDROID_HARDWARE_MEDIA_C2_V1_0_INPUT_SURFACE_CONNECTION_H

#include <memory>

#include <C2Component.h>
#include <media/stagefright/bqhelper/GraphicBufferSource.h>
#include <media/stagefright/codec2/1.0/InputSurfaceConnection.h>

namespace android {
namespace hardware {
namespace media {
namespace c2 {
namespace V1_0 {
namespace implementation {

// TODO: inherit from IInputSurfaceConnection
class InputSurfaceConnection : public RefBase {
public:
    virtual ~InputSurfaceConnection();

    // From IInputSurfaceConnection
    void disconnect();

private:
    friend class InputSurface;

    // For InputSurface
    InputSurfaceConnection(
            const sp<GraphicBufferSource> &source, const std::shared_ptr<C2Component> &comp);
    bool init();

    InputSurfaceConnection() = delete;

    class Impl;

    sp<GraphicBufferSource> mSource;
    sp<Impl> mImpl;

    DISALLOW_EVIL_CONSTRUCTORS(InputSurfaceConnection);
};

}  // namespace implementation
}  // namespace V1_0
}  // namespace c2
}  // namespace media
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_MEDIA_C2_V1_0_INPUT_SURFACE_CONNECTION_H
+0 −5
Original line number Diff line number Diff line
@@ -71,8 +71,6 @@ cc_library {
        "ComponentStore.cpp",
        "Configurable.cpp",
        "InputBufferManager.cpp",
        "InputSurface.cpp",
        "InputSurfaceConnection.cpp",
        "types.cpp",
    ],

@@ -99,7 +97,6 @@ cc_library {
        "libhidlbase",
        "liblog",
        "libstagefright_bufferpool@2.0.1",
        "libstagefright_bufferqueue_helper_novndk",
        "libui",
        "libutils",
    ],
@@ -107,11 +104,9 @@ cc_library {
    target: {
        vendor: {
            exclude_shared_libs: [
                "libstagefright_bufferqueue_helper_novndk",
                "libcodec2_hidl_plugin_stub",
            ],
            shared_libs: [
                "libstagefright_bufferqueue_helper",
                "libcodec2_hidl_plugin",
            ],
        },
+2 −11
Original line number Diff line number Diff line
@@ -385,17 +385,8 @@ Return<Status> Component::setOutputSurface(
Return<void> Component::connectToInputSurface(
        const sp<IInputSurface>& inputSurface,
        connectToInputSurface_cb _hidl_cb) {
    Status status;
    sp<IInputSurfaceConnection> connection;
    auto transStatus = inputSurface->connect(
            asInputSink(),
            [&status, &connection](
                    Status s, const sp<IInputSurfaceConnection>& c) {
                status = s;
                connection = c;
            }
        );
    _hidl_cb(status, connection);
    (void)inputSurface;
    _hidl_cb(Status::OMITTED, nullptr);
    return Void();
}

+1 −16
Original line number Diff line number Diff line
@@ -19,11 +19,9 @@
#include <android-base/logging.h>

#include <codec2/hidl/1.0/ComponentStore.h>
#include <codec2/hidl/1.0/InputSurface.h>
#include <codec2/hidl/1.0/types.h>

#include <android-base/file.h>
#include <media/stagefright/bqhelper/GraphicBufferSource.h>
#include <utils/Errors.h>

#include <C2PlatformSupport.h>
@@ -51,7 +49,6 @@ namespace V1_0 {
namespace utils {

using namespace ::android;
using ::android::GraphicBufferSource;
using namespace ::android::hardware::media::bufferpool::V2_0::implementation;

namespace /* unnamed */ {
@@ -324,19 +321,7 @@ Return<void> ComponentStore::listComponents(listComponents_cb _hidl_cb) {
}

Return<void> ComponentStore::createInputSurface(createInputSurface_cb _hidl_cb) {
    sp<GraphicBufferSource> source = new GraphicBufferSource();
    if (source->initCheck() != OK) {
        _hidl_cb(Status::CORRUPTED, nullptr);
        return Void();
    }
    using namespace std::placeholders;
    sp<InputSurface> inputSurface = new InputSurface(
            mParameterCache,
            std::make_shared<C2ReflectorHelper>(),
            source->getHGraphicBufferProducer(),
            source);
    _hidl_cb(inputSurface ? Status::OK : Status::NO_MEMORY,
             inputSurface);
    _hidl_cb(Status::OMITTED, nullptr);
    return Void();
}

Loading