2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_MEDIA_AUDIO_IO_CAUDIO_INPUT_H__
18 #define __TIZEN_MEDIA_AUDIO_IO_CAUDIO_INPUT_H__
24 namespace tizen_media_audio {
28 * A class CAudioInput that inherited from CAudioIO
30 class CAudioInput : public CAudioIO {
32 /* Constructor & Destructor */
33 explicit CAudioInput(CAudioInfo& info);
34 ~CAudioInput() = default;
36 /* Overridden Handler */
37 void onStream(CPulseAudioClient* pClient, size_t length) override;
39 /* Implemented Methods */
40 void initialize() override;
41 void finalize() override;
43 void prepare() override;
44 void unprepare() override;
46 void pause() override;
47 void resume() override;
49 void flush() override;
51 int getBufferSize() override;
53 /* Overridden Methods */
54 void setStreamCallback(SStreamCallback callback) override;
57 size_t read(void* buffer, size_t length);
58 int peek(const void** buffer, size_t* length);
61 void setVolume(double volume);
66 void __setInit(bool flag) noexcept;
67 bool __IsInit() noexcept;
68 bool __IsReady() noexcept;
70 bool __mIsUsedSyncRead { true };
73 double __mVolume { CAudioInfo::DEFAULT_RECORD_VOLUME };
77 } /* namespace tizen_media_audio */
80 #endif /* __TIZEN_MEDIA_AUDIO_IO_CAUDIO_INPUT_H__ */