2 using System.Runtime.InteropServices;
4 namespace Tizen.Multimedia
6 internal static partial class Interop
8 internal static partial class Libc
10 [DllImport(Libraries.Libc, EntryPoint = "free")]
11 public static extern void Free(IntPtr userData);
14 internal static partial class Recorder
16 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
17 internal delegate void RecorderErrorCallback(RecorderErrorCode error, RecorderState current, IntPtr userData);
19 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
20 internal delegate void InterruptedCallback(RecorderPolicy policy, RecorderState previous, RecorderState current, IntPtr userData);
22 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
23 internal delegate void RecordingLimitReachedCallback(RecordingLimitType type, IntPtr userData);
25 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
26 internal delegate void RecordingProgressCallback(ulong elapsedTime, ulong fileSize, IntPtr userData);
28 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
29 internal delegate void AudioStreamCallback(IntPtr stream, int size, AudioSampleType type, int channel, uint timeStamp, IntPtr userData);
31 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
32 internal delegate void StatechangedCallback(RecorderState previous, RecorderState current, bool byPolicy, IntPtr userData);
34 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
35 internal delegate void MuxedStreamCallback(IntPtr stream, int size, ulong offset, IntPtr userData);
37 [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_audiorecorder")]
38 internal static extern RecorderError Create(out IntPtr handle);
40 [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_videorecorder")]
41 internal static extern RecorderError CreateVideo(IntPtr cameraHandle, out IntPtr handle);
43 [DllImport(Libraries.Recorder, EntryPoint = "recorder_destroy")]
44 internal static extern RecorderError Destroy(IntPtr handle);
46 [DllImport(Libraries.Recorder, EntryPoint = "recorder_prepare")]
47 internal static extern RecorderError Prepare(IntPtr handle);
49 [DllImport(Libraries.Recorder, EntryPoint = "recorder_unprepare")]
50 internal static extern RecorderError Unprepare(IntPtr handle);
52 [DllImport(Libraries.Recorder, EntryPoint = "recorder_start")]
53 internal static extern RecorderError Start(IntPtr handle);
55 [DllImport(Libraries.Recorder, EntryPoint = "recorder_pause")]
56 internal static extern RecorderError Pause(IntPtr handle);
58 [DllImport(Libraries.Recorder, EntryPoint = "recorder_commit")]
59 internal static extern RecorderError Commit(IntPtr handle);
61 [DllImport(Libraries.Recorder, EntryPoint = "recorder_cancel")]
62 internal static extern RecorderError Cancel(IntPtr handle);
64 [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_state")]
65 internal static extern RecorderError GetState(IntPtr handle, out RecorderState state);
67 [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_sound_stream_info")]
68 internal static extern RecorderError SetAudioStreamPolicy(IntPtr handle, IntPtr streamInfoHandle);
70 [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_error_cb")]
71 internal static extern RecorderError SetErrorCallback(IntPtr handle, RecorderErrorCallback callback, IntPtr userData);
73 [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_error_cb")]
74 internal static extern RecorderError UnsetErrorCallback(IntPtr handle);
76 [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_interrupted_cb")]
77 internal static extern RecorderError SetInterruptedCallback(IntPtr handle, InterruptedCallback callback, IntPtr userData);
79 [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_interrupted_cb")]
80 internal static extern RecorderError UnsetInterruptedCallback(IntPtr handle);
82 [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_state_changed_cb")]
83 internal static extern RecorderError SetStateChangedCallback(IntPtr handle, StatechangedCallback callback, IntPtr userData);
85 [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_state_changed_cb")]
86 internal static extern RecorderError UnsetStateChangedCallback(IntPtr handle);
88 [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_recording_status_cb")]
89 internal static extern RecorderError SetRecordingProgressCallback(IntPtr handle, RecordingProgressCallback callback, IntPtr userData);
91 [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_recording_status_cb")]
92 internal static extern RecorderError UnsetRecordingProgressCallback(IntPtr handle);
94 [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_audio_stream_cb")]
95 internal static extern RecorderError SetAudioStreamCallback(IntPtr handle, AudioStreamCallback callback, IntPtr userData);
97 [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_audio_stream_cb")]
98 internal static extern RecorderError UnsetAudioStreamCallback(IntPtr handle);
100 [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_recording_limit_reached_cb")]
101 internal static extern RecorderError SetLimitReachedCallback(IntPtr handle, RecordingLimitReachedCallback callback, IntPtr userData);
103 [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_recording_limit_reached_cb")]
104 internal static extern RecorderError UnsetLimitReachedCallback(IntPtr handle);
106 [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_muxed_stream_cb")]
107 internal static extern RecorderError SetMuxedStreamCallback(IntPtr handle, MuxedStreamCallback callback, IntPtr userData);
109 [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_muxed_stream_cb")]
110 internal static extern RecorderError UnsetMuxedStreamCallback(IntPtr handle);