blob: 089be3b12890d75d2a01ede264f687efa21288c1 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2007 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#ifndef IAUDIORECORD_H_
18#define IAUDIORECORD_H_
19
20#include <stdint.h>
21#include <sys/types.h>
22
23#include <utils/RefBase.h>
24#include <utils/Errors.h>
Mathias Agopian07952722009-05-19 19:08:10 -070025#include <binder/IInterface.h>
26#include <binder/IMemory.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080027
28
29namespace android {
30
31// ----------------------------------------------------------------------------
32
33class IAudioRecord : public IInterface
34{
Glenn Kasten18db49a2012-03-12 16:29:55 -070035public:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080036 DECLARE_META_INTERFACE(AudioRecord);
37
38 /* After it's created the track is not active. Call start() to
39 * make it active. If set, the callback will start being called.
Glenn Kasten6a20b262012-02-02 10:56:47 -080040 * tid identifies the client callback thread, or 0 if not needed.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041 */
Glenn Kasten6a20b262012-02-02 10:56:47 -080042 virtual status_t start(pid_t tid) = 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043
44 /* Stop a track. If set, the callback will cease being called and
Glenn Kasten18db49a2012-03-12 16:29:55 -070045 * obtainBuffer will return an error. Buffers that are already released
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046 * will be processed, unless flush() is called.
47 */
48 virtual void stop() = 0;
49
50 /* get this tracks control block */
Glenn Kasten18db49a2012-03-12 16:29:55 -070051 virtual sp<IMemory> getCblk() const = 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052};
53
54// ----------------------------------------------------------------------------
55
56class BnAudioRecord : public BnInterface<IAudioRecord>
57{
58public:
59 virtual status_t onTransact( uint32_t code,
60 const Parcel& data,
61 Parcel* reply,
62 uint32_t flags = 0);
63};
64
65// ----------------------------------------------------------------------------
66
67}; // namespace android
68
69#endif /*IAUDIORECORD_H_*/