2 using System.Runtime.InteropServices;
3 using Tizen.Multimedia;
5 internal static partial class Interop
7 internal static partial class StreamRecorder
9 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
10 internal delegate void RecordingLimitReachedCallback(StreamRecordingLimitType type, IntPtr userData);
12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
13 internal delegate void RecordingStatusCallback(ulong elapsedTime, ulong fileSize, IntPtr userData);
15 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
16 internal delegate void NotifiedCallback(StreamRecorderState previous, StreamRecorderState current, StreamRecorderNotify notfication, IntPtr userData);
18 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
19 internal delegate void RecorderErrorCallback(StreamRecorderErrorCode error, StreamRecorderState current, IntPtr userData);
21 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
22 internal delegate void BufferConsumedCallback(IntPtr buffer, IntPtr userData);
24 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
25 internal delegate bool VideoResolutionCallback(int width, int height, IntPtr userData);
27 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
28 internal delegate bool FileFormatCallback(StreamRecorderFileFormat format, IntPtr userData);
30 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
31 internal delegate bool AudioEncoderCallback(StreamRecorderAudioCodec codec, IntPtr userData);
33 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
34 internal delegate bool VideoEncoderCallback(StreamRecorderVideoCodec codec, IntPtr userData);
37 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_create")]
38 internal static extern int Create(out IntPtr handle);
40 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_destroy")]
41 internal static extern int Destroy(IntPtr handle);
43 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_prepare")]
44 internal static extern int Prepare(IntPtr handle);
46 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unprepare")]
47 internal static extern int Unprepare(IntPtr handle);
49 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_start")]
50 internal static extern int Start(IntPtr handle);
52 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_pause")]
53 internal static extern int Pause(IntPtr handle);
55 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_commit")]
56 internal static extern int Commit(IntPtr handle);
58 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_cancel")]
59 internal static extern int Cancel(IntPtr handle);
61 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_push_stream_buffer")]
62 internal static extern int PushStreamBuffer(IntPtr handle, IntPtr/* media_packet_h */ inbuf);
64 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_enable_source_buffer")]
65 internal static extern int EnableSourceBuffer(IntPtr handle, int type);
67 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_state")]
68 internal static extern int GetState(IntPtr handle, out int state);
70 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_filename")]
71 internal static extern int SetFileName(IntPtr handle, string path);
73 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_filename")]
74 internal static extern int GetFileName(IntPtr handle, out IntPtr path);
76 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_file_format")]
77 internal static extern int SetFileFormat(IntPtr handle, int format);
79 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_file_format")]
80 internal static extern int GetFileFormat(IntPtr handle, out int format);
82 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_encoder")]
83 internal static extern int SetAudioEncoder(IntPtr handle, int codec);
85 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_encoder")]
86 internal static extern int GetAudioEncoder(IntPtr handle, out int codec);
88 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_encoder")]
89 internal static extern int SetVideoEncoder(IntPtr handle, int codec);
91 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_encoder")]
92 internal static extern int GetVideoEncoder(IntPtr handle, out int codec);
94 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_resolution")]
95 internal static extern int SetVideoResolution(IntPtr handle, int width, int height);
97 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_resolution")]
98 internal static extern int GetVideoResolution(IntPtr handle, out int width, out int height);
100 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_framerate")]
101 internal static extern int SetVideoFramerate(IntPtr handle, int framerate);
103 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_framerate")]
104 internal static extern int GetVideoFramerate(IntPtr handle, out int framerate);
106 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_source_format")]
107 internal static extern int SetVideoSourceFormat(IntPtr handle, int format);
109 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_source_format")]
110 internal static extern int GetVideoSourceFormat(IntPtr handle, out int format);
112 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_limit")]
113 internal static extern int SetRecordingLimit(IntPtr handle, int type, int limit);
115 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_recording_limit")]
116 internal static extern int GetRecordingLimit(IntPtr handle, int type, out int format);
118 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_samplerate")]
119 internal static extern int SetAudioSampleRate(IntPtr handle, int samplerate);
121 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_samplerate")]
122 internal static extern int GetAudioSampleRate(IntPtr handle, out int samplerate);
124 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_encoder_bitrate")]
125 internal static extern int SetAudioEncoderBitrate(IntPtr handle, int bitrate);
127 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_encoder_bitrate")]
128 internal static extern int GetAudioEncoderBitrate(IntPtr handle, out int bitrate);
130 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_encoder_bitrate")]
131 internal static extern int SetVideoEncoderBitrate(IntPtr handle, int bitrate);
133 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_encoder_bitrate")]
134 internal static extern int GetVideoEncoderBitrate(IntPtr handle, out int bitrate);
136 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_channel")]
137 internal static extern int SetAudioChannel(IntPtr handle, int channel);
139 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_channel")]
140 internal static extern int GetAudioChannel(IntPtr handle, out int channel);
143 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_file_format")]
144 internal static extern int FileFormats(IntPtr handle, FileFormatCallback callback, IntPtr userData);
146 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_audio_encoder")]
147 internal static extern int AudioEncoders(IntPtr handle, AudioEncoderCallback callback, IntPtr userData);
149 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_video_encoder")]
150 internal static extern int VideoEncoders(IntPtr handle, VideoEncoderCallback callback, IntPtr userData);
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 */
156 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_notify_cb")]
157 internal static extern int SetNotifiedCallback(IntPtr handle, NotifiedCallback callback, IntPtr userData);
159 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_notify_cb")]
160 internal static extern int UnsetNotifiedCallback(IntPtr handle);
162 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_status_cb")]
163 internal static extern int SetStatusChangedCallback(IntPtr handle, RecordingStatusCallback callback, IntPtr userData);
165 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_recording_status_cb")]
166 internal static extern int UnsetStatusChangedCallback(IntPtr handle);
168 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_limit_reached_cb")]
169 internal static extern int SetLimitReachedCallback(IntPtr handle, RecordingLimitReachedCallback callback, IntPtr userData);
171 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_recording_limit_reached_cb")]
172 internal static extern int UnsetLimitReachedCallback(IntPtr handle);
174 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_error_cb")]
175 internal static extern int SetErrorCallback(IntPtr handle, RecorderErrorCallback callback, IntPtr userData);
177 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_error_cb")]
178 internal static extern int UnsetErrorCallback(IntPtr handle);
180 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_buffer_consume_completed_cb")]
181 internal static extern int SetBufferConsumedCallback(IntPtr handle, BufferConsumedCallback callback, IntPtr userDat);
183 [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_buffer_consume_completed_cb")]
184 internal static extern int UnsetBufferConsumedCallback(IntPtr handle);