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 CAudioInput(CAudioInfo& info);
35 unsigned int sampleRate,
36 CAudioInfo::EChannel channel,
37 CAudioInfo::ESampleType sampleType,
38 CAudioInfo::EAudioType audioType);
41 /* Overridden Handler */
42 virtual void onStream(CPulseAudioClient* pClient, size_t length);
43 virtual void onInterrupt(CAudioSessionHandler* pHandler, int id,
44 mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state,
45 const char *reason_for_change, const char *additional_info);
46 virtual void onSignal(CAudioSessionHandler* pHandler, mm_sound_signal_name_t signal, int value);
48 /* Implemented Methods */
49 virtual void initialize();
50 virtual void finalize();
52 virtual void prepare();
53 virtual void unprepare();
56 virtual void resume();
61 virtual int getBufferSize();
63 /* Overridden Methods */
64 virtual void setStreamCallback(SStreamCallback callback);
67 size_t read(void* buffer, size_t length);
68 int peek(const void** buffer, size_t* length);
73 void __setInit(bool flag);
77 bool __mIsUsedSyncRead;
82 } /* namespace tizen_media_audio */
85 #endif /* __TIZEN_MEDIA_AUDIO_IO_CAUDIO_INPUT_H__ */