From 918dfdb5a5d366c7c9e342246a6ec4dcbdcc8321 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Fri, 24 Mar 2017 10:51:22 +0900 Subject: [PATCH] Move Interop classes to Tizen.Multimedia namespace There are extension methods in global namespace in Interop directory and Interop classes uses them. In this situation, C# compiler raises 'internal compiler error' when loading the Interop type sometimes. Change-Id: Ie5224d5a36ce91702425dcce02c2e529a049c05d Signed-off-by: WonYoung Choi --- src/Tizen.Multimedia/Camera/PreviewData.cs | 2 +- src/Tizen.Multimedia/Interop/Interop.AudioIO.cs | 163 ++++---- src/Tizen.Multimedia/Interop/Interop.Camera.cs | 413 +++++++++++---------- .../Interop/Interop.CameraDisplay.cs | 54 +-- .../Interop/Interop.CameraFeatures.cs | 193 +++++----- .../Interop/Interop.CameraSettings.cs | 289 +++++++------- src/Tizen.Multimedia/Interop/Interop.Device.cs | 98 ++--- src/Tizen.Multimedia/Interop/Interop.ErrorCode.cs | 135 +++---- src/Tizen.Multimedia/Interop/Interop.EvasObject.cs | 22 +- .../Interop/Interop.ImageUtil.Decode.cs | 113 +++--- .../Interop/Interop.ImageUtil.Encode.cs | 167 +++++---- .../Interop/Interop.ImageUtil.Transform.cs | 139 +++---- src/Tizen.Multimedia/Interop/Interop.ImageUtil.cs | 187 +++++----- src/Tizen.Multimedia/Interop/Interop.Libraries.cs | 49 +-- src/Tizen.Multimedia/Interop/Interop.MediaCodec.cs | 143 +++---- .../Interop/Interop.MediaController.cs | 251 ++++++------- src/Tizen.Multimedia/Interop/Interop.MediaTool.cs | 207 ++++++----- .../Interop/Interop.MediaVision.BarCode.cs | 72 ++-- .../Interop/Interop.MediaVision.Common.cs | 282 +++++++------- .../Interop/Interop.MediaVision.Face.cs | 246 ++++++------ .../Interop/Interop.MediaVision.Image.cs | 126 +++---- .../Interop/Interop.MediaVision.Surveillance.cs | 96 ++--- .../Interop/Interop.MetadataEditor.cs | 46 +-- .../Interop/Interop.MetadataExtractor.cs | 78 ++-- src/Tizen.Multimedia/Interop/Interop.Player.cs | 377 +++++++++---------- src/Tizen.Multimedia/Interop/Interop.Radio.cs | 351 ++++++++--------- src/Tizen.Multimedia/Interop/Interop.Recorder.cs | 136 +++---- .../Interop/Interop.RecorderFeatures.cs | 42 ++- .../Interop/Interop.RecorderSettings.cs | 136 +++---- .../Interop/Interop.SafeMultimediaHandle.cs | 87 ++--- .../Interop/Interop.ScreenMirroring.cs | 95 ++--- .../Interop/Interop.StreamPolicy.cs | 107 +++--- .../Interop/Interop.StreamRecorder.cs | 250 ++++++------- .../Interop/Interop.ThumbnailExtractor.cs | 34 +- src/Tizen.Multimedia/Interop/Interop.TonePlayer.cs | 16 +- src/Tizen.Multimedia/Interop/Interop.VideoUtil.cs | 257 ++++++------- src/Tizen.Multimedia/Interop/Interop.Volume.cs | 56 +-- src/Tizen.Multimedia/Interop/Interop.WavPlayer.cs | 23 +- .../MediaVision/BarcodeDetector.cs | 4 +- .../MediaVision/BarcodeGenerator.cs | 2 +- .../MediaVision/EngineConfiguration.cs | 2 +- src/Tizen.Multimedia/MediaVision/FaceDetector.cs | 2 +- .../MediaVision/FaceRecognitionModel.cs | 2 +- src/Tizen.Multimedia/MediaVision/FaceRecognizer.cs | 2 +- src/Tizen.Multimedia/MediaVision/FaceTracker.cs | 2 +- .../MediaVision/FaceTrackingModel.cs | 2 +- src/Tizen.Multimedia/MediaVision/ImageObject.cs | 2 +- .../MediaVision/ImageRecognizer.cs | 2 +- src/Tizen.Multimedia/MediaVision/ImageTracker.cs | 2 +- .../MediaVision/ImageTrackingModel.cs | 2 +- .../MediaVision/MediaVisionSource.cs | 2 +- .../MediaVision/MovementDetector.cs | 2 +- .../MediaVision/PersonAppearanceDetector.cs | 2 +- .../MediaVision/PersonRecognizer.cs | 2 +- .../MediaVision/SurveillanceEngine.cs | 2 +- .../MediaVision/SurveillanceSource.cs | 2 +- src/Tizen.Multimedia/MetadataExtractor/Metadata.cs | 2 +- src/Tizen.Multimedia/Tizen.Multimedia.csproj | 383 ++++++++++++++++--- 58 files changed, 3156 insertions(+), 2805 deletions(-) mode change 100755 => 100644 src/Tizen.Multimedia/Camera/PreviewData.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.AudioIO.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.Camera.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.CameraFeatures.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.CameraSettings.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.ErrorCode.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.EvasObject.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.ImageUtil.Decode.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.ImageUtil.Encode.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.ImageUtil.Transform.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.ImageUtil.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.Libraries.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.MediaController.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.MediaVision.BarCode.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.MediaVision.Common.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.MediaVision.Face.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.MediaVision.Image.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.MediaVision.Surveillance.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.MetadataEditor.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.MetadataExtractor.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.Radio.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.Recorder.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.RecorderFeatures.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.RecorderSettings.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.SafeMultimediaHandle.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.ScreenMirroring.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.StreamRecorder.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.ThumbnailExtractor.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.TonePlayer.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.VideoUtil.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.Volume.cs mode change 100755 => 100644 src/Tizen.Multimedia/Interop/Interop.WavPlayer.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/BarcodeDetector.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/BarcodeGenerator.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/EngineConfiguration.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/FaceDetector.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/FaceRecognitionModel.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/FaceRecognizer.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/FaceTracker.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/FaceTrackingModel.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/ImageRecognizer.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/ImageTracker.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/ImageTrackingModel.cs mode change 100755 => 100644 src/Tizen.Multimedia/MediaVision/MediaVisionSource.cs mode change 100755 => 100644 src/Tizen.Multimedia/MetadataExtractor/Metadata.cs mode change 100755 => 100644 src/Tizen.Multimedia/Tizen.Multimedia.csproj diff --git a/src/Tizen.Multimedia/Camera/PreviewData.cs b/src/Tizen.Multimedia/Camera/PreviewData.cs old mode 100755 new mode 100644 index 7a23e90..76b7828 --- a/src/Tizen.Multimedia/Camera/PreviewData.cs +++ b/src/Tizen.Multimedia/Camera/PreviewData.cs @@ -17,7 +17,7 @@ using System; using System.Diagnostics; using System.Runtime.InteropServices; -using static Interop.Camera; +using static Tizen.Multimedia.Interop.Camera; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/Interop/Interop.AudioIO.cs b/src/Tizen.Multimedia/Interop/Interop.AudioIO.cs old mode 100755 new mode 100644 index 8f8aaf8..f13a675 --- a/src/Tizen.Multimedia/Interop/Interop.AudioIO.cs +++ b/src/Tizen.Multimedia/Interop/Interop.AudioIO.cs @@ -1,121 +1,124 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class AudioIO + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void AudioStreamCallback(IntPtr handle, uint nbytes, IntPtr userdata); + internal static partial class AudioIO + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void AudioStreamCallback(IntPtr handle, uint nbytes, IntPtr userdata); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void AudioStateChangedCallback(IntPtr handle, int previous, int current, bool byPolicy, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void AudioStateChangedCallback(IntPtr handle, int previous, int current, bool byPolicy, IntPtr userData); - internal static partial class AudioInput - { - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(IntPtr handle, AudioStateChangedCallback callback, IntPtr user_data); + internal static partial class AudioInput + { + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_set_state_changed_cb")] + internal static extern int SetStateChangedCallback(IntPtr handle, AudioStateChangedCallback callback, IntPtr user_data); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_set_stream_cb")] - internal static extern int SetStreamCallback(IntPtr handle, AudioStreamCallback callback, IntPtr user_data); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_set_stream_cb")] + internal static extern int SetStreamCallback(IntPtr handle, AudioStreamCallback callback, IntPtr user_data); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_create")] - internal static extern int Create(int sampleRate, int channel, int type, out IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_create")] + internal static extern int Create(int sampleRate, int channel, int type, out IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_destroy")] - internal static extern int Destroy(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_destroy")] + internal static extern int Destroy(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_set_sound_stream_info")] - internal static extern int SetStreamInfo(IntPtr handle, IntPtr streamInfoHandle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_set_sound_stream_info")] + internal static extern int SetStreamInfo(IntPtr handle, IntPtr streamInfoHandle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_prepare")] - internal static extern int Prepare(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_prepare")] + internal static extern int Prepare(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_unprepare")] - internal static extern int Unprepare(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_unprepare")] + internal static extern int Unprepare(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_pause")] - internal static extern int Pause(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_pause")] + internal static extern int Pause(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_resume")] - internal static extern int Resume(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_resume")] + internal static extern int Resume(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_flush")] - internal static extern int Flush(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_flush")] + internal static extern int Flush(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_read")] - internal static extern int Read(IntPtr handle, byte[] buffer, int length); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_read")] + internal static extern int Read(IntPtr handle, byte[] buffer, int length); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_buffer_size")] - internal static extern int GetBufferSize(IntPtr handle, out int size); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_buffer_size")] + internal static extern int GetBufferSize(IntPtr handle, out int size); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_sample_rate")] - internal static extern int GetSampleRate(IntPtr handle, out int sampleRate); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_sample_rate")] + internal static extern int GetSampleRate(IntPtr handle, out int sampleRate); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_channel")] - internal static extern int GetChannel(IntPtr handle, out int channel); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_channel")] + internal static extern int GetChannel(IntPtr handle, out int channel); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_sample_type")] - internal static extern int GetSampleType(IntPtr handle, out int sampleType); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_sample_type")] + internal static extern int GetSampleType(IntPtr handle, out int sampleType); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_peek")] - internal static extern int Peek(IntPtr handle, out IntPtr buffer, ref uint length); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_peek")] + internal static extern int Peek(IntPtr handle, out IntPtr buffer, ref uint length); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_drop")] - internal static extern int Drop(IntPtr handle); - } - internal static partial class AudioOutput - { - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(IntPtr handle, AudioStateChangedCallback callback, IntPtr user_data); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_drop")] + internal static extern int Drop(IntPtr handle); + } + internal static partial class AudioOutput + { + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_set_state_changed_cb")] + internal static extern int SetStateChangedCallback(IntPtr handle, AudioStateChangedCallback callback, IntPtr user_data); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_set_stream_cb")] - internal static extern int SetStreamChangedCallback(IntPtr handle, AudioStreamCallback callback, IntPtr user_data); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_set_stream_cb")] + internal static extern int SetStreamChangedCallback(IntPtr handle, AudioStreamCallback callback, IntPtr user_data); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_create_new")] - internal static extern int Create(int sampleRate, int channel, int type, out IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_create_new")] + internal static extern int Create(int sampleRate, int channel, int type, out IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_destroy")] - internal static extern int Destroy(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_destroy")] + internal static extern int Destroy(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_drain")] - internal static extern int Drain(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_drain")] + internal static extern int Drain(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_flush")] - internal static extern int Flush(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_flush")] + internal static extern int Flush(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_buffer_size")] - internal static extern int GetBufferSize(IntPtr handle, out int size); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_buffer_size")] + internal static extern int GetBufferSize(IntPtr handle, out int size); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_channel")] - internal static extern int GetChannel(IntPtr handle, out int channel); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_channel")] + internal static extern int GetChannel(IntPtr handle, out int channel); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_sample_rate")] - internal static extern int GetSampleRate(IntPtr handle, out int sampleRate); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_sample_rate")] + internal static extern int GetSampleRate(IntPtr handle, out int sampleRate); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_sample_type")] - internal static extern int GetSampleType(IntPtr handle, out int sampleType); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_sample_type")] + internal static extern int GetSampleType(IntPtr handle, out int sampleType); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_sound_type")] - internal static extern int GetSoundType(IntPtr handle, out int soundType); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_sound_type")] + internal static extern int GetSoundType(IntPtr handle, out int soundType); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_pause")] - internal static extern int Pause(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_pause")] + internal static extern int Pause(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_prepare")] - internal static extern int Prepare(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_prepare")] + internal static extern int Prepare(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_resume")] - internal static extern int Resume(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_resume")] + internal static extern int Resume(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_set_sound_stream_info")] - internal static extern int SetStreamInfo(IntPtr handle, IntPtr streamInfoHandle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_set_sound_stream_info")] + internal static extern int SetStreamInfo(IntPtr handle, IntPtr streamInfoHandle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_unprepare")] - internal static extern int Unprepare(IntPtr handle); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_unprepare")] + internal static extern int Unprepare(IntPtr handle); - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_write")] - internal static extern int Write(IntPtr handle, byte[] buffer, uint length); + [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_write")] + internal static extern int Write(IntPtr handle, byte[] buffer, uint length); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.Camera.cs b/src/Tizen.Multimedia/Interop/Interop.Camera.cs old mode 100755 new mode 100644 index a6957a6..8f82f37 --- a/src/Tizen.Multimedia/Interop/Interop.Camera.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Camera.cs @@ -1,258 +1,259 @@ using System; using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class Camera + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void FaceDetectedCallback(IntPtr faces, int count, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(CameraState previous, CameraState current, bool byPolicy, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InterruptedCallback(CameraPolicy policy, CameraState previous, CameraState current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void FocusStateChangedCallback(CameraFocusState state, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ErrorCallback(CameraErrorCode error, CameraState current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CapturingCallback(IntPtr image, IntPtr postview, IntPtr thumbnail, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CaptureCompletedCallback(IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PreviewCallback(IntPtr frame, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MediaPacketPreviewCallback(IntPtr mediaPacketHandle, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void HdrCaptureProgressCallback(int percent, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DeviceStateChangedCallback(CameraDevice device, CameraDeviceState state, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_create")] - internal static extern int Create(int device, out IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_change_device")] - internal static extern int ChangeDevice(IntPtr handle, int device); - - [DllImport(Libraries.Camera, EntryPoint = "camera_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_device_count")] - internal static extern int GetDeviceCount(IntPtr handle, out int count); - - [DllImport(Libraries.Camera, EntryPoint = "camera_start_preview")] - internal static extern int StartPreview(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_stop_preview")] - internal static extern int StopPreview(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_device_state")] - internal static extern int GetDeviceState(CameraDevice device, out int state); + internal static partial class Camera + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void FaceDetectedCallback(IntPtr faces, int count, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_start_capture")] - internal static extern int StartCapture(IntPtr handle, CapturingCallback captureCallback, - CaptureCompletedCallback completedCallback, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void StateChangedCallback(CameraState previous, CameraState current, bool byPolicy, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_start_continuous_capture")] - internal static extern int StartContinuousCapture(IntPtr handle, int count, int interval, - CapturingCallback captureCallback, CaptureCompletedCallback completedCallback, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void InterruptedCallback(CameraPolicy policy, CameraState previous, CameraState current, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_stop_continuous_capture")] - internal static extern int StopContinuousCapture(IntPtr handle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void FocusStateChangedCallback(CameraFocusState state, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_state")] - internal static extern int GetState(IntPtr handle, out CameraState state); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void ErrorCallback(CameraErrorCode error, CameraState current, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_start_focusing")] - internal static extern int StartFocusing(IntPtr handle, bool continuous); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void CapturingCallback(IntPtr image, IntPtr postview, IntPtr thumbnail, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_cancel_focusing")] - internal static extern int CancelFocusing(IntPtr handle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void CaptureCompletedCallback(IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_resolution")] - internal static extern int SetPreviewResolution(IntPtr handle, int width, int height); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PreviewCallback(IntPtr frame, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_preview_resolution")] - internal static extern int GetPreviewResolution(IntPtr handle, out int width, out int height); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void MediaPacketPreviewCallback(IntPtr mediaPacketHandle, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_recommended_preview_resolution")] - internal static extern int GetRecommendedPreviewResolution(IntPtr handle, out int width, out int height); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void HdrCaptureProgressCallback(int percent, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_start_face_detection")] - internal static extern int StartFaceDetection(IntPtr handle, FaceDetectedCallback callback, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void DeviceStateChangedCallback(CameraDevice device, CameraDeviceState state, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_stop_face_detection")] - internal static extern int StopFaceDetection(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_create")] + internal static extern int Create(int device, out IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_reuse_hint")] - internal static extern int SetDisplayReuseHint(IntPtr handle, bool hint); + [DllImport(Libraries.Camera, EntryPoint = "camera_change_device")] + internal static extern int ChangeDevice(IntPtr handle, int device); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_reuse_hint")] - internal static extern int GetDisplayReuseHint(IntPtr handle, out bool hint); + [DllImport(Libraries.Camera, EntryPoint = "camera_destroy")] + internal static extern int Destroy(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_capture_resolution")] - internal static extern int SetCaptureResolution(IntPtr handle, int width, int height); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_device_count")] + internal static extern int GetDeviceCount(IntPtr handle, out int count); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_capture_resolution")] - internal static extern int GetCaptureResolution(IntPtr handle, out int width, out int height); + [DllImport(Libraries.Camera, EntryPoint = "camera_start_preview")] + internal static extern int StartPreview(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_capture_format")] - internal static extern int SetCaptureFormat(IntPtr handle, CameraPixelFormat format); + [DllImport(Libraries.Camera, EntryPoint = "camera_stop_preview")] + internal static extern int StopPreview(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_capture_format")] - internal static extern int GetCaptureFormat(IntPtr handle, out CameraPixelFormat format); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_device_state")] + internal static extern int GetDeviceState(CameraDevice device, out int state); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_format")] - internal static extern int SetPreviewPixelFormat(IntPtr handle, CameraPixelFormat format); + [DllImport(Libraries.Camera, EntryPoint = "camera_start_capture")] + internal static extern int StartCapture(IntPtr handle, CapturingCallback captureCallback, + CaptureCompletedCallback completedCallback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_preview_format")] - internal static extern int GetPreviewPixelFormat(IntPtr handle, out CameraPixelFormat format); + [DllImport(Libraries.Camera, EntryPoint = "camera_start_continuous_capture")] + internal static extern int StartContinuousCapture(IntPtr handle, int count, int interval, + CapturingCallback captureCallback, CaptureCompletedCallback completedCallback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_facing_direction")] - internal static extern int GetFacingDirection(IntPtr handle, out CameraFacingDirection direction); + [DllImport(Libraries.Camera, EntryPoint = "camera_stop_continuous_capture")] + internal static extern int StopContinuousCapture(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_flash_state")] - internal static extern int GetFlashState(CameraDevice device, out CameraFlashState state); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_state")] + internal static extern int GetState(IntPtr handle, out CameraState state); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_cb")] - internal static extern int SetPreviewCallback(IntPtr handle, PreviewCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_start_focusing")] + internal static extern int StartFocusing(IntPtr handle, bool continuous); - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_preview_cb")] - internal static extern int UnsetPreviewCallback(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_cancel_focusing")] + internal static extern int CancelFocusing(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_media_packet_preview_cb")] - internal static extern int SetMediaPacketPreviewCallback(IntPtr handle, MediaPacketPreviewCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_resolution")] + internal static extern int SetPreviewResolution(IntPtr handle, int width, int height); - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_media_packet_preview_cb")] - internal static extern int UnsetMediaPacketPreviewCallback(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_preview_resolution")] + internal static extern int GetPreviewResolution(IntPtr handle, out int width, out int height); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(IntPtr handle, StateChangedCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_recommended_preview_resolution")] + internal static extern int GetRecommendedPreviewResolution(IntPtr handle, out int width, out int height); - [DllImport(Libraries.Camera, EntryPoint = "camera_add_device_state_changed_cb")] - internal static extern int SetDeviceStateChangedCallback(DeviceStateChangedCallback callback, IntPtr userData, out int callbackId); + [DllImport(Libraries.Camera, EntryPoint = "camera_start_face_detection")] + internal static extern int StartFaceDetection(IntPtr handle, FaceDetectedCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_state_changed_cb")] - internal static extern int UnsetStateChangedCallback(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_stop_face_detection")] + internal static extern int StopFaceDetection(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_remove_device_state_changed_cb")] - internal static extern int UnsetDeviceStateChangedCallback(int cbId); + [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_reuse_hint")] + internal static extern int SetDisplayReuseHint(IntPtr handle, bool hint); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_interrupted_cb")] - internal static extern int SetInterruptedCallback(IntPtr handle, InterruptedCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_reuse_hint")] + internal static extern int GetDisplayReuseHint(IntPtr handle, out bool hint); - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_interrupted_cb")] - internal static extern int UnsetInterruptedCallback(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_set_capture_resolution")] + internal static extern int SetCaptureResolution(IntPtr handle, int width, int height); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_focus_changed_cb")] - internal static extern int SetFocusStateChangedCallback(IntPtr handle, FocusStateChangedCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_capture_resolution")] + internal static extern int GetCaptureResolution(IntPtr handle, out int width, out int height); - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_focus_changed_cb")] - internal static extern int UnsetFocusChangedCallback(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_set_capture_format")] + internal static extern int SetCaptureFormat(IntPtr handle, CameraPixelFormat format); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_error_cb")] - internal static extern int SetErrorCallback(IntPtr handle, ErrorCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_capture_format")] + internal static extern int GetCaptureFormat(IntPtr handle, out CameraPixelFormat format); - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_error_cb")] - internal static extern int UnsetErrorCallback(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_format")] + internal static extern int SetPreviewPixelFormat(IntPtr handle, CameraPixelFormat format); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_hdr_capture_progress_cb")] - internal static extern int SetHdrCaptureProgressCallback(IntPtr handle, HdrCaptureProgressCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_preview_format")] + internal static extern int GetPreviewPixelFormat(IntPtr handle, out CameraPixelFormat format); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_unset_hdr_capture_progress_cb")] - internal static extern int UnsetHdrCaptureProgressCallback(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_facing_direction")] + internal static extern int GetFacingDirection(IntPtr handle, out CameraFacingDirection direction); - [StructLayout(LayoutKind.Sequential)] - internal struct ImageDataStruct - { - internal IntPtr Data; - internal uint DataLength; - internal int Width; - internal int Height; - internal CameraPixelFormat Format; - internal IntPtr Exif; - internal uint ExifLength; - } + [DllImport(Libraries.Camera, EntryPoint = "camera_get_flash_state")] + internal static extern int GetFlashState(CameraDevice device, out CameraFlashState state); - [StructLayout(LayoutKind.Sequential)] - internal struct DetectedFaceStruct - { - internal int Id; - internal int Score; - internal int X; - internal int Y; - internal int Width; - internal int Height; - } + [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_cb")] + internal static extern int SetPreviewCallback(IntPtr handle, PreviewCallback callback, IntPtr userData); - [StructLayout(LayoutKind.Sequential)] - internal struct SinglePlaneStruct - { - internal IntPtr Data; - internal uint DataLength; - } + [DllImport(Libraries.Camera, EntryPoint = "camera_unset_preview_cb")] + internal static extern int UnsetPreviewCallback(IntPtr handle); - [StructLayout(LayoutKind.Sequential)] - internal struct DoublePlaneStruct - { - internal IntPtr Y; - internal IntPtr UV; - internal uint YLength; - internal uint UVLength; - } + [DllImport(Libraries.Camera, EntryPoint = "camera_set_media_packet_preview_cb")] + internal static extern int SetMediaPacketPreviewCallback(IntPtr handle, MediaPacketPreviewCallback callback, IntPtr userData); - [StructLayout(LayoutKind.Sequential)] - internal struct TriplePlaneStruct - { - internal IntPtr Y; - internal IntPtr U; - internal IntPtr V; - internal uint YLength; - internal uint ULength; - internal uint VLength; - } + [DllImport(Libraries.Camera, EntryPoint = "camera_unset_media_packet_preview_cb")] + internal static extern int UnsetMediaPacketPreviewCallback(IntPtr handle); - [StructLayout(LayoutKind.Sequential)] - internal struct EncodedPlaneStruct - { - internal IntPtr Data; - internal uint DataLength; - } + [DllImport(Libraries.Camera, EntryPoint = "camera_set_state_changed_cb")] + internal static extern int SetStateChangedCallback(IntPtr handle, StateChangedCallback callback, IntPtr userData); - [StructLayout(LayoutKind.Explicit)] - internal struct PreviewPlaneStruct - { - [FieldOffsetAttribute(0)] - internal SinglePlaneStruct SinglePlane; - [FieldOffsetAttribute(0)] - internal DoublePlaneStruct DoublePlane; - [FieldOffsetAttribute(0)] - internal TriplePlaneStruct TriplePlane; - [FieldOffsetAttribute(0)] - internal EncodedPlaneStruct EncodedPlane; - } + [DllImport(Libraries.Camera, EntryPoint = "camera_add_device_state_changed_cb")] + internal static extern int SetDeviceStateChangedCallback(DeviceStateChangedCallback callback, IntPtr userData, out int callbackId); - [StructLayout(LayoutKind.Sequential)] - internal struct CameraPreviewDataStruct - { - internal CameraPixelFormat Format; - internal int Width; - internal int Height; - internal int NumOfPlanes; - internal uint TimeStamp; - internal PreviewPlaneStruct Plane; + [DllImport(Libraries.Camera, EntryPoint = "camera_unset_state_changed_cb")] + internal static extern int UnsetStateChangedCallback(IntPtr handle); + + [DllImport(Libraries.Camera, EntryPoint = "camera_remove_device_state_changed_cb")] + internal static extern int UnsetDeviceStateChangedCallback(int cbId); + + [DllImport(Libraries.Camera, EntryPoint = "camera_set_interrupted_cb")] + internal static extern int SetInterruptedCallback(IntPtr handle, InterruptedCallback callback, IntPtr userData); + + [DllImport(Libraries.Camera, EntryPoint = "camera_unset_interrupted_cb")] + internal static extern int UnsetInterruptedCallback(IntPtr handle); + + [DllImport(Libraries.Camera, EntryPoint = "camera_set_focus_changed_cb")] + internal static extern int SetFocusStateChangedCallback(IntPtr handle, FocusStateChangedCallback callback, IntPtr userData); + + [DllImport(Libraries.Camera, EntryPoint = "camera_unset_focus_changed_cb")] + internal static extern int UnsetFocusChangedCallback(IntPtr handle); + + [DllImport(Libraries.Camera, EntryPoint = "camera_set_error_cb")] + internal static extern int SetErrorCallback(IntPtr handle, ErrorCallback callback, IntPtr userData); + + [DllImport(Libraries.Camera, EntryPoint = "camera_unset_error_cb")] + internal static extern int UnsetErrorCallback(IntPtr handle); + + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_hdr_capture_progress_cb")] + internal static extern int SetHdrCaptureProgressCallback(IntPtr handle, HdrCaptureProgressCallback callback, IntPtr userData); + + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_unset_hdr_capture_progress_cb")] + internal static extern int UnsetHdrCaptureProgressCallback(IntPtr handle); + + [StructLayout(LayoutKind.Sequential)] + internal struct ImageDataStruct + { + internal IntPtr Data; + internal uint DataLength; + internal int Width; + internal int Height; + internal CameraPixelFormat Format; + internal IntPtr Exif; + internal uint ExifLength; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct DetectedFaceStruct + { + internal int Id; + internal int Score; + internal int X; + internal int Y; + internal int Width; + internal int Height; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct SinglePlaneStruct + { + internal IntPtr Data; + internal uint DataLength; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct DoublePlaneStruct + { + internal IntPtr Y; + internal IntPtr UV; + internal uint YLength; + internal uint UVLength; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct TriplePlaneStruct + { + internal IntPtr Y; + internal IntPtr U; + internal IntPtr V; + internal uint YLength; + internal uint ULength; + internal uint VLength; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct EncodedPlaneStruct + { + internal IntPtr Data; + internal uint DataLength; + } + + [StructLayout(LayoutKind.Explicit)] + internal struct PreviewPlaneStruct + { + [FieldOffsetAttribute(0)] + internal SinglePlaneStruct SinglePlane; + [FieldOffsetAttribute(0)] + internal DoublePlaneStruct DoublePlane; + [FieldOffsetAttribute(0)] + internal TriplePlaneStruct TriplePlane; + [FieldOffsetAttribute(0)] + internal EncodedPlaneStruct EncodedPlane; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct CameraPreviewDataStruct + { + internal CameraPixelFormat Format; + internal int Width; + internal int Height; + internal int NumOfPlanes; + internal uint TimeStamp; + internal PreviewPlaneStruct Plane; + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs b/src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs old mode 100755 new mode 100644 index 94fbcab..513ca13 --- a/src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs +++ b/src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs @@ -1,42 +1,44 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class CameraDisplay + internal static partial class Interop { - [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_mode")] - internal static extern int GetMode(IntPtr handle, out CameraDisplayMode mode); + internal static partial class CameraDisplay + { + [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_mode")] + internal static extern int GetMode(IntPtr handle, out CameraDisplayMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_mode")] - internal static extern int SetMode(IntPtr handle, CameraDisplayMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_mode")] + internal static extern int SetMode(IntPtr handle, CameraDisplayMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_is_display_visible")] - internal static extern int GetVisible(IntPtr handle, out bool visible); + [DllImport(Libraries.Camera, EntryPoint = "camera_is_display_visible")] + internal static extern int GetVisible(IntPtr handle, out bool visible); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_visible")] - internal static extern int SetVisible(IntPtr handle, bool visible); + [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_visible")] + internal static extern int SetVisible(IntPtr handle, bool visible); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_rotation")] - internal static extern int GetRotation(IntPtr handle, out CameraRotation rotation); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_rotation")] + internal static extern int GetRotation(IntPtr handle, out CameraRotation rotation); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_rotation")] - internal static extern int SetRotation(IntPtr handle, CameraRotation rotation); + [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_rotation")] + internal static extern int SetRotation(IntPtr handle, CameraRotation rotation); - [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_flip")] - internal static extern int GetFlip(IntPtr handle, out CameraFlip flip); + [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_flip")] + internal static extern int GetFlip(IntPtr handle, out CameraFlip flip); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_flip")] - internal static extern int SetFlip(IntPtr handle, CameraFlip flip); + [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_flip")] + internal static extern int SetFlip(IntPtr handle, CameraFlip flip); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_display_roi_area")] - internal static extern int GetRoiArea(IntPtr handle, out int x, out int y, out int width, out int height); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_display_roi_area")] + internal static extern int GetRoiArea(IntPtr handle, out int x, out int y, out int width, out int height); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_display_roi_area")] - internal static extern int SetRoiArea(IntPtr handle, int x, int y, int width, int height); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_display_roi_area")] + internal static extern int SetRoiArea(IntPtr handle, int x, int y, int width, int height); - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display")] - internal static extern int SetInfo(IntPtr handle, CameraDisplayType displayType, IntPtr displayHandle); + [DllImport(Libraries.Camera, EntryPoint = "camera_set_display")] + internal static extern int SetInfo(IntPtr handle, CameraDisplayType displayType, IntPtr displayHandle); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.CameraFeatures.cs b/src/Tizen.Multimedia/Interop/Interop.CameraFeatures.cs old mode 100755 new mode 100644 index 773375a..d14860d --- a/src/Tizen.Multimedia/Interop/Interop.CameraFeatures.cs +++ b/src/Tizen.Multimedia/Interop/Interop.CameraFeatures.cs @@ -2,143 +2,146 @@ using System; using System.Runtime.InteropServices; using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class CameraFeatures + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PreviewResolutionCallback(int Width, int Height, IntPtr userData); + internal static partial class CameraFeatures + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool PreviewResolutionCallback(int Width, int Height, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool CaptureResolutionCallback(int Width, int Height, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool CaptureResolutionCallback(int Width, int Height, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool CaptureFormatCallback(CameraPixelFormat format, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool CaptureFormatCallback(CameraPixelFormat format, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PreviewFormatCallback(CameraPixelFormat format, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool PreviewFormatCallback(CameraPixelFormat format, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FpsCallback(CameraFps fps, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool FpsCallback(CameraFps fps, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FpsByResolutionCallback(CameraFps fps, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool FpsByResolutionCallback(CameraFps fps, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AfModeCallback(CameraAutoFocusMode mode, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool AfModeCallback(CameraAutoFocusMode mode, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ExposureModeCallback(CameraExposureMode mode, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool ExposureModeCallback(CameraExposureMode mode, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool IsoCallback(CameraIsoLevel iso, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool IsoCallback(CameraIsoLevel iso, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool TheaterModeCallback(CameraTheaterMode mode, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool TheaterModeCallback(CameraTheaterMode mode, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool WhitebalanceCallback(CameraWhiteBalance whitebalance, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool WhitebalanceCallback(CameraWhiteBalance whitebalance, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool EffectCallback(CameraEffectMode effect, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool EffectCallback(CameraEffectMode effect, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SceneModeCallback(CameraSceneMode mode, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool SceneModeCallback(CameraSceneMode mode, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FlashModeCallback(CameraFlashMode mode, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool FlashModeCallback(CameraFlashMode mode, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool StreamRotationCallback(CameraRotation rotation, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool StreamRotationCallback(CameraRotation rotation, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool StreamFlipCallback(CameraFlip flip, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool StreamFlipCallback(CameraFlip flip, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PtzTypeCallback(CameraPtzType type, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool PtzTypeCallback(CameraPtzType type, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_continuous_capture")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsContinuousCaptureSupported(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_continuous_capture")] + [return: MarshalAs(UnmanagedType.I1)] + internal static extern bool IsContinuousCaptureSupported(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_face_detection")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsFaceDetectionSupported(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_face_detection")] + [return: MarshalAs(UnmanagedType.I1)] + internal static extern bool IsFaceDetectionSupported(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_zero_shutter_lag")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsZeroShutterLagSupported(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_zero_shutter_lag")] + [return: MarshalAs(UnmanagedType.I1)] + internal static extern bool IsZeroShutterLagSupported(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_media_packet_preview_cb")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsMediaPacketPreviewCallbackSupported(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_media_packet_preview_cb")] + [return: MarshalAs(UnmanagedType.I1)] + internal static extern bool IsMediaPacketPreviewCallbackSupported(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_hdr_capture")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsHdrCaptureSupported(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_hdr_capture")] + [return: MarshalAs(UnmanagedType.I1)] + internal static extern bool IsHdrCaptureSupported(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_anti_shake")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsAntiShakeSupported(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_anti_shake")] + [return: MarshalAs(UnmanagedType.I1)] + internal static extern bool IsAntiShakeSupported(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_video_stabilization")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsVideoStabilizationSupported(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_video_stabilization")] + [return: MarshalAs(UnmanagedType.I1)] + internal static extern bool IsVideoStabilizationSupported(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_auto_contrast")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsAutoContrastSupported(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_auto_contrast")] + [return: MarshalAs(UnmanagedType.I1)] + internal static extern bool IsAutoContrastSupported(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_preview_resolution")] - internal static extern int SupportedPreviewResolutions(IntPtr handle, PreviewResolutionCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_preview_resolution")] + internal static extern int SupportedPreviewResolutions(IntPtr handle, PreviewResolutionCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_capture_resolution")] - internal static extern int SupportedCaptureResolutions(IntPtr handle, CaptureResolutionCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_capture_resolution")] + internal static extern int SupportedCaptureResolutions(IntPtr handle, CaptureResolutionCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_capture_format")] - internal static extern int SupportedCapturePixelFormats(IntPtr handle, CaptureFormatCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_capture_format")] + internal static extern int SupportedCapturePixelFormats(IntPtr handle, CaptureFormatCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_preview_format")] - internal static extern int SupportedPreviewPixelFormats(IntPtr handle, PreviewFormatCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_preview_format")] + internal static extern int SupportedPreviewPixelFormats(IntPtr handle, PreviewFormatCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_fps")] - internal static extern int SupportedPreviewFps(IntPtr handle, FpsCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_fps")] + internal static extern int SupportedPreviewFps(IntPtr handle, FpsCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_fps_by_resolution")] - internal static extern int SupportedPreviewFpsByResolution(IntPtr handle, int width, int height, FpsByResolutionCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_fps_by_resolution")] + internal static extern int SupportedPreviewFpsByResolution(IntPtr handle, int width, int height, FpsByResolutionCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_af_mode")] - internal static extern int SupportedAfModes(IntPtr handle, AfModeCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_af_mode")] + internal static extern int SupportedAfModes(IntPtr handle, AfModeCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_exposure_mode")] - internal static extern int SupportedExposureModes(IntPtr handle, ExposureModeCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_exposure_mode")] + internal static extern int SupportedExposureModes(IntPtr handle, ExposureModeCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_iso")] - internal static extern int SupportedIso(IntPtr handle, IsoCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_iso")] + internal static extern int SupportedIso(IntPtr handle, IsoCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_theater_mode")] - internal static extern int SupportedTheaterModes(IntPtr handle, TheaterModeCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_theater_mode")] + internal static extern int SupportedTheaterModes(IntPtr handle, TheaterModeCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_whitebalance")] - internal static extern int SupportedWhitebalance(IntPtr handle, WhitebalanceCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_whitebalance")] + internal static extern int SupportedWhitebalance(IntPtr handle, WhitebalanceCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_effect")] - internal static extern int SupportedEffects(IntPtr handle, EffectCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_effect")] + internal static extern int SupportedEffects(IntPtr handle, EffectCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_scene_mode")] - internal static extern int SupportedSceneModes(IntPtr handle, SceneModeCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_scene_mode")] + internal static extern int SupportedSceneModes(IntPtr handle, SceneModeCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_flash_mode")] - internal static extern int SupportedFlashModes(IntPtr handle, FlashModeCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_flash_mode")] + internal static extern int SupportedFlashModes(IntPtr handle, FlashModeCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_stream_rotation")] - internal static extern int SupportedStreamRotations(IntPtr handle, StreamRotationCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_stream_rotation")] + internal static extern int SupportedStreamRotations(IntPtr handle, StreamRotationCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_stream_flip")] - internal static extern int SupportedStreamFlips(IntPtr handle, StreamFlipCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_stream_flip")] + internal static extern int SupportedStreamFlips(IntPtr handle, StreamFlipCallback callback, IntPtr userData); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_ptz_type")] - internal static extern int SupportedPtzTypes(IntPtr handle, PtzTypeCallback callback, IntPtr userData); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_ptz_type")] + internal static extern int SupportedPtzTypes(IntPtr handle, PtzTypeCallback callback, IntPtr userData); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.CameraSettings.cs b/src/Tizen.Multimedia/Interop/Interop.CameraSettings.cs old mode 100755 new mode 100644 index 3219742..bfc633a --- a/src/Tizen.Multimedia/Interop/Interop.CameraSettings.cs +++ b/src/Tizen.Multimedia/Interop/Interop.CameraSettings.cs @@ -1,220 +1,221 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class CameraSettings + internal static partial class Interop { - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_preview_fps")] - internal static extern int SetPreviewFps(IntPtr handle, CameraFps fps); + internal static partial class CameraSettings + { + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_preview_fps")] + internal static extern int SetPreviewFps(IntPtr handle, CameraFps fps); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_preview_fps")] - internal static extern int GetPreviewFps(IntPtr handle, out CameraFps fps); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_preview_fps")] + internal static extern int GetPreviewFps(IntPtr handle, out CameraFps fps); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_image_quality")] - internal static extern int SetImageQuality(IntPtr handle, int quality); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_image_quality")] + internal static extern int SetImageQuality(IntPtr handle, int quality); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_image_quality")] - internal static extern int GetImageQuality(IntPtr handle, out int quality); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_image_quality")] + internal static extern int GetImageQuality(IntPtr handle, out int quality); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_encoded_preview_bitrate")] - internal static extern int SetBitrate(IntPtr handle, int bitrate); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_encoded_preview_bitrate")] + internal static extern int SetBitrate(IntPtr handle, int bitrate); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_encoded_preview_bitrate")] - internal static extern int GetBitrate(IntPtr handle, out int bitrate); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_encoded_preview_bitrate")] + internal static extern int GetBitrate(IntPtr handle, out int bitrate); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_encoded_preview_gop_interval")] - internal static extern int SetGopInterval(IntPtr handle, int interval); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_encoded_preview_gop_interval")] + internal static extern int SetGopInterval(IntPtr handle, int interval); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_encoded_preview_gop_interval")] - internal static extern int GetGopInterval(IntPtr handle, out int interval); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_encoded_preview_gop_interval")] + internal static extern int GetGopInterval(IntPtr handle, out int interval); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_zoom")] - internal static extern int SetZoom(IntPtr handle, int zoom); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_zoom")] + internal static extern int SetZoom(IntPtr handle, int zoom); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_zoom")] - internal static extern int GetZoom(IntPtr handle, out int zoom); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_zoom")] + internal static extern int GetZoom(IntPtr handle, out int zoom); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_zoom_range")] - internal static extern int GetZoomRange(IntPtr handle, out int min, out int max); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_zoom_range")] + internal static extern int GetZoomRange(IntPtr handle, out int min, out int max); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_af_mode")] - internal static extern int SetAutoFocusMode(IntPtr handle, CameraAutoFocusMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_af_mode")] + internal static extern int SetAutoFocusMode(IntPtr handle, CameraAutoFocusMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_af_mode")] - internal static extern int GetAutoFocusMode(IntPtr handle, out CameraAutoFocusMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_af_mode")] + internal static extern int GetAutoFocusMode(IntPtr handle, out CameraAutoFocusMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_af_area")] - internal static extern int SetAutoFocusArea(IntPtr handle, int x, int y); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_af_area")] + internal static extern int SetAutoFocusArea(IntPtr handle, int x, int y); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_clear_af_area")] - internal static extern int ClearAutoFocusArea(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_clear_af_area")] + internal static extern int ClearAutoFocusArea(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_exposure_mode")] - internal static extern int SetExposureMode(IntPtr handle, CameraExposureMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_exposure_mode")] + internal static extern int SetExposureMode(IntPtr handle, CameraExposureMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure_mode")] - internal static extern int GetExposureMode(IntPtr handle, out CameraExposureMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure_mode")] + internal static extern int GetExposureMode(IntPtr handle, out CameraExposureMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_exposure")] - internal static extern int SetExposure(IntPtr handle, int value); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_exposure")] + internal static extern int SetExposure(IntPtr handle, int value); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure")] - internal static extern int GetExposure(IntPtr handle, out int value); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure")] + internal static extern int GetExposure(IntPtr handle, out int value); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure_range")] - internal static extern int GetExposureRange(IntPtr handle, out int min, out int max); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure_range")] + internal static extern int GetExposureRange(IntPtr handle, out int min, out int max); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_iso")] - internal static extern int SetIso(IntPtr handle, CameraIsoLevel iso); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_iso")] + internal static extern int SetIso(IntPtr handle, CameraIsoLevel iso); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_iso")] - internal static extern int GetIso(IntPtr handle, out CameraIsoLevel iso); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_iso")] + internal static extern int GetIso(IntPtr handle, out CameraIsoLevel iso); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_theater_mode")] - internal static extern int SetTheaterMode(IntPtr handle, CameraTheaterMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_theater_mode")] + internal static extern int SetTheaterMode(IntPtr handle, CameraTheaterMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_theater_mode")] - internal static extern int GetTheaterMode(IntPtr handle, out CameraTheaterMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_theater_mode")] + internal static extern int GetTheaterMode(IntPtr handle, out CameraTheaterMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_brightness")] - internal static extern int SetBrightness(IntPtr handle, int level); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_brightness")] + internal static extern int SetBrightness(IntPtr handle, int level); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_brightness")] - internal static extern int GetBrightness(IntPtr handle, out int level); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_brightness")] + internal static extern int GetBrightness(IntPtr handle, out int level); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_brightness_range")] - internal static extern int GetBrightnessRange(IntPtr handle, out int min, out int max); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_brightness_range")] + internal static extern int GetBrightnessRange(IntPtr handle, out int min, out int max); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_contrast")] - internal static extern int SetContrast(IntPtr handle, int level); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_contrast")] + internal static extern int SetContrast(IntPtr handle, int level); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_contrast")] - internal static extern int GetContrast(IntPtr handle, out int level); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_contrast")] + internal static extern int GetContrast(IntPtr handle, out int level); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_contrast_range")] - internal static extern int GetContrastRange(IntPtr handle, out int min, out int max); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_contrast_range")] + internal static extern int GetContrastRange(IntPtr handle, out int min, out int max); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_whitebalance")] - internal static extern int SetWhitebalance(IntPtr handle, CameraWhiteBalance level); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_whitebalance")] + internal static extern int SetWhitebalance(IntPtr handle, CameraWhiteBalance level); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_whitebalance")] - internal static extern int GetWhiteBalance(IntPtr handle, out CameraWhiteBalance level); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_whitebalance")] + internal static extern int GetWhiteBalance(IntPtr handle, out CameraWhiteBalance level); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_effect")] - internal static extern int SetEffect(IntPtr handle, CameraEffectMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_effect")] + internal static extern int SetEffect(IntPtr handle, CameraEffectMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_effect")] - internal static extern int GetEffect(IntPtr handle, out CameraEffectMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_effect")] + internal static extern int GetEffect(IntPtr handle, out CameraEffectMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_scene_mode")] - internal static extern int SetSceneMode(IntPtr handle, CameraSceneMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_scene_mode")] + internal static extern int SetSceneMode(IntPtr handle, CameraSceneMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_scene_mode")] - internal static extern int GetSceneMode(IntPtr handle, out CameraSceneMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_scene_mode")] + internal static extern int GetSceneMode(IntPtr handle, out CameraSceneMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_tag")] - internal static extern int EnableTag(IntPtr handle, bool enable); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_tag")] + internal static extern int EnableTag(IntPtr handle, bool enable); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_enabled_tag")] - internal static extern int IsEnabledTag(IntPtr handle, out bool enabled); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_enabled_tag")] + internal static extern int IsEnabledTag(IntPtr handle, out bool enabled); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_image_description")] - internal static extern int SetImageDescription(IntPtr handle, string description); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_image_description")] + internal static extern int SetImageDescription(IntPtr handle, string description); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_image_description")] - internal static extern int GetImageDescription(IntPtr handle, out IntPtr description); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_image_description")] + internal static extern int GetImageDescription(IntPtr handle, out IntPtr description); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_software")] - internal static extern int SetTagSoftware(IntPtr handle, string software); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_software")] + internal static extern int SetTagSoftware(IntPtr handle, string software); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_software")] - internal static extern int GetTagSoftware(IntPtr handle, out IntPtr software); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_software")] + internal static extern int GetTagSoftware(IntPtr handle, out IntPtr software); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_orientation")] - internal static extern int SetTagOrientation(IntPtr handle, CameraTagOrientation orientation); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_orientation")] + internal static extern int SetTagOrientation(IntPtr handle, CameraTagOrientation orientation); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_orientation")] - internal static extern int GetTagOrientation(IntPtr handle, out CameraTagOrientation orientation); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_orientation")] + internal static extern int GetTagOrientation(IntPtr handle, out CameraTagOrientation orientation); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_geotag")] - internal static extern int SetGeotag(IntPtr handle, double latitude, double longtitude, double altitude); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_geotag")] + internal static extern int SetGeotag(IntPtr handle, double latitude, double longtitude, double altitude); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_geotag")] - internal static extern int GetGeotag(IntPtr handle, out double latitude, out double longtitude, out double altitude); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_geotag")] + internal static extern int GetGeotag(IntPtr handle, out double latitude, out double longtitude, out double altitude); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_remove_geotag")] - internal static extern int RemoveGeotag(IntPtr handle); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_remove_geotag")] + internal static extern int RemoveGeotag(IntPtr handle); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_flash_mode")] - internal static extern int SetFlashMode(IntPtr handle, CameraFlashMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_flash_mode")] + internal static extern int SetFlashMode(IntPtr handle, CameraFlashMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_flash_mode")] - internal static extern int GetFlashMode(IntPtr handle, out CameraFlashMode mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_flash_mode")] + internal static extern int GetFlashMode(IntPtr handle, out CameraFlashMode mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_lens_orientation")] - internal static extern int GetLensOrientation(IntPtr handle, out int angle); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_lens_orientation")] + internal static extern int GetLensOrientation(IntPtr handle, out int angle); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_stream_rotation")] - internal static extern int SetStreamRotation(IntPtr handle, CameraRotation mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_stream_rotation")] + internal static extern int SetStreamRotation(IntPtr handle, CameraRotation mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_stream_rotation")] - internal static extern int GetStreamRotation(IntPtr handle, out CameraRotation mode); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_stream_rotation")] + internal static extern int GetStreamRotation(IntPtr handle, out CameraRotation mode); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_stream_flip")] - internal static extern int SetFlip(IntPtr handle, CameraFlip flip); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_stream_flip")] + internal static extern int SetFlip(IntPtr handle, CameraFlip flip); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_stream_flip")] - internal static extern int GetFlip(IntPtr handle, out CameraFlip flip); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_stream_flip")] + internal static extern int GetFlip(IntPtr handle, out CameraFlip flip); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_hdr_mode")] - internal static extern int SetHdrMode(IntPtr handle, CameraHdrMode hdr); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_hdr_mode")] + internal static extern int SetHdrMode(IntPtr handle, CameraHdrMode hdr); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_hdr_mode")] - internal static extern int GetHdrMode(IntPtr handle, out CameraHdrMode hdr); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_hdr_mode")] + internal static extern int GetHdrMode(IntPtr handle, out CameraHdrMode hdr); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_anti_shake")] - internal static extern int EnableAntiShake(IntPtr handle, bool enable); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_anti_shake")] + internal static extern int EnableAntiShake(IntPtr handle, bool enable); - [DllImport(Libraries.Camera, EntryPoint = " camera_attr_is_enabled_anti_shake")] - internal static extern int IsEnabledAntiShake(IntPtr handle, out bool enabled); + [DllImport(Libraries.Camera, EntryPoint = " camera_attr_is_enabled_anti_shake")] + internal static extern int IsEnabledAntiShake(IntPtr handle, out bool enabled); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_video_stabilization")] - internal static extern int EnableVideoStabilization(IntPtr handle, bool enable); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_video_stabilization")] + internal static extern int EnableVideoStabilization(IntPtr handle, bool enable); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_enabled_video_stabilization")] - internal static extern int IsEnabledVideoStabilization(IntPtr handle, out bool enabled); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_enabled_video_stabilization")] + internal static extern int IsEnabledVideoStabilization(IntPtr handle, out bool enabled); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_auto_contrast")] - internal static extern int EnableAutoContrast(IntPtr handle, bool enable); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_auto_contrast")] + internal static extern int EnableAutoContrast(IntPtr handle, bool enable); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_enabled_auto_contrast")] - internal static extern int IsEnabledAutoContrast(IntPtr handle, out bool enabled); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_enabled_auto_contrast")] + internal static extern int IsEnabledAutoContrast(IntPtr handle, out bool enabled); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_disable_shutter_sound")] - internal static extern int DisableShutterSound(IntPtr handle, bool disable); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_disable_shutter_sound")] + internal static extern int DisableShutterSound(IntPtr handle, bool disable); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_pan")] - internal static extern int SetPan(IntPtr handle, CameraPtzMoveType type, int step); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_pan")] + internal static extern int SetPan(IntPtr handle, CameraPtzMoveType type, int step); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_pan")] - internal static extern int GetPan(IntPtr handle, out int step); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_pan")] + internal static extern int GetPan(IntPtr handle, out int step); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_pan_range")] - internal static extern int GetPanRange(IntPtr handle, out int min, out int max); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_pan_range")] + internal static extern int GetPanRange(IntPtr handle, out int min, out int max); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tilt")] - internal static extern int SetTilt(IntPtr handle, CameraPtzMoveType type, int step); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tilt")] + internal static extern int SetTilt(IntPtr handle, CameraPtzMoveType type, int step); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tilt")] - internal static extern int GetTilt(IntPtr handle, out int step); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tilt")] + internal static extern int GetTilt(IntPtr handle, out int step); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tilt_range")] - internal static extern int GetTiltRange(IntPtr handle, out int min, out int max); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tilt_range")] + internal static extern int GetTiltRange(IntPtr handle, out int min, out int max); - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_ptz_type")] - internal static extern int SetPtzType(IntPtr handle, int type); + [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_ptz_type")] + internal static extern int SetPtzType(IntPtr handle, int type); + } } } - diff --git a/src/Tizen.Multimedia/Interop/Interop.Device.cs b/src/Tizen.Multimedia/Interop/Interop.Device.cs index 12f9607..7213ad0 100644 --- a/src/Tizen.Multimedia/Interop/Interop.Device.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Device.cs @@ -1,51 +1,53 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; - -internal static partial class Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SoundDeviceConnectionChangedCallback(IntPtr device, bool isConnected, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SoundDeviceStateChangedCallback(IntPtr device, AudioDeviceState changedState, IntPtr userData); - - internal static partial class AudioDevice - { - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_list")] - internal static extern int GetCurrentDeviceList(AudioDeviceOptions deviceMask, out IntPtr deviceList); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_free_device_list")] - internal static extern int FreeDeviceList(IntPtr deviceList); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_next_device")] - internal static extern int GetNextDevice(IntPtr deviceList, out IntPtr device); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_type")] - internal static extern int GetDeviceType(IntPtr device, out AudioDeviceType type); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_io_direction")] - internal static extern int GetDeviceIoDirection(IntPtr device, out AudioDeviceIoDirection ioDirection); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_id")] - internal static extern int GetDeviceId(IntPtr device, out int id); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_name")] - internal static extern int GetDeviceName(IntPtr device, out IntPtr name); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_state")] - internal static extern int GetDeviceState(IntPtr device, out AudioDeviceState state); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_connection_changed_cb")] - internal static extern int AddDeviceConnectionChangedCallback(AudioDeviceOptions deviceMask, SoundDeviceConnectionChangedCallback callback, IntPtr userData, out int id); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_connection_changed_cb")] - internal static extern int RemoveDeviceConnectionChangedCallback(int id); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_state_changed_cb")] - internal static extern int AddDeviceStateChangedCallback(AudioDeviceOptions deviceMask, SoundDeviceStateChangedCallback callback, IntPtr userData, out int id); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_state_changed_cb")] - internal static extern int RemoveDeviceStateChangedCallback(int id); + +namespace Tizen.Multimedia +{ + internal static partial class Interop + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void SoundDeviceConnectionChangedCallback(IntPtr device, bool isConnected, IntPtr userData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void SoundDeviceStateChangedCallback(IntPtr device, AudioDeviceState changedState, IntPtr userData); + + internal static partial class AudioDevice + { + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_list")] + internal static extern int GetCurrentDeviceList(AudioDeviceOptions deviceMask, out IntPtr deviceList); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_free_device_list")] + internal static extern int FreeDeviceList(IntPtr deviceList); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_next_device")] + internal static extern int GetNextDevice(IntPtr deviceList, out IntPtr device); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_type")] + internal static extern int GetDeviceType(IntPtr device, out AudioDeviceType type); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_io_direction")] + internal static extern int GetDeviceIoDirection(IntPtr device, out AudioDeviceIoDirection ioDirection); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_id")] + internal static extern int GetDeviceId(IntPtr device, out int id); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_name")] + internal static extern int GetDeviceName(IntPtr device, out IntPtr name); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_state")] + internal static extern int GetDeviceState(IntPtr device, out AudioDeviceState state); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_connection_changed_cb")] + internal static extern int AddDeviceConnectionChangedCallback(AudioDeviceOptions deviceMask, SoundDeviceConnectionChangedCallback callback, IntPtr userData, out int id); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_connection_changed_cb")] + internal static extern int RemoveDeviceConnectionChangedCallback(int id); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_state_changed_cb")] + internal static extern int AddDeviceStateChangedCallback(AudioDeviceOptions deviceMask, SoundDeviceStateChangedCallback callback, IntPtr userData, out int id); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_state_changed_cb")] + internal static extern int RemoveDeviceStateChangedCallback(int id); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.ErrorCode.cs b/src/Tizen.Multimedia/Interop/Interop.ErrorCode.cs old mode 100755 new mode 100644 index b941043..28c8a538 --- a/src/Tizen.Multimedia/Interop/Interop.ErrorCode.cs +++ b/src/Tizen.Multimedia/Interop/Interop.ErrorCode.cs @@ -19,88 +19,91 @@ using System.IO; using System.Runtime.CompilerServices; using Tizen; -internal static partial class Interop +namespace Tizen.Multimedia { - internal enum ErrorCode + internal static partial class Interop { - None = Tizen.Internals.Errors.ErrorCode.None, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - ResourceBusy = Tizen.Internals.Errors.ErrorCode.ResourceBusy, - NoSuchFile = Tizen.Internals.Errors.ErrorCode.NoSuchFile, + internal enum ErrorCode + { + None = Tizen.Internals.Errors.ErrorCode.None, + OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, + InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, + InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation, + PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, + NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, + ResourceBusy = Tizen.Internals.Errors.ErrorCode.ResourceBusy, + NoSuchFile = Tizen.Internals.Errors.ErrorCode.NoSuchFile, - // Radio - InvalidState = -0x019A0000 | 0x01, // RADIO_ERROR_INVALID_STATE - SoundPolicy = -0x019A0000 | 0x02, // RADIO_ERROR_SOUND_POLICY - NoAntenna = -0x019A0000 | 0x03, // RADIO_ERROR_NO_ANTENNA + // Radio + InvalidState = -0x019A0000 | 0x01, // RADIO_ERROR_INVALID_STATE + SoundPolicy = -0x019A0000 | 0x02, // RADIO_ERROR_SOUND_POLICY + NoAntenna = -0x019A0000 | 0x03, // RADIO_ERROR_NO_ANTENNA - // Image/ Video Utility - NotSupportedFormat = -0x01980000 | 0x01, // VIDEO_UTIL_ERROR_NOT_SUPPORTED_FORMAT + // Image/ Video Utility + NotSupportedFormat = -0x01980000 | 0x01, // VIDEO_UTIL_ERROR_NOT_SUPPORTED_FORMAT + } } -} -internal static class ErrorCodeExtensions -{ - private const string LogTag = "Tizen.Multimedia"; - - internal static bool IsSuccess(this Interop.ErrorCode err) + internal static class ErrorCodeExtensions { - return err == Interop.ErrorCode.None; - } + private const string LogTag = "Tizen.Multimedia"; - internal static bool IsFailed(this Interop.ErrorCode err) - { - return !err.IsSuccess(); - } + internal static bool IsSuccess(this Interop.ErrorCode err) + { + return err == Interop.ErrorCode.None; + } - /// - /// Utility method to check for error, returns false if failed and print warning messages - /// - /// true in case of no error, false otherwise - internal static bool WarnIfFailed(this Interop.ErrorCode err, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - if (err.IsFailed()) + internal static bool IsFailed(this Interop.ErrorCode err) { - Log.Debug(LogTag, $"{msg}, err: {err.ToString()}", file, func, line); - return false; + return !err.IsSuccess(); } - return true; - } - /// - /// Utility method to check for error, returns false if failed and throw exception - /// - /// true in case of no error - internal static bool ThrowIfFailed(this Interop.ErrorCode err, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - if (err.IsFailed()) + /// + /// Utility method to check for error, returns false if failed and print warning messages + /// + /// true in case of no error, false otherwise + internal static bool WarnIfFailed(this Interop.ErrorCode err, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) { - Log.Error(LogTag, $"{msg}, err: {err.ToString()}", file, func, line); - throw err.GetException(msg); + if (err.IsFailed()) + { + Log.Debug(LogTag, $"{msg}, err: {err.ToString()}", file, func, line); + return false; + } + return true; } - return true; - } - internal static Exception GetException(this Interop.ErrorCode err, string message) - { - string errMessage = $"{message}, err: {err.ToString()}"; - switch (err) + /// + /// Utility method to check for error, returns false if failed and throw exception + /// + /// true in case of no error + internal static bool ThrowIfFailed(this Interop.ErrorCode err, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + if (err.IsFailed()) + { + Log.Error(LogTag, $"{msg}, err: {err.ToString()}", file, func, line); + throw err.GetException(msg); + } + return true; + } + + internal static Exception GetException(this Interop.ErrorCode err, string message) { - //case ErrorCode.None: - case Interop.ErrorCode.PermissionDenied: return new UnauthorizedAccessException(errMessage); - case Interop.ErrorCode.InvalidParameter: return new ArgumentException(errMessage); - case Interop.ErrorCode.NoSuchFile: return new FileNotFoundException(errMessage); - case Interop.ErrorCode.OutOfMemory: return new OutOfMemoryException(errMessage); - case Interop.ErrorCode.NotSupported: return new NotSupportedException(errMessage); - case Interop.ErrorCode.NoAntenna: return new NotSupportedException(errMessage); - case Interop.ErrorCode.InvalidOperation: - case Interop.ErrorCode.InvalidState: - case Interop.ErrorCode.SoundPolicy: - case Interop.ErrorCode.ResourceBusy: - default: return new InvalidOperationException(errMessage); + string errMessage = $"{message}, err: {err.ToString()}"; + switch (err) + { + //case ErrorCode.None: + case Interop.ErrorCode.PermissionDenied: return new UnauthorizedAccessException(errMessage); + case Interop.ErrorCode.InvalidParameter: return new ArgumentException(errMessage); + case Interop.ErrorCode.NoSuchFile: return new FileNotFoundException(errMessage); + case Interop.ErrorCode.OutOfMemory: return new OutOfMemoryException(errMessage); + case Interop.ErrorCode.NotSupported: return new NotSupportedException(errMessage); + case Interop.ErrorCode.NoAntenna: return new NotSupportedException(errMessage); + case Interop.ErrorCode.InvalidOperation: + case Interop.ErrorCode.InvalidState: + case Interop.ErrorCode.SoundPolicy: + case Interop.ErrorCode.ResourceBusy: + default: return new InvalidOperationException(errMessage); + } } } } \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.EvasObject.cs b/src/Tizen.Multimedia/Interop/Interop.EvasObject.cs old mode 100755 new mode 100644 index c0a56c7..4a06dd0 --- a/src/Tizen.Multimedia/Interop/Interop.EvasObject.cs +++ b/src/Tizen.Multimedia/Interop/Interop.EvasObject.cs @@ -1,16 +1,18 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class EvasObject + internal static partial class Interop { - [DllImport("libevas.so.1")] - internal static extern IntPtr evas_object_image_add(IntPtr parent); - [DllImport("libevas.so.1")] - internal static extern IntPtr evas_object_evas_get(IntPtr obj); - [DllImport("libevas.so.1")] - internal static extern void evas_object_show(IntPtr obj); + internal static partial class EvasObject + { + [DllImport("libevas.so.1")] + internal static extern IntPtr evas_object_image_add(IntPtr parent); + [DllImport("libevas.so.1")] + internal static extern IntPtr evas_object_evas_get(IntPtr obj); + [DllImport("libevas.so.1")] + internal static extern void evas_object_show(IntPtr obj); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Decode.cs b/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Decode.cs old mode 100755 new mode 100644 index c295303..6635183 --- a/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Decode.cs +++ b/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Decode.cs @@ -17,69 +17,72 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - // Image Decoder - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_input_path")] - internal static extern ErrorCode SetInputPath(this ImageDecoderHandle /* image_util_decode_h */ handle, string path); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_input_buffer")] - internal static extern ErrorCode SetInputBuffer(this ImageDecoderHandle /* image_util_decode_h */ handle, byte[] srcBuffer, ulong srcSize); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_output_buffer")] - internal static extern ErrorCode SetOutputBuffer(this ImageDecoderHandle /* image_util_decode_h */ handle, out IntPtr dstBuffer); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_colorspace")] - internal static extern ErrorCode SetColorspace(this ImageDecoderHandle /* image_util_encode_h */ handle, ImageColorSpace /* image_util_colorspace_e */ colorspace); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_jpeg_downscale")] - internal static extern ErrorCode SetJpegDownscale(this ImageDecoderHandle /* image_util_encode_h */ handle, JpegDownscale /* image_util_scale_e */ downscale); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_run")] - internal static extern ErrorCode DecodeRun(this ImageDecoderHandle /* image_util_decode_h */ handle, out int width, out int height, out ulong size); - - internal class ImageDecoderHandle : SafeMultimediaHandle + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DecodeCompletedCallback(ErrorCode errorCode, IntPtr /* void */ userData, int width, int height, ulong size); + // Image Decoder + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_input_path")] + internal static extern ErrorCode SetInputPath(this ImageDecoderHandle /* image_util_decode_h */ handle, string path); - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_run_async")] - internal static extern ErrorCode DecodeRunAsync(ImageDecoderHandle /* image_util_decode_h */ handle, DecodeCompletedCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_input_buffer")] + internal static extern ErrorCode SetInputBuffer(this ImageDecoderHandle /* image_util_decode_h */ handle, byte[] srcBuffer, ulong srcSize); - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_create")] - internal static extern ErrorCode Create(out IntPtr /* image_util_decode_h */ handle); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_output_buffer")] + internal static extern ErrorCode SetOutputBuffer(this ImageDecoderHandle /* image_util_decode_h */ handle, out IntPtr dstBuffer); - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* image_util_decode_h */ handle); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_colorspace")] + internal static extern ErrorCode SetColorspace(this ImageDecoderHandle /* image_util_encode_h */ handle, ImageColorSpace /* image_util_colorspace_e */ colorspace); - internal ImageColorSpace Colorspace - { - set { NativeSet(this.SetColorspace, value); } - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_jpeg_downscale")] + internal static extern ErrorCode SetJpegDownscale(this ImageDecoderHandle /* image_util_encode_h */ handle, JpegDownscale /* image_util_scale_e */ downscale); - internal JpegDownscale JpegDownscale - { - set { NativeSet(this.SetJpegDownscale, value); } - } - - internal ImageDecoderHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease) - { - } - - internal ImageDecoderHandle() : this(CreateNativeHandle(), true) - { - } - - internal static IntPtr CreateNativeHandle() - { - IntPtr handle; - Create(out handle).ThrowIfFailed("Failed to create native handle"); - return handle; - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_run")] + internal static extern ErrorCode DecodeRun(this ImageDecoderHandle /* image_util_decode_h */ handle, out int width, out int height, out ulong size); - internal override ErrorCode DisposeNativeHandle() + internal class ImageDecoderHandle : SafeMultimediaHandle { - return Destroy(handle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void DecodeCompletedCallback(ErrorCode errorCode, IntPtr /* void */ userData, int width, int height, ulong size); + + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_run_async")] + internal static extern ErrorCode DecodeRunAsync(ImageDecoderHandle /* image_util_decode_h */ handle, DecodeCompletedCallback callback, IntPtr /* void */ userData); + + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_create")] + internal static extern ErrorCode Create(out IntPtr /* image_util_decode_h */ handle); + + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_destroy")] + internal static extern ErrorCode Destroy(IntPtr /* image_util_decode_h */ handle); + + internal ImageColorSpace Colorspace + { + set { NativeSet(this.SetColorspace, value); } + } + + internal JpegDownscale JpegDownscale + { + set { NativeSet(this.SetJpegDownscale, value); } + } + + internal ImageDecoderHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease) + { + } + + internal ImageDecoderHandle() : this(CreateNativeHandle(), true) + { + } + + internal static IntPtr CreateNativeHandle() + { + IntPtr handle; + Create(out handle).ThrowIfFailed("Failed to create native handle"); + return handle; + } + + internal override ErrorCode DisposeNativeHandle() + { + return Destroy(handle); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Encode.cs b/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Encode.cs old mode 100755 new mode 100644 index 18b98a3..6ac714d --- a/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Encode.cs +++ b/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Encode.cs @@ -17,99 +17,102 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - // Image Encoder - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_resolution")] - internal static extern ErrorCode SetResolution(this ImageEncoderHandle /* image_util_encode_h */ handle, uint width, uint height); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_colorspace")] - internal static extern ErrorCode SetColorspace(this ImageEncoderHandle /* image_util_encode_h */ handle, ImageColorSpace /* image_util_colorspace_e */ colorspace); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_quality")] - internal static extern ErrorCode SetQuality(this ImageEncoderHandle /* image_util_encode_h */ handle, int quality); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_png_compression")] - internal static extern ErrorCode SetPngCompression(this ImageEncoderHandle /* image_util_encode_h */ handle, PngCompression /* image_util_png_compression_e */ compression); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_gif_frame_delay_time")] - internal static extern ErrorCode SetGifFrameDelayTime(this ImageEncoderHandle /* image_util_encode_h */ handle, ulong delayTime); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_output_path")] - internal static extern ErrorCode SetOutputPath(this ImageEncoderHandle /* image_util_encode_h */ handle, string path); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_input_buffer")] - internal static extern ErrorCode SetInputBuffer(this ImageEncoderHandle /* image_util_encode_h */ handle, byte[] srcBuffer); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_output_buffer")] - internal static extern ErrorCode SetOutputBuffer(this ImageEncoderHandle /* image_util_encode_h */ handle, out IntPtr dstBuffer); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_run")] - internal static extern ErrorCode EncodeRun(this ImageEncoderHandle /* image_util_encode_h */ handle, out ulong size); - - internal class ImageEncoderHandle : SafeMultimediaHandle + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EncodeCompletedCallback(ErrorCode errorCode, IntPtr /* void */ userData, ulong size); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_run_async")] - internal static extern ErrorCode EncodeRunAsync(ImageEncoderHandle /* image_util_encode_h */ handle, EncodeCompletedCallback callback, IntPtr /* void */ userData); - - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_create")] - internal static extern ErrorCode Create(ImageType /* image_util_type_e */ type, out IntPtr /* image_util_encode_h */ handle); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* image_util_encode_h */ handle); - - internal ImageEncoderHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease) - { - } + // Image Encoder + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_resolution")] + internal static extern ErrorCode SetResolution(this ImageEncoderHandle /* image_util_encode_h */ handle, uint width, uint height); - internal ImageEncoderHandle(ImageType type) : this(CreateNativeHandle(type), true) - { - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_colorspace")] + internal static extern ErrorCode SetColorspace(this ImageEncoderHandle /* image_util_encode_h */ handle, ImageColorSpace /* image_util_colorspace_e */ colorspace); - internal ImageColorSpace Colorspace - { - set { NativeSet(this.SetColorspace, value); } - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_quality")] + internal static extern ErrorCode SetQuality(this ImageEncoderHandle /* image_util_encode_h */ handle, int quality); - internal int Quality - { - set { NativeSet(this.SetQuality, value); } - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_png_compression")] + internal static extern ErrorCode SetPngCompression(this ImageEncoderHandle /* image_util_encode_h */ handle, PngCompression /* image_util_png_compression_e */ compression); - internal PngCompression PngCompression - { - set { NativeSet(this.SetPngCompression, value); } - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_gif_frame_delay_time")] + internal static extern ErrorCode SetGifFrameDelayTime(this ImageEncoderHandle /* image_util_encode_h */ handle, ulong delayTime); - internal ulong GifFrameDelay - { - set { NativeSet(this.SetGifFrameDelayTime, value); } - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_output_path")] + internal static extern ErrorCode SetOutputPath(this ImageEncoderHandle /* image_util_encode_h */ handle, string path); - internal string OutputPath - { - set { NativeSet(this.SetOutputPath, value); } - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_input_buffer")] + internal static extern ErrorCode SetInputBuffer(this ImageEncoderHandle /* image_util_encode_h */ handle, byte[] srcBuffer); - internal byte[] InputBuffer - { - set { NativeSet(this.SetInputBuffer, value); } - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_output_buffer")] + internal static extern ErrorCode SetOutputBuffer(this ImageEncoderHandle /* image_util_encode_h */ handle, out IntPtr dstBuffer); - internal static IntPtr CreateNativeHandle(ImageType type) - { - IntPtr handle; - Create(type, out handle).ThrowIfFailed("Failed to create native handle"); - return handle; - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_run")] + internal static extern ErrorCode EncodeRun(this ImageEncoderHandle /* image_util_encode_h */ handle, out ulong size); - internal override ErrorCode DisposeNativeHandle() + internal class ImageEncoderHandle : SafeMultimediaHandle { - return Destroy(handle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void EncodeCompletedCallback(ErrorCode errorCode, IntPtr /* void */ userData, ulong size); + + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_run_async")] + internal static extern ErrorCode EncodeRunAsync(ImageEncoderHandle /* image_util_encode_h */ handle, EncodeCompletedCallback callback, IntPtr /* void */ userData); + + + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_create")] + internal static extern ErrorCode Create(ImageType /* image_util_type_e */ type, out IntPtr /* image_util_encode_h */ handle); + + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_destroy")] + internal static extern ErrorCode Destroy(IntPtr /* image_util_encode_h */ handle); + + internal ImageEncoderHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease) + { + } + + internal ImageEncoderHandle(ImageType type) : this(CreateNativeHandle(type), true) + { + } + + internal ImageColorSpace Colorspace + { + set { NativeSet(this.SetColorspace, value); } + } + + internal int Quality + { + set { NativeSet(this.SetQuality, value); } + } + + internal PngCompression PngCompression + { + set { NativeSet(this.SetPngCompression, value); } + } + + internal ulong GifFrameDelay + { + set { NativeSet(this.SetGifFrameDelayTime, value); } + } + + internal string OutputPath + { + set { NativeSet(this.SetOutputPath, value); } + } + + internal byte[] InputBuffer + { + set { NativeSet(this.SetInputBuffer, value); } + } + + internal static IntPtr CreateNativeHandle(ImageType type) + { + IntPtr handle; + Create(type, out handle).ThrowIfFailed("Failed to create native handle"); + return handle; + } + + internal override ErrorCode DisposeNativeHandle() + { + return Destroy(handle); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Transform.cs b/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Transform.cs old mode 100755 new mode 100644 index 9bad56c..30d07b6 --- a/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Transform.cs +++ b/src/Tizen.Multimedia/Interop/Interop.ImageUtil.Transform.cs @@ -17,85 +17,88 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_hardware_acceleration")] - internal static extern ErrorCode SetHardwareAcceleration(this ImageTransformHandle /* transformation_h */ handle, bool mode); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_colorspace")] - internal static extern ErrorCode GetColorspace(this ImageTransformHandle /* transformation_h */ handle, out ImageColorSpace /* image_util_colorspace_e */ colorspace); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_colorspace")] - internal static extern ErrorCode SetColorspace(this ImageTransformHandle /* transformation_h */ handle, ImageColorSpace /* image_util_colorspace_e */ colorspace); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_rotation")] - internal static extern ErrorCode GetRotation(this ImageTransformHandle /* transformation_h */ handle, out ImageRotation /* image_util_rotation_e */ rotation); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_rotation")] - internal static extern ErrorCode SetRotation(this ImageTransformHandle /* transformation_h */ handle, ImageRotation /* image_util_rotation_e */ rotation); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_resolution")] - internal static extern ErrorCode GetResolution(this ImageTransformHandle /* transformation_h */ handle, out uint width, out uint height); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_resolution")] - internal static extern ErrorCode SetResolution(this ImageTransformHandle /* transformation_h */ handle, uint width, uint height); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_crop_area")] - internal static extern ErrorCode GetCropArea(this ImageTransformHandle /* transformation_h */ handle, out uint startX, out uint startY, out uint endX, out uint endY); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_crop_area")] - internal static extern ErrorCode SetCropArea(this ImageTransformHandle /* transformation_h */ handle, int startX, int startY, int endX, int endY); - - internal class ImageTransformHandle : SafeMultimediaHandle + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TransformCompletedCallback(IntPtr /* media_packet_h */ dst, ErrorCode errorCode, IntPtr /* void */ userData); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_hardware_acceleration")] + internal static extern ErrorCode SetHardwareAcceleration(this ImageTransformHandle /* transformation_h */ handle, bool mode); - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_run")] - internal static extern ErrorCode Transform(ImageTransformHandle /* transformation_h */ handle, IntPtr /* media_packet_h */ src, TransformCompletedCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_colorspace")] + internal static extern ErrorCode GetColorspace(this ImageTransformHandle /* transformation_h */ handle, out ImageColorSpace /* image_util_colorspace_e */ colorspace); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_colorspace")] + internal static extern ErrorCode SetColorspace(this ImageTransformHandle /* transformation_h */ handle, ImageColorSpace /* image_util_colorspace_e */ colorspace); - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_create")] - internal static extern ErrorCode Create(out IntPtr /* transformation_h */ handle); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_rotation")] + internal static extern ErrorCode GetRotation(this ImageTransformHandle /* transformation_h */ handle, out ImageRotation /* image_util_rotation_e */ rotation); - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* transformation_h */ handle); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_rotation")] + internal static extern ErrorCode SetRotation(this ImageTransformHandle /* transformation_h */ handle, ImageRotation /* image_util_rotation_e */ rotation); - internal ImageTransformHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease) - { - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_resolution")] + internal static extern ErrorCode GetResolution(this ImageTransformHandle /* transformation_h */ handle, out uint width, out uint height); - internal ImageTransformHandle() : this(CreateNativeHandle(), true) - { - } - - internal bool HardwareAccelerationEnabled - { - set { NativeSet(this.SetHardwareAcceleration, value); } - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_resolution")] + internal static extern ErrorCode SetResolution(this ImageTransformHandle /* transformation_h */ handle, uint width, uint height); - internal ImageColorSpace Colorspace - { - get { return NativeGet(this.GetColorspace); } - set { NativeSet(this.SetColorspace, value); } - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_crop_area")] + internal static extern ErrorCode GetCropArea(this ImageTransformHandle /* transformation_h */ handle, out uint startX, out uint startY, out uint endX, out uint endY); - internal ImageRotation Rotation - { - get { return NativeGet(this.GetRotation); } - set { NativeSet(this.SetRotation, value); } - } - - internal static IntPtr CreateNativeHandle() - { - IntPtr handle; - Create(out handle).ThrowIfFailed("Failed to create native handle"); - return handle; - } + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_crop_area")] + internal static extern ErrorCode SetCropArea(this ImageTransformHandle /* transformation_h */ handle, int startX, int startY, int endX, int endY); - internal override ErrorCode DisposeNativeHandle() + internal class ImageTransformHandle : SafeMultimediaHandle { - return Destroy(handle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void TransformCompletedCallback(IntPtr /* media_packet_h */ dst, ErrorCode errorCode, IntPtr /* void */ userData); + + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_run")] + internal static extern ErrorCode Transform(ImageTransformHandle /* transformation_h */ handle, IntPtr /* media_packet_h */ src, TransformCompletedCallback callback, IntPtr /* void */ userData); + + + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_create")] + internal static extern ErrorCode Create(out IntPtr /* transformation_h */ handle); + + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_destroy")] + internal static extern ErrorCode Destroy(IntPtr /* transformation_h */ handle); + + internal ImageTransformHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease) + { + } + + internal ImageTransformHandle() : this(CreateNativeHandle(), true) + { + } + + internal bool HardwareAccelerationEnabled + { + set { NativeSet(this.SetHardwareAcceleration, value); } + } + + internal ImageColorSpace Colorspace + { + get { return NativeGet(this.GetColorspace); } + set { NativeSet(this.SetColorspace, value); } + } + + internal ImageRotation Rotation + { + get { return NativeGet(this.GetRotation); } + set { NativeSet(this.SetRotation, value); } + } + + internal static IntPtr CreateNativeHandle() + { + IntPtr handle; + Create(out handle).ThrowIfFailed("Failed to create native handle"); + return handle; + } + + internal override ErrorCode DisposeNativeHandle() + { + return Destroy(handle); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.ImageUtil.cs b/src/Tizen.Multimedia/Interop/Interop.ImageUtil.cs old mode 100755 new mode 100644 index f4c0484..7db50a5 --- a/src/Tizen.Multimedia/Interop/Interop.ImageUtil.cs +++ b/src/Tizen.Multimedia/Interop/Interop.ImageUtil.cs @@ -18,115 +18,118 @@ using System; using System.Diagnostics; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - internal enum ImageColorSpace + internal static partial class Interop { - Yv12, // IMAGE_UTIL_COLORSPACE_YV12 - Yuv422, // IMAGE_UTIL_COLORSPACE_YUV422 - I420, // IMAGE_UTIL_COLORSPACE_I420 - Nv12, // IMAGE_UTIL_COLORSPACE_NV12 - Uyvy, // IMAGE_UTIL_COLORSPACE_UYVY - Yuyv, // IMAGE_UTIL_COLORSPACE_YUYV - Rgb565, // IMAGE_UTIL_COLORSPACE_RGB565 - Rgb888, // IMAGE_UTIL_COLORSPACE_RGB888 - Argb8888, // IMAGE_UTIL_COLORSPACE_ARGB8888 - Bgra8888, // IMAGE_UTIL_COLORSPACE_BGRA8888 - Rgba8888, // IMAGE_UTIL_COLORSPACE_RGBA8888 - Bgrx8888, // IMAGE_UTIL_COLORSPACE_BGRX8888 - Nv21, // IMAGE_UTIL_COLORSPACE_NV21 - Nv16, // IMAGE_UTIL_COLORSPACE_NV16 - Nv61, // IMAGE_UTIL_COLORSPACE_NV61 - } + internal enum ImageColorSpace + { + Yv12, // IMAGE_UTIL_COLORSPACE_YV12 + Yuv422, // IMAGE_UTIL_COLORSPACE_YUV422 + I420, // IMAGE_UTIL_COLORSPACE_I420 + Nv12, // IMAGE_UTIL_COLORSPACE_NV12 + Uyvy, // IMAGE_UTIL_COLORSPACE_UYVY + Yuyv, // IMAGE_UTIL_COLORSPACE_YUYV + Rgb565, // IMAGE_UTIL_COLORSPACE_RGB565 + Rgb888, // IMAGE_UTIL_COLORSPACE_RGB888 + Argb8888, // IMAGE_UTIL_COLORSPACE_ARGB8888 + Bgra8888, // IMAGE_UTIL_COLORSPACE_BGRA8888 + Rgba8888, // IMAGE_UTIL_COLORSPACE_RGBA8888 + Bgrx8888, // IMAGE_UTIL_COLORSPACE_BGRX8888 + Nv21, // IMAGE_UTIL_COLORSPACE_NV21 + Nv16, // IMAGE_UTIL_COLORSPACE_NV16 + Nv61, // IMAGE_UTIL_COLORSPACE_NV61 + } - internal enum ImageRotation - { - None, // IMAGE_UTIL_ROTATION_NONE - Rotate90, // IMAGE_UTIL_ROTATION_90 - Rotate180, // IMAGE_UTIL_ROTATION_180 - Rotate270, // IMAGE_UTIL_ROTATION_270 - FlipHorizontal, // IMAGE_UTIL_ROTATION_FLIP_HORZ - FlipVertical, // IMAGE_UTIL_ROTATION_FLIP_VERT - } + internal enum ImageRotation + { + None, // IMAGE_UTIL_ROTATION_NONE + Rotate90, // IMAGE_UTIL_ROTATION_90 + Rotate180, // IMAGE_UTIL_ROTATION_180 + Rotate270, // IMAGE_UTIL_ROTATION_270 + FlipHorizontal, // IMAGE_UTIL_ROTATION_FLIP_HORZ + FlipVertical, // IMAGE_UTIL_ROTATION_FLIP_VERT + } - internal enum ImageType - { - Jpeg, // IMAGE_UTIL_JPEG - Png, // IMAGE_UTIL_PNG - Gif, // IMAGE_UTIL_GIF - Bmp, // IMAGE_UTIL_BMP - } + internal enum ImageType + { + Jpeg, // IMAGE_UTIL_JPEG + Png, // IMAGE_UTIL_PNG + Gif, // IMAGE_UTIL_GIF + Bmp, // IMAGE_UTIL_BMP + } - internal enum JpegDownscale - { - NoDownscale, // IMAGE_UTIL_DOWNSCALE_1_1 - OneHalf, // IMAGE_UTIL_DOWNSCALE_1_2 - OneFourth, // IMAGE_UTIL_DOWNSCALE_1_4 - OneEighth, // IMAGE_UTIL_DOWNSCALE_1_8 - } + internal enum JpegDownscale + { + NoDownscale, // IMAGE_UTIL_DOWNSCALE_1_1 + OneHalf, // IMAGE_UTIL_DOWNSCALE_1_2 + OneFourth, // IMAGE_UTIL_DOWNSCALE_1_4 + OneEighth, // IMAGE_UTIL_DOWNSCALE_1_8 + } - internal enum PngCompression - { - NoCompression, // IMAGE_UTIL_PNG_COMPRESSION_0 - Level1, // IMAGE_UTIL_PNG_COMPRESSION_1 - Level2, // IMAGE_UTIL_PNG_COMPRESSION_2 - Level3, // IMAGE_UTIL_PNG_COMPRESSION_3 - Level4, // IMAGE_UTIL_PNG_COMPRESSION_4 - Level5, // IMAGE_UTIL_PNG_COMPRESSION_5 - Level6, // IMAGE_UTIL_PNG_COMPRESSION_6 - Level7, // IMAGE_UTIL_PNG_COMPRESSION_7 - Level8, // IMAGE_UTIL_PNG_COMPRESSION_8 - Level9, // IMAGE_UTIL_PNG_COMPRESSION_9 - } + internal enum PngCompression + { + NoCompression, // IMAGE_UTIL_PNG_COMPRESSION_0 + Level1, // IMAGE_UTIL_PNG_COMPRESSION_1 + Level2, // IMAGE_UTIL_PNG_COMPRESSION_2 + Level3, // IMAGE_UTIL_PNG_COMPRESSION_3 + Level4, // IMAGE_UTIL_PNG_COMPRESSION_4 + Level5, // IMAGE_UTIL_PNG_COMPRESSION_5 + Level6, // IMAGE_UTIL_PNG_COMPRESSION_6 + Level7, // IMAGE_UTIL_PNG_COMPRESSION_7 + Level8, // IMAGE_UTIL_PNG_COMPRESSION_8 + Level9, // IMAGE_UTIL_PNG_COMPRESSION_9 + } - internal class ImageUtil - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SupportedColorspaceCallback(ImageColorSpace /* image_util_colorspace_e */ colorspace, IntPtr /* void */ userData); + internal class ImageUtil + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool SupportedColorspaceCallback(ImageColorSpace /* image_util_colorspace_e */ colorspace, IntPtr /* void */ userData); - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_foreach_supported_colorspace")] - internal static extern ErrorCode ForeachSupportedColorspace(ImageType /* image_util_type_e */ type, SupportedColorspaceCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_foreach_supported_colorspace")] + internal static extern ErrorCode ForeachSupportedColorspace(ImageType /* image_util_type_e */ type, SupportedColorspaceCallback callback, IntPtr /* void */ userData); - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_calculate_buffer_size")] - internal static extern ErrorCode CalculateBufferSize(int width, int height, ImageColorSpace /* image_util_colorspace_e */ colorspace, out uint size); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_calculate_buffer_size")] + internal static extern ErrorCode CalculateBufferSize(int width, int height, ImageColorSpace /* image_util_colorspace_e */ colorspace, out uint size); - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_extract_color_from_memory")] - internal static extern ErrorCode ExtractColorFromMemory(byte[] buffer, int width, int height, out byte rgbR, out byte rgbG, out byte rgbB); + [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_extract_color_from_memory")] + internal static extern ErrorCode ExtractColorFromMemory(byte[] buffer, int width, int height, out byte rgbR, out byte rgbG, out byte rgbB); - internal static void ForeachSupportedColorspace(ImageType type, Action action) - { - SupportedColorspaceCallback callback = (codec, userData) => + internal static void ForeachSupportedColorspace(ImageType type, Action action) { - action(codec); - return true; - }; + SupportedColorspaceCallback callback = (codec, userData) => + { + action(codec); + return true; + }; - ForeachSupportedColorspace(type, callback, IntPtr.Zero).WarnIfFailed("Failed to get supported color-space list from native handle"); - } + ForeachSupportedColorspace(type, callback, IntPtr.Zero).WarnIfFailed("Failed to get supported color-space list from native handle"); + } - internal static uint CalculateBufferSize(int width, int height, ImageColorSpace colorSpace) - { - uint size; - CalculateBufferSize(width, height, colorSpace, out size).ThrowIfFailed("Failed to calculate buffer size"); - return size; - } + internal static uint CalculateBufferSize(int width, int height, ImageColorSpace colorSpace) + { + uint size; + CalculateBufferSize(width, height, colorSpace, out size).ThrowIfFailed("Failed to calculate buffer size"); + return size; + } - internal static ElmSharp.Color ExtractColorFromMemory(byte[] buffer, int width, int height) - { - byte r, g, b; - ExtractColorFromMemory(buffer, width, height, out r, out g, out b); - return new ElmSharp.Color(r, g, b); - } + internal static ElmSharp.Color ExtractColorFromMemory(byte[] buffer, int width, int height) + { + byte r, g, b; + ExtractColorFromMemory(buffer, width, height, out r, out g, out b); + return new ElmSharp.Color(r, g, b); + } - internal static byte[] NativeToByteArray(IntPtr nativeBuffer, int size) - { - Debug.Assert(nativeBuffer != IntPtr.Zero); + internal static byte[] NativeToByteArray(IntPtr nativeBuffer, int size) + { + Debug.Assert(nativeBuffer != IntPtr.Zero); - byte[] managedArray = new byte[size]; - Marshal.Copy(nativeBuffer, managedArray, 0, size); + byte[] managedArray = new byte[size]; + Marshal.Copy(nativeBuffer, managedArray, 0, size); - Libc.Free(nativeBuffer); - return managedArray; + Libc.Free(nativeBuffer); + return managedArray; + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia/Interop/Interop.Libraries.cs old mode 100755 new mode 100644 index 7556538..67b2ff6 --- a/src/Tizen.Multimedia/Interop/Interop.Libraries.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Libraries.cs @@ -14,29 +14,32 @@ * limitations under the License. */ -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class Libraries + internal static partial class Interop { - public const string Player = "libcapi-media-player.so.0"; - public const string Recorder = "libcapi-media-recorder.so.0"; - public const string SoundManager = "libcapi-media-sound-manager.so.0"; - public const string AudioIO = "libcapi-media-audio-io.so.0"; - public const string ScreenMirroring = "libcapi-media-screen-mirroring.so.0"; - public const string MetadataEditor = "libcapi-media-metadata-editor.so"; - public const string MetadataExtractor = "libcapi-media-metadata-extractor.so"; - public const string MediaController = "libcapi-media-controller.so.0"; - public const string MediaTool = "libcapi-media-tool.so.0"; - public const string MediaCodec = "libcapi-media-codec.so.0"; - public const string MediaVision = "libcapi-media-vision.so.0"; - public const string Libc = "libc.so.6"; - public const string Camera = "libcapi-media-camera.so.0"; - public const string StreamRecorder = "libcapi-media-streamrecorder.so.0"; - public const string Radio = "libcapi-media-radio.so.0"; - public const string VideoUtil = "libcapi-media-video-util.so.0"; - public const string ImageUtil = "libcapi-media-image-util.so.0"; - public const string ThumbnailExtractor = "libcapi-media-thumbnail-util.so"; - public const string WavPlayer = "libcapi-media-wav-player.so.0"; - public const string TonePlayer = "libcapi-media-tone-player.so.0"; + internal static partial class Libraries + { + public const string Player = "libcapi-media-player.so.0"; + public const string Recorder = "libcapi-media-recorder.so.0"; + public const string SoundManager = "libcapi-media-sound-manager.so.0"; + public const string AudioIO = "libcapi-media-audio-io.so.0"; + public const string ScreenMirroring = "libcapi-media-screen-mirroring.so.0"; + public const string MetadataEditor = "libcapi-media-metadata-editor.so"; + public const string MetadataExtractor = "libcapi-media-metadata-extractor.so"; + public const string MediaController = "libcapi-media-controller.so.0"; + public const string MediaTool = "libcapi-media-tool.so.0"; + public const string MediaCodec = "libcapi-media-codec.so.0"; + public const string MediaVision = "libcapi-media-vision.so.0"; + public const string Libc = "libc.so.6"; + public const string Camera = "libcapi-media-camera.so.0"; + public const string StreamRecorder = "libcapi-media-streamrecorder.so.0"; + public const string Radio = "libcapi-media-radio.so.0"; + public const string VideoUtil = "libcapi-media-video-util.so.0"; + public const string ImageUtil = "libcapi-media-image-util.so.0"; + public const string ThumbnailExtractor = "libcapi-media-thumbnail-util.so"; + public const string WavPlayer = "libcapi-media-wav-player.so.0"; + public const string TonePlayer = "libcapi-media-tone-player.so.0"; + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.MediaCodec.cs b/src/Tizen.Multimedia/Interop/Interop.MediaCodec.cs index 149079d..f3555ea 100644 --- a/src/Tizen.Multimedia/Interop/Interop.MediaCodec.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MediaCodec.cs @@ -1,105 +1,108 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static class MediaCodec + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InputBufferUsedCallback(IntPtr mediaPacket, IntPtr arg); + internal static class MediaCodec + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void InputBufferUsedCallback(IntPtr mediaPacket, IntPtr arg); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void OutputBufferAvailableCallback(IntPtr mediaPacket, IntPtr arg); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void OutputBufferAvailableCallback(IntPtr mediaPacket, IntPtr arg); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ErrorCallback(int errorCode, IntPtr arg); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void ErrorCallback(int errorCode, IntPtr arg); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EosCallback(IntPtr arg); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void EosCallback(IntPtr arg); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void BufferStatusCallback(int statusCode, IntPtr arg); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void BufferStatusCallback(int statusCode, IntPtr arg); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SupportedCodecCallback(int codecType, IntPtr arg); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool SupportedCodecCallback(int codecType, IntPtr arg); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_create")] - internal static extern int Create(out IntPtr handle); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_create")] + internal static extern int Create(out IntPtr handle); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_destroy")] - internal static extern int Destroy(IntPtr handle); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_destroy")] + internal static extern int Destroy(IntPtr handle); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_codec")] - internal static extern int Configure(IntPtr handle, int codecType, int flags); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_codec")] + internal static extern int Configure(IntPtr handle, int codecType, int flags); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_vdec_info")] - internal static extern int SetVideoDecoderInfo(IntPtr handle, int width, int height); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_vdec_info")] + internal static extern int SetVideoDecoderInfo(IntPtr handle, int width, int height); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_venc_info")] - internal static extern int SetVideoEncoderInfo(IntPtr handle, int width, int height, - int fps, int targetBits); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_venc_info")] + internal static extern int SetVideoEncoderInfo(IntPtr handle, int width, int height, + int fps, int targetBits); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_adec_info")] - internal static extern int SetAudioDecoderInfo(IntPtr handle, int sampleRate, int channel, - int bit); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_adec_info")] + internal static extern int SetAudioDecoderInfo(IntPtr handle, int sampleRate, int channel, + int bit); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_aenc_info")] - internal static extern int SetAudioEncoderInfo(IntPtr handle, int sampleRate, int channel, - int bit, int bitRate); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_aenc_info")] + internal static extern int SetAudioEncoderInfo(IntPtr handle, int sampleRate, int channel, + int bit, int bitRate); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_prepare")] - internal static extern int Prepare(IntPtr handle); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_prepare")] + internal static extern int Prepare(IntPtr handle); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unprepare")] - internal static extern int Unprepare(IntPtr handle); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unprepare")] + internal static extern int Unprepare(IntPtr handle); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_process_input")] - internal static extern int Process(IntPtr handle, IntPtr mediaPacket, ulong timeoutInUs); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_process_input")] + internal static extern int Process(IntPtr handle, IntPtr mediaPacket, ulong timeoutInUs); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_get_output")] - internal static extern int GetOutput(IntPtr handle, out IntPtr packet, ulong timeoutInUs); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_get_output")] + internal static extern int GetOutput(IntPtr handle, out IntPtr packet, ulong timeoutInUs); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_flush_buffers")] - internal static extern int FlushBuffers(IntPtr handle); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_flush_buffers")] + internal static extern int FlushBuffers(IntPtr handle); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_input_buffer_used_cb")] - internal static extern int SetInputBufferUsedCb(IntPtr handle, - InputBufferUsedCallback cb, IntPtr arg); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_input_buffer_used_cb")] + internal static extern int SetInputBufferUsedCb(IntPtr handle, + InputBufferUsedCallback cb, IntPtr arg); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_input_buffer_used_cb")] - internal static extern int UnsetInputBufferUsedCb(IntPtr handle); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_input_buffer_used_cb")] + internal static extern int UnsetInputBufferUsedCb(IntPtr handle); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_output_buffer_available_cb")] - internal static extern int SetOutputBufferAvaiableCb(IntPtr handle, - OutputBufferAvailableCallback cb, IntPtr arg); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_output_buffer_available_cb")] + internal static extern int SetOutputBufferAvaiableCb(IntPtr handle, + OutputBufferAvailableCallback cb, IntPtr arg); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_output_buffer_available_cb")] - internal static extern int UnsetOutputBufferAvaiableCb(IntPtr handle); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_output_buffer_available_cb")] + internal static extern int UnsetOutputBufferAvaiableCb(IntPtr handle); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_error_cb")] - internal static extern int SetErrorCb(IntPtr handle, ErrorCallback cb, IntPtr arg); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_error_cb")] + internal static extern int SetErrorCb(IntPtr handle, ErrorCallback cb, IntPtr arg); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_error_cb")] - internal static extern int UnsetErrorCb(IntPtr handle); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_error_cb")] + internal static extern int UnsetErrorCb(IntPtr handle); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_eos_cb")] - internal static extern int SetEosCb(IntPtr handle, EosCallback cb, IntPtr arg); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_eos_cb")] + internal static extern int SetEosCb(IntPtr handle, EosCallback cb, IntPtr arg); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_eos_cb")] - internal static extern int UnsetEosCb(IntPtr handle); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_eos_cb")] + internal static extern int UnsetEosCb(IntPtr handle); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_buffer_status_cb")] - internal static extern int SetBufferStatusCb(IntPtr handle, BufferStatusCallback cb, - IntPtr arg); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_buffer_status_cb")] + internal static extern int SetBufferStatusCb(IntPtr handle, BufferStatusCallback cb, + IntPtr arg); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_buffer_status_cb")] - internal static extern int UnsetBufferStatusCb(IntPtr handle); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_buffer_status_cb")] + internal static extern int UnsetBufferStatusCb(IntPtr handle); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_get_supported_type")] - internal static extern int GetSupportedType(IntPtr handle, int codecType, bool isEncoder, - out int value); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_get_supported_type")] + internal static extern int GetSupportedType(IntPtr handle, int codecType, bool isEncoder, + out int value); - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_foreach_supported_codec_static")] - internal static extern int ForeachSupportedCodec(SupportedCodecCallback cb, IntPtr arg); + [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_foreach_supported_codec_static")] + internal static extern int ForeachSupportedCodec(SupportedCodecCallback cb, IntPtr arg); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.MediaController.cs b/src/Tizen.Multimedia/Interop/Interop.MediaController.cs old mode 100755 new mode 100644 index 47d34b3..e9d7619 --- a/src/Tizen.Multimedia/Interop/Interop.MediaController.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MediaController.cs @@ -3,183 +3,186 @@ using System.Runtime.InteropServices; using Tizen.Applications; using Tizen.Multimedia.MediaController; -internal static partial class Interop -{ - internal static partial class MediaControllerClient +namespace Tizen.Multimedia +{ + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ServerUpdatedCallback(IntPtr serverName, MediaControllerServerState serverState, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PlaybackUpdatedCallback(IntPtr serverName, IntPtr playback, IntPtr userData); + internal static partial class MediaControllerClient + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void ServerUpdatedCallback(IntPtr serverName, MediaControllerServerState serverState, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MetadataUpdatedCallback(IntPtr serverName, IntPtr metadata, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PlaybackUpdatedCallback(IntPtr serverName, IntPtr playback, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ShuffleModeUpdatedCallback(IntPtr serverName, MediaControllerShuffleMode shuffleMode, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void MetadataUpdatedCallback(IntPtr serverName, IntPtr metadata, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RepeatModeUpdatedCallback(IntPtr serverName, MediaControllerRepeatMode repeatMode, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void ShuffleModeUpdatedCallback(IntPtr serverName, MediaControllerShuffleMode shuffleMode, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CommandReplyRecievedCallback(IntPtr serverName, int result, IntPtr bundle, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void RepeatModeUpdatedCallback(IntPtr serverName, MediaControllerRepeatMode repeatMode, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SubscribedServerCallback(IntPtr serverName, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void CommandReplyRecievedCallback(IntPtr serverName, int result, IntPtr bundle, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ActivatedServerCallback(IntPtr serverName, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool SubscribedServerCallback(IntPtr serverName, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_create")] - internal static extern MediaControllerError Create(out IntPtr handle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool ActivatedServerCallback(IntPtr serverName, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy")] - internal static extern MediaControllerError Destroy(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_create")] + internal static extern MediaControllerError Create(out IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_server_update_cb")] - internal static extern MediaControllerError SetServerUpdatedCb(IntPtr handle, ServerUpdatedCallback callback, IntPtr userData); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy")] + internal static extern MediaControllerError Destroy(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_server_update_cb")] - internal static extern MediaControllerError UnsetServerUpdatedCb(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_server_update_cb")] + internal static extern MediaControllerError SetServerUpdatedCb(IntPtr handle, ServerUpdatedCallback callback, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_playback_update_cb")] - internal static extern MediaControllerError SetPlaybackUpdatedCb(IntPtr handle, PlaybackUpdatedCallback callback, IntPtr userData); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_server_update_cb")] + internal static extern MediaControllerError UnsetServerUpdatedCb(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_playback_update_cb")] - internal static extern MediaControllerError UnsetPlaybackUpdatedCb(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_playback_update_cb")] + internal static extern MediaControllerError SetPlaybackUpdatedCb(IntPtr handle, PlaybackUpdatedCallback callback, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_metadata_update_cb")] - internal static extern MediaControllerError SetMetadataUpdatedCb(IntPtr handle, MetadataUpdatedCallback callback, IntPtr userData); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_playback_update_cb")] + internal static extern MediaControllerError UnsetPlaybackUpdatedCb(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_metadata_update_cb")] - internal static extern MediaControllerError UnsetMetadataUpdatedCb(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_metadata_update_cb")] + internal static extern MediaControllerError SetMetadataUpdatedCb(IntPtr handle, MetadataUpdatedCallback callback, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_shuffle_mode_update_cb")] - internal static extern MediaControllerError SetShuffleModeUpdatedCb(IntPtr handle, ShuffleModeUpdatedCallback callback, IntPtr userData); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_metadata_update_cb")] + internal static extern MediaControllerError UnsetMetadataUpdatedCb(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_shuffle_mode_update_cb")] - internal static extern MediaControllerError UnsetShuffleModeUpdatedCb(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_shuffle_mode_update_cb")] + internal static extern MediaControllerError SetShuffleModeUpdatedCb(IntPtr handle, ShuffleModeUpdatedCallback callback, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_repeat_mode_update_cb")] - internal static extern MediaControllerError SetRepeatModeUpdatedCb(IntPtr handle, RepeatModeUpdatedCallback callback, IntPtr userData); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_shuffle_mode_update_cb")] + internal static extern MediaControllerError UnsetShuffleModeUpdatedCb(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_repeat_mode_update_cb")] - internal static extern MediaControllerError UnsetRepeatModeUpdatedCb(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_repeat_mode_update_cb")] + internal static extern MediaControllerError SetRepeatModeUpdatedCb(IntPtr handle, RepeatModeUpdatedCallback callback, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_subscribe")] - internal static extern MediaControllerError Subscribe(IntPtr handle, MediaControllerSubscriptionType subscriptionType, string serverName); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_repeat_mode_update_cb")] + internal static extern MediaControllerError UnsetRepeatModeUpdatedCb(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unsubscribe")] - internal static extern MediaControllerError Unsubscribe(IntPtr handle, MediaControllerSubscriptionType subscriptionType, string serverName); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_subscribe")] + internal static extern MediaControllerError Subscribe(IntPtr handle, MediaControllerSubscriptionType subscriptionType, string serverName); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_playback_state")] - internal static extern MediaControllerError GetPlaybackState(IntPtr playback, out MediaControllerPlaybackState state); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unsubscribe")] + internal static extern MediaControllerError Unsubscribe(IntPtr handle, MediaControllerSubscriptionType subscriptionType, string serverName); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_playback_position")] - internal static extern MediaControllerError GetPlaybackPosition(IntPtr playback, out ulong position); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_playback_state")] + internal static extern MediaControllerError GetPlaybackState(IntPtr playback, out MediaControllerPlaybackState state); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy_playback")] - internal static extern MediaControllerError DestroyPlayback(IntPtr playback); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_playback_position")] + internal static extern MediaControllerError GetPlaybackPosition(IntPtr playback, out ulong position); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_metadata")] - private static extern MediaControllerError GetMetadata(IntPtr metadata, MediaControllerAttributes attribute, out IntPtr value); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy_playback")] + internal static extern MediaControllerError DestroyPlayback(IntPtr playback); - internal static string GetMetadata(IntPtr handle, MediaControllerAttributes attr) - { - IntPtr valuePtr = IntPtr.Zero; + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_metadata")] + private static extern MediaControllerError GetMetadata(IntPtr metadata, MediaControllerAttributes attribute, out IntPtr value); - try + internal static string GetMetadata(IntPtr handle, MediaControllerAttributes attr) { - var ret = GetMetadata(handle, attr, out valuePtr); - MediaControllerValidator.ThrowIfError(ret, "Failed to get value for " + attr); - return Marshal.PtrToStringAnsi(valuePtr); + IntPtr valuePtr = IntPtr.Zero; + + try + { + var ret = GetMetadata(handle, attr, out valuePtr); + MediaControllerValidator.ThrowIfError(ret, "Failed to get value for " + attr); + return Marshal.PtrToStringAnsi(valuePtr); + } + finally + { + Libc.Free(valuePtr); + } } - finally - { - Libc.Free(valuePtr); - } - } - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy_metadata")] - internal static extern MediaControllerError DestroyMetadata(IntPtr metadata); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy_metadata")] + internal static extern MediaControllerError DestroyMetadata(IntPtr metadata); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_latest_server_info")] - internal static extern MediaControllerError GetLatestServer(IntPtr handle, out IntPtr serverName, out MediaControllerServerState serverState); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_latest_server_info")] + internal static extern MediaControllerError GetLatestServer(IntPtr handle, out IntPtr serverName, out MediaControllerServerState serverState); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_playback_info")] - internal static extern MediaControllerError GetServerPlayback(IntPtr handle, string serverName, out IntPtr playback); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_playback_info")] + internal static extern MediaControllerError GetServerPlayback(IntPtr handle, string serverName, out IntPtr playback); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_metadata")] - internal static extern MediaControllerError GetServerMetadata(IntPtr handle, string serverName, out IntPtr metadata); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_metadata")] + internal static extern MediaControllerError GetServerMetadata(IntPtr handle, string serverName, out IntPtr metadata); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_shuffle_mode")] - internal static extern MediaControllerError GetServerShuffleMode(IntPtr handle, string serverName, out MediaControllerShuffleMode mode); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_shuffle_mode")] + internal static extern MediaControllerError GetServerShuffleMode(IntPtr handle, string serverName, out MediaControllerShuffleMode mode); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_repeat_mode")] - internal static extern MediaControllerError GetServerRepeatMode(IntPtr handle, string serverName, out MediaControllerRepeatMode mode); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_repeat_mode")] + internal static extern MediaControllerError GetServerRepeatMode(IntPtr handle, string serverName, out MediaControllerRepeatMode mode); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_send_playback_state_command")] - internal static extern MediaControllerError SendPlaybackStateCommand(IntPtr handle, string serverName, MediaControllerPlaybackState state); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_send_playback_state_command")] + internal static extern MediaControllerError SendPlaybackStateCommand(IntPtr handle, string serverName, MediaControllerPlaybackState state); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_send_custom_command")] - internal static extern MediaControllerError SendCustomCommand(IntPtr handle, string serverName, string command, SafeBundleHandle bundle, CommandReplyRecievedCallback callback, IntPtr userData); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_send_custom_command")] + internal static extern MediaControllerError SendCustomCommand(IntPtr handle, string serverName, string command, SafeBundleHandle bundle, CommandReplyRecievedCallback callback, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_foreach_server_subscribed")] - internal static extern MediaControllerError ForeachSubscribedServer(IntPtr handle, MediaControllerSubscriptionType subscriptionType, SubscribedServerCallback callback, IntPtr userData); + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_foreach_server_subscribed")] + internal static extern MediaControllerError ForeachSubscribedServer(IntPtr handle, MediaControllerSubscriptionType subscriptionType, SubscribedServerCallback callback, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_foreach_server")] - internal static extern MediaControllerError ForeachActivatedServer(IntPtr handle, ActivatedServerCallback callback, IntPtr userData); - } + [DllImport(Libraries.MediaController, EntryPoint = "mc_client_foreach_server")] + internal static extern MediaControllerError ForeachActivatedServer(IntPtr handle, ActivatedServerCallback callback, IntPtr userData); + } - internal static partial class MediaControllerServer - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PlaybackStateCommandRecievedCallback(IntPtr clientName, MediaControllerPlaybackState state, IntPtr userData); + internal static partial class MediaControllerServer + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PlaybackStateCommandRecievedCallback(IntPtr clientName, MediaControllerPlaybackState state, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CustomCommandRecievedCallback(IntPtr clientName, IntPtr command, IntPtr bundle, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void CustomCommandRecievedCallback(IntPtr clientName, IntPtr command, IntPtr bundle, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_create")] - internal static extern MediaControllerError Create(out IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_create")] + internal static extern MediaControllerError Create(out IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_destroy")] - internal static extern MediaControllerError Destroy(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_destroy")] + internal static extern MediaControllerError Destroy(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state")] - internal static extern MediaControllerError SetPlaybackState(IntPtr handle, MediaControllerPlaybackState state); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state")] + internal static extern MediaControllerError SetPlaybackState(IntPtr handle, MediaControllerPlaybackState state); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_position")] - internal static extern MediaControllerError SetPlaybackPosition(IntPtr handle, ulong position); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_position")] + internal static extern MediaControllerError SetPlaybackPosition(IntPtr handle, ulong position); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_playback_info")] - internal static extern MediaControllerError UpdatePlayback(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_playback_info")] + internal static extern MediaControllerError UpdatePlayback(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_metadata")] - internal static extern MediaControllerError SetMetadata(IntPtr handle, MediaControllerAttributes attribute, string value); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_metadata")] + internal static extern MediaControllerError SetMetadata(IntPtr handle, MediaControllerAttributes attribute, string value); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_metadata")] - internal static extern MediaControllerError UpdateMetadata(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_metadata")] + internal static extern MediaControllerError UpdateMetadata(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_shuffle_mode")] - internal static extern MediaControllerError UpdateShuffleMode(IntPtr handle, MediaControllerShuffleMode mode); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_shuffle_mode")] + internal static extern MediaControllerError UpdateShuffleMode(IntPtr handle, MediaControllerShuffleMode mode); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_repeat_mode")] - internal static extern MediaControllerError UpdateRepeatMode(IntPtr handle, MediaControllerRepeatMode mode); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_repeat_mode")] + internal static extern MediaControllerError UpdateRepeatMode(IntPtr handle, MediaControllerRepeatMode mode); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state_command_received_cb")] - internal static extern MediaControllerError SetPlaybackStateCmdRecvCb(IntPtr handle, PlaybackStateCommandRecievedCallback callback, IntPtr userData); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state_command_received_cb")] + internal static extern MediaControllerError SetPlaybackStateCmdRecvCb(IntPtr handle, PlaybackStateCommandRecievedCallback callback, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_unset_playback_state_command_received_cb")] - internal static extern MediaControllerError UnsetPlaybackStateCmdRecvCb(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_unset_playback_state_command_received_cb")] + internal static extern MediaControllerError UnsetPlaybackStateCmdRecvCb(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_custom_command_received_cb")] - internal static extern MediaControllerError SetCustomCmdRecvCb(IntPtr handle, CustomCommandRecievedCallback callback, IntPtr userData); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_custom_command_received_cb")] + internal static extern MediaControllerError SetCustomCmdRecvCb(IntPtr handle, CustomCommandRecievedCallback callback, IntPtr userData); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_unset_custom_command_received_cb")] - internal static extern MediaControllerError UnsetCustomCmdRecvCb(IntPtr handle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_unset_custom_command_received_cb")] + internal static extern MediaControllerError UnsetCustomCmdRecvCb(IntPtr handle); - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_send_command_reply")] - internal static extern MediaControllerError SendCommandReply(IntPtr handle, string clientName, int result, SafeBundleHandle bundle); + [DllImport(Libraries.MediaController, EntryPoint = "mc_server_send_command_reply")] + internal static extern MediaControllerError SendCommandReply(IntPtr handle, string clientName, int result, SafeBundleHandle bundle); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs b/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs index a11fdd5..e72f8c2 100644 --- a/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs @@ -1,154 +1,157 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static class MediaPacket + internal static partial class Interop { - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_create")] - internal static extern int Create(IntPtr format, IntPtr finalizeCb, IntPtr cbData, out IntPtr handle); + internal static class MediaPacket + { + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_create")] + internal static extern int Create(IntPtr format, IntPtr finalizeCb, IntPtr cbData, out IntPtr handle); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_alloc")] - internal static extern int Alloc(IntPtr handle); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_alloc")] + internal static extern int Alloc(IntPtr handle); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_destroy")] - internal static extern int Destroy(IntPtr handle); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_destroy")] + internal static extern int Destroy(IntPtr handle); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_format")] - internal static extern int GetFormat(IntPtr handle, out IntPtr format); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_format")] + internal static extern int GetFormat(IntPtr handle, out IntPtr format); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_buffer_data_ptr")] - internal static extern int GetBufferData(IntPtr handle, out IntPtr dataHandle); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_buffer_data_ptr")] + internal static extern int GetBufferData(IntPtr handle, out IntPtr dataHandle); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_buffer_size")] - internal static extern int GetBufferSize(IntPtr handle, out ulong size); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_buffer_size")] + internal static extern int GetBufferSize(IntPtr handle, out ulong size); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_buffer_size")] - internal static extern int SetBufferSize(IntPtr handle, ulong size); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_buffer_size")] + internal static extern int SetBufferSize(IntPtr handle, ulong size); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_allocated_buffer_size")] - internal static extern int GetAllocatedBufferSize(IntPtr handle, out int size); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_allocated_buffer_size")] + internal static extern int GetAllocatedBufferSize(IntPtr handle, out int size); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_number_of_video_planes")] - internal static extern int GetNumberOfVideoPlanes(IntPtr handle, out uint num); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_number_of_video_planes")] + internal static extern int GetNumberOfVideoPlanes(IntPtr handle, out uint num); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_stride_width")] - internal static extern int GetVideoStrideWidth(IntPtr handle, int planeIndex, out int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_stride_width")] + internal static extern int GetVideoStrideWidth(IntPtr handle, int planeIndex, out int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_stride_height")] - internal static extern int GetVideoStrideHeight(IntPtr handle, int planeIndex, out int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_stride_height")] + internal static extern int GetVideoStrideHeight(IntPtr handle, int planeIndex, out int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_plane_data_ptr")] - internal static extern int GetVideoPlaneData(IntPtr handle, int planeIndex, out IntPtr dataHandle); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_plane_data_ptr")] + internal static extern int GetVideoPlaneData(IntPtr handle, int planeIndex, out IntPtr dataHandle); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_is_encoded")] - internal static extern int IsEncoded(IntPtr handle, out bool value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_is_encoded")] + internal static extern int IsEncoded(IntPtr handle, out bool value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_flags")] - internal static extern int GetBufferFlags(IntPtr handle, out int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_flags")] + internal static extern int GetBufferFlags(IntPtr handle, out int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_flags")] - internal static extern int SetBufferFlags(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_flags")] + internal static extern int SetBufferFlags(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_reset_flags")] - internal static extern int ResetBufferFlags(IntPtr handle); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_reset_flags")] + internal static extern int ResetBufferFlags(IntPtr handle); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_pts")] - internal static extern int GetPts(IntPtr handle, out ulong value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_pts")] + internal static extern int GetPts(IntPtr handle, out ulong value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_dts")] - internal static extern int GetDts(IntPtr handle, out ulong value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_dts")] + internal static extern int GetDts(IntPtr handle, out ulong value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_pts")] - internal static extern int SetPts(IntPtr handle, ulong value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_pts")] + internal static extern int SetPts(IntPtr handle, ulong value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_dts")] - internal static extern int SetDts(IntPtr handle, ulong value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_dts")] + internal static extern int SetDts(IntPtr handle, ulong value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_extra")] - internal static extern int SetExtra(IntPtr handle, IntPtr value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_extra")] + internal static extern int SetExtra(IntPtr handle, IntPtr value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_extra")] - internal static extern int GetExtra(IntPtr handle, out IntPtr value); - } + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_extra")] + internal static extern int GetExtra(IntPtr handle, out IntPtr value); + } - internal static class MediaFormat - { - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_create")] - internal static extern int Create(out IntPtr handle); + internal static class MediaFormat + { + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_create")] + internal static extern int Create(out IntPtr handle); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_unref")] - internal static extern int Unref(IntPtr handle); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_unref")] + internal static extern int Unref(IntPtr handle); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_type")] - internal static extern int GetType(IntPtr handle, out int type); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_type")] + internal static extern int GetType(IntPtr handle, out int type); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_container_mime")] - internal static extern int GetContainerMimeType(IntPtr handle, out int mimeType); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_container_mime")] + internal static extern int GetContainerMimeType(IntPtr handle, out int mimeType); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_container_mime")] - internal static extern int SetContainerMimeType(IntPtr handle, int mimeType); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_container_mime")] + internal static extern int SetContainerMimeType(IntPtr handle, int mimeType); - #region Video apis - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_video_info")] - internal static extern int GetVideoInfo(IntPtr handle, out int mimeType, - out int width, out int height, out int averageBps, out int maxBps); + #region Video apis + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_video_info")] + internal static extern int GetVideoInfo(IntPtr handle, out int mimeType, + out int width, out int height, out int averageBps, out int maxBps); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_video_frame_rate")] - internal static extern int GetVideoFrameRate(IntPtr handle, out int frameRate); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_video_frame_rate")] + internal static extern int GetVideoFrameRate(IntPtr handle, out int frameRate); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_mime")] - internal static extern int SetVideoMimeType(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_mime")] + internal static extern int SetVideoMimeType(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_width")] - internal static extern int SetVideoWidth(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_width")] + internal static extern int SetVideoWidth(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_height")] - internal static extern int SetVideoHeight(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_height")] + internal static extern int SetVideoHeight(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_avg_bps")] - internal static extern int SetVideoAverageBps(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_avg_bps")] + internal static extern int SetVideoAverageBps(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_frame_rate")] - internal static extern int SetVideoFrameRate(IntPtr handle, int value); - #endregion + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_frame_rate")] + internal static extern int SetVideoFrameRate(IntPtr handle, int value); + #endregion - #region Audio apis - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_audio_info")] - internal static extern int GetAudioInfo(IntPtr handle, out int mimeType, - out int channel, out int sampleRate, out int bit, out int averageBps); + #region Audio apis + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_audio_info")] + internal static extern int GetAudioInfo(IntPtr handle, out int mimeType, + out int channel, out int sampleRate, out int bit, out int averageBps); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_audio_aac_header_type")] - internal static extern int GetAudioAacType(IntPtr handle, out int aacType); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_audio_aac_header_type")] + internal static extern int GetAudioAacType(IntPtr handle, out int aacType); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_mime")] - internal static extern int SetAudioMimeType(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_mime")] + internal static extern int SetAudioMimeType(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_channel")] - internal static extern int SetAudioChannel(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_channel")] + internal static extern int SetAudioChannel(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_samplerate")] - internal static extern int SetAudioSampleRate(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_samplerate")] + internal static extern int SetAudioSampleRate(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_bit")] - internal static extern int SetAudioBit(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_bit")] + internal static extern int SetAudioBit(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_avg_bps")] - internal static extern int SetAudioAverageBps(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_avg_bps")] + internal static extern int SetAudioAverageBps(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_aac_header_type")] - internal static extern int SetAudioAacType(IntPtr handle, int value); - #endregion + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_aac_header_type")] + internal static extern int SetAudioAacType(IntPtr handle, int value); + #endregion - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_text_info")] - internal static extern int GetTextInfo(IntPtr handle, out int mimeType, out int textType); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_text_info")] + internal static extern int GetTextInfo(IntPtr handle, out int mimeType, out int textType); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_text_mime")] - internal static extern int SetTextMimeType(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_text_mime")] + internal static extern int SetTextMimeType(IntPtr handle, int value); - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_text_type")] - internal static extern int SetTextType(IntPtr handle, int value); + [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_text_type")] + internal static extern int SetTextType(IntPtr handle, int value); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.MediaVision.BarCode.cs b/src/Tizen.Multimedia/Interop/Interop.MediaVision.BarCode.cs old mode 100755 new mode 100644 index 03a0013..c1bc048 --- a/src/Tizen.Multimedia/Interop/Interop.MediaVision.BarCode.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MediaVision.BarCode.cs @@ -16,53 +16,55 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -/// -/// Interop APIs -/// -internal static partial class Interop +namespace Tizen.Multimedia { /// - /// Interop for media vision APIs + /// Interop APIs /// - internal static partial class MediaVision + internal static partial class Interop { /// - /// Interop for barcode detector APIs + /// Interop for media vision APIs /// - internal static partial class BarcodeDetector + internal static partial class MediaVision { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_detect")] - internal static extern MediaVisionError Detect(IntPtr source, IntPtr engineCfg, Rectangle roi, - DetectedCallback detectCb, IntPtr userData = default(IntPtr)); + /// + /// Interop for barcode detector APIs + /// + internal static partial class BarcodeDetector + { + [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_detect")] + internal static extern MediaVisionError Detect(IntPtr source, IntPtr engineCfg, Rectangle roi, + DetectedCallback detectCb, IntPtr userData = default(IntPtr)); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DetectedCallback( - IntPtr source, - IntPtr engineCfg, - [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 5)] + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void DetectedCallback( + IntPtr source, + IntPtr engineCfg, + [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 5)] Quadrangle[] locations, - [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 5)] + [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 5)] string[] messages, - BarcodeType[] types, - int numberOfBarcodes, - IntPtr userData); - } + BarcodeType[] types, + int numberOfBarcodes, + IntPtr userData); + } - /// - /// Interop for barcode generator APIs - /// - internal static partial class BarcodeGenerator - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_generate_source")] - internal static extern MediaVisionError GenerateSource(IntPtr engineCfg, string message, - BarcodeType type, int qrEncMode, int qrEcc, int qrVersion, IntPtr source); + /// + /// Interop for barcode generator APIs + /// + internal static partial class BarcodeGenerator + { + [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_generate_source")] + internal static extern MediaVisionError GenerateSource(IntPtr engineCfg, string message, + BarcodeType type, int qrEncMode, int qrEcc, int qrVersion, IntPtr source); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_generate_image")] - internal static extern MediaVisionError GenerateImage(IntPtr engineCfg, - string message, int imageWidth, int imageHeight, BarcodeType type, - int qrEncMode, int qrEcc, int qrVersion, string imagePath, BarcodeImageFormat imageFormat); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_generate_image")] + internal static extern MediaVisionError GenerateImage(IntPtr engineCfg, + string message, int imageWidth, int imageHeight, BarcodeType type, + int qrEncMode, int qrEcc, int qrVersion, string imagePath, BarcodeImageFormat imageFormat); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.MediaVision.Common.cs b/src/Tizen.Multimedia/Interop/Interop.MediaVision.Common.cs old mode 100755 new mode 100644 index 1ee91a0..b373db4 --- a/src/Tizen.Multimedia/Interop/Interop.MediaVision.Common.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MediaVision.Common.cs @@ -16,177 +16,179 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -/// -/// Interop APIs -/// -internal static partial class Interop +namespace Tizen.Multimedia { - internal static Tizen.Multimedia.Point ToApiStruct(this MediaVision.Point pt) - { - return new Tizen.Multimedia.Point(pt.x, pt.y); - } - - internal static MediaVision.Point ToMarshalable(this Tizen.Multimedia.Point pt) - { - return new MediaVision.Point() { x = pt.X, y = pt.Y }; - } - - internal static MediaVision.Point[] ToMarshalable(Tizen.Multimedia.Point[] pts) + /// + /// Interop APIs + /// + internal static partial class Interop { - var result = new MediaVision.Point[pts.Length]; - for (int i = 0; i < pts.Length;++i) + internal static Tizen.Multimedia.Point ToApiStruct(this MediaVision.Point pt) { - result[i] = pts[i].ToMarshalable(); + return new Tizen.Multimedia.Point(pt.x, pt.y); } - return result; - } - - internal static Tizen.Multimedia.Quadrangle ToApiStruct(this MediaVision.Quadrangle quadrangle) - { - Tizen.Multimedia.Point[] points = new Tizen.Multimedia.Point[4]; - for (int i = 0; i < 4; ++i) + internal static MediaVision.Point ToMarshalable(this Tizen.Multimedia.Point pt) { - points[i] = quadrangle.points[i].ToApiStruct(); + return new MediaVision.Point() { x = pt.X, y = pt.Y }; } - return new Tizen.Multimedia.Quadrangle(points); - } - internal static MediaVision.Quadrangle ToMarshalable(this Tizen.Multimedia.Quadrangle quadrangle) - { - MediaVision.Point[] points = new MediaVision.Point[4]; - for (int i = 0; i < 4; ++i) + internal static MediaVision.Point[] ToMarshalable(Tizen.Multimedia.Point[] pts) { - points[i] = quadrangle.Points[i].ToMarshalable(); + var result = new MediaVision.Point[pts.Length]; + for (int i = 0; i < pts.Length; ++i) + { + result[i] = pts[i].ToMarshalable(); + } + return result; } - return new MediaVision.Quadrangle() { points = points }; - } - - internal static Tizen.Multimedia.Rectangle ToApiStruct(this MediaVision.Rectangle rectangle) - { - return new Tizen.Multimedia.Rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height); - } - internal static MediaVision.Rectangle ToMarshalable(this Tizen.Multimedia.Rectangle rectangle) - { - return new MediaVision.Rectangle() - { - x = rectangle.X, - y = rectangle.Y, - width = rectangle.Width, - height = rectangle.Height - }; - } - - internal static Tizen.Multimedia.Rectangle[] ToApiStruct(MediaVision.Rectangle[] rects) - { - var result = new Tizen.Multimedia.Rectangle[rects.Length]; - for (int i = 0; i < rects.Length; i++) + internal static Tizen.Multimedia.Quadrangle ToApiStruct(this MediaVision.Quadrangle quadrangle) { - result[i] = rects[i].ToApiStruct(); + Tizen.Multimedia.Point[] points = new Tizen.Multimedia.Point[4]; + for (int i = 0; i < 4; ++i) + { + points[i] = quadrangle.points[i].ToApiStruct(); + } + return new Tizen.Multimedia.Quadrangle(points); } - return result; - } - /// - /// Interop for media vision APIs - /// - internal static partial class MediaVision - { - [StructLayout(LayoutKind.Sequential)] - internal struct Point + internal static MediaVision.Quadrangle ToMarshalable(this Tizen.Multimedia.Quadrangle quadrangle) { - internal int x; - internal int y; + MediaVision.Point[] points = new MediaVision.Point[4]; + for (int i = 0; i < 4; ++i) + { + points[i] = quadrangle.Points[i].ToMarshalable(); + } + return new MediaVision.Quadrangle() { points = points }; } - [StructLayout(LayoutKind.Sequential)] - internal struct Rectangle + internal static Tizen.Multimedia.Rectangle ToApiStruct(this MediaVision.Rectangle rectangle) { - internal int x; - internal int y; - internal int width; - internal int height; + return new Tizen.Multimedia.Rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height); } - [StructLayout(LayoutKind.Sequential)] - internal struct Quadrangle + internal static MediaVision.Rectangle ToMarshalable(this Tizen.Multimedia.Rectangle rectangle) { - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - internal Point[] points; + return new MediaVision.Rectangle() + { + x = rectangle.X, + y = rectangle.Y, + width = rectangle.Width, + height = rectangle.Height + }; } - /// - /// Interop for media vision source APIs - /// - internal static partial class MediaSource + internal static Tizen.Multimedia.Rectangle[] ToApiStruct(MediaVision.Rectangle[] rects) { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_create_source")] - internal static extern MediaVisionError Create(out IntPtr source); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_destroy_source")] - internal static extern int Destroy(IntPtr /* mv_source_h */ source); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_fill_by_media_packet")] - internal static extern MediaVisionError FillMediaPacket(IntPtr source, IntPtr mediaPacket); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_fill_by_buffer")] - internal static extern MediaVisionError FillBuffer(IntPtr source, byte[] buffer, - int bufferSize, uint imageWidth, uint imageHeight, Colorspace colorspace); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_clear")] - internal static extern int Clear(IntPtr /* mv_source_h */ source); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_buffer")] - internal static extern MediaVisionError GetBuffer(IntPtr source, out IntPtr buffer, out int bufferSize); + var result = new Tizen.Multimedia.Rectangle[rects.Length]; - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_height")] - internal static extern int GetHeight(IntPtr source, out uint imageHeight); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_width")] - internal static extern int GetWidth(IntPtr source, out uint imageWidth); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_colorspace")] - internal static extern int GetColorspace(IntPtr /* mv_source_h */ source, out Tizen.Multimedia.Colorspace colorspace); + for (int i = 0; i < rects.Length; i++) + { + result[i] = rects[i].ToApiStruct(); + } + return result; } /// - /// Interop for engine configuration APIs + /// Interop for media vision APIs /// - internal static partial class EngineConfig + internal static partial class MediaVision { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_create_engine_config")] - internal static extern MediaVisionError Create(out IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_destroy_engine_config")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_double_attribute")] - internal static extern Tizen.Multimedia.MediaVisionError SetDouble(IntPtr handle, string name, double value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_int_attribute")] - internal static extern Tizen.Multimedia.MediaVisionError SetInt(IntPtr handle, string name, int value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_bool_attribute")] - internal static extern Tizen.Multimedia.MediaVisionError SetBool(IntPtr handle, string name, bool value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_string_attribute")] - internal static extern Tizen.Multimedia.MediaVisionError SetString(IntPtr handle, string name, string value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_double_attribute")] - internal static extern Tizen.Multimedia.MediaVisionError GetDouble(IntPtr handle, string name, out double value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_int_attribute")] - internal static extern Tizen.Multimedia.MediaVisionError GetInt(IntPtr handle, string name, out int value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_bool_attribute")] - internal static extern Tizen.Multimedia.MediaVisionError GetBool(IntPtr handle, string name, out bool value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_string_attribute")] - internal static extern Tizen.Multimedia.MediaVisionError GetString(IntPtr handle, string name, out IntPtr value); + [StructLayout(LayoutKind.Sequential)] + internal struct Point + { + internal int x; + internal int y; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct Rectangle + { + internal int x; + internal int y; + internal int width; + internal int height; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct Quadrangle + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + internal Point[] points; + } + + /// + /// Interop for media vision source APIs + /// + internal static partial class MediaSource + { + [DllImport(Libraries.MediaVision, EntryPoint = "mv_create_source")] + internal static extern MediaVisionError Create(out IntPtr source); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_destroy_source")] + internal static extern int Destroy(IntPtr /* mv_source_h */ source); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_fill_by_media_packet")] + internal static extern MediaVisionError FillMediaPacket(IntPtr source, IntPtr mediaPacket); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_fill_by_buffer")] + internal static extern MediaVisionError FillBuffer(IntPtr source, byte[] buffer, + int bufferSize, uint imageWidth, uint imageHeight, Colorspace colorspace); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_clear")] + internal static extern int Clear(IntPtr /* mv_source_h */ source); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_buffer")] + internal static extern MediaVisionError GetBuffer(IntPtr source, out IntPtr buffer, out int bufferSize); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_height")] + internal static extern int GetHeight(IntPtr source, out uint imageHeight); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_width")] + internal static extern int GetWidth(IntPtr source, out uint imageWidth); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_colorspace")] + internal static extern int GetColorspace(IntPtr /* mv_source_h */ source, out Tizen.Multimedia.Colorspace colorspace); + } + + /// + /// Interop for engine configuration APIs + /// + internal static partial class EngineConfig + { + [DllImport(Libraries.MediaVision, EntryPoint = "mv_create_engine_config")] + internal static extern MediaVisionError Create(out IntPtr handle); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_destroy_engine_config")] + internal static extern int Destroy(IntPtr handle); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_double_attribute")] + internal static extern Tizen.Multimedia.MediaVisionError SetDouble(IntPtr handle, string name, double value); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_int_attribute")] + internal static extern Tizen.Multimedia.MediaVisionError SetInt(IntPtr handle, string name, int value); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_bool_attribute")] + internal static extern Tizen.Multimedia.MediaVisionError SetBool(IntPtr handle, string name, bool value); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_string_attribute")] + internal static extern Tizen.Multimedia.MediaVisionError SetString(IntPtr handle, string name, string value); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_double_attribute")] + internal static extern Tizen.Multimedia.MediaVisionError GetDouble(IntPtr handle, string name, out double value); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_int_attribute")] + internal static extern Tizen.Multimedia.MediaVisionError GetInt(IntPtr handle, string name, out int value); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_bool_attribute")] + internal static extern Tizen.Multimedia.MediaVisionError GetBool(IntPtr handle, string name, out bool value); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_string_attribute")] + internal static extern Tizen.Multimedia.MediaVisionError GetString(IntPtr handle, string name, out IntPtr value); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.MediaVision.Face.cs b/src/Tizen.Multimedia/Interop/Interop.MediaVision.Face.cs old mode 100755 new mode 100644 index 224caa8..3ee606b --- a/src/Tizen.Multimedia/Interop/Interop.MediaVision.Face.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MediaVision.Face.cs @@ -16,138 +16,140 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -/// -/// Interop APIs -/// -internal static partial class Interop +namespace Tizen.Multimedia { /// - /// Interop for media vision APIs + /// Interop APIs /// - internal static partial class MediaVision + internal static partial class Interop { /// - /// Interop for Face APIs + /// Interop for media vision APIs /// - internal static partial class Face + internal static partial class MediaVision { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_detect")] - internal static extern MediaVisionError Detect(IntPtr source, IntPtr engineCfg, - DetectedCallback detectedCb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognize")] - internal static extern MediaVisionError Recognize(IntPtr source, IntPtr recognitionModel, IntPtr engineCfg, - IntPtr faceLocation, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognize")] - internal static extern MediaVisionError Recognize(IntPtr source, IntPtr recognitionModel, IntPtr engineCfg, - ref Rectangle faceLocation, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_track")] - internal static extern MediaVisionError Track(IntPtr source, IntPtr trackingModel, IntPtr engineCfg, - TrackedCallback trackedCb, bool doLearn, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_eye_condition_recognize")] - internal static extern MediaVisionError RecognizeEyeCondition(IntPtr source, IntPtr engineCfg, - Rectangle faceLocation, EyeConditionRecognizedCallback eyeConditionRecognizedCb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_facial_expression_recognize")] - internal static extern MediaVisionError RecognizeFacialExpression(IntPtr source, IntPtr engineCfg, - Rectangle faceLocation, MvFaceFacialExpressionRecognizedCallback expressionRecognizedCb, - IntPtr userData = default(IntPtr)); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DetectedCallback(IntPtr source, IntPtr engineCfg, - [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] Rectangle[] facesLocations, - int numberOfFaces, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecognizedCallback(IntPtr source, IntPtr recognitionModel, - IntPtr engineCfg, IntPtr faceLocation, IntPtr faceLabel, double confidence, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TrackedCallback(IntPtr source, IntPtr trackingModel, IntPtr engineCfg, - IntPtr location, double confidence, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EyeConditionRecognizedCallback(IntPtr source, IntPtr engineCfg, - Rectangle faceLocation, EyeCondition eyeCondition, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MvFaceFacialExpressionRecognizedCallback(IntPtr source, - IntPtr engineCfg, Rectangle faceLocation, FacialExpression facialExpression, IntPtr userData); - } - - /// - /// Interop for FaceRecognitionModel APIs - /// - internal static partial class FaceRecognitionModel - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_create")] - internal static extern MediaVisionError Create(out IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dst); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_add")] - internal static extern MediaVisionError Add(IntPtr source, IntPtr recognitionModel, - ref Rectangle exampleLocation, int faceLabel); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_add")] - internal static extern MediaVisionError Add(IntPtr source, IntPtr recognitionModel, - IntPtr exampleLocation, int faceLabel); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_reset")] - internal static extern MediaVisionError Reset(IntPtr recognitionModel, IntPtr faceLabel = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_reset")] - internal static extern MediaVisionError Remove(IntPtr recognitionModel, ref int faceLabel); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_learn")] - internal static extern MediaVisionError Learn(IntPtr engineCfg, IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_query_labels")] - internal static extern MediaVisionError QueryLabels(IntPtr handle, out IntPtr labels, out uint numberOfLabels); - } - - /// - /// Interop for FaceTrackingModel APIs - /// - internal static partial class FaceTrackingModel - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_create")] - internal static extern MediaVisionError Create(out IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_prepare")] - internal static extern MediaVisionError Prepare(IntPtr trackingModel, IntPtr engineCfg, - IntPtr source, ref Quadrangle location); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_prepare")] - internal static extern MediaVisionError Prepare(IntPtr trackingModel, IntPtr engineCfg, - IntPtr source, IntPtr location); + /// + /// Interop for Face APIs + /// + internal static partial class Face + { + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_detect")] + internal static extern MediaVisionError Detect(IntPtr source, IntPtr engineCfg, + DetectedCallback detectedCb, IntPtr userData = default(IntPtr)); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognize")] + internal static extern MediaVisionError Recognize(IntPtr source, IntPtr recognitionModel, IntPtr engineCfg, + IntPtr faceLocation, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognize")] + internal static extern MediaVisionError Recognize(IntPtr source, IntPtr recognitionModel, IntPtr engineCfg, + ref Rectangle faceLocation, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_track")] + internal static extern MediaVisionError Track(IntPtr source, IntPtr trackingModel, IntPtr engineCfg, + TrackedCallback trackedCb, bool doLearn, IntPtr userData = default(IntPtr)); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_eye_condition_recognize")] + internal static extern MediaVisionError RecognizeEyeCondition(IntPtr source, IntPtr engineCfg, + Rectangle faceLocation, EyeConditionRecognizedCallback eyeConditionRecognizedCb, IntPtr userData = default(IntPtr)); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_facial_expression_recognize")] + internal static extern MediaVisionError RecognizeFacialExpression(IntPtr source, IntPtr engineCfg, + Rectangle faceLocation, MvFaceFacialExpressionRecognizedCallback expressionRecognizedCb, + IntPtr userData = default(IntPtr)); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void DetectedCallback(IntPtr source, IntPtr engineCfg, + [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] Rectangle[] facesLocations, + int numberOfFaces, IntPtr userData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void RecognizedCallback(IntPtr source, IntPtr recognitionModel, + IntPtr engineCfg, IntPtr faceLocation, IntPtr faceLabel, double confidence, IntPtr userData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void TrackedCallback(IntPtr source, IntPtr trackingModel, IntPtr engineCfg, + IntPtr location, double confidence, IntPtr userData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void EyeConditionRecognizedCallback(IntPtr source, IntPtr engineCfg, + Rectangle faceLocation, EyeCondition eyeCondition, IntPtr userData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void MvFaceFacialExpressionRecognizedCallback(IntPtr source, + IntPtr engineCfg, Rectangle faceLocation, FacialExpression facialExpression, IntPtr userData); + } + + /// + /// Interop for FaceRecognitionModel APIs + /// + internal static partial class FaceRecognitionModel + { + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_create")] + internal static extern MediaVisionError Create(out IntPtr handle); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_destroy")] + internal static extern int Destroy(IntPtr handle); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_clone")] + internal static extern int Clone(IntPtr src, out IntPtr dst); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_save")] + internal static extern MediaVisionError Save(string fileName, IntPtr handle); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_load")] + internal static extern MediaVisionError Load(string fileName, out IntPtr handle); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_add")] + internal static extern MediaVisionError Add(IntPtr source, IntPtr recognitionModel, + ref Rectangle exampleLocation, int faceLabel); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_add")] + internal static extern MediaVisionError Add(IntPtr source, IntPtr recognitionModel, + IntPtr exampleLocation, int faceLabel); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_reset")] + internal static extern MediaVisionError Reset(IntPtr recognitionModel, IntPtr faceLabel = default(IntPtr)); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_reset")] + internal static extern MediaVisionError Remove(IntPtr recognitionModel, ref int faceLabel); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_learn")] + internal static extern MediaVisionError Learn(IntPtr engineCfg, IntPtr handle); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_query_labels")] + internal static extern MediaVisionError QueryLabels(IntPtr handle, out IntPtr labels, out uint numberOfLabels); + } + + /// + /// Interop for FaceTrackingModel APIs + /// + internal static partial class FaceTrackingModel + { + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_create")] + internal static extern MediaVisionError Create(out IntPtr handle); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_destroy")] + internal static extern int Destroy(IntPtr handle); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_prepare")] + internal static extern MediaVisionError Prepare(IntPtr trackingModel, IntPtr engineCfg, + IntPtr source, ref Quadrangle location); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dst); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_prepare")] + internal static extern MediaVisionError Prepare(IntPtr trackingModel, IntPtr engineCfg, + IntPtr source, IntPtr location); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr handle); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_clone")] + internal static extern int Clone(IntPtr src, out IntPtr dst); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr handle); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_save")] + internal static extern MediaVisionError Save(string fileName, IntPtr handle); + + [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_load")] + internal static extern MediaVisionError Load(string fileName, out IntPtr handle); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.MediaVision.Image.cs b/src/Tizen.Multimedia/Interop/Interop.MediaVision.Image.cs old mode 100755 new mode 100644 index 3afc9b5..03d36d0 --- a/src/Tizen.Multimedia/Interop/Interop.MediaVision.Image.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MediaVision.Image.cs @@ -16,96 +16,98 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -/// -/// Interop APIs -/// -internal static partial class Interop +namespace Tizen.Multimedia { /// - /// Interop for Media vision APIs + /// Interop APIs /// - internal static partial class MediaVision + internal static partial class Interop { /// - /// Interop for Image APIs + /// Interop for Media vision APIs /// - internal static partial class Image + internal static partial class MediaVision { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_recognize")] - internal static extern MediaVisionError Recognize(IntPtr source, IntPtr[] imageObjects, - int numberOfObjects, IntPtr engineCfg, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); + /// + /// Interop for Image APIs + /// + internal static partial class Image + { + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_recognize")] + internal static extern MediaVisionError Recognize(IntPtr source, IntPtr[] imageObjects, + int numberOfObjects, IntPtr engineCfg, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_track")] - internal static extern MediaVisionError Track(IntPtr source, IntPtr imageTrackingModel, - IntPtr engineCfg, TrackedCallback trackedCb, IntPtr userData = default(IntPtr)); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_track")] + internal static extern MediaVisionError Track(IntPtr source, IntPtr imageTrackingModel, + IntPtr engineCfg, TrackedCallback trackedCb, IntPtr userData = default(IntPtr)); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_create")] - internal static extern MediaVisionError Create(out IntPtr handle); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_create")] + internal static extern MediaVisionError Create(out IntPtr handle); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_destroy")] - internal static extern int Destroy(IntPtr handle); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_destroy")] + internal static extern int Destroy(IntPtr handle); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_fill")] - internal static extern MediaVisionError Fill(IntPtr handle, IntPtr engineCfg, IntPtr source, ref Rectangle location); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_fill")] + internal static extern MediaVisionError Fill(IntPtr handle, IntPtr engineCfg, IntPtr source, ref Rectangle location); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_fill")] - internal static extern MediaVisionError Fill(IntPtr handle, IntPtr engineCfg, IntPtr source, IntPtr location); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_fill")] + internal static extern MediaVisionError Fill(IntPtr handle, IntPtr engineCfg, IntPtr source, IntPtr location); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_get_recognition_rate")] - internal static extern MediaVisionError GetRecognitionRate(IntPtr handle, out double recognitionRate); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_get_recognition_rate")] + internal static extern MediaVisionError GetRecognitionRate(IntPtr handle, out double recognitionRate); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_set_label")] - internal static extern MediaVisionError SetLabel(IntPtr handle, int label); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_set_label")] + internal static extern MediaVisionError SetLabel(IntPtr handle, int label); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_get_label")] - internal static extern MediaVisionError GetLabel(IntPtr handle, out int label); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_get_label")] + internal static extern MediaVisionError GetLabel(IntPtr handle, out int label); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dst); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_clone")] + internal static extern int Clone(IntPtr src, out IntPtr dst); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr handle); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_save")] + internal static extern MediaVisionError Save(string fileName, IntPtr handle); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr handle); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_load")] + internal static extern MediaVisionError Load(string fileName, out IntPtr handle); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecognizedCallback(IntPtr source, IntPtr engineCfg, IntPtr imageObjects, - [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void RecognizedCallback(IntPtr source, IntPtr engineCfg, IntPtr imageObjects, + [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] IntPtr[] locations, uint numberOfObjects, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TrackedCallback(IntPtr source, IntPtr imageTrackingModel, - IntPtr engineCfg, IntPtr location, IntPtr userData); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void TrackedCallback(IntPtr source, IntPtr imageTrackingModel, + IntPtr engineCfg, IntPtr location, IntPtr userData); + } - /// - /// Interop for ImageTrackingModel APIs - /// - internal static partial class ImageTrackingModel - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_create")] - internal static extern MediaVisionError Create(out IntPtr imageTrackingModel); + /// + /// Interop for ImageTrackingModel APIs + /// + internal static partial class ImageTrackingModel + { + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_create")] + internal static extern MediaVisionError Create(out IntPtr imageTrackingModel); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_set_target")] - internal static extern MediaVisionError SetTarget(IntPtr handle, IntPtr imageTrackingModel); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_set_target")] + internal static extern MediaVisionError SetTarget(IntPtr handle, IntPtr imageTrackingModel); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_destroy")] - internal static extern int Destroy(IntPtr imageTrackingModel); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_destroy")] + internal static extern int Destroy(IntPtr imageTrackingModel); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_refresh")] - internal static extern MediaVisionError Refresh(IntPtr imageTrackingModel, IntPtr engineCfg); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_refresh")] + internal static extern MediaVisionError Refresh(IntPtr imageTrackingModel, IntPtr engineCfg); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dest); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_clone")] + internal static extern int Clone(IntPtr src, out IntPtr dest); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr imageTrackingModel); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_save")] + internal static extern MediaVisionError Save(string fileName, IntPtr imageTrackingModel); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr imageTrackingModel); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_load")] + internal static extern MediaVisionError Load(string fileName, out IntPtr imageTrackingModel); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.MediaVision.Surveillance.cs b/src/Tizen.Multimedia/Interop/Interop.MediaVision.Surveillance.cs old mode 100755 new mode 100644 index 22eb51b..64aaf2c --- a/src/Tizen.Multimedia/Interop/Interop.MediaVision.Surveillance.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MediaVision.Surveillance.cs @@ -16,76 +16,78 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -/// -/// Interop APIs -/// -internal static partial class Interop +namespace Tizen.Multimedia { /// - /// Interop for media vision APIs + /// Interop APIs /// - internal static partial class MediaVision + internal static partial class Interop { /// - /// Interop for surveillance APIs + /// Interop for media vision APIs /// - internal static partial class Surveillance + internal static partial class MediaVision { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_event_trigger_create")] - internal static extern MediaVisionError EventTriggerCreate(string eventType, out IntPtr trigger); + /// + /// Interop for surveillance APIs + /// + internal static partial class Surveillance + { + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_event_trigger_create")] + internal static extern MediaVisionError EventTriggerCreate(string eventType, out IntPtr trigger); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_event_trigger_destroy")] - internal static extern int EventTriggerDestroy(IntPtr trigger); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_event_trigger_destroy")] + internal static extern int EventTriggerDestroy(IntPtr trigger); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_event_trigger_type")] - internal static extern int GetEventTriggerType(IntPtr trigger, out string eventType); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_event_trigger_type")] + internal static extern int GetEventTriggerType(IntPtr trigger, out string eventType); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_set_event_trigger_roi")] - internal static extern MediaVisionError SetEventTriggerRoi(IntPtr trigger, int numberOfPoints, Point[] roi); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_set_event_trigger_roi")] + internal static extern MediaVisionError SetEventTriggerRoi(IntPtr trigger, int numberOfPoints, Point[] roi); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_event_trigger_roi")] - internal static extern MediaVisionError GetEventTriggerRoi(IntPtr trigger, out int numberOfPoints, out IntPtr roi); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_event_trigger_roi")] + internal static extern MediaVisionError GetEventTriggerRoi(IntPtr trigger, out int numberOfPoints, out IntPtr roi); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_subscribe_event_trigger")] - internal static extern MediaVisionError SubscribeEventTrigger(IntPtr trigger, int videoStreamId, - IntPtr engineCfg, EventOccurredCallback callback, IntPtr userData = default(IntPtr)); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_subscribe_event_trigger")] + internal static extern MediaVisionError SubscribeEventTrigger(IntPtr trigger, int videoStreamId, + IntPtr engineCfg, EventOccurredCallback callback, IntPtr userData = default(IntPtr)); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_unsubscribe_event_trigger")] - internal static extern MediaVisionError UnsubscribeEventTrigger(IntPtr trigger, int videoStreamId); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_unsubscribe_event_trigger")] + internal static extern MediaVisionError UnsubscribeEventTrigger(IntPtr trigger, int videoStreamId); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_push_source")] - internal static extern MediaVisionError PushSource(IntPtr source, int videoStreamId); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_push_source")] + internal static extern MediaVisionError PushSource(IntPtr source, int videoStreamId); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_foreach_supported_event_type")] - internal static extern int ForeachSupportedEventType(EventTypeCallback callback, IntPtr userData); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_foreach_supported_event_type")] + internal static extern int ForeachSupportedEventType(EventTypeCallback callback, IntPtr userData); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_foreach_event_result_name")] - internal static extern int ForeachEventResultName(string eventType, EventResultNameCallback callback, - IntPtr userData); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_foreach_event_result_name")] + internal static extern int ForeachEventResultName(string eventType, EventResultNameCallback callback, + IntPtr userData); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, out int value); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] + internal static extern MediaVisionError GetResultValue(IntPtr result, string name, out int value); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] int[] value); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] + internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] int[] value); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] double[] value); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] + internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] double[] value); - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] Rectangle[] value); + [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] + internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] Rectangle[] value); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EventOccurredCallback(IntPtr trigger, IntPtr source, - int videoStreamId, IntPtr eventResult, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void EventOccurredCallback(IntPtr trigger, IntPtr source, + int videoStreamId, IntPtr eventResult, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool EventTypeCallback(string eventType, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool EventTypeCallback(string eventType, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool EventResultNameCallback(string name, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool EventResultNameCallback(string name, IntPtr userData); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.MetadataEditor.cs b/src/Tizen.Multimedia/Interop/Interop.MetadataEditor.cs old mode 100755 new mode 100644 index c187e7b..9f988c4 --- a/src/Tizen.Multimedia/Interop/Interop.MetadataEditor.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MetadataEditor.cs @@ -1,36 +1,38 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class MetadataEditor + internal static partial class Interop { - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_create")] - internal static extern MetadataEditorError Create(out IntPtr handle); + internal static partial class MetadataEditor + { + [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_create")] + internal static extern MetadataEditorError Create(out IntPtr handle); - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_set_path")] - internal static extern MetadataEditorError SetPath(IntPtr handle, string path); + [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_set_path")] + internal static extern MetadataEditorError SetPath(IntPtr handle, string path); - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_destroy")] - internal static extern MetadataEditorError Destroy(IntPtr handle); + [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_destroy")] + internal static extern MetadataEditorError Destroy(IntPtr handle); - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_get_metadata")] - internal static extern MetadataEditorError GetMetadata(IntPtr handle, MetadataEditorAttr attribute, out IntPtr value); + [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_get_metadata")] + internal static extern MetadataEditorError GetMetadata(IntPtr handle, MetadataEditorAttr attribute, out IntPtr value); - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_set_metadata")] - internal static extern MetadataEditorError SetMetadata(IntPtr handle, MetadataEditorAttr attribute, string value); + [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_set_metadata")] + internal static extern MetadataEditorError SetMetadata(IntPtr handle, MetadataEditorAttr attribute, string value); - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_update_metadata")] - internal static extern MetadataEditorError UpdateMetadata(IntPtr handle); + [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_update_metadata")] + internal static extern MetadataEditorError UpdateMetadata(IntPtr handle); - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_get_picture")] - internal static extern MetadataEditorError GetPicture(IntPtr handle, int index, out IntPtr picture, out int size, out IntPtr mimeType); + [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_get_picture")] + internal static extern MetadataEditorError GetPicture(IntPtr handle, int index, out IntPtr picture, out int size, out IntPtr mimeType); - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_append_picture")] - internal static extern MetadataEditorError AddPicture(IntPtr handle, string path); + [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_append_picture")] + internal static extern MetadataEditorError AddPicture(IntPtr handle, string path); - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_remove_picture")] - internal static extern MetadataEditorError RemovePicture(IntPtr handle, int index); + [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_remove_picture")] + internal static extern MetadataEditorError RemovePicture(IntPtr handle, int index); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.MetadataExtractor.cs b/src/Tizen.Multimedia/Interop/Interop.MetadataExtractor.cs old mode 100755 new mode 100644 index 54a393f..14f9b4a --- a/src/Tizen.Multimedia/Interop/Interop.MetadataExtractor.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MetadataExtractor.cs @@ -1,55 +1,57 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class MetadataExtractor + internal static partial class Interop { - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_create")] - internal static extern MetadataExtractorError Create(out IntPtr handle); - - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_set_path")] - internal static extern MetadataExtractorError SetPath(IntPtr handle, string path); + internal static partial class MetadataExtractor + { + [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_create")] + internal static extern MetadataExtractorError Create(out IntPtr handle); - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_set_buffer")] - internal static extern MetadataExtractorError SetBuffer(IntPtr handle, IntPtr buffer, int size); + [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_set_path")] + internal static extern MetadataExtractorError SetPath(IntPtr handle, string path); - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_destroy")] - internal static extern MetadataExtractorError Destroy(IntPtr handle); + [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_set_buffer")] + internal static extern MetadataExtractorError SetBuffer(IntPtr handle, IntPtr buffer, int size); - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_metadata")] - private static extern MetadataExtractorError GetMetadata(IntPtr handle, MetadataExtractorAttr attribute, out IntPtr value); + [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_destroy")] + internal static extern MetadataExtractorError Destroy(IntPtr handle); - internal static string GetMetadata(IntPtr handle, MetadataExtractorAttr attr) - { - IntPtr valuePtr = IntPtr.Zero; + [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_metadata")] + private static extern MetadataExtractorError GetMetadata(IntPtr handle, MetadataExtractorAttr attribute, out IntPtr value); - try + internal static string GetMetadata(IntPtr handle, MetadataExtractorAttr attr) { - var ret = GetMetadata(handle, attr, out valuePtr); - MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get value for " + attr); - return Marshal.PtrToStringAnsi(valuePtr); + IntPtr valuePtr = IntPtr.Zero; + + try + { + var ret = GetMetadata(handle, attr, out valuePtr); + MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get value for " + attr); + return Marshal.PtrToStringAnsi(valuePtr); + } + finally + { + Libc.Free(valuePtr); + } } - finally - { - Libc.Free(valuePtr); - } - } - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_artwork")] - internal static extern MetadataExtractorError GetArtwork(IntPtr handle, out IntPtr artwork, - out int size, out IntPtr mimeType); + [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_artwork")] + internal static extern MetadataExtractorError GetArtwork(IntPtr handle, out IntPtr artwork, + out int size, out IntPtr mimeType); - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_frame")] - internal static extern MetadataExtractorError GetFrame(IntPtr handle, out IntPtr frame, out int size); + [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_frame")] + internal static extern MetadataExtractorError GetFrame(IntPtr handle, out IntPtr frame, out int size); - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_synclyrics")] - internal static extern MetadataExtractorError GetSynclyrics(IntPtr handle, int index, - out uint timeStamp, out IntPtr lyrics); + [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_synclyrics")] + internal static extern MetadataExtractorError GetSynclyrics(IntPtr handle, int index, + out uint timeStamp, out IntPtr lyrics); - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_frame_at_time")] - internal static extern MetadataExtractorError GetFrameAtTime(IntPtr handle, uint timeStamp, - bool isAccurate, out IntPtr frame, out int size); + [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_frame_at_time")] + internal static extern MetadataExtractorError GetFrameAtTime(IntPtr handle, uint timeStamp, + bool isAccurate, out IntPtr frame, out int size); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.Player.cs b/src/Tizen.Multimedia/Interop/Interop.Player.cs index 7cecaa9..047e887 100644 --- a/src/Tizen.Multimedia/Interop/Interop.Player.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Player.cs @@ -1,287 +1,290 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class Player + internal static partial class Interop { + internal static partial class Player + { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PlaybackCompletedCallback(IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PlaybackCompletedCallback(IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PlaybackInterruptedCallback(int code, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PlaybackInterruptedCallback(int code, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PlaybackErrorCallback(int code, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PlaybackErrorCallback(int code, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VideoFrameDecodedCallback(IntPtr packetHandle, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void VideoFrameDecodedCallback(IntPtr packetHandle, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SubtitleUpdatedCallback(uint duration, string text, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void SubtitleUpdatedCallback(uint duration, string text, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void BufferingProgressCallback(int percent, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void BufferingProgressCallback(int percent, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VideoStreamChangedCallback(int width, int height, int fps, int bitrate, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void VideoStreamChangedCallback(int width, int height, int fps, int bitrate, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MediaStreamBufferStatusCallback(int status, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void MediaStreamBufferStatusCallback(int status, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MediaStreamSeekCallback(ulong offset, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void MediaStreamSeekCallback(ulong offset, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VideoCaptureCallback(IntPtr data, int width, int height, uint size, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void VideoCaptureCallback(IntPtr data, int width, int height, uint size, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PrepareCallback(IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PrepareCallback(IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SeekCompletedCallback(IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void SeekCompletedCallback(IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_create")] - internal static extern int Create(out IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_create")] + internal static extern int Create(out IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_destroy")] - internal static extern int Destroy(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_destroy")] + internal static extern int Destroy(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_prepare")] - internal static extern int Prepare(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_prepare")] + internal static extern int Prepare(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_prepare_async")] - internal static extern int PrepareAsync(IntPtr player, PrepareCallback cb, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_prepare_async")] + internal static extern int PrepareAsync(IntPtr player, PrepareCallback cb, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_unprepare")] - internal static extern int Unprepare(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_unprepare")] + internal static extern int Unprepare(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_set_uri")] - internal static extern int SetUri(IntPtr player, string uri); + [DllImport(Libraries.Player, EntryPoint = "player_set_uri")] + internal static extern int SetUri(IntPtr player, string uri); - [DllImport(Libraries.Player, EntryPoint = "player_set_display")] - internal static extern int SetDisplay(IntPtr player, int type, IntPtr display); + [DllImport(Libraries.Player, EntryPoint = "player_set_display")] + internal static extern int SetDisplay(IntPtr player, int type, IntPtr display); - [DllImport(Libraries.Player, EntryPoint = "player_start")] - internal static extern int Start(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_start")] + internal static extern int Start(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_stop")] - internal static extern int Stop(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_stop")] + internal static extern int Stop(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_pause")] - internal static extern int Pause(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_pause")] + internal static extern int Pause(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_set_memory_buffer")] - internal static extern int SetMemoryBuffer(IntPtr player, byte[] data, int size); + [DllImport(Libraries.Player, EntryPoint = "player_set_memory_buffer")] + internal static extern int SetMemoryBuffer(IntPtr player, byte[] data, int size); - [DllImport(Libraries.Player, EntryPoint = "player_get_state")] - internal static extern int GetState(IntPtr player, out int state); + [DllImport(Libraries.Player, EntryPoint = "player_get_state")] + internal static extern int GetState(IntPtr player, out int state); - [DllImport(Libraries.Player, EntryPoint = "player_set_volume")] - internal static extern int SetVolume(IntPtr player, float left, float right); + [DllImport(Libraries.Player, EntryPoint = "player_set_volume")] + internal static extern int SetVolume(IntPtr player, float left, float right); - [DllImport(Libraries.Player, EntryPoint = "player_get_volume")] - internal static extern int GetVolume(IntPtr player, out float left, out float right); + [DllImport(Libraries.Player, EntryPoint = "player_get_volume")] + internal static extern int GetVolume(IntPtr player, out float left, out float right); - [DllImport(Libraries.Player, EntryPoint = "player_set_sound_stream_info")] - internal static extern int SetAudioPolicyInfo(IntPtr player, IntPtr streamInfo); + [DllImport(Libraries.Player, EntryPoint = "player_set_sound_stream_info")] + internal static extern int SetAudioPolicyInfo(IntPtr player, IntPtr streamInfo); - [DllImport(Libraries.Player, EntryPoint = "player_set_audio_latency_mode")] - internal static extern int SetAudioLatencyMode(IntPtr player, int latencyMode); + [DllImport(Libraries.Player, EntryPoint = "player_set_audio_latency_mode")] + internal static extern int SetAudioLatencyMode(IntPtr player, int latencyMode); - [DllImport(Libraries.Player, EntryPoint = "player_get_audio_latency_mode")] - internal static extern int GetAudioLatencyMode(IntPtr player, out int latencyMode); + [DllImport(Libraries.Player, EntryPoint = "player_get_audio_latency_mode")] + internal static extern int GetAudioLatencyMode(IntPtr player, out int latencyMode); - [DllImport(Libraries.Player, EntryPoint = "player_get_play_position")] - internal static extern int GetPlayPosition(IntPtr player, out int millisecond); + [DllImport(Libraries.Player, EntryPoint = "player_get_play_position")] + internal static extern int GetPlayPosition(IntPtr player, out int millisecond); - [DllImport(Libraries.Player, EntryPoint = "player_set_play_position")] - internal static extern int SetPlayPosition(IntPtr player, int millisecond, bool accurate, SeekCompletedCallback cb, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_set_play_position")] + internal static extern int SetPlayPosition(IntPtr player, int millisecond, bool accurate, SeekCompletedCallback cb, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_set_mute")] - internal static extern int SetMute(IntPtr player, bool muted); + [DllImport(Libraries.Player, EntryPoint = "player_set_mute")] + internal static extern int SetMute(IntPtr player, bool muted); - [DllImport(Libraries.Player, EntryPoint = "player_is_muted")] - internal static extern int IsMuted(IntPtr player, out bool muted); + [DllImport(Libraries.Player, EntryPoint = "player_is_muted")] + internal static extern int IsMuted(IntPtr player, out bool muted); - [DllImport(Libraries.Player, EntryPoint = "player_set_looping")] - internal static extern int SetLooping(IntPtr player, bool looping); + [DllImport(Libraries.Player, EntryPoint = "player_set_looping")] + internal static extern int SetLooping(IntPtr player, bool looping); - [DllImport(Libraries.Player, EntryPoint = "player_is_looping")] - internal static extern int IsLooping(IntPtr player, out bool looping); + [DllImport(Libraries.Player, EntryPoint = "player_is_looping")] + internal static extern int IsLooping(IntPtr player, out bool looping); - [DllImport(Libraries.Player, EntryPoint = "player_set_completed_cb")] - internal static extern int SetCompletedCb(IntPtr player, PlaybackCompletedCallback callback, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_set_completed_cb")] + internal static extern int SetCompletedCb(IntPtr player, PlaybackCompletedCallback callback, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_unset_completed_cb")] - internal static extern int UnsetCompletedCb(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_unset_completed_cb")] + internal static extern int UnsetCompletedCb(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_set_interrupted_cb")] - internal static extern int SetInterruptedCb(IntPtr player, PlaybackInterruptedCallback callback, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_set_interrupted_cb")] + internal static extern int SetInterruptedCb(IntPtr player, PlaybackInterruptedCallback callback, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_unset_interrupted_cb")] - internal static extern int UnsetInterruptedCb(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_unset_interrupted_cb")] + internal static extern int UnsetInterruptedCb(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_set_error_cb")] - internal static extern int SetErrorCb(IntPtr player, PlaybackErrorCallback callback, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_set_error_cb")] + internal static extern int SetErrorCb(IntPtr player, PlaybackErrorCallback callback, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_unset_error_cb")] - internal static extern int UnsetErrorCb(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_unset_error_cb")] + internal static extern int UnsetErrorCb(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_capture_video")] - internal static extern int CaptureVideo(IntPtr player, VideoCaptureCallback callback, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_capture_video")] + internal static extern int CaptureVideo(IntPtr player, VideoCaptureCallback callback, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_set_media_packet_video_frame_decoded_cb")] - internal static extern int SetVideoFrameDecodedCb(IntPtr player, VideoFrameDecodedCallback callback, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_set_media_packet_video_frame_decoded_cb")] + internal static extern int SetVideoFrameDecodedCb(IntPtr player, VideoFrameDecodedCallback callback, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_unset_media_packet_video_frame_decoded_cb")] - internal static extern int UnsetVideoFrameDecodedCb(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_unset_media_packet_video_frame_decoded_cb")] + internal static extern int UnsetVideoFrameDecodedCb(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_set_streaming_cookie")] - internal static extern int SetStreamingCookie(IntPtr player, string cookie, int size); + [DllImport(Libraries.Player, EntryPoint = "player_set_streaming_cookie")] + internal static extern int SetStreamingCookie(IntPtr player, string cookie, int size); - [DllImport(Libraries.Player, EntryPoint = "player_set_streaming_user_agent")] - internal static extern int SetStreamingUserAgent(IntPtr player, string userAgent, int size); + [DllImport(Libraries.Player, EntryPoint = "player_set_streaming_user_agent")] + internal static extern int SetStreamingUserAgent(IntPtr player, string userAgent, int size); - [DllImport(Libraries.Player, EntryPoint = "player_get_streaming_download_progress")] - internal static extern int GetStreamingDownloadProgress(IntPtr player, out int start, out int current); + [DllImport(Libraries.Player, EntryPoint = "player_get_streaming_download_progress")] + internal static extern int GetStreamingDownloadProgress(IntPtr player, out int start, out int current); - [DllImport(Libraries.Player, EntryPoint = "player_set_buffering_cb")] - internal static extern int SetBufferingCb(IntPtr player, BufferingProgressCallback callback, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_set_buffering_cb")] + internal static extern int SetBufferingCb(IntPtr player, BufferingProgressCallback callback, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_unset_buffering_cb")] - internal static extern int UnsetBufferingCb(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_unset_buffering_cb")] + internal static extern int UnsetBufferingCb(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_set_playback_rate")] - internal static extern int SetPlaybackRate(IntPtr player, float rate); + [DllImport(Libraries.Player, EntryPoint = "player_set_playback_rate")] + internal static extern int SetPlaybackRate(IntPtr player, float rate); - [DllImport(Libraries.Player, EntryPoint = "player_push_media_stream")] - internal static extern int PushMediaStream(IntPtr player, IntPtr packet); + [DllImport(Libraries.Player, EntryPoint = "player_push_media_stream")] + internal static extern int PushMediaStream(IntPtr player, IntPtr packet); - [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_info")] - internal static extern int SetMediaStreamInfo(IntPtr player, int type, IntPtr format); + [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_info")] + internal static extern int SetMediaStreamInfo(IntPtr player, int type, IntPtr format); - [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_buffer_status_cb")] - internal static extern int SetMediaStreamBufferStatusCb(IntPtr player, int type, MediaStreamBufferStatusCallback callback, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_buffer_status_cb")] + internal static extern int SetMediaStreamBufferStatusCb(IntPtr player, int type, MediaStreamBufferStatusCallback callback, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_unset_media_stream_buffer_status_cb")] - internal static extern int UnsetMediaStreamBufferStatusCb(IntPtr player, int type); + [DllImport(Libraries.Player, EntryPoint = "player_unset_media_stream_buffer_status_cb")] + internal static extern int UnsetMediaStreamBufferStatusCb(IntPtr player, int type); - [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_seek_cb")] - internal static extern int SetMediaStreamSeekCb(IntPtr player, int type, MediaStreamSeekCallback callback, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_seek_cb")] + internal static extern int SetMediaStreamSeekCb(IntPtr player, int type, MediaStreamSeekCallback callback, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_unset_media_stream_seek_cb")] - internal static extern int UnsetMediaStreamSeekCb(IntPtr player, int type); + [DllImport(Libraries.Player, EntryPoint = "player_unset_media_stream_seek_cb")] + internal static extern int UnsetMediaStreamSeekCb(IntPtr player, int type); - [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_buffer_max_size")] - internal static extern int SetMediaStreamBufferMaxSize(IntPtr player, int type, ulong maxSize); + [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_buffer_max_size")] + internal static extern int SetMediaStreamBufferMaxSize(IntPtr player, int type, ulong maxSize); - [DllImport(Libraries.Player, EntryPoint = "player_get_media_stream_buffer_max_size")] - internal static extern int GetMediaStreamBufferMaxSize(IntPtr player, int type, out ulong maxSize); + [DllImport(Libraries.Player, EntryPoint = "player_get_media_stream_buffer_max_size")] + internal static extern int GetMediaStreamBufferMaxSize(IntPtr player, int type, out ulong maxSize); - [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_buffer_min_threshold")] - internal static extern int SetMediaStreamBufferMinThreshold(IntPtr player, int type, uint percent); + [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_buffer_min_threshold")] + internal static extern int SetMediaStreamBufferMinThreshold(IntPtr player, int type, uint percent); - [DllImport(Libraries.Player, EntryPoint = "player_get_media_stream_buffer_min_threshold")] - internal static extern int GetMediaStreamBufferMinThreshold(IntPtr player, int type, out uint percent); + [DllImport(Libraries.Player, EntryPoint = "player_get_media_stream_buffer_min_threshold")] + internal static extern int GetMediaStreamBufferMinThreshold(IntPtr player, int type, out uint percent); - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_bands_count")] - internal static extern int AudioEffectGetEqualizerBandsCount(IntPtr player, out int count); + [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_bands_count")] + internal static extern int AudioEffectGetEqualizerBandsCount(IntPtr player, out int count); - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_set_equalizer_band_level")] - internal static extern int AudioEffectSetEqualizerBandLevel(IntPtr player, int index, int level); + [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_set_equalizer_band_level")] + internal static extern int AudioEffectSetEqualizerBandLevel(IntPtr player, int index, int level); - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_level")] - internal static extern int AudioEffectGetEqualizerBandLevel(IntPtr player, int index, out int level); + [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_level")] + internal static extern int AudioEffectGetEqualizerBandLevel(IntPtr player, int index, out int level); - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_set_equalizer_all_bands")] - internal static extern int AudioEffectSetEqualizerAllBands(IntPtr player, out int band_levels, int length); + [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_set_equalizer_all_bands")] + internal static extern int AudioEffectSetEqualizerAllBands(IntPtr player, out int band_levels, int length); - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_level_range")] - internal static extern int AudioEffectGetEqualizerLevelRange(IntPtr player, out int min, out int max); + [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_level_range")] + internal static extern int AudioEffectGetEqualizerLevelRange(IntPtr player, out int min, out int max); - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_frequency")] - internal static extern int AudioEffectGetEqualizerBandFrequency(IntPtr player, int index, out int frequency); + [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_frequency")] + internal static extern int AudioEffectGetEqualizerBandFrequency(IntPtr player, int index, out int frequency); - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_frequency_range")] - internal static extern int AudioEffectGetEqualizerBandFrequencyRange(IntPtr player, int index, out int range); + [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_frequency_range")] + internal static extern int AudioEffectGetEqualizerBandFrequencyRange(IntPtr player, int index, out int range); - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_equalizer_clear")] - internal static extern int AudioEffectEqualizerClear(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_equalizer_clear")] + internal static extern int AudioEffectEqualizerClear(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_equalizer_is_available")] - internal static extern int AudioEffectEqualizerIsAvailable(IntPtr player, out bool available); + [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_equalizer_is_available")] + internal static extern int AudioEffectEqualizerIsAvailable(IntPtr player, out bool available); - [DllImport(Libraries.Player, EntryPoint = "player_set_display_mode")] - internal static extern int SetDisplayMode(IntPtr player, int mode); + [DllImport(Libraries.Player, EntryPoint = "player_set_display_mode")] + internal static extern int SetDisplayMode(IntPtr player, int mode); - [DllImport(Libraries.Player, EntryPoint = "player_get_display_mode")] - internal static extern int GetDisplayMode(IntPtr player, out int mode); + [DllImport(Libraries.Player, EntryPoint = "player_get_display_mode")] + internal static extern int GetDisplayMode(IntPtr player, out int mode); - [DllImport(Libraries.Player, EntryPoint = "player_set_display_visible")] - internal static extern int SetDisplayVisible(IntPtr player, bool visible); + [DllImport(Libraries.Player, EntryPoint = "player_set_display_visible")] + internal static extern int SetDisplayVisible(IntPtr player, bool visible); - [DllImport(Libraries.Player, EntryPoint = "player_is_display_visible")] - internal static extern int IsDisplayVisible(IntPtr player, out bool visible); + [DllImport(Libraries.Player, EntryPoint = "player_is_display_visible")] + internal static extern int IsDisplayVisible(IntPtr player, out bool visible); - [DllImport(Libraries.Player, EntryPoint = "player_set_display_rotation")] - internal static extern int SetDisplayRotation(IntPtr player, int rotation); + [DllImport(Libraries.Player, EntryPoint = "player_set_display_rotation")] + internal static extern int SetDisplayRotation(IntPtr player, int rotation); - [DllImport(Libraries.Player, EntryPoint = "player_get_display_rotation")] - internal static extern int GetDisplayRotation(IntPtr player, out int rotation); + [DllImport(Libraries.Player, EntryPoint = "player_get_display_rotation")] + internal static extern int GetDisplayRotation(IntPtr player, out int rotation); - [DllImport(Libraries.Player, EntryPoint = "player_get_content_info")] - internal static extern int GetContentInfo(IntPtr player, int key, out IntPtr value); + [DllImport(Libraries.Player, EntryPoint = "player_get_content_info")] + internal static extern int GetContentInfo(IntPtr player, int key, out IntPtr value); - [DllImport(Libraries.Player, EntryPoint = "player_get_codec_info")] - internal static extern int GetCodecInfo(IntPtr player, out IntPtr audioCodec, out IntPtr videoCodec); + [DllImport(Libraries.Player, EntryPoint = "player_get_codec_info")] + internal static extern int GetCodecInfo(IntPtr player, out IntPtr audioCodec, out IntPtr videoCodec); - [DllImport(Libraries.Player, EntryPoint = "player_get_audio_stream_info")] - internal static extern int GetAudioStreamInfo(IntPtr player, out int sampleRate, out int channel, out int bitRate); + [DllImport(Libraries.Player, EntryPoint = "player_get_audio_stream_info")] + internal static extern int GetAudioStreamInfo(IntPtr player, out int sampleRate, out int channel, out int bitRate); - [DllImport(Libraries.Player, EntryPoint = "player_get_video_stream_info")] - internal static extern int GetVideoStreamInfo(IntPtr player, out int fps, out int bitRate); + [DllImport(Libraries.Player, EntryPoint = "player_get_video_stream_info")] + internal static extern int GetVideoStreamInfo(IntPtr player, out int fps, out int bitRate); - [DllImport(Libraries.Player, EntryPoint = "player_get_album_art")] - internal static extern int GetAlbumArt(IntPtr player, out IntPtr albumArt, out int size); + [DllImport(Libraries.Player, EntryPoint = "player_get_album_art")] + internal static extern int GetAlbumArt(IntPtr player, out IntPtr albumArt, out int size); - [DllImport(Libraries.Player, EntryPoint = "player_get_video_size")] - internal static extern int GetVideoSize(IntPtr player, out int width, out int height); + [DllImport(Libraries.Player, EntryPoint = "player_get_video_size")] + internal static extern int GetVideoSize(IntPtr player, out int width, out int height); - [DllImport(Libraries.Player, EntryPoint = "player_get_duration")] - internal static extern int GetDuration(IntPtr player, out int duration); + [DllImport(Libraries.Player, EntryPoint = "player_get_duration")] + internal static extern int GetDuration(IntPtr player, out int duration); - [DllImport(Libraries.Player, EntryPoint = "player_set_subtitle_path")] - internal static extern int SetSubtitlePath(IntPtr player, string path); + [DllImport(Libraries.Player, EntryPoint = "player_set_subtitle_path")] + internal static extern int SetSubtitlePath(IntPtr player, string path); - [DllImport(Libraries.Player, EntryPoint = "player_set_subtitle_updated_cb")] - internal static extern int SetSubtitleUpdatedCb(IntPtr player, SubtitleUpdatedCallback callback, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_set_subtitle_updated_cb")] + internal static extern int SetSubtitleUpdatedCb(IntPtr player, SubtitleUpdatedCallback callback, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_unset_subtitle_updated_cb")] - internal static extern int UnsetSubtitleUpdatedCb(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_unset_subtitle_updated_cb")] + internal static extern int UnsetSubtitleUpdatedCb(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_set_subtitle_position_offset")] - internal static extern int SetSubtitlePositionOffset(IntPtr player, int millisecond); + [DllImport(Libraries.Player, EntryPoint = "player_set_subtitle_position_offset")] + internal static extern int SetSubtitlePositionOffset(IntPtr player, int millisecond); - [DllImport(Libraries.Player, EntryPoint = "player_set_video_stream_changed_cb")] - internal static extern int SetVideoStreamChangedCb(IntPtr player, VideoStreamChangedCallback callback, IntPtr userData); + [DllImport(Libraries.Player, EntryPoint = "player_set_video_stream_changed_cb")] + internal static extern int SetVideoStreamChangedCb(IntPtr player, VideoStreamChangedCallback callback, IntPtr userData); - [DllImport(Libraries.Player, EntryPoint = "player_unset_video_stream_changed_cb")] - internal static extern int UnsetVideoStreamChangedCb(IntPtr player); + [DllImport(Libraries.Player, EntryPoint = "player_unset_video_stream_changed_cb")] + internal static extern int UnsetVideoStreamChangedCb(IntPtr player); - [DllImport(Libraries.Player, EntryPoint = "player_get_track_count")] - internal static extern int GetTrackCount(IntPtr player, int type, out int count); + [DllImport(Libraries.Player, EntryPoint = "player_get_track_count")] + internal static extern int GetTrackCount(IntPtr player, int type, out int count); - [DllImport(Libraries.Player, EntryPoint = "player_select_track")] - internal static extern int SelectTrack(IntPtr player, int type, int index); + [DllImport(Libraries.Player, EntryPoint = "player_select_track")] + internal static extern int SelectTrack(IntPtr player, int type, int index); - [DllImport(Libraries.Player, EntryPoint = "player_get_current_track")] - internal static extern int GetCurrentTrack(IntPtr player, int type, out int index); + [DllImport(Libraries.Player, EntryPoint = "player_get_current_track")] + internal static extern int GetCurrentTrack(IntPtr player, int type, out int index); - [DllImport(Libraries.Player, EntryPoint = "player_get_track_language_code")] - internal static extern int GetTrackLanguageCode(IntPtr player, int type, int index, out IntPtr code); + [DllImport(Libraries.Player, EntryPoint = "player_get_track_language_code")] + internal static extern int GetTrackLanguageCode(IntPtr player, int type, int index, out IntPtr code); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.Radio.cs b/src/Tizen.Multimedia/Interop/Interop.Radio.cs old mode 100755 new mode 100644 index fc53c11..cbb80f8 --- a/src/Tizen.Multimedia/Interop/Interop.Radio.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Radio.cs @@ -17,238 +17,241 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - internal enum RadioState + internal static partial class Interop { - Ready, // RADIO_STATE_READY - Playing, // RADIO_STATE_PLAYING - Scanning, // RADIO_STATE_SCANNING - } + internal enum RadioState + { + Ready, // RADIO_STATE_READY + Playing, // RADIO_STATE_PLAYING + Scanning, // RADIO_STATE_SCANNING + } - internal enum RadioInterruptedReason - { - Completed, // RADIO_INTERRUPTED_COMPLETED - Media, // RADIO_INTERRUPTED_BY_MEDIA - Call, // RADIO_INTERRUPTED_BY_CALL - EarjackUnplug, // RADIO_INTERRUPTED_BY_EARJACK_UNPLUG - ResourceConflict, // RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT - Alarm, // RADIO_INTERRUPTED_BY_ALARM - Emergency, // RADIO_INTERRUPTED_BY_EMERGENCY - ResumableMedia, // RADIO_INTERRUPTED_BY_RESUMABLE_MEDIA - Notification, // RADIO_INTERRUPTED_BY_NOTIFICATION - } + internal enum RadioInterruptedReason + { + Completed, // RADIO_INTERRUPTED_COMPLETED + Media, // RADIO_INTERRUPTED_BY_MEDIA + Call, // RADIO_INTERRUPTED_BY_CALL + EarjackUnplug, // RADIO_INTERRUPTED_BY_EARJACK_UNPLUG + ResourceConflict, // RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT + Alarm, // RADIO_INTERRUPTED_BY_ALARM + Emergency, // RADIO_INTERRUPTED_BY_EMERGENCY + ResumableMedia, // RADIO_INTERRUPTED_BY_RESUMABLE_MEDIA + Notification, // RADIO_INTERRUPTED_BY_NOTIFICATION + } - [DllImport(Libraries.Radio, EntryPoint = "radio_get_state")] - internal static extern ErrorCode GetState(this RadioHandle /* radio_h */ radio, out RadioState /* radio_state_e */ state); + [DllImport(Libraries.Radio, EntryPoint = "radio_get_state")] + internal static extern ErrorCode GetState(this RadioHandle /* radio_h */ radio, out RadioState /* radio_state_e */ state); - [DllImport(Libraries.Radio, EntryPoint = "radio_start")] - internal static extern ErrorCode Start(this RadioHandle /* radio_h */ radio); + [DllImport(Libraries.Radio, EntryPoint = "radio_start")] + internal static extern ErrorCode Start(this RadioHandle /* radio_h */ radio); - [DllImport(Libraries.Radio, EntryPoint = "radio_stop")] - internal static extern ErrorCode Stop(this RadioHandle /* radio_h */ radio); + [DllImport(Libraries.Radio, EntryPoint = "radio_stop")] + internal static extern ErrorCode Stop(this RadioHandle /* radio_h */ radio); - [DllImport(Libraries.Radio, EntryPoint = "radio_seek_up")] - internal static extern ErrorCode SeekUp(this RadioHandle /* radio_h */ radio, RadioHandle.SeekCompletedCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.Radio, EntryPoint = "radio_seek_up")] + internal static extern ErrorCode SeekUp(this RadioHandle /* radio_h */ radio, RadioHandle.SeekCompletedCallback callback, IntPtr /* void */ userData); - [DllImport(Libraries.Radio, EntryPoint = "radio_seek_down")] - internal static extern ErrorCode SeekDown(this RadioHandle /* radio_h */ radio, RadioHandle.SeekCompletedCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.Radio, EntryPoint = "radio_seek_down")] + internal static extern ErrorCode SeekDown(this RadioHandle /* radio_h */ radio, RadioHandle.SeekCompletedCallback callback, IntPtr /* void */ userData); - [DllImport(Libraries.Radio, EntryPoint = "radio_set_frequency")] - internal static extern ErrorCode SetFrequency(this RadioHandle /* radio_h */ radio, int frequency); + [DllImport(Libraries.Radio, EntryPoint = "radio_set_frequency")] + internal static extern ErrorCode SetFrequency(this RadioHandle /* radio_h */ radio, int frequency); - [DllImport(Libraries.Radio, EntryPoint = "radio_get_frequency")] - internal static extern ErrorCode GetFrequency(this RadioHandle /* radio_h */ radio, out int frequency); + [DllImport(Libraries.Radio, EntryPoint = "radio_get_frequency")] + internal static extern ErrorCode GetFrequency(this RadioHandle /* radio_h */ radio, out int frequency); - [DllImport(Libraries.Radio, EntryPoint = "radio_get_signal_strength")] - internal static extern ErrorCode GetSignalStrength(this RadioHandle /* radio_h */ radio, out int strength); + [DllImport(Libraries.Radio, EntryPoint = "radio_get_signal_strength")] + internal static extern ErrorCode GetSignalStrength(this RadioHandle /* radio_h */ radio, out int strength); - [DllImport(Libraries.Radio, EntryPoint = "radio_scan_start")] - internal static extern ErrorCode ScanStart(this RadioHandle /* radio_h */ radio, RadioHandle.ScanUpdatedCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.Radio, EntryPoint = "radio_scan_start")] + internal static extern ErrorCode ScanStart(this RadioHandle /* radio_h */ radio, RadioHandle.ScanUpdatedCallback callback, IntPtr /* void */ userData); - [DllImport(Libraries.Radio, EntryPoint = "radio_scan_stop")] - internal static extern ErrorCode ScanStop(this RadioHandle /* radio_h */ radio, RadioHandle.ScanStoppedCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.Radio, EntryPoint = "radio_scan_stop")] + internal static extern ErrorCode ScanStop(this RadioHandle /* radio_h */ radio, RadioHandle.ScanStoppedCallback callback, IntPtr /* void */ userData); - [DllImport(Libraries.Radio, EntryPoint = "radio_set_mute")] - internal static extern ErrorCode SetMute(this RadioHandle /* radio_h */ radio, bool muted); + [DllImport(Libraries.Radio, EntryPoint = "radio_set_mute")] + internal static extern ErrorCode SetMute(this RadioHandle /* radio_h */ radio, bool muted); - [DllImport(Libraries.Radio, EntryPoint = "radio_is_muted")] - internal static extern ErrorCode GetMuted(this RadioHandle /* radio_h */ radio, out bool muted); + [DllImport(Libraries.Radio, EntryPoint = "radio_is_muted")] + internal static extern ErrorCode GetMuted(this RadioHandle /* radio_h */ radio, out bool muted); - [DllImport(Libraries.Radio, EntryPoint = "radio_set_scan_completed_cb")] - internal static extern ErrorCode SetScanCompletedCb(this RadioHandle /* radio_h */ radio, RadioHandle.ScanCompletedCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.Radio, EntryPoint = "radio_set_scan_completed_cb")] + internal static extern ErrorCode SetScanCompletedCb(this RadioHandle /* radio_h */ radio, RadioHandle.ScanCompletedCallback callback, IntPtr /* void */ userData); - [DllImport(Libraries.Radio, EntryPoint = "radio_unset_scan_completed_cb")] - internal static extern ErrorCode UnsetScanCompletedCb(this RadioHandle /* radio_h */ radio); + [DllImport(Libraries.Radio, EntryPoint = "radio_unset_scan_completed_cb")] + internal static extern ErrorCode UnsetScanCompletedCb(this RadioHandle /* radio_h */ radio); - [DllImport(Libraries.Radio, EntryPoint = "radio_set_interrupted_cb")] - internal static extern ErrorCode SetInterruptedCb(this RadioHandle /* radio_h */ radio, RadioHandle.InterruptedCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.Radio, EntryPoint = "radio_set_interrupted_cb")] + internal static extern ErrorCode SetInterruptedCb(this RadioHandle /* radio_h */ radio, RadioHandle.InterruptedCallback callback, IntPtr /* void */ userData); - [DllImport(Libraries.Radio, EntryPoint = "radio_unset_interrupted_cb")] - internal static extern ErrorCode UnsetInterruptedCb(this RadioHandle /* radio_h */ radio); + [DllImport(Libraries.Radio, EntryPoint = "radio_unset_interrupted_cb")] + internal static extern ErrorCode UnsetInterruptedCb(this RadioHandle /* radio_h */ radio); - [DllImport(Libraries.Radio, EntryPoint = "radio_get_frequency_range")] - internal static extern ErrorCode GetFrequencyRange(this RadioHandle /* radio_h */ radio, out int minFreq, out int maxFreq); + [DllImport(Libraries.Radio, EntryPoint = "radio_get_frequency_range")] + internal static extern ErrorCode GetFrequencyRange(this RadioHandle /* radio_h */ radio, out int minFreq, out int maxFreq); - [DllImport(Libraries.Radio, EntryPoint = "radio_get_channel_spacing")] - internal static extern ErrorCode GetChannelSpacing(this RadioHandle /* radio_h */ radio, out int channelSpacing); + [DllImport(Libraries.Radio, EntryPoint = "radio_get_channel_spacing")] + internal static extern ErrorCode GetChannelSpacing(this RadioHandle /* radio_h */ radio, out int channelSpacing); - [DllImport(Libraries.Radio, EntryPoint = "radio_set_volume")] - internal static extern ErrorCode SetVolume(this RadioHandle /* radio_h */ radio, float volume); + [DllImport(Libraries.Radio, EntryPoint = "radio_set_volume")] + internal static extern ErrorCode SetVolume(this RadioHandle /* radio_h */ radio, float volume); - [DllImport(Libraries.Radio, EntryPoint = "radio_get_volume")] - internal static extern ErrorCode GetVolume(this RadioHandle /* radio_h */ radio, out float volume); + [DllImport(Libraries.Radio, EntryPoint = "radio_get_volume")] + internal static extern ErrorCode GetVolume(this RadioHandle /* radio_h */ radio, out float volume); - internal struct RadioFrequencyRange - { - public int minFreq; - public int maxFreq; - } + internal struct RadioFrequencyRange + { + public int minFreq; + public int maxFreq; + } - internal class RadioHandle : SafeMultimediaHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SeekCompletedCallback(int frequency, IntPtr /* void */ userData); + internal class RadioHandle : SafeMultimediaHandle + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void SeekCompletedCallback(int frequency, IntPtr /* void */ userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ScanUpdatedCallback(int frequency, IntPtr /* void */ userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void ScanUpdatedCallback(int frequency, IntPtr /* void */ userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ScanStoppedCallback(IntPtr /* void */ userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void ScanStoppedCallback(IntPtr /* void */ userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ScanCompletedCallback(IntPtr /* void */ userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void ScanCompletedCallback(IntPtr /* void */ userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InterruptedCallback(RadioInterruptedReason /* radio_interrupted_code_e */ code, IntPtr /* void */ userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void InterruptedCallback(RadioInterruptedReason /* radio_interrupted_code_e */ code, IntPtr /* void */ userData); - [DllImport(Libraries.Radio, EntryPoint = "radio_create")] - internal static extern ErrorCode Create(out IntPtr /* radio_h */ radio); + [DllImport(Libraries.Radio, EntryPoint = "radio_create")] + internal static extern ErrorCode Create(out IntPtr /* radio_h */ radio); - [DllImport(Libraries.Radio, EntryPoint = "radio_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* radio_h */ radio); + [DllImport(Libraries.Radio, EntryPoint = "radio_destroy")] + internal static extern ErrorCode Destroy(IntPtr /* radio_h */ radio); - internal RadioHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease) - { - } + internal RadioHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease) + { + } - internal RadioHandle() : this(CreateNativeHandle(), true) - { - } + internal RadioHandle() : this(CreateNativeHandle(), true) + { + } - internal static IntPtr CreateNativeHandle() - { - IntPtr handle; - Create(out handle).ThrowIfFailed("Failed to create native handle"); - return handle; - } + internal static IntPtr CreateNativeHandle() + { + IntPtr handle; + Create(out handle).ThrowIfFailed("Failed to create native handle"); + return handle; + } - internal override ErrorCode DisposeNativeHandle() - { - ScanCompleteCb = null; - InteruptedCb = null; - return Destroy(handle); - } + internal override ErrorCode DisposeNativeHandle() + { + ScanCompleteCb = null; + InteruptedCb = null; + return Destroy(handle); + } - internal RadioState State - { - get { return NativeGet(this.GetState); } - } + internal RadioState State + { + get { return NativeGet(this.GetState); } + } - internal int Frequency - { - get { return NativeGet(this.GetFrequency); } - set { NativeSet(this.SetFrequency, value); } - } + internal int Frequency + { + get { return NativeGet(this.GetFrequency); } + set { NativeSet(this.SetFrequency, value); } + } - internal int SignalStrength - { - get { return NativeGet(this.GetSignalStrength); } - } + internal int SignalStrength + { + get { return NativeGet(this.GetSignalStrength); } + } - internal bool IsMuted - { - get { return NativeGet(this.GetMuted); } - set { NativeSet(this.SetMute, value); } - } + internal bool IsMuted + { + get { return NativeGet(this.GetMuted); } + set { NativeSet(this.SetMute, value); } + } - internal int ChannelSpacing - { - get { return NativeGet(this.GetChannelSpacing); } - } + internal int ChannelSpacing + { + get { return NativeGet(this.GetChannelSpacing); } + } - internal float Volume - { - get { return NativeGet(this.GetVolume); } - set { NativeSet(this.SetVolume, value); } - } + internal float Volume + { + get { return NativeGet(this.GetVolume); } + set { NativeSet(this.SetVolume, value); } + } - internal int MinimumFrequency - { - get + internal int MinimumFrequency { - RadioFrequencyRange range; - this.GetFrequencyRange(out range.minFreq, out range.maxFreq); - return range.minFreq; + get + { + RadioFrequencyRange range; + this.GetFrequencyRange(out range.minFreq, out range.maxFreq); + return range.minFreq; + } } - } - internal int MaximumFrequency - { - get + internal int MaximumFrequency { - RadioFrequencyRange range; - this.GetFrequencyRange(out range.minFreq, out range.maxFreq); - return range.maxFreq; + get + { + RadioFrequencyRange range; + this.GetFrequencyRange(out range.minFreq, out range.maxFreq); + return range.maxFreq; + } } - } - internal ScanCompletedCallback ScanCompleteCb - { - set + internal ScanCompletedCallback ScanCompleteCb { - var err = (value != null) ? this.SetScanCompletedCb(value, IntPtr.Zero) : this.UnsetScanCompletedCb(); - err.ThrowIfFailed("Failed to set/ unset scan complete callback"); + set + { + var err = (value != null) ? this.SetScanCompletedCb(value, IntPtr.Zero) : this.UnsetScanCompletedCb(); + err.ThrowIfFailed("Failed to set/ unset scan complete callback"); + } } - } - internal InterruptedCallback InteruptedCb - { - set + internal InterruptedCallback InteruptedCb { - var err = (value != null) ? this.SetInterruptedCb(value, IntPtr.Zero) : this.UnsetInterruptedCb(); - err.ThrowIfFailed("Failed to set/ unset interrupted callback"); + set + { + var err = (value != null) ? this.SetInterruptedCb(value, IntPtr.Zero) : this.UnsetInterruptedCb(); + err.ThrowIfFailed("Failed to set/ unset interrupted callback"); + } } - } - internal void StartPlayback() - { - this.Start().ThrowIfFailed("Failed to start radio"); - } + internal void StartPlayback() + { + this.Start().ThrowIfFailed("Failed to start radio"); + } - internal void StopPlayback() - { - this.Stop().ThrowIfFailed("Failed to stop radio"); - } + internal void StopPlayback() + { + this.Stop().ThrowIfFailed("Failed to stop radio"); + } - internal void StartScan(ScanUpdatedCallback callback) - { - this.ScanStart(callback, IntPtr.Zero).ThrowIfFailed("Failed to start radio"); - } + internal void StartScan(ScanUpdatedCallback callback) + { + this.ScanStart(callback, IntPtr.Zero).ThrowIfFailed("Failed to start radio"); + } - internal void StopScan(ScanStoppedCallback callback) - { - this.ScanStop(callback, IntPtr.Zero).ThrowIfFailed("Failed to stop radio"); - } + internal void StopScan(ScanStoppedCallback callback) + { + this.ScanStop(callback, IntPtr.Zero).ThrowIfFailed("Failed to stop radio"); + } - internal void SeekUp(SeekCompletedCallback callback) - { - this.SeekUp(callback, IntPtr.Zero).ThrowIfFailed("Failed to start radio"); - } + internal void SeekUp(SeekCompletedCallback callback) + { + this.SeekUp(callback, IntPtr.Zero).ThrowIfFailed("Failed to start radio"); + } - internal void SeekDown(SeekCompletedCallback callback) - { - this.SeekDown(callback, IntPtr.Zero).ThrowIfFailed("Failed to stop radio"); + internal void SeekDown(SeekCompletedCallback callback) + { + this.SeekDown(callback, IntPtr.Zero).ThrowIfFailed("Failed to stop radio"); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.Recorder.cs b/src/Tizen.Multimedia/Interop/Interop.Recorder.cs old mode 100755 new mode 100644 index f6f1ca6..10bca63 --- a/src/Tizen.Multimedia/Interop/Interop.Recorder.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Recorder.cs @@ -1,102 +1,104 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class Libc + internal static partial class Interop { - [DllImport(Libraries.Libc, EntryPoint = "free")] - public static extern void Free(IntPtr userData); - } + internal static partial class Libc + { + [DllImport(Libraries.Libc, EntryPoint = "free")] + public static extern void Free(IntPtr userData); + } - internal static partial class Recorder - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecorderErrorCallback(RecorderErrorCode error, RecorderState current, IntPtr userData); + internal static partial class Recorder + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void RecorderErrorCallback(RecorderErrorCode error, RecorderState current, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InterruptedCallback(RecorderPolicy policy, RecorderState previous, RecorderState current, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void InterruptedCallback(RecorderPolicy policy, RecorderState previous, RecorderState current, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecordingLimitReachedCallback(RecordingLimitType type, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void RecordingLimitReachedCallback(RecordingLimitType type, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecordingProgressCallback(ulong elapsedTime, ulong fileSize, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void RecordingProgressCallback(ulong elapsedTime, ulong fileSize, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AudioStreamCallback(IntPtr stream, int size, AudioSampleType type, int channel, uint timeStamp, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void AudioStreamCallback(IntPtr stream, int size, AudioSampleType type, int channel, uint timeStamp, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StatechangedCallback(RecorderState previous, RecorderState current, bool byPolicy, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void StatechangedCallback(RecorderState previous, RecorderState current, bool byPolicy, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_audiorecorder")] - internal static extern int Create(out IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_audiorecorder")] + internal static extern int Create(out IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_videorecorder")] - internal static extern int CreateVideo(IntPtr cameraHandle, out IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_videorecorder")] + internal static extern int CreateVideo(IntPtr cameraHandle, out IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_destroy")] - internal static extern int Destroy(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_destroy")] + internal static extern int Destroy(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_prepare")] - internal static extern int Prepare(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_prepare")] + internal static extern int Prepare(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unprepare")] - internal static extern int Unprepare(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_unprepare")] + internal static extern int Unprepare(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_start")] - internal static extern int Start(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_start")] + internal static extern int Start(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_pause")] - internal static extern int Pause(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_pause")] + internal static extern int Pause(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_commit")] - internal static extern int Commit(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_commit")] + internal static extern int Commit(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_cancel")] - internal static extern int Cancel(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_cancel")] + internal static extern int Cancel(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_state")] - internal static extern int GetState(IntPtr handle, out RecorderState state); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_state")] + internal static extern int GetState(IntPtr handle, out RecorderState state); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_sound_stream_info")] - internal static extern int SetAudioStreamPolicy(IntPtr handle, IntPtr streamInfoHandle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_sound_stream_info")] + internal static extern int SetAudioStreamPolicy(IntPtr handle, IntPtr streamInfoHandle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_error_cb")] - internal static extern int SetErrorCallback(IntPtr handle, RecorderErrorCallback callback, IntPtr userData); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_error_cb")] + internal static extern int SetErrorCallback(IntPtr handle, RecorderErrorCallback callback, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_error_cb")] - internal static extern int UnsetErrorCallback(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_error_cb")] + internal static extern int UnsetErrorCallback(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_interrupted_cb")] - internal static extern int SetInterruptedCallback(IntPtr handle, InterruptedCallback callback, IntPtr userData); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_interrupted_cb")] + internal static extern int SetInterruptedCallback(IntPtr handle, InterruptedCallback callback, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_interrupted_cb")] - internal static extern int UnsetInterruptedCallback(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_interrupted_cb")] + internal static extern int UnsetInterruptedCallback(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(IntPtr handle, StatechangedCallback callback, IntPtr userData); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_state_changed_cb")] + internal static extern int SetStateChangedCallback(IntPtr handle, StatechangedCallback callback, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_state_changed_cb")] - internal static extern int UnsetStateChangedCallback(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_state_changed_cb")] + internal static extern int UnsetStateChangedCallback(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_recording_status_cb")] - internal static extern int SetRecordingProgressCallback(IntPtr handle, RecordingProgressCallback callback, IntPtr userData); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_recording_status_cb")] + internal static extern int SetRecordingProgressCallback(IntPtr handle, RecordingProgressCallback callback, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_recording_status_cb")] - internal static extern int UnsetRecordingProgressCallback(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_recording_status_cb")] + internal static extern int UnsetRecordingProgressCallback(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_audio_stream_cb")] - internal static extern int SetAudioStreamCallback(IntPtr handle, AudioStreamCallback callback, IntPtr userData); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_audio_stream_cb")] + internal static extern int SetAudioStreamCallback(IntPtr handle, AudioStreamCallback callback, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_audio_stream_cb")] - internal static extern int UnsetAudioStreamCallback(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_audio_stream_cb")] + internal static extern int UnsetAudioStreamCallback(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_recording_limit_reached_cb")] - internal static extern int SetLimitReachedCallback(IntPtr handle, RecordingLimitReachedCallback callback, IntPtr userData); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_recording_limit_reached_cb")] + internal static extern int SetLimitReachedCallback(IntPtr handle, RecordingLimitReachedCallback callback, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_recording_limit_reached_cb")] - internal static extern int UnsetLimitReachedCallback(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_recording_limit_reached_cb")] + internal static extern int UnsetLimitReachedCallback(IntPtr handle); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.RecorderFeatures.cs b/src/Tizen.Multimedia/Interop/Interop.RecorderFeatures.cs old mode 100755 new mode 100644 index 5899e1c..73e12ad --- a/src/Tizen.Multimedia/Interop/Interop.RecorderFeatures.cs +++ b/src/Tizen.Multimedia/Interop/Interop.RecorderFeatures.cs @@ -1,33 +1,35 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class RecorderFeatures + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool VideoResolutionCallback(int width, int height, IntPtr userData); + internal static partial class RecorderFeatures + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool VideoResolutionCallback(int width, int height, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FileFormatCallback(RecorderFileFormat format, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool FileFormatCallback(RecorderFileFormat format, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AudioEncoderCallback(RecorderAudioCodec codec, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool AudioEncoderCallback(RecorderAudioCodec codec, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool VideoEncoderCallback(RecorderVideoCodec codec, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool VideoEncoderCallback(RecorderVideoCodec codec, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_file_format")] - internal static extern int FileFormats(IntPtr handle, FileFormatCallback callback, IntPtr userData); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_file_format")] + internal static extern int FileFormats(IntPtr handle, FileFormatCallback callback, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_audio_encoder")] - internal static extern int AudioEncoders(IntPtr handle, AudioEncoderCallback callback, IntPtr userData); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_audio_encoder")] + internal static extern int AudioEncoders(IntPtr handle, AudioEncoderCallback callback, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_video_encoder")] - internal static extern int VideoEncoders(IntPtr handle, VideoEncoderCallback callback, IntPtr userData); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_video_encoder")] + internal static extern int VideoEncoders(IntPtr handle, VideoEncoderCallback callback, IntPtr userData); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_video_resolution")] - internal static extern int VideoResolution(IntPtr handle, VideoResolutionCallback callback, IntPtr userData); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_video_resolution")] + internal static extern int VideoResolution(IntPtr handle, VideoResolutionCallback callback, IntPtr userData); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.RecorderSettings.cs b/src/Tizen.Multimedia/Interop/Interop.RecorderSettings.cs old mode 100755 new mode 100644 index 46c822b..738394c --- a/src/Tizen.Multimedia/Interop/Interop.RecorderSettings.cs +++ b/src/Tizen.Multimedia/Interop/Interop.RecorderSettings.cs @@ -1,103 +1,105 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class RecorderSettings + internal static partial class Interop { - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_channel")] - internal static extern int GetAudioChannel(IntPtr handle, out int channelCount); + internal static partial class RecorderSettings + { + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_channel")] + internal static extern int GetAudioChannel(IntPtr handle, out int channelCount); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_channel")] - internal static extern int SetAudioChannel(IntPtr handle, int channelCount); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_channel")] + internal static extern int SetAudioChannel(IntPtr handle, int channelCount); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_device")] - internal static extern int GetAudioDevice(IntPtr handle, out RecorderAudioDevice device); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_device")] + internal static extern int GetAudioDevice(IntPtr handle, out RecorderAudioDevice device); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_device")] - internal static extern int SetAudioDevice(IntPtr handle, RecorderAudioDevice device); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_device")] + internal static extern int SetAudioDevice(IntPtr handle, RecorderAudioDevice device); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_audio_level")] - internal static extern int GetAudioLevel(IntPtr handle, out double dB); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_audio_level")] + internal static extern int GetAudioLevel(IntPtr handle, out double dB); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_samplerate")] - internal static extern int GetAudioSampleRate(IntPtr handle, out int sampleRate); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_samplerate")] + internal static extern int GetAudioSampleRate(IntPtr handle, out int sampleRate); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_samplerate")] - internal static extern int SetAudioSampleRate(IntPtr handle, int sampleRate); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_samplerate")] + internal static extern int SetAudioSampleRate(IntPtr handle, int sampleRate); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_encoder_bitrate")] - internal static extern int GetAudioEncoderBitrate(IntPtr handle, out int bitRate); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_encoder_bitrate")] + internal static extern int GetAudioEncoderBitrate(IntPtr handle, out int bitRate); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_encoder_bitrate")] - internal static extern int SetAudioEncoderBitrate(IntPtr handle, int bitRate); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_encoder_bitrate")] + internal static extern int SetAudioEncoderBitrate(IntPtr handle, int bitRate); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_video_encoder_bitrate")] - internal static extern int GetVideoEncoderBitrate(IntPtr handle, out int bitRate); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_video_encoder_bitrate")] + internal static extern int GetVideoEncoderBitrate(IntPtr handle, out int bitRate); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_video_encoder_bitrate")] - internal static extern int SetVideoEncoderBitrate(IntPtr handle, int bitRate); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_video_encoder_bitrate")] + internal static extern int SetVideoEncoderBitrate(IntPtr handle, int bitRate); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_audio_encoder")] - internal static extern int GetAudioEncoder(IntPtr handle, out RecorderAudioCodec codec); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_audio_encoder")] + internal static extern int GetAudioEncoder(IntPtr handle, out RecorderAudioCodec codec); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_audio_encoder")] - internal static extern int SetAudioEncoder(IntPtr handle, RecorderAudioCodec codec); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_audio_encoder")] + internal static extern int SetAudioEncoder(IntPtr handle, RecorderAudioCodec codec); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_video_encoder")] - internal static extern int GetVideoEncoder(IntPtr handle, out RecorderVideoCodec codec); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_video_encoder")] + internal static extern int GetVideoEncoder(IntPtr handle, out RecorderVideoCodec codec); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_video_encoder")] - internal static extern int SetVideoEncoder(IntPtr handle, RecorderVideoCodec codec); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_video_encoder")] + internal static extern int SetVideoEncoder(IntPtr handle, RecorderVideoCodec codec); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_file_format")] - internal static extern int GetFileFormat(IntPtr handle, out RecorderFileFormat format); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_file_format")] + internal static extern int GetFileFormat(IntPtr handle, out RecorderFileFormat format); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_file_format")] - internal static extern int SetFileFormat(IntPtr handle, RecorderFileFormat format); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_file_format")] + internal static extern int SetFileFormat(IntPtr handle, RecorderFileFormat format); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_filename")] - internal static extern int GetFileName(IntPtr handle, out IntPtr path); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_filename")] + internal static extern int GetFileName(IntPtr handle, out IntPtr path); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_filename")] - internal static extern int SetFileName(IntPtr handle, string path); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_filename")] + internal static extern int SetFileName(IntPtr handle, string path); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_size_limit")] - internal static extern int GetSizeLimit(IntPtr handle, out int kbyte); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_size_limit")] + internal static extern int GetSizeLimit(IntPtr handle, out int kbyte); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_size_limit")] - internal static extern int SetSizeLimit(IntPtr handle, int kbyte); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_size_limit")] + internal static extern int SetSizeLimit(IntPtr handle, int kbyte); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_time_limit")] - internal static extern int GetTimeLimit(IntPtr handle, out int second); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_time_limit")] + internal static extern int GetTimeLimit(IntPtr handle, out int second); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_time_limit")] - internal static extern int SetTimeLimit(IntPtr handle, int second); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_time_limit")] + internal static extern int SetTimeLimit(IntPtr handle, int second); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_is_muted")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool GetMute(IntPtr handle); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_is_muted")] + [return: MarshalAs(UnmanagedType.I1)] + internal static extern bool GetMute(IntPtr handle); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_mute")] - internal static extern int SetMute(IntPtr handle, bool enable); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_mute")] + internal static extern int SetMute(IntPtr handle, bool enable); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_recording_motion_rate")] - internal static extern int GetMotionRate(IntPtr handle, out double motionRate); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_recording_motion_rate")] + internal static extern int GetMotionRate(IntPtr handle, out double motionRate); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_recording_motion_rate")] - internal static extern int SetMotionRate(IntPtr handle, double motionRate); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_recording_motion_rate")] + internal static extern int SetMotionRate(IntPtr handle, double motionRate); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_orientation_tag")] - internal static extern int GetOrientationTag(IntPtr handle, out RecorderOrientation orientation); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_orientation_tag")] + internal static extern int GetOrientationTag(IntPtr handle, out RecorderOrientation orientation); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_orientation_tag")] - internal static extern int SetOrientationTag(IntPtr handle, RecorderOrientation orientation); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_orientation_tag")] + internal static extern int SetOrientationTag(IntPtr handle, RecorderOrientation orientation); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_video_resolution")] - internal static extern int GetVideoResolution(IntPtr handle, out int width, out int height); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_video_resolution")] + internal static extern int GetVideoResolution(IntPtr handle, out int width, out int height); - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_video_resolution")] - internal static extern int SetVideoResolution(IntPtr handle, int width, int height); + [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_video_resolution")] + internal static extern int SetVideoResolution(IntPtr handle, int width, int height); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.SafeMultimediaHandle.cs b/src/Tizen.Multimedia/Interop/Interop.SafeMultimediaHandle.cs old mode 100755 new mode 100644 index ced1e62..14964b1 --- a/src/Tizen.Multimedia/Interop/Interop.SafeMultimediaHandle.cs +++ b/src/Tizen.Multimedia/Interop/Interop.SafeMultimediaHandle.cs @@ -20,60 +20,63 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading.Tasks; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static Task PinnedTask(TaskCompletionSource tcs) + internal static partial class Interop { - var gch = GCHandle.Alloc(tcs); - return tcs.Task.ContinueWith( - t => { gch.Free(); return t; }, - TaskContinuationOptions.ExecuteSynchronously).Unwrap(); - } - - internal abstract class SafeMultimediaHandle : SafeHandle - { - internal delegate ErrorCode GetterMethod(out TProp value); - internal delegate ErrorCode SetterMethod(TProp value); - - protected SafeMultimediaHandle(IntPtr handle, bool needToRelease) : base(handle, true) + internal static Task PinnedTask(TaskCompletionSource tcs) { - Debug.Assert(handle != IntPtr.Zero); - HasOwnership = needToRelease; + var gch = GCHandle.Alloc(tcs); + return tcs.Task.ContinueWith( + t => { gch.Free(); return t; }, + TaskContinuationOptions.ExecuteSynchronously).Unwrap(); } - internal bool HasOwnership { get; set; } - public override bool IsInvalid { get { return handle == IntPtr.Zero; } } + internal abstract class SafeMultimediaHandle : SafeHandle + { + internal delegate ErrorCode GetterMethod(out TProp value); + internal delegate ErrorCode SetterMethod(TProp value); - internal abstract ErrorCode DisposeNativeHandle(); + protected SafeMultimediaHandle(IntPtr handle, bool needToRelease) : base(handle, true) + { + Debug.Assert(handle != IntPtr.Zero); + HasOwnership = needToRelease; + } - internal TProp NativeGet(GetterMethod getter, [CallerMemberName] string propertyName = "") - { - TProp value; getter(out value).ThrowIfFailed($"Failed to get {propertyName}"); - return value; - } + internal bool HasOwnership { get; set; } + public override bool IsInvalid { get { return handle == IntPtr.Zero; } } - internal string NativeGet(GetterMethod getter, [CallerMemberName] string propertyName = "") - { - string value; getter(out value).ThrowIfFailed($"Failed to get {propertyName}"); - return value; - } + internal abstract ErrorCode DisposeNativeHandle(); - internal void NativeSet(SetterMethod setter, TProp value, [CallerMemberName] string propertyName = "") - { - setter(value).ThrowIfFailed($"Failed to set {propertyName}"); - } + internal TProp NativeGet(GetterMethod getter, [CallerMemberName] string propertyName = "") + { + TProp value; getter(out value).ThrowIfFailed($"Failed to get {propertyName}"); + return value; + } - protected override bool ReleaseHandle() - { - var err = ErrorCode.None; - if (HasOwnership) + internal string NativeGet(GetterMethod getter, [CallerMemberName] string propertyName = "") { - err = DisposeNativeHandle(); - err.WarnIfFailed($"Failed to delete native {GetType()} handle"); + string value; getter(out value).ThrowIfFailed($"Failed to get {propertyName}"); + return value; } - SetHandle(IntPtr.Zero); - return err.IsSuccess(); + internal void NativeSet(SetterMethod setter, TProp value, [CallerMemberName] string propertyName = "") + { + setter(value).ThrowIfFailed($"Failed to set {propertyName}"); + } + + protected override bool ReleaseHandle() + { + var err = ErrorCode.None; + if (HasOwnership) + { + err = DisposeNativeHandle(); + err.WarnIfFailed($"Failed to delete native {GetType()} handle"); + } + + SetHandle(IntPtr.Zero); + return err.IsSuccess(); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.ScreenMirroring.cs b/src/Tizen.Multimedia/Interop/Interop.ScreenMirroring.cs old mode 100755 new mode 100644 index cfda95c..6f78597 --- a/src/Tizen.Multimedia/Interop/Interop.ScreenMirroring.cs +++ b/src/Tizen.Multimedia/Interop/Interop.ScreenMirroring.cs @@ -1,74 +1,77 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class ScreenMirroring + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(IntPtr userData, int state, int error); + internal static partial class ScreenMirroring + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void StateChangedCallback(IntPtr userData, int state, int error); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_create")] - internal static extern int Create(out IntPtr scmirroringSink); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_create")] + internal static extern int Create(out IntPtr scmirroringSink); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_state_changed_cb")] - internal static extern int SetStateChangedCb(IntPtr scmirroringSink, StateChangedCallback cb, IntPtr userData); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_state_changed_cb")] + internal static extern int SetStateChangedCb(IntPtr scmirroringSink, StateChangedCallback cb, IntPtr userData); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_ip_and_port")] - internal static extern int SetIpAndPort(IntPtr scmirroringSink, string ip, string port); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_ip_and_port")] + internal static extern int SetIpAndPort(IntPtr scmirroringSink, string ip, string port); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_display")] - internal static extern int SetDisplay(IntPtr scmirroringSink, int type, IntPtr display); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_display")] + internal static extern int SetDisplay(IntPtr scmirroringSink, int type, IntPtr display); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_resolution")] - internal static extern int SetResolution(IntPtr scmirroringSink, int resolution); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_resolution")] + internal static extern int SetResolution(IntPtr scmirroringSink, int resolution); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_prepare")] - internal static extern int Prepare(IntPtr scmirroringSink); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_prepare")] + internal static extern int Prepare(IntPtr scmirroringSink); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_connect")] - internal static extern int ConnectAsync(IntPtr scmirroringSink); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_connect")] + internal static extern int ConnectAsync(IntPtr scmirroringSink); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_start")] - internal static extern int StartAsync(IntPtr scmirroringSink); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_start")] + internal static extern int StartAsync(IntPtr scmirroringSink); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_pause")] - internal static extern int PauseAsync(IntPtr scmirroringSink); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_pause")] + internal static extern int PauseAsync(IntPtr scmirroringSink); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_resume")] - internal static extern int ResumeAsync(IntPtr scmirroringSink); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_resume")] + internal static extern int ResumeAsync(IntPtr scmirroringSink); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_disconnect")] - internal static extern int Disconnect(IntPtr scmirroringSink); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_disconnect")] + internal static extern int Disconnect(IntPtr scmirroringSink); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_unprepare")] - internal static extern int Unprepare(IntPtr scmirroringSink); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_unprepare")] + internal static extern int Unprepare(IntPtr scmirroringSink); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_unset_state_changed_cb")] - internal static extern int UnsetStateChangedCb(IntPtr scmirroringSink); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_unset_state_changed_cb")] + internal static extern int UnsetStateChangedCb(IntPtr scmirroringSink); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_destroy")] - internal static extern int Destroy(IntPtr scmirroringSink); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_destroy")] + internal static extern int Destroy(IntPtr scmirroringSink); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_codec")] - internal static extern int GetNegotiatedVideoCodec(ref IntPtr scmirroringSink, out int codec); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_codec")] + internal static extern int GetNegotiatedVideoCodec(ref IntPtr scmirroringSink, out int codec); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_resolution")] - internal static extern int GetNegotiatedVideoResolution(ref IntPtr scmirroringSink, out int width, out int height); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_resolution")] + internal static extern int GetNegotiatedVideoResolution(ref IntPtr scmirroringSink, out int width, out int height); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_frame_rate")] - internal static extern int GetNegotiatedVideoFrameRate(ref IntPtr scmirroringSink, out int frameRate); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_frame_rate")] + internal static extern int GetNegotiatedVideoFrameRate(ref IntPtr scmirroringSink, out int frameRate); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_codec")] - internal static extern int GetNegotiatedAudioCodec(ref IntPtr scmirroringSink, out int codec); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_codec")] + internal static extern int GetNegotiatedAudioCodec(ref IntPtr scmirroringSink, out int codec); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_channel")] - internal static extern int GetNegotiatedAudioChannel(ref IntPtr scmirroringSink, out int channel); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_channel")] + internal static extern int GetNegotiatedAudioChannel(ref IntPtr scmirroringSink, out int channel); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_sample_rate")] - internal static extern int GetNegotiatedAudioSampleRate(ref IntPtr scmirroringSink, out int sampleRate); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_sample_rate")] + internal static extern int GetNegotiatedAudioSampleRate(ref IntPtr scmirroringSink, out int sampleRate); - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_bitwidth")] - internal static extern int GetNegotiatedAudioBitwidth(ref IntPtr scmirroringSink, out int bitwidth); + [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_bitwidth")] + internal static extern int GetNegotiatedAudioBitwidth(ref IntPtr scmirroringSink, out int bitwidth); + } } } \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs b/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs old mode 100755 new mode 100644 index df18d35..7f4dbec --- a/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs +++ b/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs @@ -1,55 +1,56 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; - - -internal static partial class Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SoundStreamFocusStateChangedCallback(IntPtr streamInfo, AudioStreamFocusOptions focusMask, AudioStreamFocusState focusState, int reason, int audioStreamBehavior, string extraInfo, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SoundStreamFocusStateWatchCallback(int id, AudioStreamFocusOptions focusMask, AudioStreamFocusState focusState, AudioStreamFocusChangedReason reason, string extraInfo, IntPtr userData); - - internal static partial class AudioStreamPolicy - { - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_create_stream_information")] - internal static extern int CreateStreamInformation(int streamType, SoundStreamFocusStateChangedCallback callback, IntPtr userData, out IntPtr streamInfo); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_destroy_stream_information")] - internal static extern int DestroyStreamInformation(IntPtr streamInfo); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_for_stream_routing")] - internal static extern int AddDeviceForStreamRouting(IntPtr streamInfo, IntPtr device); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_for_stream_routing")] - internal static extern int RemoveDeviceForStreamRouting(IntPtr streamInfo, IntPtr device); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_apply_stream_routing")] - internal static extern int ApplyStreamRouting(IntPtr streamInfo); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_acquire_focus")] - internal static extern int AcquireFocus(IntPtr streamInfo, AudioStreamFocusOptions focusMask, int audioStreamBehavior, string extraInfo); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_release_focus")] - internal static extern int ReleaseFocus(IntPtr streamInfo, AudioStreamFocusOptions focusMask, int audioStreamBehavior, string extraInfo); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_focus_state")] - internal static extern int GetFocusState(IntPtr streaInfo, out AudioStreamFocusState stateForPlayback, out AudioStreamFocusState stateForRecording); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_set_focus_reacquisition")] - internal static extern int SetFocusReacquisition(IntPtr streamInfo, bool enable); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_focus_reacquisition")] - internal static extern int GetFocusReacquisition(IntPtr streamInfo, out bool enabled); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_sound_type")] - internal static extern int GetSoundType(IntPtr streamInfo, out AudioVolumeType soundType); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_add_focus_state_watch_cb")] - internal static extern int AddFocusStateWatchCallback(AudioStreamFocusOptions focusMask, SoundStreamFocusStateWatchCallback callback, IntPtr userData, out int id); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_focus_state_watch_cb")] - internal static extern int RemoveFocusStateWatchCallback(int id); - } -} + +namespace Tizen.Multimedia +{ + internal static partial class Interop + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void SoundStreamFocusStateChangedCallback(IntPtr streamInfo, AudioStreamFocusOptions focusMask, AudioStreamFocusState focusState, int reason, int audioStreamBehavior, string extraInfo, IntPtr userData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void SoundStreamFocusStateWatchCallback(int id, AudioStreamFocusOptions focusMask, AudioStreamFocusState focusState, AudioStreamFocusChangedReason reason, string extraInfo, IntPtr userData); + + internal static partial class AudioStreamPolicy + { + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_create_stream_information")] + internal static extern int CreateStreamInformation(int streamType, SoundStreamFocusStateChangedCallback callback, IntPtr userData, out IntPtr streamInfo); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_destroy_stream_information")] + internal static extern int DestroyStreamInformation(IntPtr streamInfo); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_for_stream_routing")] + internal static extern int AddDeviceForStreamRouting(IntPtr streamInfo, IntPtr device); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_for_stream_routing")] + internal static extern int RemoveDeviceForStreamRouting(IntPtr streamInfo, IntPtr device); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_apply_stream_routing")] + internal static extern int ApplyStreamRouting(IntPtr streamInfo); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_acquire_focus")] + internal static extern int AcquireFocus(IntPtr streamInfo, AudioStreamFocusOptions focusMask, int audioStreamBehavior, string extraInfo); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_release_focus")] + internal static extern int ReleaseFocus(IntPtr streamInfo, AudioStreamFocusOptions focusMask, int audioStreamBehavior, string extraInfo); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_focus_state")] + internal static extern int GetFocusState(IntPtr streaInfo, out AudioStreamFocusState stateForPlayback, out AudioStreamFocusState stateForRecording); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_set_focus_reacquisition")] + internal static extern int SetFocusReacquisition(IntPtr streamInfo, bool enable); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_focus_reacquisition")] + internal static extern int GetFocusReacquisition(IntPtr streamInfo, out bool enabled); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_sound_type")] + internal static extern int GetSoundType(IntPtr streamInfo, out AudioVolumeType soundType); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_add_focus_state_watch_cb")] + internal static extern int AddFocusStateWatchCallback(AudioStreamFocusOptions focusMask, SoundStreamFocusStateWatchCallback callback, IntPtr userData, out int id); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_focus_state_watch_cb")] + internal static extern int RemoveFocusStateWatchCallback(int id); + } + } +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.StreamRecorder.cs b/src/Tizen.Multimedia/Interop/Interop.StreamRecorder.cs old mode 100755 new mode 100644 index c06e7a5..c638037 --- a/src/Tizen.Multimedia/Interop/Interop.StreamRecorder.cs +++ b/src/Tizen.Multimedia/Interop/Interop.StreamRecorder.cs @@ -1,186 +1,188 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class StreamRecorder + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecordingLimitReachedCallback(StreamRecordingLimitType type, IntPtr userData); + internal static partial class StreamRecorder + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void RecordingLimitReachedCallback(StreamRecordingLimitType type, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecordingStatusCallback(ulong elapsedTime, ulong fileSize, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void RecordingStatusCallback(ulong elapsedTime, ulong fileSize, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void NotifiedCallback(StreamRecorderState previous, StreamRecorderState current, StreamRecorderNotify notfication, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void NotifiedCallback(StreamRecorderState previous, StreamRecorderState current, StreamRecorderNotify notfication, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecorderErrorCallback(StreamRecorderErrorCode error, StreamRecorderState current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void BufferConsumedCallback(IntPtr buffer, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void RecorderErrorCallback(StreamRecorderErrorCode error, StreamRecorderState current, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool VideoResolutionCallback(int width, int height, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void BufferConsumedCallback(IntPtr buffer, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FileFormatCallback(StreamRecorderFileFormat format, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool VideoResolutionCallback(int width, int height, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AudioEncoderCallback(StreamRecorderAudioCodec codec, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool FileFormatCallback(StreamRecorderFileFormat format, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool VideoEncoderCallback(StreamRecorderVideoCodec codec, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool AudioEncoderCallback(StreamRecorderAudioCodec codec, IntPtr userData); - /* begin of method */ - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_create")] - internal static extern int Create(out IntPtr handle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool VideoEncoderCallback(StreamRecorderVideoCodec codec, IntPtr userData); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_destroy")] - internal static extern int Destroy(IntPtr handle); + /* begin of method */ + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_create")] + internal static extern int Create(out IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_prepare")] - internal static extern int Prepare(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_destroy")] + internal static extern int Destroy(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unprepare")] - internal static extern int Unprepare(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_prepare")] + internal static extern int Prepare(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_start")] - internal static extern int Start(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unprepare")] + internal static extern int Unprepare(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_pause")] - internal static extern int Pause(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_start")] + internal static extern int Start(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_commit")] - internal static extern int Commit(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_pause")] + internal static extern int Pause(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_cancel")] - internal static extern int Cancel(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_commit")] + internal static extern int Commit(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_push_stream_buffer")] - internal static extern int PushStreamBuffer(IntPtr handle, IntPtr/* media_packet_h */ inbuf); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_cancel")] + internal static extern int Cancel(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_enable_source_buffer")] - internal static extern int EnableSourceBuffer(IntPtr handle, int type); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_push_stream_buffer")] + internal static extern int PushStreamBuffer(IntPtr handle, IntPtr/* media_packet_h */ inbuf); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_state")] - internal static extern int GetState(IntPtr handle, out int state); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_enable_source_buffer")] + internal static extern int EnableSourceBuffer(IntPtr handle, int type); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_filename")] - internal static extern int SetFileName(IntPtr handle, string path); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_state")] + internal static extern int GetState(IntPtr handle, out int state); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_filename")] - internal static extern int GetFileName(IntPtr handle, out IntPtr path); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_filename")] + internal static extern int SetFileName(IntPtr handle, string path); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_file_format")] - internal static extern int SetFileFormat(IntPtr handle, int format); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_filename")] + internal static extern int GetFileName(IntPtr handle, out IntPtr path); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_file_format")] - internal static extern int GetFileFormat(IntPtr handle, out int format); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_file_format")] + internal static extern int SetFileFormat(IntPtr handle, int format); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_encoder")] - internal static extern int SetAudioEncoder(IntPtr handle, int codec); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_file_format")] + internal static extern int GetFileFormat(IntPtr handle, out int format); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_encoder")] - internal static extern int GetAudioEncoder(IntPtr handle, out int codec); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_encoder")] + internal static extern int SetAudioEncoder(IntPtr handle, int codec); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_encoder")] - internal static extern int SetVideoEncoder(IntPtr handle, int codec); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_encoder")] + internal static extern int GetAudioEncoder(IntPtr handle, out int codec); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_encoder")] - internal static extern int GetVideoEncoder(IntPtr handle, out int codec); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_encoder")] + internal static extern int SetVideoEncoder(IntPtr handle, int codec); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_resolution")] - internal static extern int SetVideoResolution(IntPtr handle, int width, int height); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_encoder")] + internal static extern int GetVideoEncoder(IntPtr handle, out int codec); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_resolution")] - internal static extern int GetVideoResolution(IntPtr handle, out int width, out int height); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_resolution")] + internal static extern int SetVideoResolution(IntPtr handle, int width, int height); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_framerate")] - internal static extern int SetVideoFramerate(IntPtr handle, int framerate); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_resolution")] + internal static extern int GetVideoResolution(IntPtr handle, out int width, out int height); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_framerate")] - internal static extern int GetVideoFramerate(IntPtr handle, out int framerate); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_framerate")] + internal static extern int SetVideoFramerate(IntPtr handle, int framerate); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_source_format")] - internal static extern int SetVideoSourceFormat(IntPtr handle, int format); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_framerate")] + internal static extern int GetVideoFramerate(IntPtr handle, out int framerate); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_source_format")] - internal static extern int GetVideoSourceFormat(IntPtr handle, out int format); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_source_format")] + internal static extern int SetVideoSourceFormat(IntPtr handle, int format); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_limit")] - internal static extern int SetRecordingLimit(IntPtr handle, int type, int limit); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_source_format")] + internal static extern int GetVideoSourceFormat(IntPtr handle, out int format); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_recording_limit")] - internal static extern int GetRecordingLimit(IntPtr handle, int type, out int format); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_limit")] + internal static extern int SetRecordingLimit(IntPtr handle, int type, int limit); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_samplerate")] - internal static extern int SetAudioSampleRate(IntPtr handle, int samplerate); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_recording_limit")] + internal static extern int GetRecordingLimit(IntPtr handle, int type, out int format); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_samplerate")] - internal static extern int GetAudioSampleRate(IntPtr handle, out int samplerate); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_samplerate")] + internal static extern int SetAudioSampleRate(IntPtr handle, int samplerate); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_encoder_bitrate")] - internal static extern int SetAudioEncoderBitrate(IntPtr handle, int bitrate); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_samplerate")] + internal static extern int GetAudioSampleRate(IntPtr handle, out int samplerate); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_encoder_bitrate")] - internal static extern int GetAudioEncoderBitrate(IntPtr handle, out int bitrate); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_encoder_bitrate")] + internal static extern int SetAudioEncoderBitrate(IntPtr handle, int bitrate); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_encoder_bitrate")] - internal static extern int SetVideoEncoderBitrate(IntPtr handle, int bitrate); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_encoder_bitrate")] + internal static extern int GetAudioEncoderBitrate(IntPtr handle, out int bitrate); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_encoder_bitrate")] - internal static extern int GetVideoEncoderBitrate(IntPtr handle, out int bitrate); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_encoder_bitrate")] + internal static extern int SetVideoEncoderBitrate(IntPtr handle, int bitrate); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_channel")] - internal static extern int SetAudioChannel(IntPtr handle, int channel); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_encoder_bitrate")] + internal static extern int GetVideoEncoderBitrate(IntPtr handle, out int bitrate); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_channel")] - internal static extern int GetAudioChannel(IntPtr handle, out int channel); - /* End of method */ + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_channel")] + internal static extern int SetAudioChannel(IntPtr handle, int channel); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_file_format")] - internal static extern int FileFormats(IntPtr handle, FileFormatCallback callback, IntPtr userData); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_channel")] + internal static extern int GetAudioChannel(IntPtr handle, out int channel); + /* End of method */ - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_audio_encoder")] - internal static extern int AudioEncoders(IntPtr handle, AudioEncoderCallback callback, IntPtr userData); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_file_format")] + internal static extern int FileFormats(IntPtr handle, FileFormatCallback callback, IntPtr userData); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_video_encoder")] - internal static extern int VideoEncoders(IntPtr handle, VideoEncoderCallback callback, IntPtr userData); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_audio_encoder")] + internal static extern int AudioEncoders(IntPtr handle, AudioEncoderCallback callback, IntPtr userData); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_video_resolution")] - internal static extern int VideoResolution(IntPtr handle, VideoResolutionCallback callback, IntPtr userData); - /* End of foreach method */ + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_video_encoder")] + internal static extern int VideoEncoders(IntPtr handle, VideoEncoderCallback callback, IntPtr userData); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_notify_cb")] - internal static extern int SetNotifiedCallback(IntPtr handle, NotifiedCallback callback, IntPtr userData); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_video_resolution")] + internal static extern int VideoResolution(IntPtr handle, VideoResolutionCallback callback, IntPtr userData); + /* End of foreach method */ - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_notify_cb")] - internal static extern int UnsetNotifiedCallback(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_notify_cb")] + internal static extern int SetNotifiedCallback(IntPtr handle, NotifiedCallback callback, IntPtr userData); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_status_cb")] - internal static extern int SetStatusChangedCallback(IntPtr handle, RecordingStatusCallback callback, IntPtr userData); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_notify_cb")] + internal static extern int UnsetNotifiedCallback(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_recording_status_cb")] - internal static extern int UnsetStatusChangedCallback(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_status_cb")] + internal static extern int SetStatusChangedCallback(IntPtr handle, RecordingStatusCallback callback, IntPtr userData); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_limit_reached_cb")] - internal static extern int SetLimitReachedCallback(IntPtr handle, RecordingLimitReachedCallback callback, IntPtr userData); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_recording_status_cb")] + internal static extern int UnsetStatusChangedCallback(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_recording_limit_reached_cb")] - internal static extern int UnsetLimitReachedCallback(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_limit_reached_cb")] + internal static extern int SetLimitReachedCallback(IntPtr handle, RecordingLimitReachedCallback callback, IntPtr userData); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_error_cb")] - internal static extern int SetErrorCallback(IntPtr handle, RecorderErrorCallback callback, IntPtr userData); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_recording_limit_reached_cb")] + internal static extern int UnsetLimitReachedCallback(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_error_cb")] - internal static extern int UnsetErrorCallback(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_error_cb")] + internal static extern int SetErrorCallback(IntPtr handle, RecorderErrorCallback callback, IntPtr userData); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_buffer_consume_completed_cb")] - internal static extern int SetBufferConsumedCallback(IntPtr handle, BufferConsumedCallback callback, IntPtr userDat); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_error_cb")] + internal static extern int UnsetErrorCallback(IntPtr handle); - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_buffer_consume_completed_cb")] - internal static extern int UnsetBufferConsumedCallback(IntPtr handle); + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_buffer_consume_completed_cb")] + internal static extern int SetBufferConsumedCallback(IntPtr handle, BufferConsumedCallback callback, IntPtr userDat); + + [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_buffer_consume_completed_cb")] + internal static extern int UnsetBufferConsumedCallback(IntPtr handle); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.ThumbnailExtractor.cs b/src/Tizen.Multimedia/Interop/Interop.ThumbnailExtractor.cs old mode 100755 new mode 100644 index 81b9224..efc95e8 --- a/src/Tizen.Multimedia/Interop/Interop.ThumbnailExtractor.cs +++ b/src/Tizen.Multimedia/Interop/Interop.ThumbnailExtractor.cs @@ -1,27 +1,29 @@ using System; -using Tizen.Multimedia; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class ThumbnailExtractor + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void ThumbnailExtractCallback(ThumbnailExtractorError error, string requestId, int thumbWidth, int thumbHeight, IntPtr thumbData, int thumbSize, IntPtr userData); + internal static partial class ThumbnailExtractor + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ThumbnailExtractCallback(ThumbnailExtractorError error, string requestId, int thumbWidth, int thumbHeight, IntPtr thumbData, int thumbSize, IntPtr userData); - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_create")] - internal static extern ThumbnailExtractorError Create(out IntPtr handle); + [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_create")] + internal static extern ThumbnailExtractorError Create(out IntPtr handle); - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_extract")] - internal static extern ThumbnailExtractorError Extract(IntPtr handle, ThumbnailExtractCallback callback, IntPtr userData, out IntPtr requestId); + [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_extract")] + internal static extern ThumbnailExtractorError Extract(IntPtr handle, ThumbnailExtractCallback callback, IntPtr userData, out IntPtr requestId); - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_set_path")] - internal static extern ThumbnailExtractorError SetPath(IntPtr handle, string path); + [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_set_path")] + internal static extern ThumbnailExtractorError SetPath(IntPtr handle, string path); - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_set_size")] - internal static extern ThumbnailExtractorError SetSize(IntPtr handle, int width, int height); + [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_set_size")] + internal static extern ThumbnailExtractorError SetSize(IntPtr handle, int width, int height); - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_destroy")] - internal static extern ThumbnailExtractorError Destroy(IntPtr handle); + [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_destroy")] + internal static extern ThumbnailExtractorError Destroy(IntPtr handle); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.TonePlayer.cs b/src/Tizen.Multimedia/Interop/Interop.TonePlayer.cs old mode 100755 new mode 100644 index d123d22..dbae73b --- a/src/Tizen.Multimedia/Interop/Interop.TonePlayer.cs +++ b/src/Tizen.Multimedia/Interop/Interop.TonePlayer.cs @@ -1,15 +1,17 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class TonePlayer + internal static partial class Interop { - [DllImport(Libraries.TonePlayer, EntryPoint = "tone_player_start_new")] - internal static extern int Start(ToneType tone, IntPtr streamInfoHandle, int durationMs, out int playerId); + internal static partial class TonePlayer + { + [DllImport(Libraries.TonePlayer, EntryPoint = "tone_player_start_new")] + internal static extern int Start(ToneType tone, IntPtr streamInfoHandle, int durationMs, out int playerId); - [DllImport(Libraries.TonePlayer, EntryPoint = "tone_player_stop")] - internal static extern int Stop(int PlayerId); + [DllImport(Libraries.TonePlayer, EntryPoint = "tone_player_stop")] + internal static extern int Stop(int PlayerId); + } } } diff --git a/src/Tizen.Multimedia/Interop/Interop.VideoUtil.cs b/src/Tizen.Multimedia/Interop/Interop.VideoUtil.cs old mode 100755 new mode 100644 index f62e6f4..d55f8fc --- a/src/Tizen.Multimedia/Interop/Interop.VideoUtil.cs +++ b/src/Tizen.Multimedia/Interop/Interop.VideoUtil.cs @@ -17,176 +17,179 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - internal enum VideoCodec + internal static partial class Interop { - Mpeg4, // VIDEO_UTIL_VIDEO_CODEC_MPEG4 - H263, // VIDEO_UTIL_VIDEO_CODEC_H263 - H264, // VIDEO_UTIL_VIDEO_CODEC_H264 - None, // VIDEO_UTIL_VIDEO_CODEC_NONE - } + internal enum VideoCodec + { + Mpeg4, // VIDEO_UTIL_VIDEO_CODEC_MPEG4 + H263, // VIDEO_UTIL_VIDEO_CODEC_H263 + H264, // VIDEO_UTIL_VIDEO_CODEC_H264 + None, // VIDEO_UTIL_VIDEO_CODEC_NONE + } - internal enum AudioCodec - { - Aac, // VIDEO_UTIL_AUDIO_CODEC_AAC - Amrnb, // VIDEO_UTIL_AUDIO_CODEC_AMRNB - None, // VIDEO_UTIL_AUDIO_CODEC_NONE - } + internal enum AudioCodec + { + Aac, // VIDEO_UTIL_AUDIO_CODEC_AAC + Amrnb, // VIDEO_UTIL_AUDIO_CODEC_AMRNB + None, // VIDEO_UTIL_AUDIO_CODEC_NONE + } - internal enum VideoFileFormat - { - Format3Gp, // VIDEO_UTIL_FILE_FORMAT_3GP - FormatMp4, // VIDEO_UTIL_FILE_FORMAT_MP4 - FormatMax, // VIDEO_UTIL_FILE_FORMAT_MAX - } + internal enum VideoFileFormat + { + Format3Gp, // VIDEO_UTIL_FILE_FORMAT_3GP + FormatMp4, // VIDEO_UTIL_FILE_FORMAT_MP4 + FormatMax, // VIDEO_UTIL_FILE_FORMAT_MAX + } - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_foreach_supported_file_format")] - internal static extern ErrorCode ForeachSupportedFileFormat(this VideoTranscoderHandle /* video_util_h */ handle, VideoTranscoderHandle.SupportedFileFormatCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_foreach_supported_file_format")] + internal static extern ErrorCode ForeachSupportedFileFormat(this VideoTranscoderHandle /* video_util_h */ handle, VideoTranscoderHandle.SupportedFileFormatCallback callback, IntPtr /* void */ userData); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_foreach_supported_video_codec")] - internal static extern ErrorCode ForeachSupportedVideoCodec(this VideoTranscoderHandle /* video_util_h */ handle, VideoTranscoderHandle.SupportedVideoEncoderCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_foreach_supported_video_codec")] + internal static extern ErrorCode ForeachSupportedVideoCodec(this VideoTranscoderHandle /* video_util_h */ handle, VideoTranscoderHandle.SupportedVideoEncoderCallback callback, IntPtr /* void */ userData); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_foreach_supported_audio_codec")] - internal static extern ErrorCode ForeachSupportedAudioCodec(this VideoTranscoderHandle /* video_util_h */ handle, VideoTranscoderHandle.SupportedAudioEncoderCallback callback, IntPtr /* void */ userData); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_foreach_supported_audio_codec")] + internal static extern ErrorCode ForeachSupportedAudioCodec(this VideoTranscoderHandle /* video_util_h */ handle, VideoTranscoderHandle.SupportedAudioEncoderCallback callback, IntPtr /* void */ userData); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_start_transcoding")] - internal static extern ErrorCode StartTranscoding(this VideoTranscoderHandle /* video_util_h */ handle, ulong start, ulong duration, - string outPath, VideoTranscoderHandle.TranscodingProgressCallback progressCb, VideoTranscoderHandle.TranscodingCompletedCallback completedCb, IntPtr /* void */ userData); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_start_transcoding")] + internal static extern ErrorCode StartTranscoding(this VideoTranscoderHandle /* video_util_h */ handle, ulong start, ulong duration, + string outPath, VideoTranscoderHandle.TranscodingProgressCallback progressCb, VideoTranscoderHandle.TranscodingCompletedCallback completedCb, IntPtr /* void */ userData); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_cancel_transcoding")] - internal static extern ErrorCode CancelTranscoding(this VideoTranscoderHandle /* video_util_h */ handle); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_cancel_transcoding")] + internal static extern ErrorCode CancelTranscoding(this VideoTranscoderHandle /* video_util_h */ handle); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_get_progress_transcoding")] - internal static extern ErrorCode GetProgressTranscoding(this VideoTranscoderHandle /* video_util_h */ handle, out ulong currentPosition, out ulong duration); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_get_progress_transcoding")] + internal static extern ErrorCode GetProgressTranscoding(this VideoTranscoderHandle /* video_util_h */ handle, out ulong currentPosition, out ulong duration); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_resolution")] - internal static extern ErrorCode SetResolution(this VideoTranscoderHandle /* video_util_h */ handle, int width, int height); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_resolution")] + internal static extern ErrorCode SetResolution(this VideoTranscoderHandle /* video_util_h */ handle, int width, int height); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_file_path")] - internal static extern ErrorCode SetFilePath(this VideoTranscoderHandle /* video_util_h */ handle, string path); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_file_path")] + internal static extern ErrorCode SetFilePath(this VideoTranscoderHandle /* video_util_h */ handle, string path); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_accurate_mode")] - internal static extern ErrorCode SetAccurateMode(this VideoTranscoderHandle /* video_util_h */ handle, bool mode); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_accurate_mode")] + internal static extern ErrorCode SetAccurateMode(this VideoTranscoderHandle /* video_util_h */ handle, bool mode); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_video_codec")] - internal static extern ErrorCode SetVideoCodec(this VideoTranscoderHandle /* video_util_h */ handle, VideoCodec /* video_util_video_codec_e */ codec); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_video_codec")] + internal static extern ErrorCode SetVideoCodec(this VideoTranscoderHandle /* video_util_h */ handle, VideoCodec /* video_util_video_codec_e */ codec); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_audio_codec")] - internal static extern ErrorCode SetAudioCodec(this VideoTranscoderHandle /* video_util_h */ handle, AudioCodec /* video_util_audio_codec_e */ codec); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_audio_codec")] + internal static extern ErrorCode SetAudioCodec(this VideoTranscoderHandle /* video_util_h */ handle, AudioCodec /* video_util_audio_codec_e */ codec); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_file_format")] - internal static extern ErrorCode SetFileFormat(this VideoTranscoderHandle /* video_util_h */ handle, VideoFileFormat /* video_util_file_format_e */ format); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_file_format")] + internal static extern ErrorCode SetFileFormat(this VideoTranscoderHandle /* video_util_h */ handle, VideoFileFormat /* video_util_file_format_e */ format); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_fps")] - internal static extern ErrorCode SetFps(this VideoTranscoderHandle /* video_util_h */ handle, int fps); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_set_fps")] + internal static extern ErrorCode SetFps(this VideoTranscoderHandle /* video_util_h */ handle, int fps); - internal class VideoTranscoderHandle : SafeMultimediaHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TranscodingProgressCallback(ulong currentPosition, ulong duration, IntPtr /* void */ userData); + internal class VideoTranscoderHandle : SafeMultimediaHandle + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void TranscodingProgressCallback(ulong currentPosition, ulong duration, IntPtr /* void */ userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TranscodingCompletedCallback(ErrorCode /* video_util_error_e */ errorCode, IntPtr /* void */ userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void TranscodingCompletedCallback(ErrorCode /* video_util_error_e */ errorCode, IntPtr /* void */ userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SupportedFileFormatCallback(VideoFileFormat /* video_util_file_format_e */ format, IntPtr /* void */ userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool SupportedFileFormatCallback(VideoFileFormat /* video_util_file_format_e */ format, IntPtr /* void */ userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SupportedVideoEncoderCallback(VideoCodec /* video_util_video_codec_e */ codec, IntPtr /* void */ userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool SupportedVideoEncoderCallback(VideoCodec /* video_util_video_codec_e */ codec, IntPtr /* void */ userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SupportedAudioEncoderCallback(AudioCodec /* video_util_audio_codec_e */ codec, IntPtr /* void */ userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool SupportedAudioEncoderCallback(AudioCodec /* video_util_audio_codec_e */ codec, IntPtr /* void */ userData); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_create")] - internal static extern ErrorCode Create(out IntPtr /* video_util_h */ handle); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_create")] + internal static extern ErrorCode Create(out IntPtr /* video_util_h */ handle); - [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* video_util_h */ handle); + [DllImport(Libraries.VideoUtil, EntryPoint = "video_util_destroy")] + internal static extern ErrorCode Destroy(IntPtr /* video_util_h */ handle); - internal string InputFile - { - set { NativeSet(this.SetFilePath, value); } - } + internal string InputFile + { + set { NativeSet(this.SetFilePath, value); } + } - internal bool AccurateModeEnabled - { - set { NativeSet(this.SetAccurateMode, value); } - } + internal bool AccurateModeEnabled + { + set { NativeSet(this.SetAccurateMode, value); } + } - internal VideoCodec VideoCodec - { - set { NativeSet(this.SetVideoCodec, value); } - } + internal VideoCodec VideoCodec + { + set { NativeSet(this.SetVideoCodec, value); } + } - internal AudioCodec AudioCodec - { - set { NativeSet(this.SetAudioCodec, value); } - } + internal AudioCodec AudioCodec + { + set { NativeSet(this.SetAudioCodec, value); } + } - internal VideoFileFormat FileFormat - { - set { NativeSet(this.SetFileFormat, value); } - } + internal VideoFileFormat FileFormat + { + set { NativeSet(this.SetFileFormat, value); } + } - internal int Fps - { - set { NativeSet(this.SetFps, value); } - } + internal int Fps + { + set { NativeSet(this.SetFps, value); } + } - internal VideoTranscoderHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease) - { - } + internal VideoTranscoderHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease) + { + } - internal VideoTranscoderHandle() : this(CreateNativeHandle(), true) - { - } + internal VideoTranscoderHandle() : this(CreateNativeHandle(), true) + { + } - internal static IntPtr CreateNativeHandle() - { - IntPtr handle; - Create(out handle).ThrowIfFailed("Failed to create native handle"); - return handle; - } + internal static IntPtr CreateNativeHandle() + { + IntPtr handle; + Create(out handle).ThrowIfFailed("Failed to create native handle"); + return handle; + } - internal override ErrorCode DisposeNativeHandle() - { - return Destroy(handle); - } + internal override ErrorCode DisposeNativeHandle() + { + return Destroy(handle); + } - internal void ForeachSupportedFileFormat(Action action) - { - SupportedFileFormatCallback callback = (codec, userData) => + internal void ForeachSupportedFileFormat(Action action) { - action(codec); - return true; - }; + SupportedFileFormatCallback callback = (codec, userData) => + { + action(codec); + return true; + }; - this.ForeachSupportedFileFormat(callback, IntPtr.Zero).ThrowIfFailed("Failed to get supported file format list from native handle"); - } + this.ForeachSupportedFileFormat(callback, IntPtr.Zero).ThrowIfFailed("Failed to get supported file format list from native handle"); + } - internal void ForeachSupportedVideoCodec(Action action) - { - SupportedVideoEncoderCallback callback = (codec, userData) => + internal void ForeachSupportedVideoCodec(Action action) { - action(codec); - return true; - }; + SupportedVideoEncoderCallback callback = (codec, userData) => + { + action(codec); + return true; + }; - this.ForeachSupportedVideoCodec(callback, IntPtr.Zero).ThrowIfFailed("Failed to get supported video codec list from native handle"); - } + this.ForeachSupportedVideoCodec(callback, IntPtr.Zero).ThrowIfFailed("Failed to get supported video codec list from native handle"); + } - internal void ForeachSupportedAudioCodec(Action action) - { - SupportedAudioEncoderCallback callback = (codec, userData) => + internal void ForeachSupportedAudioCodec(Action action) { - action(codec); - return true; - }; - - this.ForeachSupportedAudioCodec(callback, IntPtr.Zero).ThrowIfFailed("Failed to get supported audio codec list from native handle"); + SupportedAudioEncoderCallback callback = (codec, userData) => + { + action(codec); + return true; + }; + + this.ForeachSupportedAudioCodec(callback, IntPtr.Zero).ThrowIfFailed("Failed to get supported audio codec list from native handle"); + } } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.Volume.cs b/src/Tizen.Multimedia/Interop/Interop.Volume.cs old mode 100755 new mode 100644 index b40fdf0..abc017f --- a/src/Tizen.Multimedia/Interop/Interop.Volume.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Volume.cs @@ -1,30 +1,32 @@ using System; using System.Runtime.InteropServices; -using Tizen.Multimedia; - -internal static partial class Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SoundManagerVolumeChangedCallback(AudioVolumeType type, uint volume, IntPtr userData); - - internal static partial class AudioVolume - { - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_max_volume")] - internal static extern int GetMaxVolume(AudioVolumeType type, out int max); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_set_volume")] - internal static extern int SetVolume(AudioVolumeType type, int volume); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_volume")] - internal static extern int GetVolume(AudioVolumeType type, out int volume); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_current_sound_type")] - internal static extern int GetCurrentSoundType(out AudioVolumeType type); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_add_volume_changed_cb")] - internal static extern int AddVolumeChangedCallback(SoundManagerVolumeChangedCallback callback, IntPtr userData, out int id); - - [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_volume_changed_cb")] - internal static extern int RemoveVolumeChangedCallback(int id); + +namespace Tizen.Multimedia +{ + internal static partial class Interop + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void SoundManagerVolumeChangedCallback(AudioVolumeType type, uint volume, IntPtr userData); + + internal static partial class AudioVolume + { + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_max_volume")] + internal static extern int GetMaxVolume(AudioVolumeType type, out int max); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_set_volume")] + internal static extern int SetVolume(AudioVolumeType type, int volume); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_volume")] + internal static extern int GetVolume(AudioVolumeType type, out int volume); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_get_current_sound_type")] + internal static extern int GetCurrentSoundType(out AudioVolumeType type); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_add_volume_changed_cb")] + internal static extern int AddVolumeChangedCallback(SoundManagerVolumeChangedCallback callback, IntPtr userData, out int id); + + [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_volume_changed_cb")] + internal static extern int RemoveVolumeChangedCallback(int id); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.WavPlayer.cs b/src/Tizen.Multimedia/Interop/Interop.WavPlayer.cs old mode 100755 new mode 100644 index 36aac3c..1e1a6a2 --- a/src/Tizen.Multimedia/Interop/Interop.WavPlayer.cs +++ b/src/Tizen.Multimedia/Interop/Interop.WavPlayer.cs @@ -1,18 +1,21 @@ using System; using System.Runtime.InteropServices; -internal static partial class Interop +namespace Tizen.Multimedia { - internal static partial class WavPlayer + internal static partial class Interop { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void WavPlayerCompletedCallback(int playerId, IntPtr userData); + internal static partial class WavPlayer + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void WavPlayerCompletedCallback(int playerId, IntPtr userData); - [DllImport(Libraries.WavPlayer, EntryPoint = "wav_player_start_new")] - internal static extern int WavPlayerStart(string filePath, IntPtr streamInfoHandle, WavPlayerCompletedCallback completedCallback, - IntPtr userData, out int playerId); + [DllImport(Libraries.WavPlayer, EntryPoint = "wav_player_start_new")] + internal static extern int WavPlayerStart(string filePath, IntPtr streamInfoHandle, WavPlayerCompletedCallback completedCallback, + IntPtr userData, out int playerId); - [DllImport(Libraries.WavPlayer, EntryPoint = "wav_player_stop")] - internal static extern int WavPlayerStop(int PlayerId); + [DllImport(Libraries.WavPlayer, EntryPoint = "wav_player_stop")] + internal static extern int WavPlayerStop(int PlayerId); + } } -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia/MediaVision/BarcodeDetector.cs b/src/Tizen.Multimedia/MediaVision/BarcodeDetector.cs old mode 100755 new mode 100644 index 8430537..c92e641 --- a/src/Tizen.Multimedia/MediaVision/BarcodeDetector.cs +++ b/src/Tizen.Multimedia/MediaVision/BarcodeDetector.cs @@ -17,8 +17,8 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using InteropBarcode = Interop.MediaVision.BarcodeDetector; -using Unmanaged = Interop.MediaVision; +using InteropBarcode = Tizen.Multimedia.Interop.MediaVision.BarcodeDetector; +using Unmanaged = Tizen.Multimedia.Interop.MediaVision; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/BarcodeGenerator.cs b/src/Tizen.Multimedia/MediaVision/BarcodeGenerator.cs old mode 100755 new mode 100644 index 160b51c..55983f7 --- a/src/Tizen.Multimedia/MediaVision/BarcodeGenerator.cs +++ b/src/Tizen.Multimedia/MediaVision/BarcodeGenerator.cs @@ -15,7 +15,7 @@ */ using System; -using InteropBarcode = Interop.MediaVision.BarcodeGenerator; +using InteropBarcode = Tizen.Multimedia.Interop.MediaVision.BarcodeGenerator; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/EngineConfiguration.cs b/src/Tizen.Multimedia/MediaVision/EngineConfiguration.cs old mode 100755 new mode 100644 index a9a8347..604f2ba --- a/src/Tizen.Multimedia/MediaVision/EngineConfiguration.cs +++ b/src/Tizen.Multimedia/MediaVision/EngineConfiguration.cs @@ -16,7 +16,7 @@ using System; using System.Runtime.InteropServices; -using static Interop.MediaVision; +using static Tizen.Multimedia.Interop.MediaVision; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/FaceDetector.cs b/src/Tizen.Multimedia/MediaVision/FaceDetector.cs old mode 100755 new mode 100644 index 47792f6..bf90073 --- a/src/Tizen.Multimedia/MediaVision/FaceDetector.cs +++ b/src/Tizen.Multimedia/MediaVision/FaceDetector.cs @@ -16,7 +16,7 @@ using System; using System.Threading.Tasks; -using InteropFace = Interop.MediaVision.Face; +using InteropFace = Tizen.Multimedia.Interop.MediaVision.Face; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/FaceRecognitionModel.cs b/src/Tizen.Multimedia/MediaVision/FaceRecognitionModel.cs old mode 100755 new mode 100644 index dcbea29..bccb800 --- a/src/Tizen.Multimedia/MediaVision/FaceRecognitionModel.cs +++ b/src/Tizen.Multimedia/MediaVision/FaceRecognitionModel.cs @@ -17,7 +17,7 @@ using System; using System.IO; using System.Runtime.InteropServices; -using InteropModel = Interop.MediaVision.FaceRecognitionModel; +using InteropModel = Tizen.Multimedia.Interop.MediaVision.FaceRecognitionModel; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/FaceRecognizer.cs b/src/Tizen.Multimedia/MediaVision/FaceRecognizer.cs old mode 100755 new mode 100644 index a914b4a..7c06dc3 --- a/src/Tizen.Multimedia/MediaVision/FaceRecognizer.cs +++ b/src/Tizen.Multimedia/MediaVision/FaceRecognizer.cs @@ -17,7 +17,7 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; -using InteropFace = Interop.MediaVision.Face; +using InteropFace = Tizen.Multimedia.Interop.MediaVision.Face; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/FaceTracker.cs b/src/Tizen.Multimedia/MediaVision/FaceTracker.cs old mode 100755 new mode 100644 index c49a61e..f472c19 --- a/src/Tizen.Multimedia/MediaVision/FaceTracker.cs +++ b/src/Tizen.Multimedia/MediaVision/FaceTracker.cs @@ -17,7 +17,7 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; -using InteropFace = Interop.MediaVision.Face; +using InteropFace = Tizen.Multimedia.Interop.MediaVision.Face; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/FaceTrackingModel.cs b/src/Tizen.Multimedia/MediaVision/FaceTrackingModel.cs old mode 100755 new mode 100644 index 2b2a8e2..bddeac3 --- a/src/Tizen.Multimedia/MediaVision/FaceTrackingModel.cs +++ b/src/Tizen.Multimedia/MediaVision/FaceTrackingModel.cs @@ -16,7 +16,7 @@ using System; using System.IO; -using InteropModel = Interop.MediaVision.FaceTrackingModel; +using InteropModel = Tizen.Multimedia.Interop.MediaVision.FaceTrackingModel; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/ImageObject.cs b/src/Tizen.Multimedia/MediaVision/ImageObject.cs index eedcbba..9974f42 100644 --- a/src/Tizen.Multimedia/MediaVision/ImageObject.cs +++ b/src/Tizen.Multimedia/MediaVision/ImageObject.cs @@ -16,7 +16,7 @@ using System; using System.IO; -using InteropImage = Interop.MediaVision.Image; +using InteropImage = Tizen.Multimedia.Interop.MediaVision.Image; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/ImageRecognizer.cs b/src/Tizen.Multimedia/MediaVision/ImageRecognizer.cs old mode 100755 new mode 100644 index bf950ac..48e4ff8 --- a/src/Tizen.Multimedia/MediaVision/ImageRecognizer.cs +++ b/src/Tizen.Multimedia/MediaVision/ImageRecognizer.cs @@ -17,7 +17,7 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; -using InteropImage = Interop.MediaVision.Image; +using InteropImage = Tizen.Multimedia.Interop.MediaVision.Image; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/ImageTracker.cs b/src/Tizen.Multimedia/MediaVision/ImageTracker.cs old mode 100755 new mode 100644 index d1f0a3e..1ca7170 --- a/src/Tizen.Multimedia/MediaVision/ImageTracker.cs +++ b/src/Tizen.Multimedia/MediaVision/ImageTracker.cs @@ -17,7 +17,7 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; -using InteropImage = Interop.MediaVision.Image; +using InteropImage = Tizen.Multimedia.Interop.MediaVision.Image; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/ImageTrackingModel.cs b/src/Tizen.Multimedia/MediaVision/ImageTrackingModel.cs old mode 100755 new mode 100644 index f982ca9..add2130 --- a/src/Tizen.Multimedia/MediaVision/ImageTrackingModel.cs +++ b/src/Tizen.Multimedia/MediaVision/ImageTrackingModel.cs @@ -16,7 +16,7 @@ using System; using System.IO; -using InteropModel = Interop.MediaVision.ImageTrackingModel; +using InteropModel = Tizen.Multimedia.Interop.MediaVision.ImageTrackingModel; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/MediaVisionSource.cs b/src/Tizen.Multimedia/MediaVision/MediaVisionSource.cs old mode 100755 new mode 100644 index a4de14f..04c7068 --- a/src/Tizen.Multimedia/MediaVision/MediaVisionSource.cs +++ b/src/Tizen.Multimedia/MediaVision/MediaVisionSource.cs @@ -16,7 +16,7 @@ using System; using System.Diagnostics; -using InteropSource = Interop.MediaVision.MediaSource; +using InteropSource = Tizen.Multimedia.Interop.MediaVision.MediaSource; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/MovementDetector.cs b/src/Tizen.Multimedia/MediaVision/MovementDetector.cs index a989a7c..fde8c32 100644 --- a/src/Tizen.Multimedia/MediaVision/MovementDetector.cs +++ b/src/Tizen.Multimedia/MediaVision/MovementDetector.cs @@ -15,7 +15,7 @@ */ using System; -using static Interop.MediaVision.Surveillance; +using static Tizen.Multimedia.Interop.MediaVision.Surveillance; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/PersonAppearanceDetector.cs b/src/Tizen.Multimedia/MediaVision/PersonAppearanceDetector.cs index 029d38f..fcd4c0f 100644 --- a/src/Tizen.Multimedia/MediaVision/PersonAppearanceDetector.cs +++ b/src/Tizen.Multimedia/MediaVision/PersonAppearanceDetector.cs @@ -15,7 +15,7 @@ */ using System; -using static Interop.MediaVision.Surveillance; +using static Tizen.Multimedia.Interop.MediaVision.Surveillance; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/PersonRecognizer.cs b/src/Tizen.Multimedia/MediaVision/PersonRecognizer.cs index 63f12ff..a6cb655 100644 --- a/src/Tizen.Multimedia/MediaVision/PersonRecognizer.cs +++ b/src/Tizen.Multimedia/MediaVision/PersonRecognizer.cs @@ -15,7 +15,7 @@ */ using System; -using static Interop.MediaVision.Surveillance; +using static Tizen.Multimedia.Interop.MediaVision.Surveillance; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/SurveillanceEngine.cs b/src/Tizen.Multimedia/MediaVision/SurveillanceEngine.cs index bf0c87c..1144add 100644 --- a/src/Tizen.Multimedia/MediaVision/SurveillanceEngine.cs +++ b/src/Tizen.Multimedia/MediaVision/SurveillanceEngine.cs @@ -16,7 +16,7 @@ using System; using System.Runtime.InteropServices; -using static Interop.MediaVision.Surveillance; +using static Tizen.Multimedia.Interop.MediaVision.Surveillance; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MediaVision/SurveillanceSource.cs b/src/Tizen.Multimedia/MediaVision/SurveillanceSource.cs index bd9c314..608a8b3 100644 --- a/src/Tizen.Multimedia/MediaVision/SurveillanceSource.cs +++ b/src/Tizen.Multimedia/MediaVision/SurveillanceSource.cs @@ -15,7 +15,7 @@ */ using System; -using static Interop.MediaVision.Surveillance; +using static Tizen.Multimedia.Interop.MediaVision.Surveillance; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/MetadataExtractor/Metadata.cs b/src/Tizen.Multimedia/MetadataExtractor/Metadata.cs old mode 100755 new mode 100644 index 977e84c..818687d --- a/src/Tizen.Multimedia/MetadataExtractor/Metadata.cs +++ b/src/Tizen.Multimedia/MetadataExtractor/Metadata.cs @@ -16,7 +16,7 @@ using System; using System.Diagnostics; -using static Interop.MetadataExtractor; +using static Tizen.Multimedia.Interop.MetadataExtractor; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/Tizen.Multimedia.csproj b/src/Tizen.Multimedia/Tizen.Multimedia.csproj old mode 100755 new mode 100644 index ff642a3..9e8bb4e --- a/src/Tizen.Multimedia/Tizen.Multimedia.csproj +++ b/src/Tizen.Multimedia/Tizen.Multimedia.csproj @@ -1,72 +1,335 @@ - - - - Debug - AnyCPU - {0CE698B0-4849-4096-9D7F-30E611F50DAD} - Library - Properties - Tizen.Multimedia - Tizen.Multimedia - 512 - - - .NETStandard - v1.3 - .NETStandard,Version=v1.3 - false - true - $(NoWarn);1701;1702 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - - - Tizen.Multimedia.snk - - - - - - - - - - + + + + Debug + AnyCPU + {0CE698B0-4849-4096-9D7F-30E611F50DAD} + Library + Properties + Tizen.Multimedia + Tizen.Multimedia + 512 + + + .NETStandard + v1.3 + .NETStandard,Version=v1.3 + false + true + $(NoWarn);1701;1702 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + Tizen.Multimedia.snk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + --> + + --> - <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) - <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) - true - + --> + <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) + <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) + true + \ No newline at end of file -- 2.7.4