xref: /aosp_15_r20/frameworks/av/media/codec2/hal/aidl/inputsurface/InputSurface.cpp (revision ec779b8e0859a360c3d303172224686826e6e0e1)
1 /*
2  * Copyright 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 //#define LOG_NDEBUG 0
18 #define LOG_TAG "Codec2-InputSurface"
19 #include <android-base/logging.h>
20 
21 #include <codec2/aidl/inputsurface/InputSurface.h>
22 
23 namespace aidl::android::hardware::media::c2::utils {
24 
25 // Derived class of C2InterfaceHelper
26 class InputSurface::Interface : public C2InterfaceHelper {
27 public:
Interface(const std::shared_ptr<C2ReflectorHelper> & helper)28     explicit Interface(
29             const std::shared_ptr<C2ReflectorHelper> &helper)
30         : C2InterfaceHelper(helper) {
31 
32         setDerivedInstance(this);
33 
34     }
35 
36 private:
37 };
38 
39 class InputSurface::ConfigurableIntf : public ConfigurableC2Intf {
40 public:
41 };
42 
43 struct InputSurface::DeathContext {
44     // TODO;
45 };
46 
OnBinderDied(void * cookie)47 void InputSurface::OnBinderDied(void *cookie) {
48     (void) cookie;
49 }
50 
OnBinderUnlinked(void * cookie)51 void InputSurface::OnBinderUnlinked(void *cookie) {
52     (void) cookie;
53 }
54 
InputSurface()55 InputSurface::InputSurface() : mDeathContext(nullptr) {
56     mInit = C2_OK;
57 }
58 
~InputSurface()59 InputSurface::~InputSurface() {
60 }
61 
getSurface(::aidl::android::view::Surface * surface)62 ::ndk::ScopedAStatus InputSurface::getSurface(::aidl::android::view::Surface* surface) {
63     (void) surface;
64     return ::ndk::ScopedAStatus::ok();
65 }
66 
getConfigurable(std::shared_ptr<IConfigurable> * configurable)67 ::ndk::ScopedAStatus InputSurface::getConfigurable(
68         std::shared_ptr<IConfigurable>* configurable) {
69     *configurable = mConfigurable;
70     return ::ndk::ScopedAStatus::ok();
71 }
72 
connect(const std::shared_ptr<IInputSink> & sink,std::shared_ptr<IInputSurfaceConnection> * connection)73 ::ndk::ScopedAStatus InputSurface::connect(
74         const std::shared_ptr<IInputSink>& sink,
75         std::shared_ptr<IInputSurfaceConnection>* connection) {
76     (void) sink;
77     (void) connection;
78     return ::ndk::ScopedAStatus::ok();
79 }
80 
81 }  // namespace aidl::android::hardware::media::c2::utils
82