blob: 518c2c089a9484c061fe4b7e1367f35ee7fcbef1 [file] [log] [blame]
Ytai Ben-Tsvi734e3502020-08-24 14:57:36 -07001/*
2 * Copyright (C) 2020 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#include <binding/AAudioBinderAdapter.h>
18
19namespace aaudio {
20
21AAudioBinderAdapter::AAudioBinderAdapter(android::IAAudioService *delegate)
22 : mDelegate(delegate) {}
23
24void AAudioBinderAdapter::registerClient(const android::sp<aaudio::IAAudioClient> &client) {
25 mDelegate->registerClient(client);
26}
27
28aaudio_handle_t AAudioBinderAdapter::openStream(const AAudioStreamRequest &request,
29 AAudioStreamConfiguration &configuration) {
30 return mDelegate->openStream(request, configuration);
31}
32
33aaudio_result_t AAudioBinderAdapter::closeStream(aaudio_handle_t streamHandle) {
34 return mDelegate->closeStream(streamHandle);
35}
36
37aaudio_result_t AAudioBinderAdapter::getStreamDescription(aaudio_handle_t streamHandle,
38 AudioEndpointParcelable &parcelable) {
39 return mDelegate->getStreamDescription(streamHandle, parcelable);
40}
41
42aaudio_result_t AAudioBinderAdapter::startStream(aaudio_handle_t streamHandle) {
43 return mDelegate->startStream(streamHandle);
44}
45
46aaudio_result_t AAudioBinderAdapter::pauseStream(aaudio_handle_t streamHandle) {
47 return mDelegate->pauseStream(streamHandle);
48}
49
50aaudio_result_t AAudioBinderAdapter::stopStream(aaudio_handle_t streamHandle) {
51 return mDelegate->stopStream(streamHandle);
52}
53
54aaudio_result_t AAudioBinderAdapter::flushStream(aaudio_handle_t streamHandle) {
55 return mDelegate->flushStream(streamHandle);
56}
57
58aaudio_result_t AAudioBinderAdapter::registerAudioThread(aaudio_handle_t streamHandle,
59 pid_t clientThreadId,
60 int64_t periodNanoseconds) {
61 return mDelegate->registerAudioThread(streamHandle, clientThreadId, periodNanoseconds);
62}
63
64aaudio_result_t AAudioBinderAdapter::unregisterAudioThread(aaudio_handle_t streamHandle,
65 pid_t clientThreadId) {
66 return mDelegate->unregisterAudioThread(streamHandle, clientThreadId);
67}
68
69} // namespace aaudio