From 94bf3e0d24cc5e781ee1faa099139cfadc7e1e66 Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Tue, 28 Mar 2017 21:35:49 +0900 Subject: [PATCH] [Camera] Fixed possible memory leak and Add some descriptions Change-Id: I0ba0270c801ea6b3d6f4bfb94a64037d9d826a5b Signed-off-by: Haesu Gwon --- packaging/csapi-multimedia.spec | 2 +- src/Tizen.Multimedia/Camera/Camera.cs | 157 ++++--- src/Tizen.Multimedia/Camera/CameraDisplay.cs | 18 +- src/Tizen.Multimedia/Camera/CameraErrorFactory.cs | 9 +- src/Tizen.Multimedia/Camera/CameraFeatures.cs | 453 ++++++++++++++------- src/Tizen.Multimedia/Camera/CameraSettings.cs | 106 ++++- src/Tizen.Multimedia/Interop/Interop.Camera.cs | 88 ++-- .../Interop/Interop.CameraDisplay.cs | 22 +- .../Interop/Interop.CameraFeatures.cs | 34 +- .../Interop/Interop.CameraSettings.cs | 140 +++---- src/Tizen.Multimedia/Interop/Interop.Recorder.cs | 50 +-- .../Interop/Interop.RecorderFeatures.cs | 8 +- .../Interop/Interop.RecorderSettings.cs | 60 +-- src/Tizen.Multimedia/Recorder/Recorder.cs | 86 +++- .../Recorder/RecorderErrorFactory.cs | 9 +- src/Tizen.Multimedia/Recorder/RecorderFeatures.cs | 106 +++-- src/Tizen.Multimedia/Recorder/RecorderSettings.cs | 38 +- src/Tizen.Multimedia/Tizen.Multimedia.project.json | 6 +- 18 files changed, 905 insertions(+), 487 deletions(-) mode change 100644 => 100755 src/Tizen.Multimedia/Interop/Interop.Camera.cs mode change 100644 => 100755 src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs mode change 100644 => 100755 src/Tizen.Multimedia/Interop/Interop.CameraFeatures.cs mode change 100644 => 100755 src/Tizen.Multimedia/Interop/Interop.CameraSettings.cs mode change 100644 => 100755 src/Tizen.Multimedia/Interop/Interop.RecorderFeatures.cs mode change 100644 => 100755 src/Tizen.Multimedia/Interop/Interop.RecorderSettings.cs diff --git a/packaging/csapi-multimedia.spec b/packaging/csapi-multimedia.spec index 9e4458c..a3ab59e 100755 --- a/packaging/csapi-multimedia.spec +++ b/packaging/csapi-multimedia.spec @@ -1,6 +1,6 @@ Name: csapi-multimedia Summary: Tizen Multimedia API for C# -Version: 1.0.48 +Version: 1.0.49 Release: 0 Group: Development/Libraries License: Apache-2.0 diff --git a/src/Tizen.Multimedia/Camera/Camera.cs b/src/Tizen.Multimedia/Camera/Camera.cs index ecbeae9..34da30f 100755 --- a/src/Tizen.Multimedia/Camera/Camera.cs +++ b/src/Tizen.Multimedia/Camera/Camera.cs @@ -26,6 +26,8 @@ namespace Tizen.Multimedia static internal class CameraLog { internal const string Tag = "Tizen.Multimedia.Camera"; + internal const string Enter = "[Enter]"; + internal const string Leave = "[Leave]"; } /// @@ -48,6 +50,9 @@ namespace Tizen.Multimedia /// Initializes a new instance of the Class. /// /// The camera device to access + /// + /// http://tizen.org/privilege/camera + /// public Camera(CameraDevice device) { CameraErrorFactory.ThrowIfError(Interop.Camera.Create((int)device, out _handle), @@ -59,7 +64,7 @@ namespace Tizen.Multimedia RegisterCallbacks(); - _state = CameraState.Created; + SetState(CameraState.Created); } /// @@ -109,6 +114,7 @@ namespace Tizen.Multimedia { if (_disposed) { + Log.Error(CameraLog.Tag, "Camera handle is disposed."); throw new ObjectDisposedException(nameof(Camera)); } } @@ -349,10 +355,14 @@ namespace Tizen.Multimedia /// /// Gets the state of the camera. /// + /// None, Created, Preview, Capturing, Captured + /// The camera already has been disposed. public CameraState State { get { + ValidateNotDisposed(); + CameraState val = CameraState.None; CameraErrorFactory.ThrowIfError(Interop.Camera.GetState(_handle, out val), "Failed to get camera state"); @@ -366,11 +376,15 @@ namespace Tizen.Multimedia /// If the hint is set to true, the display will be reused when the camera device is changed with /// ChangeDevice method. /// - /// In case of invalid parameters + /// In case of invalid parameters. + /// Invalid state. + /// The camera already has been disposed. public bool DisplayReuseHint { get { + ValidateNotDisposed(); + bool val = false; CameraErrorFactory.ThrowIfError(Interop.Camera.GetDisplayReuseHint(_handle, out val), @@ -381,6 +395,8 @@ namespace Tizen.Multimedia set { + ValidateState(CameraState.Preview); + CameraErrorFactory.ThrowIfError(Interop.Camera.SetDisplayReuseHint(_handle, value), "Failed to set display reuse hint."); } @@ -389,10 +405,14 @@ namespace Tizen.Multimedia /// /// Gets the facing direction of camera module. /// + /// A that specifies the facing direction of camera device. + /// The camera already has been disposed. public CameraFacingDirection Direction { get { + ValidateNotDisposed(); + CameraFacingDirection val = 0; CameraErrorFactory.ThrowIfError(Interop.Camera.GetFacingDirection(_handle, out val), @@ -405,14 +425,15 @@ namespace Tizen.Multimedia /// /// Gets the camera device count. /// - /// - /// This returns 2, if the device supports primary and secondary cameras. - /// Otherwise 1, if the device only supports primary camera. - /// + /// This returns 2, if the device supports primary and secondary cameras. + /// Otherwise 1, if the device only supports primary camera. + /// The camera already has been disposed. public int CameraCount { get { + ValidateNotDisposed(); + int val = 0; CameraErrorFactory.ThrowIfError(Interop.Camera.GetDeviceCount(_handle, out val), @@ -421,9 +442,9 @@ namespace Tizen.Multimedia return val; } } -#endregion Properties + #endregion Properties -#region Methods + #region Methods /// /// Changes the camera device. /// @@ -437,9 +458,10 @@ namespace Tizen.Multimedia /// can be kept even though camera device is changed. /// The camera must be in the or state. /// - /// In case of invalid parameters - /// In case of any invalid operations - /// In case of ChangeDevice feature is not supported + /// In case of invalid parameters. + /// In case of any invalid operations. + /// In case of ChangeDevice feature is not supported. + /// The camera already has been disposed. public void ChangeDevice(CameraDevice device) { ValidateState(CameraState.Created, CameraState.Preview); @@ -456,9 +478,9 @@ namespace Tizen.Multimedia /// /// The device to get state. /// Returns the state of camera device - /// In case of invalid parameters - /// In case of any invalid operations - /// In case of this feature is not supported + /// In case of invalid parameters. + /// In case of any invalid operations. + /// In case of this feature is not supported. public CameraDeviceState GetDeviceState(CameraDevice device) { int val = 0; @@ -469,6 +491,17 @@ namespace Tizen.Multimedia return (CameraDeviceState)val; } + /// + /// Gets the flash state. + /// + /// + /// http://tizen.org/privilege/camera + /// + /// The device to get state. + /// Returns the flash state of camera device + /// In case of invalid parameters. + /// In case of any invalid operations. + /// In case of this feature is not supported. public static CameraFlashState GetFlashState(CameraDevice device) { CameraFlashState val = CameraFlashState.NotUsed; @@ -481,18 +514,20 @@ namespace Tizen.Multimedia /// /// Starts capturing and drawing preview frames on the screen. - /// The display handle must be set using + /// The display handle must be set using /// before using this method. - /// If needed set fps , preview resolution - /// , or preview format + /// If needed set fps , preview resolution + /// , or preview format /// before using this method. + /// The camera must be in the or state. /// /// /// http://tizen.org/privilege/camera /// - /// In case of any invalid operations - /// In case of this feature is not supported - /// In case of access to the resources cannot be granted + /// In case of any invalid operations. + /// In case of this feature is not supported. + /// The camera already has been disposed. + /// In case of access to the resources cannot be granted. public void StartPreview() { ValidateState(CameraState.Created, CameraState.Captured); @@ -506,15 +541,19 @@ namespace Tizen.Multimedia /// /// Stops capturing and drawing preview frames on the screen. + /// The camera must be in the state. /// /// /// http://tizen.org/privilege/camera /// - /// In case of any invalid operations - /// In case of this feature is not supported - /// In case of access to the resources cannot be granted + /// In case of any invalid operations. + /// In case of this feature is not supported. + /// The camera already has been disposed. + /// In case of access to the resources cannot be granted. public void StopPreview() { + ValidateState(CameraState.Preview); + CameraErrorFactory.ThrowIfError(Interop.Camera.StopPreview(_handle), "Failed to stop the camera preview."); @@ -523,9 +562,9 @@ namespace Tizen.Multimedia /// /// Starts capturing of still images. - /// EventHandler must be set for capturing using - /// and for completed using before - /// calling this method. + /// EventHandler must be set for capturing using + /// and for completed using before calling this method. + /// The camera must be in the state. /// /// /// http://tizen.org/privilege/camera @@ -533,12 +572,12 @@ namespace Tizen.Multimedia /// /// This function causes the transition of the camera state from Capturing to Captured /// automatically and the corresponding EventHandlers will be invoked. - /// The camera's preview should be restarted by calling - /// method. + /// The preview should be restarted by calling method after capture is completed. /// - /// In case of any invalid operations - /// In case of this feature is not supported - /// In case of access to the resources cannot be granted + /// In case of any invalid operations. + /// In case of this feature is not supported. + /// The camera already has been disposed. + /// In case of access to the resources cannot be granted. public void StartCapture() { ValidateState(CameraState.Preview); @@ -551,26 +590,29 @@ namespace Tizen.Multimedia /// /// Starts continuously capturing still images. - /// EventHandler must be set for capturing using - /// and for completed using before - /// calling this method. + /// EventHandler must be set for capturing using + /// and for completed using before calling this method. + /// The camera must be in the state. /// /// /// http://tizen.org/privilege/camera /// /// The number of still images. /// The interval of the capture(milliseconds). + /// The cancellation token to cancel capturing. + /// /// /// If this is not supported zero shutter lag occurs. The capture resolution could be /// changed to the preview resolution. This function causes the transition of the camera state /// from Capturing to Captured automatically and the corresponding Eventhandlers will be invoked. - /// Each captured image will be delivered through Eventhandler set using event. - /// The camera's preview should be restarted by calling method. + /// Each captured image will be delivered through Eventhandler set using event. + /// The preview should be restarted by calling method after capture is completed. /// - /// In case of invalid parameters - /// In case of any invalid operations - /// In case of this feature is not supported - /// In case of access to the resources cannot be granted + /// In case of invalid parameters. + /// In case of any invalid operations. + /// In case of this feature is not supported. + /// The camera already has been disposed. + /// In case of access to the resources cannot be granted. public void StartCapture(int count, int interval, CancellationToken cancellationToken) { ValidateState(CameraState.Preview); @@ -604,18 +646,20 @@ namespace Tizen.Multimedia /// /// Starts camera auto-focusing, asynchronously. + /// The camera must be in the or state. /// - /// Continuous. + /// Continuous auto focus /// /// http://tizen.org/privilege/camera /// /// /// If continuous status is true, the camera continuously tries to focus. /// - /// In case of invalid parameters - /// In case of any invalid operations - /// In case of this feature is not supported - /// In case of access to the resources cannot be granted + /// In case of invalid parameters. + /// In case of any invalid operations. + /// In case of this feature is not supported. + /// The camera already has been disposed. + /// In case of access to the resources cannot be granted. public void StartFocusing(bool continuous) { ValidateState(CameraState.Preview, CameraState.Captured); @@ -626,13 +670,15 @@ namespace Tizen.Multimedia /// /// Stops camera auto focusing. + /// The camera must be in the or state. /// /// /// http://tizen.org/privilege/camera /// - /// In case of any invalid operations - /// In case of this feature is not supported - /// In case of access to the resources cannot be granted + /// In case of any invalid operations. + /// In case of this feature is not supported. + /// The camera already has been disposed. + /// In case of access to the resources cannot be granted. public void StopFocusing() { ValidateState(CameraState.Preview, CameraState.Captured); @@ -643,18 +689,20 @@ namespace Tizen.Multimedia /// /// Starts face detection. + /// The camera must be in the state. /// /// /// http://tizen.org/privilege/camera /// /// - /// This should be called after is started. - /// The Eventhandler set using invoked when the face is detected in preview frame. + /// This should be called after is started. + /// The Eventhandler set using invoked when the face is detected in preview frame. /// Internally it starts continuous focus and focusing on the detected face. /// - /// In case of any invalid operations - /// In case of this feature is not supported - /// In case of access to the resources cannot be granted + /// In case of any invalid operations. + /// In case of this feature is not supported. + /// The camera already has been disposed. + /// In case of access to the resources cannot be granted. public void StartFaceDetection() { ValidateState(CameraState.Preview); @@ -684,6 +732,7 @@ namespace Tizen.Multimedia /// /// In case of any invalid operations /// In case of this feature is not supported + /// The camera already has been disposed. /// In case of access to the resources cannot be granted public void StopFaceDetection() { @@ -748,7 +797,7 @@ namespace Tizen.Multimedia { _stateChangedCallback = (CameraState previous, CameraState current, bool byPolicy, IntPtr _) => { - _state = current; + SetState(current); Log.Info(CameraLog.Tag, "Camera state changed " + previous.ToString() + " -> " + current.ToString()); StateChanged?.Invoke(this, new CameraStateChangedEventArgs(previous, current, byPolicy)); }; diff --git a/src/Tizen.Multimedia/Camera/CameraDisplay.cs b/src/Tizen.Multimedia/Camera/CameraDisplay.cs index e9c4774..877deb0 100755 --- a/src/Tizen.Multimedia/Camera/CameraDisplay.cs +++ b/src/Tizen.Multimedia/Camera/CameraDisplay.cs @@ -35,6 +35,8 @@ namespace Tizen.Multimedia /// /// The display mode. /// + /// A that specifies the display mode. + /// The camera already has been disposed. public CameraDisplayMode Mode { get @@ -58,6 +60,7 @@ namespace Tizen.Multimedia /// The display visibility. /// True if camera display visible, otherwise false. /// + /// The camera already has been disposed. public bool Visible { get @@ -80,9 +83,11 @@ namespace Tizen.Multimedia /// /// The display rotation. /// + /// A that specifies the rotation of camera device. /// /// http://tizen.org/privilege/camera. /// + /// The camera already has been disposed. public CameraRotation Rotation { get @@ -105,9 +110,11 @@ namespace Tizen.Multimedia /// /// The display flip. /// + /// A that specifies camera flip type. /// /// http://tizen.org/privilege/camera. /// + /// The camera already has been disposed. public CameraFlip Flip { get @@ -130,6 +137,7 @@ namespace Tizen.Multimedia /// /// the ROI(Region Of Interest) area of display. /// + /// The camera already has been disposed. public Rectangle RoiArea { get @@ -154,6 +162,7 @@ namespace Tizen.Multimedia /// /// Sets the display type and handle to show preview images. + /// The camera must be in the state. /// /// Display type. /// MediaView object to display preview. @@ -161,10 +170,11 @@ namespace Tizen.Multimedia /// This method must be called before StartPreview() method. /// In Custom ROI display mode, DisplayRoiArea property must be set before calling this method. /// - /// In case of invalid parameters - /// In case of any invalid operations - /// In case of this feature is not supported - /// In case of access to the resources cannot be granted + /// In case of invalid parameters. + /// In case of any invalid operations. + /// In case of this feature is not supported. + /// The camera already has been disposed. + /// In case of access to the resources cannot be granted. public void SetInfo(CameraDisplayType displayType, MediaView displayHandle) { _camera.ValidateState(CameraState.Created); diff --git a/src/Tizen.Multimedia/Camera/CameraErrorFactory.cs b/src/Tizen.Multimedia/Camera/CameraErrorFactory.cs index 4d776fc..15862f3 100755 --- a/src/Tizen.Multimedia/Camera/CameraErrorFactory.cs +++ b/src/Tizen.Multimedia/Camera/CameraErrorFactory.cs @@ -42,18 +42,17 @@ namespace Tizen.Multimedia internal static class CameraErrorFactory { - internal static void ThrowIfError(int errorCode, string errorMessage = null, + internal static void ThrowIfError(CameraError errorCode, string errorMessage = null, [CallerMemberName] string caller = null, [CallerLineNumber] int line = 0) { - CameraError err = (CameraError)errorCode; - if (err == CameraError.None) + if (errorCode == CameraError.None) { return; } - Log.Info(CameraLog.Tag, "errorCode : " + err.ToString() + ", Caller : " + caller + ", line " + line.ToString()); + Log.Info(CameraLog.Tag, "errorCode : " + errorCode.ToString() + ", Caller : " + caller + ", line " + line.ToString()); - switch (err) + switch (errorCode) { case CameraError.InvalidParameter: throw new ArgumentException(errorMessage); diff --git a/src/Tizen.Multimedia/Camera/CameraFeatures.cs b/src/Tizen.Multimedia/Camera/CameraFeatures.cs index a09d91f..374b7f4 100755 --- a/src/Tizen.Multimedia/Camera/CameraFeatures.cs +++ b/src/Tizen.Multimedia/Camera/CameraFeatures.cs @@ -34,6 +34,7 @@ namespace Tizen.Multimedia private List _captureFormats; private List _previewFormats; private List _fps; + private List _fpsByResolution; private List _autoFocusModes; private List _exposureModes; private List _isoLevels; @@ -46,7 +47,7 @@ namespace Tizen.Multimedia private List _streamFlips; private List _ptzTypes; - private delegate int GetRangeDelegate(IntPtr handle, out int min, out int max); + private delegate CameraError GetRangeDelegate(IntPtr handle, out int min, out int max); private delegate bool IsSupportedDelegate(IntPtr handle); internal CameraFeatures(Camera camera) @@ -78,7 +79,8 @@ namespace Tizen.Multimedia int min = 0; int max = 0; - CameraErrorFactory.ThrowIfError(func(_camera.GetHandle(), out min, out max), "Failed to check feature is suported or not."); + CameraErrorFactory.ThrowIfError(func(_camera.GetHandle(), out min, out max), + "Failed to check feature is suported or not."); return min < max; } @@ -168,21 +170,30 @@ namespace Tizen.Multimedia /// It returns a list containing all the supported preview resolutions. /// by recorder. /// + /// The camera already has been disposed. public IEnumerable SupportedPreviewResolutions { get { if (_previewResolutions == null) { - _previewResolutions = new List(); - - Interop.CameraFeatures.PreviewResolutionCallback callback = (int width, int height, IntPtr userData) => + try { - _previewResolutions.Add(new Size(width, height)); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedPreviewResolutions(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported preview resolutions"); + _previewResolutions = new List(); + + Interop.CameraFeatures.PreviewResolutionCallback callback = (int width, int height, IntPtr userData) => + { + _previewResolutions.Add(new Size(width, height)); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedPreviewResolutions(_camera.GetHandle(), callback, IntPtr.Zero), + "Failed to get the supported preview resolutions"); + } + catch + { + _previewResolutions = null; + throw; + } } return _previewResolutions; @@ -195,21 +206,30 @@ namespace Tizen.Multimedia /// /// It returns a list containing all the supported capture resolutions. /// + /// The camera already has been disposed. public IEnumerable SupportedCaptureResolutions { get { if (_cameraResolutions == null) { - _cameraResolutions = new List(); - - Interop.CameraFeatures.CaptureResolutionCallback callback = (int width, int height, IntPtr userData) => + try { - _cameraResolutions.Add(new Size(width, height)); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedCaptureResolutions(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported capture resolutions"); + _cameraResolutions = new List(); + + Interop.CameraFeatures.CaptureResolutionCallback callback = (int width, int height, IntPtr userData) => + { + _cameraResolutions.Add(new Size(width, height)); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedCaptureResolutions(_camera.GetHandle(), callback, IntPtr.Zero), + "Failed to get the supported capture resolutions"); + } + catch + { + _cameraResolutions = null; + throw; + } } return _cameraResolutions; @@ -220,23 +240,32 @@ namespace Tizen.Multimedia /// Retrieves all the capture formats supported by the camera. /// /// - /// It returns a list containing all the supported capture formats. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedCapturePixelFormats { get { if (_captureFormats == null) { - _captureFormats = new List(); - - Interop.CameraFeatures.CaptureFormatCallback callback = (CameraPixelFormat format, IntPtr userData) => + try { - _captureFormats.Add(format); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedCapturePixelFormats(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported capture formats."); + _captureFormats = new List(); + + Interop.CameraFeatures.CaptureFormatCallback callback = (CameraPixelFormat format, IntPtr userData) => + { + _captureFormats.Add(format); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedCapturePixelFormats(_camera.GetHandle(), callback, IntPtr.Zero), + "Failed to get the supported capture formats."); + } + catch + { + _captureFormats = null; + throw; + } } return _captureFormats; @@ -247,23 +276,32 @@ namespace Tizen.Multimedia /// Retrieves all the preview formats supported by the camera. /// /// - /// It returns a list containing all the supported preview formats. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedPreviewPixelFormats { get { if (_previewFormats == null) { - _previewFormats = new List(); - - Interop.CameraFeatures.PreviewFormatCallback callback = (CameraPixelFormat format, IntPtr userData) => + try { - _previewFormats.Add(format); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedPreviewPixelFormats(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported preview formats."); + _previewFormats = new List(); + + Interop.CameraFeatures.PreviewFormatCallback callback = (CameraPixelFormat format, IntPtr userData) => + { + _previewFormats.Add(format); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedPreviewPixelFormats(_camera.GetHandle(), callback, IntPtr.Zero), + "Failed to get the supported preview formats."); + } + catch + { + _previewFormats = null; + throw; + } } return _previewFormats; @@ -274,23 +312,32 @@ namespace Tizen.Multimedia /// Retrieves all the fps supported by the camera. /// /// - /// It returns a list containing all the supported fps. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedPreviewFps { get { if (_fps == null) { - _fps = new List(); - - Interop.CameraFeatures.FpsCallback callback = (CameraFps fps, IntPtr userData) => + try { - _fps.Add(fps); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedPreviewFps(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported camera fps"); + _fps = new List(); + + Interop.CameraFeatures.FpsCallback callback = (CameraFps fps, IntPtr userData) => + { + _fps.Add(fps); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedPreviewFps(_camera.GetHandle(), callback, IntPtr.Zero), + "Failed to get the supported camera fps"); + } + catch + { + _fps = null; + throw; + } } return _fps; @@ -301,55 +348,77 @@ namespace Tizen.Multimedia /// Retrieves all the fps by resolution supported by the camera. /// /// - /// It returns a list containing all the supported fps by resolution. + /// It returns a list containing all the supported by resolution. /// + /// The camera already has been disposed. public IEnumerable GetSupportedPreviewFpsByResolution(int width, int height) { - var result = new List(); - - Interop.CameraFeatures.FpsByResolutionCallback callback = (CameraFps fps, IntPtr userData) => + if (_fpsByResolution == null) { - result.Add(fps); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedPreviewFpsByResolution(_camera.GetHandle(), - width, height, callback, IntPtr.Zero), "Failed to get the supported fps by resolutions."); + try + { + _fpsByResolution = new List(); - return result; + Interop.CameraFeatures.FpsByResolutionCallback callback = (CameraFps fps, IntPtr userData) => + { + _fpsByResolution.Add(fps); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedPreviewFpsByResolution(_camera.GetHandle(), + width, height, callback, IntPtr.Zero), "Failed to get the supported fps by resolutions."); + } + catch + { + _fpsByResolution = null; + throw; + } + } + + return _fpsByResolution; } /// /// Retrieves all the fps by resolution supported by the camera. /// /// - /// It returns a list containing all the supported fps by resolution. + /// It returns a list containing all the supported by resolution. /// + /// The camera already has been disposed. public IEnumerable GetSupportedPreviewFpsByResolution(Size size) { return GetSupportedPreviewFpsByResolution(size.Width, size.Height); } /// - /// Retrieves all the fps by resolution supported by the camera. + /// Retrieves all the auto focus modes supported by the camera. /// /// - /// It returns a list containing all the supported fps by resolution. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedAutoFocusModes { get { if (_autoFocusModes == null) { - _autoFocusModes = new List(); - - Interop.CameraFeatures.AfModeCallback callback = (CameraAutoFocusMode mode, IntPtr userData) => + try { - _autoFocusModes.Add(mode); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedAfModes(_camera.GetHandle(), callback, IntPtr.Zero), + _autoFocusModes = new List(); + + Interop.CameraFeatures.AfModeCallback callback = (CameraAutoFocusMode mode, IntPtr userData) => + { + _autoFocusModes.Add(mode); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedAfModes(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported Auto focus modes."); + } + catch + { + _autoFocusModes = null; + throw; + } } return _autoFocusModes; @@ -360,23 +429,32 @@ namespace Tizen.Multimedia /// Retrieves all the exposure modes supported by the camera. /// /// - /// It returns a list containing all the supported camera exposure modes. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedExposureModes { get { if (_exposureModes == null) { - _exposureModes = new List(); - - Interop.CameraFeatures.ExposureModeCallback callback = (CameraExposureMode mode, IntPtr userData) => + try { - _exposureModes.Add(mode); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedExposureModes(_camera.GetHandle(), callback, IntPtr.Zero), + _exposureModes = new List(); + + Interop.CameraFeatures.ExposureModeCallback callback = (CameraExposureMode mode, IntPtr userData) => + { + _exposureModes.Add(mode); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedExposureModes(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported Exposure modes."); + } + catch + { + _exposureModes = null; + throw; + } } return _exposureModes; @@ -387,23 +465,32 @@ namespace Tizen.Multimedia /// Retrieves all the Iso level supported by the camera. /// /// - /// It returns a list containing all the supported camera Iso levels. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedIsoLevels { get { if (_isoLevels == null) { - _isoLevels = new List(); - - Interop.CameraFeatures.IsoCallback callback = (CameraIsoLevel iso, IntPtr userData) => + try { - _isoLevels.Add(iso); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedIso(_camera.GetHandle(), callback, IntPtr.Zero), + _isoLevels = new List(); + + Interop.CameraFeatures.IsoCallback callback = (CameraIsoLevel iso, IntPtr userData) => + { + _isoLevels.Add(iso); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedIso(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported Iso levels."); + } + catch + { + _isoLevels = null; + throw; + } } return _isoLevels; @@ -414,23 +501,32 @@ namespace Tizen.Multimedia /// Retrieves all the theater modes supported by the camera. /// /// - /// It returns a list containing all the supported camera theater modes. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedTheaterModes { get { if (_theaterModes == null) { - _theaterModes = new List(); - - Interop.CameraFeatures.TheaterModeCallback callback = (CameraTheaterMode theaterMode, IntPtr userData) => + try { - _theaterModes.Add(theaterMode); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedTheaterModes(_camera.GetHandle(), callback, IntPtr.Zero), + _theaterModes = new List(); + + Interop.CameraFeatures.TheaterModeCallback callback = (CameraTheaterMode theaterMode, IntPtr userData) => + { + _theaterModes.Add(theaterMode); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedTheaterModes(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported theater modes."); + } + catch + { + _theaterModes = null; + throw; + } } return _theaterModes; @@ -438,26 +534,35 @@ namespace Tizen.Multimedia } /// - /// Retrieves all the whitebalance mode supported by the camera. + /// Retrieves all the whitebalance modes supported by the camera. /// /// - /// It returns a list containing all the supported camera white balance modes. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedWhiteBalances { get { if (_whitebalances == null) { - _whitebalances = new List(); - - Interop.CameraFeatures.WhitebalanceCallback callback = (CameraWhiteBalance whiteBalance, IntPtr userData) => + try { - _whitebalances.Add(whiteBalance); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedWhitebalance(_camera.GetHandle(), callback, IntPtr.Zero), + _whitebalances = new List(); + + Interop.CameraFeatures.WhitebalanceCallback callback = (CameraWhiteBalance whiteBalance, IntPtr userData) => + { + _whitebalances.Add(whiteBalance); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedWhitebalance(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported white balance."); + } + catch + { + _whitebalances = null; + throw; + } } return _whitebalances; @@ -468,23 +573,32 @@ namespace Tizen.Multimedia /// Retrieves all the flash modes supported by the camera. /// /// - /// It returns a list containing all the supported camera flash modes. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedFlashModes { get { if (_flashModes == null) { - _flashModes = new List(); - - Interop.CameraFeatures.FlashModeCallback callback = (CameraFlashMode flashMode, IntPtr userData) => + try { - _flashModes.Add(flashMode); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedFlashModes(_camera.GetHandle(), callback, IntPtr.Zero), + _flashModes = new List(); + + Interop.CameraFeatures.FlashModeCallback callback = (CameraFlashMode flashMode, IntPtr userData) => + { + _flashModes.Add(flashMode); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedFlashModes(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported flash modes."); + } + catch + { + _flashModes = null; + throw; + } } return _flashModes; @@ -495,23 +609,32 @@ namespace Tizen.Multimedia /// Retrieves all the scene modes supported by the camera. /// /// - /// It returns a list containing all the supported camera scene modes. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedSceneModes { get { if (_sceneModes == null) { - _sceneModes = new List(); - - Interop.CameraFeatures.SceneModeCallback callback = (CameraSceneMode sceneMode, IntPtr userData) => + try { - _sceneModes.Add(sceneMode); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedSceneModes(_camera.GetHandle(), callback, IntPtr.Zero), + _sceneModes = new List(); + + Interop.CameraFeatures.SceneModeCallback callback = (CameraSceneMode sceneMode, IntPtr userData) => + { + _sceneModes.Add(sceneMode); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedSceneModes(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported scene modes."); + } + catch + { + _sceneModes = null; + throw; + } } return _sceneModes; @@ -519,26 +642,35 @@ namespace Tizen.Multimedia } /// - /// Retrieves all the effects supported by the camera. + /// Retrieves all the effect modes supported by the camera. /// /// - /// It returns a list containing all the supported camera effects. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedEffects { get { if (_effectModes == null) { - _effectModes = new List(); - - Interop.CameraFeatures.EffectCallback callback = (CameraEffectMode effect, IntPtr userData) => + try { - _effectModes.Add(effect); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedEffects(_camera.GetHandle(), callback, IntPtr.Zero), + _effectModes = new List(); + + Interop.CameraFeatures.EffectCallback callback = (CameraEffectMode effect, IntPtr userData) => + { + _effectModes.Add(effect); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedEffects(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported camera effects."); + } + catch + { + _effectModes = null; + throw; + } } return _effectModes; @@ -549,23 +681,32 @@ namespace Tizen.Multimedia /// Retrieves all the stream rotation supported by the camera. /// /// - /// It returns a list containing all the supported camera stream rotations. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedStreamRotations { get { if (_streamRotations == null) { - _streamRotations = new List(); - - Interop.CameraFeatures.StreamRotationCallback callback = (CameraRotation streamRotation, IntPtr userData) => + try { - _streamRotations.Add(streamRotation); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedStreamRotations(_camera.GetHandle(), callback, IntPtr.Zero), + _streamRotations = new List(); + + Interop.CameraFeatures.StreamRotationCallback callback = (CameraRotation streamRotation, IntPtr userData) => + { + _streamRotations.Add(streamRotation); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedStreamRotations(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported camera rotations."); + } + catch + { + _streamRotations = null; + throw; + } } return _streamRotations; @@ -576,23 +717,32 @@ namespace Tizen.Multimedia /// Retrieves all the flips supported by the camera. /// /// - /// It returns a list containing all the supported camera flip. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedStreamFlips { get { if (_streamFlips == null) { - _streamFlips = new List(); - - Interop.CameraFeatures.StreamFlipCallback callback = (CameraFlip streamFlip, IntPtr userData) => + try { - _streamFlips.Add(streamFlip); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedStreamFlips(_camera.GetHandle(), callback, IntPtr.Zero), + _streamFlips = new List(); + + Interop.CameraFeatures.StreamFlipCallback callback = (CameraFlip streamFlip, IntPtr userData) => + { + _streamFlips.Add(streamFlip); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedStreamFlips(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported camera flips."); + } + catch + { + _streamFlips = null; + throw; + } } return _streamFlips; @@ -603,23 +753,32 @@ namespace Tizen.Multimedia /// Retrieves all the ptz types by the camera. /// /// - /// It returns a list containing all the supported ptz types. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedPtzTypes { get { if (_ptzTypes.Count == 0) { - _ptzTypes = new List(); - - Interop.CameraFeatures.PtzTypeCallback callback = (CameraPtzType ptzType, IntPtr userData) => + try { - _ptzTypes.Add(ptzType); - return true; - }; - CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedPtzTypes(_camera.GetHandle(), callback, IntPtr.Zero), + _ptzTypes = new List(); + + Interop.CameraFeatures.PtzTypeCallback callback = (CameraPtzType ptzType, IntPtr userData) => + { + _ptzTypes.Add(ptzType); + return true; + }; + CameraErrorFactory.ThrowIfError(Interop.CameraFeatures.SupportedPtzTypes(_camera.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported Ptz types."); + } + catch + { + _ptzTypes = null; + throw; + } } return _ptzTypes; diff --git a/src/Tizen.Multimedia/Camera/CameraSettings.cs b/src/Tizen.Multimedia/Camera/CameraSettings.cs index 16d3d6e..9a8845a 100755 --- a/src/Tizen.Multimedia/Camera/CameraSettings.cs +++ b/src/Tizen.Multimedia/Camera/CameraSettings.cs @@ -47,7 +47,7 @@ namespace Tizen.Multimedia _tiltRange = GetRange(Interop.CameraSettings.GetTiltRange); } - private delegate int GetRangeDelegate(IntPtr handle, out int min, out int max); + private delegate CameraError GetRangeDelegate(IntPtr handle, out int min, out int max); private Range? GetRange(GetRangeDelegate func) { int min = 0; @@ -68,18 +68,36 @@ namespace Tizen.Multimedia /// /// Sets auto focus area. /// + /// + /// should not be the . + /// /// /// http://tizen.org/privilege/camera /// /// X position /// Y position - /// In case of invalid parameters + /// In case of invalid parameters. + /// In case of any invalid operations. + /// The camera already has been disposed. public void SetAutoFocusArea(int x, int y) { CameraErrorFactory.ThrowIfError(Interop.CameraSettings.SetAutoFocusArea(_camera.GetHandle(), x, y), "Failed to set the autofocus area."); } + /// + /// Sets auto focus area. + /// + /// + /// should not be the . + /// + /// + /// http://tizen.org/privilege/camera + /// + /// structure including X, Y position + /// In case of invalid parameters. + /// In case of any invalid operations. + /// The camera already has been disposed. public void SetAutoFocusArea(Point pos) { CameraErrorFactory.ThrowIfError(Interop.CameraSettings.SetAutoFocusArea(_camera.GetHandle(), pos.X, pos.Y), @@ -92,6 +110,7 @@ namespace Tizen.Multimedia /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public void ClearFocusArea() { CameraErrorFactory.ThrowIfError(Interop.CameraSettings.ClearAutoFocusArea(_camera.GetHandle()), @@ -101,9 +120,11 @@ namespace Tizen.Multimedia /// /// The auto focus mode. /// + /// A that specifies the auto focus mode. /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public CameraAutoFocusMode AutoFocusMode { get @@ -122,7 +143,7 @@ namespace Tizen.Multimedia "Failed to set camera autofocus mode."); } } - #endregion Auto Focus +#endregion Auto Focus #region Contrast /// @@ -131,6 +152,7 @@ namespace Tizen.Multimedia /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public int Contrast { get @@ -157,6 +179,7 @@ namespace Tizen.Multimedia /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public bool AutoContrast { get @@ -181,11 +204,12 @@ namespace Tizen.Multimedia /// /// If min value is greater than the max value, it means this feature is not supported. /// + /// In case of this feature is not supported. public Range ContrastRange { get { - if (_contrastRange.HasValue == false) + if (!_contrastRange.HasValue) { throw new NotSupportedException("Contrast is not supported."); } @@ -202,6 +226,7 @@ namespace Tizen.Multimedia /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public int Brightness { get @@ -227,11 +252,12 @@ namespace Tizen.Multimedia /// /// If min value is greater than the max value, it means this feature is not supported. /// + /// In case of this feature is not supported. public Range BrightnessRange { get { - if (_brightnessRange.HasValue == false) + if (!_brightnessRange.HasValue) { throw new NotSupportedException("Brightness is not supported."); } @@ -248,6 +274,7 @@ namespace Tizen.Multimedia /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public int Exposure { get @@ -270,9 +297,11 @@ namespace Tizen.Multimedia /// /// The exposure mode. /// + /// A that specifies the exposure mode. /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public CameraExposureMode ExposureMode { get @@ -298,11 +327,12 @@ namespace Tizen.Multimedia /// /// If min value is greater than the max value, it means this feature is not supported. /// + /// In case of this feature is not supported. public Range ExposureRange { get { - if (_exposureRange.HasValue == false) + if (!_exposureRange.HasValue) { throw new NotSupportedException("Exposure is not supported."); } @@ -310,7 +340,7 @@ namespace Tizen.Multimedia return _exposureRange.Value; } } - #endregion Exposure +#endregion Exposure #region Zoom /// @@ -320,6 +350,7 @@ namespace Tizen.Multimedia /// /// http://tizen.org/privilege/camera. /// + /// The camera already has been disposed. public int ZoomLevel { get @@ -345,11 +376,12 @@ namespace Tizen.Multimedia /// /// If min value is greater than the max value, it means this feature is not supported. /// + /// In case of this feature is not supported. public Range ZoomRange { get { - if (_zoomRange.HasValue == false) + if (!_zoomRange.HasValue) { throw new NotSupportedException("Zoom is not supported."); } @@ -362,9 +394,11 @@ namespace Tizen.Multimedia /// /// The whitebalance mode. /// + /// A that specifies the white balance mode. /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public CameraWhiteBalance WhiteBalance { get @@ -387,9 +421,11 @@ namespace Tizen.Multimedia /// /// The ISO level. /// + /// A that specifies ISO level. /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public CameraIsoLevel IsoLevel { get @@ -416,6 +452,7 @@ namespace Tizen.Multimedia /// /// http://tizen.org/privilege/camera. /// + /// The camera already has been disposed. public int ImageQuality { get @@ -439,6 +476,8 @@ namespace Tizen.Multimedia /// /// The preview frame rate. /// + /// A that specifies preview frame rate. + /// The camera already has been disposed. public CameraFps PreviewFps { get @@ -464,7 +503,8 @@ namespace Tizen.Multimedia /// /// http://tizen.org/privilege/camera /// - /// In case of invalid parameters + /// In case of invalid parameters. + /// The camera already has been disposed. public Size PreviewResolution { get @@ -492,6 +532,7 @@ namespace Tizen.Multimedia /// Depending on the capture resolution aspect ratio and display resolution, /// the recommended preview resolution is determined. /// + /// The camera already has been disposed. public Size RecommendedPreviewResolution { get @@ -509,7 +550,9 @@ namespace Tizen.Multimedia /// /// The preview data format. /// - /// In case of invalid parameters + /// A that specifies the pixel format of preview data. + /// In case of invalid parameters. + /// The camera already has been disposed. public CameraPixelFormat PreviewPixelFormat { get @@ -536,6 +579,7 @@ namespace Tizen.Multimedia /// http://tizen.org/privilege/camera /// /// In case of invalid parameters + /// The camera already has been disposed. public Size CaptureResolution { get @@ -561,7 +605,9 @@ namespace Tizen.Multimedia /// /// Format of an image to be captured. /// + /// A that specifies the pixel format of captured image. /// In case of invalid parameters + /// The camera already has been disposed. public CameraPixelFormat CapturePixelFormat { get @@ -586,6 +632,7 @@ namespace Tizen.Multimedia /// /// The bit rate of encoded preview. /// + /// The camera already has been disposed. public int EncodedPreviewBitrate { get @@ -608,6 +655,7 @@ namespace Tizen.Multimedia /// /// GOP(Group Of Pictures) interval of encoded preview. /// + /// The camera already has been disposed. public int EncodedPreviewGopInterval { get @@ -631,6 +679,7 @@ namespace Tizen.Multimedia /// /// The theater mode. /// + /// A that specifies theater mode. /// /// http://tizen.org/privilege/camera /// @@ -638,6 +687,7 @@ namespace Tizen.Multimedia /// If you want to display the preview image on the external display with the full screen mode, /// use this property. /// + /// The camera already has been disposed. public CameraTheaterMode TheaterMode { get @@ -660,9 +710,11 @@ namespace Tizen.Multimedia /// /// The camera effect mode. /// + /// A that specifies effect mode. /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public CameraEffectMode Effect { get @@ -685,9 +737,11 @@ namespace Tizen.Multimedia /// /// The scene mode. /// + /// A that specifies scene mode. /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public CameraSceneMode SceneMode { get @@ -710,9 +764,11 @@ namespace Tizen.Multimedia /// /// The camera's flash mode. /// + /// A that specifies flash mode. /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public CameraFlashMode FlashMode { get @@ -735,6 +791,7 @@ namespace Tizen.Multimedia /// /// Gets the camera lens orientation angle. /// + /// The camera already has been disposed. public int LensOrientation { get @@ -751,6 +808,8 @@ namespace Tizen.Multimedia /// /// The stream rotation. /// + /// A that specifies the rotation of camera device. + /// The camera already has been disposed. public CameraRotation StreamRotation { get @@ -773,6 +832,8 @@ namespace Tizen.Multimedia /// /// The stream flip. /// + /// A that specifies camera flip type. + /// The camera already has been disposed. public CameraFlip StreamFlip { get @@ -795,6 +856,7 @@ namespace Tizen.Multimedia /// /// The mode of HDR(High dynamic range) capture. /// + /// A that specifies the HDR mode. /// /// http://tizen.org/privilege/camera /// @@ -803,6 +865,7 @@ namespace Tizen.Multimedia /// so that we eventually arrive at a picture that is representative in both dark and bright areas. /// If this attribute is set, then eventhandler set for HdrCaptureProgress event is invoked. /// + /// The camera already has been disposed. public CameraHdrMode HdrMode { get @@ -826,6 +889,7 @@ namespace Tizen.Multimedia /// The anti shake feature. /// If true the antishake feature is enabled, otherwise false. /// + /// The camera already has been disposed. public bool AntiShake { get @@ -856,6 +920,7 @@ namespace Tizen.Multimedia /// If video stabilization is enabled, zero shutter lag is disabled. /// This feature is used to record a video. /// + /// The camera already has been disposed. public bool VideoStabilization { get @@ -882,6 +947,7 @@ namespace Tizen.Multimedia /// /// In some countries, this operation is not permitted. /// + /// The camera already has been disposed. public bool DisableShutterSound { set @@ -895,6 +961,8 @@ namespace Tizen.Multimedia /// /// Sets the type of PTZ(Pan Tilt Zoom). Mechanical or Electronic. /// + /// A that specifies the type of PTZ. + /// The camera already has been disposed. public CameraPtzType PtzType { set @@ -910,9 +978,10 @@ namespace Tizen.Multimedia /// /// http://tizen.org/privilege/camera /// - /// ptz move type. + /// ptz move type. /// pan step /// In case of invalid parameters + /// The camera already has been disposed. public void SetPan(CameraPtzMoveType type, int panStep) { CameraErrorFactory.ThrowIfError(Interop.CameraSettings.SetPan(_camera.GetHandle(), type, panStep), @@ -926,6 +995,7 @@ namespace Tizen.Multimedia /// http://tizen.org/privilege/camera /// /// Returns the camera's horizontal position + /// The camera already has been disposed. public int GetPan() { int val = 0; @@ -945,6 +1015,7 @@ namespace Tizen.Multimedia /// ptz move type /// tilt step /// In case of invalid parameters + /// The camera already has been disposed. public void SetTilt(CameraPtzMoveType type, int tiltStep) { CameraErrorFactory.ThrowIfError(Interop.CameraSettings.SetTilt(_camera.GetHandle(), type, tiltStep), @@ -958,6 +1029,7 @@ namespace Tizen.Multimedia /// http://tizen.org/privilege/camera /// /// Returns the current vertical position + /// The camera already has been disposed. public int GetTilt() { int val = 0; @@ -974,11 +1046,12 @@ namespace Tizen.Multimedia /// /// If min value is greater than the max value, it means this feature is not supported. /// + /// In case of this feature is not supported. public Range PanRange { get { - if (_panRange.HasValue == false) + if (!_panRange.HasValue) { throw new NotSupportedException("Pan is not supported."); } @@ -992,11 +1065,12 @@ namespace Tizen.Multimedia /// /// If min value is greater than the max value, it means this feature is not supported. /// + /// In case of this feature is not supported. public Range TiltRange { get { - if (_tiltRange.HasValue == false) + if (!_tiltRange.HasValue) { throw new NotSupportedException("Tilt is not supported."); } @@ -1010,6 +1084,7 @@ namespace Tizen.Multimedia /// The scene mode. /// true if EXIF tags are enabled in JPEG file, otherwise false. /// + /// The camera already has been disposed. public bool EnableTag { get @@ -1032,6 +1107,7 @@ namespace Tizen.Multimedia /// /// The camera image description in the EXIF tag. /// + /// The camera already has been disposed. public string ImageDescriptionTag { get @@ -1060,6 +1136,7 @@ namespace Tizen.Multimedia /// /// The software information in the EXIF tag. /// + /// The camera already has been disposed. public string SoftwareTag { get @@ -1089,6 +1166,7 @@ namespace Tizen.Multimedia /// /// The geotag(GPS data) in the EXIF tag. /// + /// The camera already has been disposed. public Location GeoTag { get @@ -1116,6 +1194,7 @@ namespace Tizen.Multimedia /// /// http://tizen.org/privilege/camera /// + /// The camera already has been disposed. public void RemoveGeoTag() { CameraErrorFactory.ThrowIfError(Interop.CameraSettings.RemoveGeotag(_camera.GetHandle()), @@ -1125,6 +1204,7 @@ namespace Tizen.Multimedia /// /// The camera orientation in the tag. /// + /// The camera already has been disposed. public CameraTagOrientation OrientationTag { get diff --git a/src/Tizen.Multimedia/Interop/Interop.Camera.cs b/src/Tizen.Multimedia/Interop/Interop.Camera.cs old mode 100644 new mode 100755 index 8f82f37..45ee869 --- a/src/Tizen.Multimedia/Interop/Interop.Camera.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Camera.cs @@ -41,138 +41,138 @@ namespace Tizen.Multimedia 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); + internal static extern CameraError Create(int device, out IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_change_device")] - internal static extern int ChangeDevice(IntPtr handle, int device); + internal static extern CameraError ChangeDevice(IntPtr handle, int device); [DllImport(Libraries.Camera, EntryPoint = "camera_destroy")] - internal static extern int Destroy(IntPtr handle); + internal static extern CameraError Destroy(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_get_device_count")] - internal static extern int GetDeviceCount(IntPtr handle, out int count); + internal static extern CameraError GetDeviceCount(IntPtr handle, out int count); [DllImport(Libraries.Camera, EntryPoint = "camera_start_preview")] - internal static extern int StartPreview(IntPtr handle); + internal static extern CameraError StartPreview(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_stop_preview")] - internal static extern int StopPreview(IntPtr handle); + internal static extern CameraError StopPreview(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_get_device_state")] - internal static extern int GetDeviceState(CameraDevice device, out int state); + internal static extern CameraError GetDeviceState(CameraDevice device, out int state); [DllImport(Libraries.Camera, EntryPoint = "camera_start_capture")] - internal static extern int StartCapture(IntPtr handle, CapturingCallback captureCallback, + internal static extern CameraError StartCapture(IntPtr handle, CapturingCallback captureCallback, CaptureCompletedCallback completedCallback, IntPtr userData); [DllImport(Libraries.Camera, EntryPoint = "camera_start_continuous_capture")] - internal static extern int StartContinuousCapture(IntPtr handle, int count, int interval, + internal static extern CameraError StartContinuousCapture(IntPtr handle, int count, int interval, CapturingCallback captureCallback, CaptureCompletedCallback completedCallback, IntPtr userData); [DllImport(Libraries.Camera, EntryPoint = "camera_stop_continuous_capture")] - internal static extern int StopContinuousCapture(IntPtr handle); + internal static extern CameraError StopContinuousCapture(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_get_state")] - internal static extern int GetState(IntPtr handle, out CameraState state); + internal static extern CameraError GetState(IntPtr handle, out CameraState state); [DllImport(Libraries.Camera, EntryPoint = "camera_start_focusing")] - internal static extern int StartFocusing(IntPtr handle, bool continuous); + internal static extern CameraError StartFocusing(IntPtr handle, bool continuous); [DllImport(Libraries.Camera, EntryPoint = "camera_cancel_focusing")] - internal static extern int CancelFocusing(IntPtr handle); + internal static extern CameraError CancelFocusing(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_resolution")] - internal static extern int SetPreviewResolution(IntPtr handle, int width, int height); + internal static extern CameraError SetPreviewResolution(IntPtr handle, int width, int height); [DllImport(Libraries.Camera, EntryPoint = "camera_get_preview_resolution")] - internal static extern int GetPreviewResolution(IntPtr handle, out int width, out int height); + internal static extern CameraError GetPreviewResolution(IntPtr handle, out int width, out int height); [DllImport(Libraries.Camera, EntryPoint = "camera_get_recommended_preview_resolution")] - internal static extern int GetRecommendedPreviewResolution(IntPtr handle, out int width, out int height); + internal static extern CameraError GetRecommendedPreviewResolution(IntPtr handle, out int width, out int height); [DllImport(Libraries.Camera, EntryPoint = "camera_start_face_detection")] - internal static extern int StartFaceDetection(IntPtr handle, FaceDetectedCallback callback, IntPtr userData); + internal static extern CameraError StartFaceDetection(IntPtr handle, FaceDetectedCallback callback, IntPtr userData); [DllImport(Libraries.Camera, EntryPoint = "camera_stop_face_detection")] - internal static extern int StopFaceDetection(IntPtr handle); + internal static extern CameraError StopFaceDetection(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_reuse_hint")] - internal static extern int SetDisplayReuseHint(IntPtr handle, bool hint); + internal static extern CameraError SetDisplayReuseHint(IntPtr handle, bool hint); [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_reuse_hint")] - internal static extern int GetDisplayReuseHint(IntPtr handle, out bool hint); + internal static extern CameraError GetDisplayReuseHint(IntPtr handle, out bool hint); [DllImport(Libraries.Camera, EntryPoint = "camera_set_capture_resolution")] - internal static extern int SetCaptureResolution(IntPtr handle, int width, int height); + internal static extern CameraError SetCaptureResolution(IntPtr handle, int width, int height); [DllImport(Libraries.Camera, EntryPoint = "camera_get_capture_resolution")] - internal static extern int GetCaptureResolution(IntPtr handle, out int width, out int height); + internal static extern CameraError GetCaptureResolution(IntPtr handle, out int width, out int height); [DllImport(Libraries.Camera, EntryPoint = "camera_set_capture_format")] - internal static extern int SetCaptureFormat(IntPtr handle, CameraPixelFormat format); + internal static extern CameraError SetCaptureFormat(IntPtr handle, CameraPixelFormat format); [DllImport(Libraries.Camera, EntryPoint = "camera_get_capture_format")] - internal static extern int GetCaptureFormat(IntPtr handle, out CameraPixelFormat format); + internal static extern CameraError GetCaptureFormat(IntPtr handle, out CameraPixelFormat format); [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_format")] - internal static extern int SetPreviewPixelFormat(IntPtr handle, CameraPixelFormat format); + internal static extern CameraError SetPreviewPixelFormat(IntPtr handle, CameraPixelFormat format); [DllImport(Libraries.Camera, EntryPoint = "camera_get_preview_format")] - internal static extern int GetPreviewPixelFormat(IntPtr handle, out CameraPixelFormat format); + internal static extern CameraError GetPreviewPixelFormat(IntPtr handle, out CameraPixelFormat format); [DllImport(Libraries.Camera, EntryPoint = "camera_get_facing_direction")] - internal static extern int GetFacingDirection(IntPtr handle, out CameraFacingDirection direction); + internal static extern CameraError GetFacingDirection(IntPtr handle, out CameraFacingDirection direction); [DllImport(Libraries.Camera, EntryPoint = "camera_get_flash_state")] - internal static extern int GetFlashState(CameraDevice device, out CameraFlashState state); + internal static extern CameraError GetFlashState(CameraDevice device, out CameraFlashState state); [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_cb")] - internal static extern int SetPreviewCallback(IntPtr handle, PreviewCallback callback, IntPtr userData); + internal static extern CameraError SetPreviewCallback(IntPtr handle, PreviewCallback callback, IntPtr userData); [DllImport(Libraries.Camera, EntryPoint = "camera_unset_preview_cb")] - internal static extern int UnsetPreviewCallback(IntPtr handle); + internal static extern CameraError UnsetPreviewCallback(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_set_media_packet_preview_cb")] - internal static extern int SetMediaPacketPreviewCallback(IntPtr handle, MediaPacketPreviewCallback callback, IntPtr userData); + internal static extern CameraError SetMediaPacketPreviewCallback(IntPtr handle, MediaPacketPreviewCallback callback, IntPtr userData); [DllImport(Libraries.Camera, EntryPoint = "camera_unset_media_packet_preview_cb")] - internal static extern int UnsetMediaPacketPreviewCallback(IntPtr handle); + internal static extern CameraError UnsetMediaPacketPreviewCallback(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(IntPtr handle, StateChangedCallback callback, IntPtr userData); + internal static extern CameraError SetStateChangedCallback(IntPtr handle, StateChangedCallback callback, IntPtr userData); [DllImport(Libraries.Camera, EntryPoint = "camera_add_device_state_changed_cb")] - internal static extern int SetDeviceStateChangedCallback(DeviceStateChangedCallback callback, IntPtr userData, out int callbackId); + internal static extern CameraError SetDeviceStateChangedCallback(DeviceStateChangedCallback callback, IntPtr userData, out int callbackId); [DllImport(Libraries.Camera, EntryPoint = "camera_unset_state_changed_cb")] - internal static extern int UnsetStateChangedCallback(IntPtr handle); + internal static extern CameraError UnsetStateChangedCallback(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_remove_device_state_changed_cb")] - internal static extern int UnsetDeviceStateChangedCallback(int cbId); + internal static extern CameraError UnsetDeviceStateChangedCallback(int cbId); [DllImport(Libraries.Camera, EntryPoint = "camera_set_interrupted_cb")] - internal static extern int SetInterruptedCallback(IntPtr handle, InterruptedCallback callback, IntPtr userData); + internal static extern CameraError SetInterruptedCallback(IntPtr handle, InterruptedCallback callback, IntPtr userData); [DllImport(Libraries.Camera, EntryPoint = "camera_unset_interrupted_cb")] - internal static extern int UnsetInterruptedCallback(IntPtr handle); + internal static extern CameraError UnsetInterruptedCallback(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_set_focus_changed_cb")] - internal static extern int SetFocusStateChangedCallback(IntPtr handle, FocusStateChangedCallback callback, IntPtr userData); + internal static extern CameraError SetFocusStateChangedCallback(IntPtr handle, FocusStateChangedCallback callback, IntPtr userData); [DllImport(Libraries.Camera, EntryPoint = "camera_unset_focus_changed_cb")] - internal static extern int UnsetFocusChangedCallback(IntPtr handle); + internal static extern CameraError UnsetFocusChangedCallback(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_set_error_cb")] - internal static extern int SetErrorCallback(IntPtr handle, ErrorCallback callback, IntPtr userData); + internal static extern CameraError SetErrorCallback(IntPtr handle, ErrorCallback callback, IntPtr userData); [DllImport(Libraries.Camera, EntryPoint = "camera_unset_error_cb")] - internal static extern int UnsetErrorCallback(IntPtr handle); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError UnsetHdrCaptureProgressCallback(IntPtr handle); [StructLayout(LayoutKind.Sequential)] internal struct ImageDataStruct diff --git a/src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs b/src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs old mode 100644 new mode 100755 index 513ca13..94a20af --- a/src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs +++ b/src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs @@ -8,37 +8,37 @@ namespace Tizen.Multimedia internal static partial class CameraDisplay { [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_mode")] - internal static extern int GetMode(IntPtr handle, out CameraDisplayMode mode); + internal static extern CameraError GetMode(IntPtr handle, out CameraDisplayMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_mode")] - internal static extern int SetMode(IntPtr handle, CameraDisplayMode mode); + internal static extern CameraError SetMode(IntPtr handle, CameraDisplayMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_is_display_visible")] - internal static extern int GetVisible(IntPtr handle, out bool visible); + internal static extern CameraError GetVisible(IntPtr handle, out bool visible); [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_visible")] - internal static extern int SetVisible(IntPtr handle, bool visible); + internal static extern CameraError SetVisible(IntPtr handle, bool visible); [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_rotation")] - internal static extern int GetRotation(IntPtr handle, out CameraRotation rotation); + internal static extern CameraError GetRotation(IntPtr handle, out CameraRotation rotation); [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_rotation")] - internal static extern int SetRotation(IntPtr handle, CameraRotation rotation); + internal static extern CameraError SetRotation(IntPtr handle, CameraRotation rotation); [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_flip")] - internal static extern int GetFlip(IntPtr handle, out CameraFlip flip); + internal static extern CameraError GetFlip(IntPtr handle, out CameraFlip flip); [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_flip")] - internal static extern int SetFlip(IntPtr handle, CameraFlip flip); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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 100644 new mode 100755 index d14860d..e7077de --- a/src/Tizen.Multimedia/Interop/Interop.CameraFeatures.cs +++ b/src/Tizen.Multimedia/Interop/Interop.CameraFeatures.cs @@ -93,55 +93,55 @@ namespace Tizen.Multimedia 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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 100644 new mode 100755 index bfc633a..f0c63c3 --- a/src/Tizen.Multimedia/Interop/Interop.CameraSettings.cs +++ b/src/Tizen.Multimedia/Interop/Interop.CameraSettings.cs @@ -8,214 +8,214 @@ namespace Tizen.Multimedia internal static partial class CameraSettings { [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_preview_fps")] - internal static extern int SetPreviewFps(IntPtr handle, CameraFps fps); + internal static extern CameraError SetPreviewFps(IntPtr handle, CameraFps fps); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_preview_fps")] - internal static extern int GetPreviewFps(IntPtr handle, out CameraFps fps); + internal static extern CameraError GetPreviewFps(IntPtr handle, out CameraFps fps); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_image_quality")] - internal static extern int SetImageQuality(IntPtr handle, int quality); + internal static extern CameraError SetImageQuality(IntPtr handle, int quality); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_image_quality")] - internal static extern int GetImageQuality(IntPtr handle, out int quality); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError GetGopInterval(IntPtr handle, out int interval); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_zoom")] - internal static extern int SetZoom(IntPtr handle, int zoom); + internal static extern CameraError SetZoom(IntPtr handle, int zoom); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_zoom")] - internal static extern int GetZoom(IntPtr handle, out int zoom); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError SetAutoFocusMode(IntPtr handle, CameraAutoFocusMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_af_mode")] - internal static extern int GetAutoFocusMode(IntPtr handle, out CameraAutoFocusMode mode); + internal static extern CameraError 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); + internal static extern CameraError SetAutoFocusArea(IntPtr handle, int x, int y); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_clear_af_area")] - internal static extern int ClearAutoFocusArea(IntPtr handle); + internal static extern CameraError ClearAutoFocusArea(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_exposure_mode")] - internal static extern int SetExposureMode(IntPtr handle, CameraExposureMode mode); + internal static extern CameraError SetExposureMode(IntPtr handle, CameraExposureMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure_mode")] - internal static extern int GetExposureMode(IntPtr handle, out CameraExposureMode mode); + internal static extern CameraError GetExposureMode(IntPtr handle, out CameraExposureMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_exposure")] - internal static extern int SetExposure(IntPtr handle, int value); + internal static extern CameraError SetExposure(IntPtr handle, int value); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure")] - internal static extern int GetExposure(IntPtr handle, out int value); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError SetIso(IntPtr handle, CameraIsoLevel iso); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_iso")] - internal static extern int GetIso(IntPtr handle, out CameraIsoLevel iso); + internal static extern CameraError GetIso(IntPtr handle, out CameraIsoLevel iso); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_theater_mode")] - internal static extern int SetTheaterMode(IntPtr handle, CameraTheaterMode mode); + internal static extern CameraError SetTheaterMode(IntPtr handle, CameraTheaterMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_theater_mode")] - internal static extern int GetTheaterMode(IntPtr handle, out CameraTheaterMode mode); + internal static extern CameraError GetTheaterMode(IntPtr handle, out CameraTheaterMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_brightness")] - internal static extern int SetBrightness(IntPtr handle, int level); + internal static extern CameraError SetBrightness(IntPtr handle, int level); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_brightness")] - internal static extern int GetBrightness(IntPtr handle, out int level); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError SetContrast(IntPtr handle, int level); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_contrast")] - internal static extern int GetContrast(IntPtr handle, out int level); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError SetWhitebalance(IntPtr handle, CameraWhiteBalance level); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_whitebalance")] - internal static extern int GetWhiteBalance(IntPtr handle, out CameraWhiteBalance level); + internal static extern CameraError GetWhiteBalance(IntPtr handle, out CameraWhiteBalance level); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_effect")] - internal static extern int SetEffect(IntPtr handle, CameraEffectMode mode); + internal static extern CameraError SetEffect(IntPtr handle, CameraEffectMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_effect")] - internal static extern int GetEffect(IntPtr handle, out CameraEffectMode mode); + internal static extern CameraError GetEffect(IntPtr handle, out CameraEffectMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_scene_mode")] - internal static extern int SetSceneMode(IntPtr handle, CameraSceneMode mode); + internal static extern CameraError SetSceneMode(IntPtr handle, CameraSceneMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_scene_mode")] - internal static extern int GetSceneMode(IntPtr handle, out CameraSceneMode mode); + internal static extern CameraError GetSceneMode(IntPtr handle, out CameraSceneMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_tag")] - internal static extern int EnableTag(IntPtr handle, bool enable); + internal static extern CameraError EnableTag(IntPtr handle, bool enable); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_enabled_tag")] - internal static extern int IsEnabledTag(IntPtr handle, out bool enabled); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError GetImageDescription(IntPtr handle, out IntPtr description); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_software")] - internal static extern int SetTagSoftware(IntPtr handle, string software); + internal static extern CameraError SetTagSoftware(IntPtr handle, string software); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_software")] - internal static extern int GetTagSoftware(IntPtr handle, out IntPtr software); + internal static extern CameraError GetTagSoftware(IntPtr handle, out IntPtr software); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_orientation")] - internal static extern int SetTagOrientation(IntPtr handle, CameraTagOrientation orientation); + internal static extern CameraError SetTagOrientation(IntPtr handle, CameraTagOrientation orientation); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_orientation")] - internal static extern int GetTagOrientation(IntPtr handle, out CameraTagOrientation orientation); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError RemoveGeotag(IntPtr handle); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_flash_mode")] - internal static extern int SetFlashMode(IntPtr handle, CameraFlashMode mode); + internal static extern CameraError SetFlashMode(IntPtr handle, CameraFlashMode mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_flash_mode")] - internal static extern int GetFlashMode(IntPtr handle, out CameraFlashMode mode); + internal static extern CameraError 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); + internal static extern CameraError GetLensOrientation(IntPtr handle, out int angle); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_stream_rotation")] - internal static extern int SetStreamRotation(IntPtr handle, CameraRotation mode); + internal static extern CameraError SetStreamRotation(IntPtr handle, CameraRotation mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_stream_rotation")] - internal static extern int GetStreamRotation(IntPtr handle, out CameraRotation mode); + internal static extern CameraError GetStreamRotation(IntPtr handle, out CameraRotation mode); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_stream_flip")] - internal static extern int SetFlip(IntPtr handle, CameraFlip flip); + internal static extern CameraError SetFlip(IntPtr handle, CameraFlip flip); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_stream_flip")] - internal static extern int GetFlip(IntPtr handle, out CameraFlip flip); + internal static extern CameraError GetFlip(IntPtr handle, out CameraFlip flip); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_hdr_mode")] - internal static extern int SetHdrMode(IntPtr handle, CameraHdrMode hdr); + internal static extern CameraError SetHdrMode(IntPtr handle, CameraHdrMode hdr); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_hdr_mode")] - internal static extern int GetHdrMode(IntPtr handle, out CameraHdrMode hdr); + internal static extern CameraError GetHdrMode(IntPtr handle, out CameraHdrMode hdr); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_anti_shake")] - internal static extern int EnableAntiShake(IntPtr handle, bool enable); + internal static extern CameraError 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); + internal static extern CameraError IsEnabledAntiShake(IntPtr handle, out bool enabled); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_video_stabilization")] - internal static extern int EnableVideoStabilization(IntPtr handle, bool enable); + internal static extern CameraError 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); + internal static extern CameraError IsEnabledVideoStabilization(IntPtr handle, out bool enabled); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_auto_contrast")] - internal static extern int EnableAutoContrast(IntPtr handle, bool enable); + internal static extern CameraError 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); + internal static extern CameraError IsEnabledAutoContrast(IntPtr handle, out bool enabled); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_disable_shutter_sound")] - internal static extern int DisableShutterSound(IntPtr handle, bool disable); + internal static extern CameraError DisableShutterSound(IntPtr handle, bool disable); [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_pan")] - internal static extern int SetPan(IntPtr handle, CameraPtzMoveType type, int step); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError 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); + internal static extern CameraError SetPtzType(IntPtr handle, int type); } } } diff --git a/src/Tizen.Multimedia/Interop/Interop.Recorder.cs b/src/Tizen.Multimedia/Interop/Interop.Recorder.cs index 2f66bb6..aecb874 100755 --- a/src/Tizen.Multimedia/Interop/Interop.Recorder.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Recorder.cs @@ -35,79 +35,79 @@ namespace Tizen.Multimedia internal delegate void MuxedStreamCallback(IntPtr stream, int size, ulong offset, IntPtr userData); [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_audiorecorder")] - internal static extern int Create(out IntPtr handle); + internal static extern RecorderError Create(out IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_videorecorder")] - internal static extern int CreateVideo(IntPtr cameraHandle, out IntPtr handle); + internal static extern RecorderError CreateVideo(IntPtr cameraHandle, out IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_destroy")] - internal static extern int Destroy(IntPtr handle); + internal static extern RecorderError Destroy(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_prepare")] - internal static extern int Prepare(IntPtr handle); + internal static extern RecorderError Prepare(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_unprepare")] - internal static extern int Unprepare(IntPtr handle); + internal static extern RecorderError Unprepare(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_start")] - internal static extern int Start(IntPtr handle); + internal static extern RecorderError Start(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_pause")] - internal static extern int Pause(IntPtr handle); + internal static extern RecorderError Pause(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_commit")] - internal static extern int Commit(IntPtr handle); + internal static extern RecorderError Commit(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_cancel")] - internal static extern int Cancel(IntPtr handle); + internal static extern RecorderError Cancel(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_state")] - internal static extern int GetState(IntPtr handle, out RecorderState state); + internal static extern RecorderError GetState(IntPtr handle, out RecorderState state); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_sound_stream_info")] - internal static extern int SetAudioStreamPolicy(IntPtr handle, IntPtr streamInfoHandle); + internal static extern RecorderError SetAudioStreamPolicy(IntPtr handle, IntPtr streamInfoHandle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_error_cb")] - internal static extern int SetErrorCallback(IntPtr handle, RecorderErrorCallback callback, IntPtr userData); + internal static extern RecorderError SetErrorCallback(IntPtr handle, RecorderErrorCallback callback, IntPtr userData); [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_error_cb")] - internal static extern int UnsetErrorCallback(IntPtr handle); + internal static extern RecorderError UnsetErrorCallback(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_interrupted_cb")] - internal static extern int SetInterruptedCallback(IntPtr handle, InterruptedCallback callback, IntPtr userData); + internal static extern RecorderError SetInterruptedCallback(IntPtr handle, InterruptedCallback callback, IntPtr userData); [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_interrupted_cb")] - internal static extern int UnsetInterruptedCallback(IntPtr handle); + internal static extern RecorderError UnsetInterruptedCallback(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(IntPtr handle, StatechangedCallback callback, IntPtr userData); + internal static extern RecorderError SetStateChangedCallback(IntPtr handle, StatechangedCallback callback, IntPtr userData); [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_state_changed_cb")] - internal static extern int UnsetStateChangedCallback(IntPtr handle); + internal static extern RecorderError UnsetStateChangedCallback(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_recording_status_cb")] - internal static extern int SetRecordingProgressCallback(IntPtr handle, RecordingProgressCallback callback, IntPtr userData); + internal static extern RecorderError SetRecordingProgressCallback(IntPtr handle, RecordingProgressCallback callback, IntPtr userData); [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_recording_status_cb")] - internal static extern int UnsetRecordingProgressCallback(IntPtr handle); + internal static extern RecorderError UnsetRecordingProgressCallback(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_audio_stream_cb")] - internal static extern int SetAudioStreamCallback(IntPtr handle, AudioStreamCallback callback, IntPtr userData); + internal static extern RecorderError SetAudioStreamCallback(IntPtr handle, AudioStreamCallback callback, IntPtr userData); [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_audio_stream_cb")] - internal static extern int UnsetAudioStreamCallback(IntPtr handle); + internal static extern RecorderError UnsetAudioStreamCallback(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_recording_limit_reached_cb")] - internal static extern int SetLimitReachedCallback(IntPtr handle, RecordingLimitReachedCallback callback, IntPtr userData); + internal static extern RecorderError SetLimitReachedCallback(IntPtr handle, RecordingLimitReachedCallback callback, IntPtr userData); [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_recording_limit_reached_cb")] - internal static extern int UnsetLimitReachedCallback(IntPtr handle); + internal static extern RecorderError UnsetLimitReachedCallback(IntPtr handle); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_muxed_stream_cb")] - internal static extern int SetMuxedStreamCallback(IntPtr handle, MuxedStreamCallback callback, IntPtr userData); + internal static extern RecorderError SetMuxedStreamCallback(IntPtr handle, MuxedStreamCallback callback, IntPtr userData); [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_muxed_stream_cb")] - internal static extern int UnsetMuxedStreamCallback(IntPtr handle); + internal static extern RecorderError UnsetMuxedStreamCallback(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 100644 new mode 100755 index 73e12ad..58cc03f --- a/src/Tizen.Multimedia/Interop/Interop.RecorderFeatures.cs +++ b/src/Tizen.Multimedia/Interop/Interop.RecorderFeatures.cs @@ -20,16 +20,16 @@ namespace Tizen.Multimedia 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); + internal static extern RecorderError 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); + internal static extern RecorderError 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); + internal static extern RecorderError 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); + internal static extern RecorderError 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 100644 new mode 100755 index 738394c..ce62a18 --- a/src/Tizen.Multimedia/Interop/Interop.RecorderSettings.cs +++ b/src/Tizen.Multimedia/Interop/Interop.RecorderSettings.cs @@ -8,98 +8,98 @@ namespace Tizen.Multimedia internal static partial class RecorderSettings { [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_channel")] - internal static extern int GetAudioChannel(IntPtr handle, out int channelCount); + internal static extern RecorderError GetAudioChannel(IntPtr handle, out int channelCount); [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_channel")] - internal static extern int SetAudioChannel(IntPtr handle, int channelCount); + internal static extern RecorderError SetAudioChannel(IntPtr handle, int channelCount); [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_device")] - internal static extern int GetAudioDevice(IntPtr handle, out RecorderAudioDevice device); + internal static extern RecorderError GetAudioDevice(IntPtr handle, out RecorderAudioDevice device); [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_device")] - internal static extern int SetAudioDevice(IntPtr handle, RecorderAudioDevice device); + internal static extern RecorderError SetAudioDevice(IntPtr handle, RecorderAudioDevice device); [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_audio_level")] - internal static extern int GetAudioLevel(IntPtr handle, out double dB); + internal static extern RecorderError 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); + internal static extern RecorderError GetAudioSampleRate(IntPtr handle, out int sampleRate); [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_samplerate")] - internal static extern int SetAudioSampleRate(IntPtr handle, int sampleRate); + internal static extern RecorderError 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); + internal static extern RecorderError 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); + internal static extern RecorderError 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); + internal static extern RecorderError 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); + internal static extern RecorderError SetVideoEncoderBitrate(IntPtr handle, int bitRate); [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_audio_encoder")] - internal static extern int GetAudioEncoder(IntPtr handle, out RecorderAudioCodec codec); + internal static extern RecorderError GetAudioEncoder(IntPtr handle, out RecorderAudioCodec codec); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_audio_encoder")] - internal static extern int SetAudioEncoder(IntPtr handle, RecorderAudioCodec codec); + internal static extern RecorderError SetAudioEncoder(IntPtr handle, RecorderAudioCodec codec); [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_video_encoder")] - internal static extern int GetVideoEncoder(IntPtr handle, out RecorderVideoCodec codec); + internal static extern RecorderError GetVideoEncoder(IntPtr handle, out RecorderVideoCodec codec); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_video_encoder")] - internal static extern int SetVideoEncoder(IntPtr handle, RecorderVideoCodec codec); + internal static extern RecorderError SetVideoEncoder(IntPtr handle, RecorderVideoCodec codec); [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_file_format")] - internal static extern int GetFileFormat(IntPtr handle, out RecorderFileFormat format); + internal static extern RecorderError GetFileFormat(IntPtr handle, out RecorderFileFormat format); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_file_format")] - internal static extern int SetFileFormat(IntPtr handle, RecorderFileFormat format); + internal static extern RecorderError SetFileFormat(IntPtr handle, RecorderFileFormat format); [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_filename")] - internal static extern int GetFileName(IntPtr handle, out IntPtr path); + internal static extern RecorderError GetFileName(IntPtr handle, out IntPtr path); [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_filename")] - internal static extern int SetFileName(IntPtr handle, string path); + internal static extern RecorderError SetFileName(IntPtr handle, string path); [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_size_limit")] - internal static extern int GetSizeLimit(IntPtr handle, out int kbyte); + internal static extern RecorderError GetSizeLimit(IntPtr handle, out int kbyte); [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_size_limit")] - internal static extern int SetSizeLimit(IntPtr handle, int kbyte); + internal static extern RecorderError SetSizeLimit(IntPtr handle, int kbyte); [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_time_limit")] - internal static extern int GetTimeLimit(IntPtr handle, out int second); + internal static extern RecorderError GetTimeLimit(IntPtr handle, out int second); [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_time_limit")] - internal static extern int SetTimeLimit(IntPtr handle, int second); + internal static extern RecorderError 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_set_mute")] - internal static extern int SetMute(IntPtr handle, bool enable); + internal static extern RecorderError 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); + internal static extern RecorderError 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); + internal static extern RecorderError SetMotionRate(IntPtr handle, double motionRate); [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_orientation_tag")] - internal static extern int GetOrientationTag(IntPtr handle, out RecorderOrientation orientation); + internal static extern RecorderError GetOrientationTag(IntPtr handle, out RecorderOrientation orientation); [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_orientation_tag")] - internal static extern int SetOrientationTag(IntPtr handle, RecorderOrientation orientation); + internal static extern RecorderError 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); + internal static extern RecorderError 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); + internal static extern RecorderError SetVideoResolution(IntPtr handle, int width, int height); } } } \ No newline at end of file diff --git a/src/Tizen.Multimedia/Recorder/Recorder.cs b/src/Tizen.Multimedia/Recorder/Recorder.cs index 81558b9..f47e22e 100755 --- a/src/Tizen.Multimedia/Recorder/Recorder.cs +++ b/src/Tizen.Multimedia/Recorder/Recorder.cs @@ -19,7 +19,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.InteropServices; -using Tizen.Internals.Errors; namespace Tizen.Multimedia { @@ -45,6 +44,9 @@ namespace Tizen.Multimedia /// /// Audio recorder constructor. /// + /// /// + /// http://tizen.org/privilege/microphone + /// public Recorder() { RecorderErrorFactory.ThrowIfError(Interop.Recorder.Create(out _handle), @@ -54,6 +56,8 @@ namespace Tizen.Multimedia Setting = new RecorderSettings(this); RegisterCallbacks(); + + SetState(RecorderState.Created); } /// @@ -62,6 +66,9 @@ namespace Tizen.Multimedia /// /// The camera object. /// + /// + /// http://tizen.org/privilege/camera + /// public Recorder(Camera camera) { RecorderErrorFactory.ThrowIfError(Interop.Recorder.CreateVideo(camera.GetHandle(), out _handle), @@ -71,6 +78,8 @@ namespace Tizen.Multimedia Setting = new RecorderSettings(this); RegisterCallbacks(); + + SetState(RecorderState.Created); } /// @@ -202,10 +211,14 @@ namespace Tizen.Multimedia /// /// The current state of the recorder. /// + /// A that specifies the state of recorder. + /// The camera already has been disposed. public RecorderState State { get { + ValidateNotDisposed(); + RecorderState val = 0; RecorderErrorFactory.ThrowIfError(Interop.Recorder.GetState(_handle, out val), @@ -219,34 +232,55 @@ namespace Tizen.Multimedia #region Methods /// /// Prepare the media recorder for recording. + /// The recorder must be in the state. + /// After this method is finished without any exception, + /// The state of recorder will be changed to state. /// /// /// Before calling the function, it is required to set AudioEncoder, /// videoencoder and fileformat properties of recorder. /// /// - /// http://tizen.org/privilege/recorder + /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone /// + /// In case of any invalid operations. + /// The camera already has been disposed. public void Prepare() { + ValidateState(RecorderState.Created); + RecorderErrorFactory.ThrowIfError(Interop.Recorder.Prepare(_handle), "Failed to prepare media recorder for recording"); + + SetState(RecorderState.Ready); } /// /// Resets the media recorder. + /// The recorder must be in the state. + /// After this method is finished without any exception, + /// The state of recorder will be changed to state. /// /// - /// http://tizen.org/privilege/recorder + /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone /// + /// In case of any invalid operations. + /// The camera already has been disposed. public void Unprepare() { + ValidateState(RecorderState.Ready); + RecorderErrorFactory.ThrowIfError(Interop.Recorder.Unprepare(_handle), "Failed to reset the media recorder"); + + SetState(RecorderState.Created); } /// /// Starts the recording. + /// The recorder must be in the state. + /// After this method is finished without any exception, + /// The state of recorder will be changed to state. /// /// /// If file path has been set to an existing file, this file is removed automatically and updated by new one. @@ -255,60 +289,96 @@ namespace Tizen.Multimedia /// The filename should be set before this function is invoked. /// /// - /// http://tizen.org/privilege/recorder + /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone /// + /// In case of any invalid operations. + /// The camera already has been disposed. public void Start() { + ValidateState(RecorderState.Ready); + RecorderErrorFactory.ThrowIfError(Interop.Recorder.Start(_handle), "Failed to start the media recorder"); + + SetState(RecorderState.Recording); } /// /// Pause the recording. + /// The recorder must be in the state. + /// After this method is finished without any exception, + /// The state of recorder will be changed to state. /// /// /// Recording can be resumed with Start(). /// /// - /// http://tizen.org/privilege/recorder + /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone /// + /// In case of any invalid operations. + /// The camera already has been disposed. public void Pause() { + ValidateState(RecorderState.Recording); + RecorderErrorFactory.ThrowIfError(Interop.Recorder.Pause(_handle), "Failed to pause the media recorder"); + + SetState(RecorderState.Paused); } /// /// Stops recording and saves the result. + /// The recorder must be in the or state. + /// After this method is finished without any exception, + /// The state of recorder will be changed to state. /// /// - /// http://tizen.org/privilege/recorder + /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone /// + /// In case of any invalid operations. + /// The camera already has been disposed. public void Commit() { + ValidateState(RecorderState.Recording, RecorderState.Paused); + RecorderErrorFactory.ThrowIfError(Interop.Recorder.Commit(_handle), "Failed to save the recorded content"); + + SetState(RecorderState.Ready); } /// /// Cancels the recording. /// The recording data is discarded and not written in the recording file. + /// The recorder must be in the or state. + /// After this method is finished without any exception, + /// The state of recorder will be changed to state. /// /// - /// http://tizen.org/privilege/recorder + /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone /// + /// In case of any invalid operations. + /// The camera already has been disposed. public void Cancel() { + ValidateState(RecorderState.Recording, RecorderState.Paused); + RecorderErrorFactory.ThrowIfError(Interop.Recorder.Cancel(_handle), "Failed to cancel the recording"); + + SetState(RecorderState.Ready); } /// /// Sets the audio stream policy. /// /// Policy. + /// The camera already has been disposed. public void SetAudioStreamPolicy(AudioStreamPolicy policy) { + ValidateNotDisposed(); + RecorderErrorFactory.ThrowIfError(Interop.Recorder.SetAudioStreamPolicy(_handle, policy.Handle), "Failed to set audio stream policy"); } @@ -350,6 +420,8 @@ namespace Tizen.Multimedia { _stateChangedCallback = (RecorderState previous, RecorderState current, bool byPolicy, IntPtr userData) => { + SetState(current); + Log.Info(RecorderLog.Tag, "Recorder state changed " + previous.ToString() + " -> " + current.ToString()); StateChanged?.Invoke(this, new RecorderStateChangedEventArgs(previous, current, byPolicy)); }; RecorderErrorFactory.ThrowIfError(Interop.Recorder.SetStateChangedCallback(_handle, _stateChangedCallback, IntPtr.Zero), diff --git a/src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs b/src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs index 7ca36b2..74a8b46 100755 --- a/src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs +++ b/src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs @@ -41,18 +41,17 @@ namespace Tizen.Multimedia internal static class RecorderErrorFactory { - internal static void ThrowIfError(int errorCode, string errorMessage = null, + internal static void ThrowIfError(RecorderError errorCode, string errorMessage = null, [CallerMemberName] string caller = null, [CallerLineNumber] int line = 0) { - RecorderError err = (RecorderError)errorCode; - if (err == RecorderError.None) + if (errorCode == RecorderError.None) { return; } - Log.Info(RecorderLog.Tag, "errorCode : " + err.ToString() + ", Caller : " + caller + ", line " + line.ToString()); + Log.Info(RecorderLog.Tag, "errorCode : " + errorCode.ToString() + ", Caller : " + caller + ", line " + line.ToString()); - switch (err) + switch (errorCode) { case RecorderError.InvalidParameter: throw new ArgumentException(errorMessage); diff --git a/src/Tizen.Multimedia/Recorder/RecorderFeatures.cs b/src/Tizen.Multimedia/Recorder/RecorderFeatures.cs index ee6a4e9..ed0d010 100755 --- a/src/Tizen.Multimedia/Recorder/RecorderFeatures.cs +++ b/src/Tizen.Multimedia/Recorder/RecorderFeatures.cs @@ -42,24 +42,32 @@ namespace Tizen.Multimedia /// Retrieves all the file formats supported by the recorder. /// /// - /// It returns a list containing all the supported file - /// formats by recorder. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedFileFormats { get { if (_fileFormats == null) { - _fileFormats = new List(); - - Interop.RecorderFeatures.FileFormatCallback callback = (RecorderFileFormat format, IntPtr userData) => + try { - _fileFormats.Add(format); - return true; - }; - RecorderErrorFactory.ThrowIfError(Interop.RecorderFeatures.FileFormats(_recorder.GetHandle(), callback, IntPtr.Zero), + _fileFormats = new List(); + + Interop.RecorderFeatures.FileFormatCallback callback = (RecorderFileFormat format, IntPtr userData) => + { + _fileFormats.Add(format); + return true; + }; + RecorderErrorFactory.ThrowIfError(Interop.RecorderFeatures.FileFormats(_recorder.GetHandle(), callback, IntPtr.Zero), "Failed to get the supported fileformats"); + } + catch + { + _fileFormats = null; + throw; + } } return _fileFormats; @@ -70,24 +78,32 @@ namespace Tizen.Multimedia /// Retrieves all the audio encoders supported by the recorder. /// /// - /// It returns a list containing all the supported audio encoders - /// by recorder. + /// It returns a list containing all the supported . /// + /// The camera already has been disposed. public IEnumerable SupportedAudioEncodings { get { if (_audioCodec == null) { - _audioCodec = new List(); - - Interop.RecorderFeatures.AudioEncoderCallback callback = (RecorderAudioCodec codec, IntPtr userData) => + try + { + _audioCodec = new List(); + + Interop.RecorderFeatures.AudioEncoderCallback callback = (RecorderAudioCodec codec, IntPtr userData) => + { + _audioCodec.Add(codec); + return true; + }; + RecorderErrorFactory.ThrowIfError(Interop.RecorderFeatures.AudioEncoders(_recorder.GetHandle(), callback, IntPtr.Zero), + "Failed to get the supported audio encoders"); + } + catch { - _audioCodec.Add(codec); - return true; - }; - RecorderErrorFactory.ThrowIfError(Interop.RecorderFeatures.AudioEncoders(_recorder.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported audio encoders"); + _audioCodec = null; + throw; + } } return _audioCodec; @@ -98,24 +114,33 @@ namespace Tizen.Multimedia /// Retrieves all the video encoders supported by the recorder. /// /// - /// It returns a list containing all the supported video encoders + /// It returns a list containing all the supported . /// by recorder. /// + /// The camera already has been disposed. public IEnumerable SupportedVideoEncodings { get { if (_videoCodec == null) { - _videoCodec = new List(); - - Interop.RecorderFeatures.VideoEncoderCallback callback = (RecorderVideoCodec codec, IntPtr userData) => + try + { + _videoCodec = new List(); + + Interop.RecorderFeatures.VideoEncoderCallback callback = (RecorderVideoCodec codec, IntPtr userData) => + { + _videoCodec.Add(codec); + return true; + }; + RecorderErrorFactory.ThrowIfError(Interop.RecorderFeatures.VideoEncoders(_recorder.GetHandle(), callback, IntPtr.Zero), + "Failed to get the supported video encoders"); + } + catch { - _videoCodec.Add(codec); - return true; - }; - RecorderErrorFactory.ThrowIfError(Interop.RecorderFeatures.VideoEncoders(_recorder.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported video encoders"); + _videoCodec = null; + throw; + } } return _videoCodec; @@ -129,21 +154,30 @@ namespace Tizen.Multimedia /// It returns videoresolution list containing the width and height of /// different resolutions supported by recorder. /// + /// The camera already has been disposed. public IEnumerable SupportedVideoResolutions { get { if (_videoResolution == null) { - _videoResolution = new List(); - - Interop.RecorderFeatures.VideoResolutionCallback callback = (int width, int height, IntPtr userData) => + try + { + _videoResolution = new List(); + + Interop.RecorderFeatures.VideoResolutionCallback callback = (int width, int height, IntPtr userData) => + { + _videoResolution.Add(new Size(width, height)); + return true; + }; + RecorderErrorFactory.ThrowIfError(Interop.RecorderFeatures.VideoResolution(_recorder.GetHandle(), callback, IntPtr.Zero), + "Failed to get the supported video resolutions."); + } + catch { - _videoResolution.Add(new Size(width, height)); - return true; - }; - RecorderErrorFactory.ThrowIfError(Interop.RecorderFeatures.VideoResolution(_recorder.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported video resolutions."); + _videoResolution = null; + throw; + } } return _videoResolution; diff --git a/src/Tizen.Multimedia/Recorder/RecorderSettings.cs b/src/Tizen.Multimedia/Recorder/RecorderSettings.cs index 4dcaf2f..0f6192c 100755 --- a/src/Tizen.Multimedia/Recorder/RecorderSettings.cs +++ b/src/Tizen.Multimedia/Recorder/RecorderSettings.cs @@ -37,11 +37,11 @@ namespace Tizen.Multimedia /// /// The number of audio channel. /// - /// - /// The attribute is applied only in Created state. + /// /// For mono recording, set channel to 1. /// For stereo recording, set channel to 2. - /// + /// + /// The camera already has been disposed. public int AudioChannel { get @@ -64,6 +64,8 @@ namespace Tizen.Multimedia /// /// The audio device for recording. /// + /// A that specifies the type of audio device. + /// The camera already has been disposed. public RecorderAudioDevice AudioDevice { get @@ -89,6 +91,7 @@ namespace Tizen.Multimedia /// /// 0dB indicates maximum input level, -300dB indicates minimum input level. /// + /// The camera already has been disposed. public double AudioLevel { get @@ -105,6 +108,7 @@ namespace Tizen.Multimedia /// /// The sampling rate of an audio stream in hertz. /// + /// The camera already has been disposed. public int AudioSampleRate { get @@ -127,6 +131,7 @@ namespace Tizen.Multimedia /// /// The bitrate of an audio encoder in bits per second. /// + /// The camera already has been disposed. public int AudioBitRate { get @@ -149,6 +154,7 @@ namespace Tizen.Multimedia /// /// The bitrate of an video encoder in bits per second. /// + /// The camera already has been disposed. public int VideoBitRate { get @@ -171,6 +177,8 @@ namespace Tizen.Multimedia /// /// The audio codec for encoding an audio stream. /// + /// A that specifies the type of audio codec. + /// The camera already has been disposed. public RecorderAudioCodec AudioCodec { get @@ -193,6 +201,8 @@ namespace Tizen.Multimedia /// /// The video codec for encoding video stream. /// + /// A that specifies the type of video codec. + /// The camera already has been disposed. public RecorderVideoCodec VideoCodec { get @@ -215,6 +225,8 @@ namespace Tizen.Multimedia /// /// The file format for recording media stream. /// + /// A that specifies the file format. + /// The camera already has been disposed. public RecorderFileFormat FileFormat { get @@ -241,13 +253,14 @@ namespace Tizen.Multimedia /// If the same file already exists in the file system, then old file /// will be overwritten. /// + /// The camera already has been disposed. public string FilePath { get { IntPtr val; - int ret = Interop.RecorderSettings.GetFileName(_recorder.GetHandle(), out val); - if ((RecorderError)ret != RecorderError.None) + RecorderError ret = Interop.RecorderSettings.GetFileName(_recorder.GetHandle(), out val); + if (ret != RecorderError.None) { Log.Error(RecorderLog.Tag, "Failed to get filepath, " + (RecorderError)ret); } @@ -272,7 +285,7 @@ namespace Tizen.Multimedia /// be discarded and not written to the file. /// The recorder state must be in 'Ready' or 'Created' state. /// - /// + /// The camera already has been disposed. public int SizeLimit { get @@ -301,6 +314,7 @@ namespace Tizen.Multimedia /// be discarded and not written to the file. /// The recorder state must be in 'Ready' or 'Created' state. /// + /// The camera already has been disposed. public int TimeLimit { get @@ -323,6 +337,7 @@ namespace Tizen.Multimedia /// /// The mute state of a recorder. /// + /// The camera already has been disposed. public bool Mute { get @@ -345,6 +360,7 @@ namespace Tizen.Multimedia /// If the rate is in range of 0-1, video is recorded in a slow motion mode. /// If the rate is bigger than 1, video is recorded in a fast motion mode. /// + /// The camera already has been disposed. public double MotionRate { get @@ -367,6 +383,8 @@ namespace Tizen.Multimedia /// /// The orientation in a video metadata tag. /// + /// A that specifies the type of orientation. + /// The camera already has been disposed. public RecorderOrientation OrientationTag { get @@ -389,10 +407,8 @@ namespace Tizen.Multimedia /// /// Resolution of the video. /// - /// - /// http://tizen.org/privilege/recorder - /// /// In case of invalid parameters + /// The camera already has been disposed. public Size VideoResolution { get @@ -400,7 +416,7 @@ namespace Tizen.Multimedia int width = 0; int height = 0; - CameraErrorFactory.ThrowIfError(Interop.RecorderSettings.GetVideoResolution(_recorder.GetHandle(), out width, out height), + RecorderErrorFactory.ThrowIfError(Interop.RecorderSettings.GetVideoResolution(_recorder.GetHandle(), out width, out height), "Failed to get camera video resolution"); return new Size(width, height); @@ -410,7 +426,7 @@ namespace Tizen.Multimedia { Size res = value; - CameraErrorFactory.ThrowIfError(Interop.RecorderSettings.SetVideoResolution(_recorder.GetHandle(), res.Width, res.Height), + RecorderErrorFactory.ThrowIfError(Interop.RecorderSettings.SetVideoResolution(_recorder.GetHandle(), res.Width, res.Height), "Failed to set video resolution."); } } diff --git a/src/Tizen.Multimedia/Tizen.Multimedia.project.json b/src/Tizen.Multimedia/Tizen.Multimedia.project.json index 42ba1e8..d7fdcc7 100755 --- a/src/Tizen.Multimedia/Tizen.Multimedia.project.json +++ b/src/Tizen.Multimedia/Tizen.Multimedia.project.json @@ -1,9 +1,9 @@ { "dependencies": { "ElmSharp": "1.1.0-*", - "NETStandard.Library": "1.6.0", - "Tizen": "1.0.2", - "Tizen.Applications": "1.2.4" + "NETStandard.Library": "1.6.1", + "Tizen": "1.0.3", + "Tizen.Applications": "1.3.2" }, "frameworks": { "netstandard1.3": {} -- 2.7.4