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/InputSurfaceConnection.h>
22 #include <codec2/aidl/inputsurface/InputSurfaceSource.h>
23
24 namespace aidl::android::hardware::media::c2::utils {
25
InputSurfaceConnection(const std::shared_ptr<IInputSink> & sink,::android::sp<c2::implementation::InputSurfaceSource> const & source)26 InputSurfaceConnection::InputSurfaceConnection(
27 const std::shared_ptr<IInputSink>& sink,
28 ::android::sp<c2::implementation::InputSurfaceSource> const &source)
29 : mSink{sink}, mSource{source} {
30 }
31
~InputSurfaceConnection()32 InputSurfaceConnection::~InputSurfaceConnection() {
33 }
34
status() const35 c2_status_t InputSurfaceConnection::status() const {
36 // TODO;
37 return C2_OK;
38 }
39
disconnect()40 ::ndk::ScopedAStatus InputSurfaceConnection::disconnect() {
41 return ::ndk::ScopedAStatus::ok();
42 }
43
signalEndOfStream()44 ::ndk::ScopedAStatus InputSurfaceConnection::signalEndOfStream() {
45 return ::ndk::ScopedAStatus::ok();
46 }
47
submitBuffer(int32_t bufferId,const AImage * buffer,int64_t timestamp,int fenceFd)48 c2_status_t InputSurfaceConnection::submitBuffer(
49 int32_t bufferId, const AImage *buffer, int64_t timestamp, int fenceFd) {
50 (void)bufferId;
51 (void)buffer;
52 (void)timestamp;
53 (void)fenceFd;
54 return C2_OK;
55 }
56
submitEos(int32_t bufferId)57 c2_status_t InputSurfaceConnection::submitEos(int32_t bufferId) {
58 (void)bufferId;
59 return C2_OK;
60 }
61
dispatchDataSpaceChanged(int32_t dataSpace,int32_t aspects,int32_t pixelFormat)62 void InputSurfaceConnection::dispatchDataSpaceChanged(
63 int32_t dataSpace, int32_t aspects, int32_t pixelFormat) {
64 (void)dataSpace;
65 (void)aspects;
66 (void)pixelFormat;
67 }
68
69 } // namespace aidl::android::hardware::media::c2::utils
70