187c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk/*
287c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk * Copyright (C) 2017 The Android Open Source Project
387c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk *
487c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk * Licensed under the Apache License, Version 2.0 (the "License");
587c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk * you may not use this file except in compliance with the License.
687c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk * You may obtain a copy of the License at
787c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk *
887c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk *      http://www.apache.org/licenses/LICENSE-2.0
987c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk *
1087c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk * Unless required by applicable law or agreed to in writing, software
1187c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk * distributed under the License is distributed on an "AS IS" BASIS,
1287c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1387c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk * See the License for the specific language governing permissions and
1487c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk * limitations under the License.
1587c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk */
1687c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk
1787c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk#ifndef AAUDIO_SERVICE_ENDPOINT_CAPTURE_H
1887c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk#define AAUDIO_SERVICE_ENDPOINT_CAPTURE_H
1987c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk
2087c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk#include "client/AudioStreamInternal.h"
2187c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk#include "client/AudioStreamInternalCapture.h"
2287c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk
2387c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burknamespace aaudio {
2487c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk
2587c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burkclass AAudioServiceEndpointCapture : public AAudioServiceEndpoint {
2687c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burkpublic:
2787c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk    explicit AAudioServiceEndpointCapture(android::AAudioService &audioService);
2887c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk    virtual ~AAudioServiceEndpointCapture();
2987c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk
3087c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk    aaudio_result_t open(int32_t deviceId) override;
3187c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk
3287c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk    AudioStreamInternal *getStreamInternal() override {
3387c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk        return &mStreamInternalCapture;
3487c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk    }
3587c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk
3687c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk    void *callbackLoop() override;
3787c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk
3887c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burkprivate:
3987c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk    AudioStreamInternalCapture  mStreamInternalCapture;
4087c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk    uint8_t                    *mDistributionBuffer = nullptr;
4187c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk};
4287c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk
4387c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk} /* namespace aaudio */
4487c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk
4587c9f646a94259d7c321c3b3d5947fa1778f5ac2Phil Burk#endif //AAUDIO_SERVICE_ENDPOINT_CAPTURE_H
46