Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.StreamRecorder / Interop / Interop.StreamRecorder.cs
1 using System;
2 using System.Runtime.InteropServices;
3 using Tizen.Multimedia;
4
5 internal static partial class Interop
6 {
7     internal static partial class StreamRecorder
8     {
9         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
10         internal delegate void RecordingLimitReachedCallback(StreamRecordingLimitType type, IntPtr userData);
11
12         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
13         internal delegate void RecordingStatusCallback(ulong elapsedTime, ulong fileSize, IntPtr userData);
14
15         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
16         internal delegate void NotifiedCallback(StreamRecorderState previous, StreamRecorderState current, StreamRecorderNotify notfication, IntPtr userData);
17
18         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
19         internal delegate void RecorderErrorCallback(StreamRecorderErrorCode error, StreamRecorderState current, IntPtr userData);
20
21         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
22         internal delegate void BufferConsumedCallback(IntPtr buffer, IntPtr userData);
23
24         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
25         internal delegate bool VideoResolutionCallback(int width, int height, IntPtr userData);
26
27         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
28         internal delegate bool FileFormatCallback(StreamRecorderFileFormat format, IntPtr userData);
29
30         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
31         internal delegate bool AudioEncoderCallback(StreamRecorderAudioCodec codec, IntPtr userData);
32
33         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
34         internal delegate bool VideoEncoderCallback(StreamRecorderVideoCodec codec, IntPtr userData);
35
36         /* begin of method */
37         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_create")]
38         internal static extern int Create(out IntPtr handle);
39
40         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_destroy")]
41         internal static extern int Destroy(IntPtr handle);
42
43         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_prepare")]
44         internal static extern int Prepare(IntPtr handle);
45
46         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unprepare")]
47         internal static extern int Unprepare(IntPtr handle);
48
49         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_start")]
50         internal static extern int Start(IntPtr handle);
51
52         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_pause")]
53         internal static extern int Pause(IntPtr handle);
54
55         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_commit")]
56         internal static extern int Commit(IntPtr handle);
57
58         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_cancel")]
59         internal static extern int Cancel(IntPtr handle);
60
61         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_push_stream_buffer")]
62         internal static extern int PushStreamBuffer(IntPtr handle, IntPtr/*  media_packet_h */ inbuf);
63
64         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_enable_source_buffer")]
65         internal static extern int EnableSourceBuffer(IntPtr handle, int type);
66
67         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_state")]
68         internal static extern int GetState(IntPtr handle, out int state);
69
70         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_filename")]
71         internal static extern int SetFileName(IntPtr handle, string path);
72
73         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_filename")]
74         internal static extern int GetFileName(IntPtr handle, out IntPtr path);
75
76         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_file_format")]
77         internal static extern int SetFileFormat(IntPtr handle, int format);
78
79         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_file_format")]
80         internal static extern int GetFileFormat(IntPtr handle, out int format);
81
82         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_encoder")]
83         internal static extern int SetAudioEncoder(IntPtr handle, int codec);
84
85         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_encoder")]
86         internal static extern int GetAudioEncoder(IntPtr handle, out int codec);
87
88         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_encoder")]
89         internal static extern int SetVideoEncoder(IntPtr handle, int codec);
90
91         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_encoder")]
92         internal static extern int GetVideoEncoder(IntPtr handle, out int codec);
93
94         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_resolution")]
95         internal static extern int SetVideoResolution(IntPtr handle, int width, int height);
96
97         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_resolution")]
98         internal static extern int GetVideoResolution(IntPtr handle, out int width, out int height);
99
100         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_framerate")]
101         internal static extern int SetVideoFramerate(IntPtr handle, int framerate);
102
103         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_framerate")]
104         internal static extern int GetVideoFramerate(IntPtr handle, out int framerate);
105
106         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_source_format")]
107         internal static extern int SetVideoSourceFormat(IntPtr handle, int format);
108
109         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_source_format")]
110         internal static extern int GetVideoSourceFormat(IntPtr handle, out int format);
111
112         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_limit")]
113         internal static extern int SetRecordingLimit(IntPtr handle, int type, int limit);
114
115         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_recording_limit")]
116         internal static extern int GetRecordingLimit(IntPtr handle, int type, out int format);
117
118         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_samplerate")]
119         internal static extern int SetAudioSampleRate(IntPtr handle, int samplerate);
120
121         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_samplerate")]
122         internal static extern int GetAudioSampleRate(IntPtr handle, out int samplerate);
123
124         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_encoder_bitrate")]
125         internal static extern int SetAudioEncoderBitrate(IntPtr handle, int bitrate);
126
127         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_encoder_bitrate")]
128         internal static extern int GetAudioEncoderBitrate(IntPtr handle, out int bitrate);
129
130         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_encoder_bitrate")]
131         internal static extern int SetVideoEncoderBitrate(IntPtr handle, int bitrate);
132
133         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_encoder_bitrate")]
134         internal static extern int GetVideoEncoderBitrate(IntPtr handle, out int bitrate);
135
136         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_channel")]
137         internal static extern int SetAudioChannel(IntPtr handle, int channel);
138
139         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_channel")]
140         internal static extern int GetAudioChannel(IntPtr handle, out int channel);
141         /* End of method */
142
143         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_file_format")]
144         internal static extern int FileFormats(IntPtr handle, FileFormatCallback callback, IntPtr userData);
145
146         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_audio_encoder")]
147         internal static extern int AudioEncoders(IntPtr handle, AudioEncoderCallback callback, IntPtr userData);
148
149         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_video_encoder")]
150         internal static extern int VideoEncoders(IntPtr handle, VideoEncoderCallback callback, IntPtr userData);
151
152         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_video_resolution")]
153         internal static extern int VideoResolution(IntPtr handle, VideoResolutionCallback callback, IntPtr userData);
154         /* End of foreach method */
155
156         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_notify_cb")]
157         internal static extern int SetNotifiedCallback(IntPtr handle, NotifiedCallback callback, IntPtr userData);
158
159         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_notify_cb")]
160         internal static extern int UnsetNotifiedCallback(IntPtr handle);
161
162         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_status_cb")]
163         internal static extern int SetStatusChangedCallback(IntPtr handle, RecordingStatusCallback callback, IntPtr userData);
164
165         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_recording_status_cb")]
166         internal static extern int UnsetStatusChangedCallback(IntPtr handle);
167
168         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_limit_reached_cb")]
169         internal static extern int SetLimitReachedCallback(IntPtr handle, RecordingLimitReachedCallback callback, IntPtr userData);
170
171         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_recording_limit_reached_cb")]
172         internal static extern int UnsetLimitReachedCallback(IntPtr handle);
173
174         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_error_cb")]
175         internal static extern int SetErrorCallback(IntPtr handle, RecorderErrorCallback callback, IntPtr userData);
176
177         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_error_cb")]
178         internal static extern int UnsetErrorCallback(IntPtr handle);
179
180         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_buffer_consume_completed_cb")]
181         internal static extern int SetBufferConsumedCallback(IntPtr handle, BufferConsumedCallback callback, IntPtr userDat);
182
183         [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_buffer_consume_completed_cb")]
184         internal static extern int UnsetBufferConsumedCallback(IntPtr handle);
185     }
186 }