check null before use when dbus close connection
[platform/core/uifw/voice-control.git] / server / vcd_recorder.h
1 /*
2 * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd All Rights Reserved
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
18 #ifndef __VCD_RECORDER_H__
19 #define __VCD_RECORDER_H__
20
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26
27 typedef enum {
28         VCD_RECORDER_STATE_READY,       /**< Recorder is ready to start */
29         VCD_RECORDER_STATE_RECORDING,   /**< In the middle of recording */
30 } vcd_recorder_state_e;
31
32
33 typedef int (*vcd_recoder_audio_cb)(const void* data, const unsigned int length);
34
35 typedef void (*vcd_recorder_interrupt_cb)();
36
37
38 int vcd_recorder_create(vcd_recoder_audio_cb audio_cb, vcd_recorder_interrupt_cb interrupt_cb);
39
40 int vcd_recorder_destroy();
41
42 int vcd_recorder_set(const char* audio_type, vce_audio_type_e type, int rate, int channel);
43
44 int vcd_recorder_get(char** audio_type);
45
46 int vcd_recorder_start();
47
48 int vcd_recorder_read();
49
50 int vcd_recorder_stop();
51
52 int vcd_recorder_get_state();
53
54
55 #ifdef __cplusplus
56 }
57 #endif
58
59 #endif  /* __VCD_RECORDER_H__ */
60