[Camera] Fixed possible memory leak and Add some descriptions
authorHaesu Gwon <haesu.gwon@samsung.com>
Tue, 28 Mar 2017 12:35:49 +0000 (21:35 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Thu, 30 Mar 2017 09:57:01 +0000 (18:57 +0900)
Change-Id: I0ba0270c801ea6b3d6f4bfb94a64037d9d826a5b
Signed-off-by: Haesu Gwon <haesu.gwon@samsung.com>
18 files changed:
packaging/csapi-multimedia.spec
src/Tizen.Multimedia/Camera/Camera.cs
src/Tizen.Multimedia/Camera/CameraDisplay.cs
src/Tizen.Multimedia/Camera/CameraErrorFactory.cs
src/Tizen.Multimedia/Camera/CameraFeatures.cs
src/Tizen.Multimedia/Camera/CameraSettings.cs
src/Tizen.Multimedia/Interop/Interop.Camera.cs [changed mode: 0644->0755]
src/Tizen.Multimedia/Interop/Interop.CameraDisplay.cs [changed mode: 0644->0755]
src/Tizen.Multimedia/Interop/Interop.CameraFeatures.cs [changed mode: 0644->0755]
src/Tizen.Multimedia/Interop/Interop.CameraSettings.cs [changed mode: 0644->0755]
src/Tizen.Multimedia/Interop/Interop.Recorder.cs
src/Tizen.Multimedia/Interop/Interop.RecorderFeatures.cs [changed mode: 0644->0755]
src/Tizen.Multimedia/Interop/Interop.RecorderSettings.cs [changed mode: 0644->0755]
src/Tizen.Multimedia/Recorder/Recorder.cs
src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs
src/Tizen.Multimedia/Recorder/RecorderFeatures.cs
src/Tizen.Multimedia/Recorder/RecorderSettings.cs
src/Tizen.Multimedia/Tizen.Multimedia.project.json

index 9e4458c..a3ab59e 100755 (executable)
@@ -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
index ecbeae9..34da30f 100755 (executable)
@@ -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]";
     }
 
     /// <summary>
@@ -48,6 +50,9 @@ namespace Tizen.Multimedia
         /// Initializes a new instance of the <see cref="Camera"/> Class.
         /// </summary>
         /// <param name="device">The camera device to access</param>
+        /// <privilege>
+        /// http://tizen.org/privilege/camera
+        /// </privilege>
         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);
         }
 
         /// <summary>
@@ -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
         /// <summary>
         /// Gets the state of the camera.
         /// </summary>
+        /// <value> None, Created, Preview, Capturing, Captured </value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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.
         /// </summary>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+        /// <exception cref="InvalidOperationException">Invalid state.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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
         /// <summary>
         /// Gets the facing direction of camera module.
         /// </summary>
+        /// <value>A <see cref="CameraFacingDirection"/> that specifies the facing direction of camera device.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraFacingDirection Direction
         {
             get
             {
+                ValidateNotDisposed();
+
                 CameraFacingDirection val = 0;
 
                 CameraErrorFactory.ThrowIfError(Interop.Camera.GetFacingDirection(_handle, out val),
@@ -405,14 +425,15 @@ namespace Tizen.Multimedia
         /// <summary>
         /// Gets the camera device count.
         /// </summary>
-        /// <remarks>
-        /// This returns 2, if the device supports primary and secondary cameras.
-        /// Otherwise 1, if the device only supports primary camera.
-        /// </remarks>
+        /// <value>This returns 2, if the device supports primary and secondary cameras.
+        /// Otherwise 1, if the device only supports primary camera.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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
         /// <summary>
         /// Changes the camera device.
         /// </summary>
@@ -437,9 +458,10 @@ namespace Tizen.Multimedia
         /// can be kept even though camera device is changed.
         /// The camera must be in the <see cref="CameraState.Created"/> or <see cref="CameraState.Preview"/> state.
         /// </remarks>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
-        /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
-        /// <exception cref="NotSupportedException">In case of ChangeDevice feature is not supported</exception>
+        /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of ChangeDevice feature is not supported.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void ChangeDevice(CameraDevice device)
         {
             ValidateState(CameraState.Created, CameraState.Preview);
@@ -456,9 +478,9 @@ namespace Tizen.Multimedia
         /// </privilege>
         /// <param name="device">The device to get state.</param>
         /// <returns>Returns the state of camera device</returns>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
-        /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
-        /// <exception cref="NotSupportedException">In case of this feature is not supported</exception>
+        /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
         public CameraDeviceState GetDeviceState(CameraDevice device)
         {
             int val = 0;
@@ -469,6 +491,17 @@ namespace Tizen.Multimedia
             return (CameraDeviceState)val;
         }
 
+        /// <summary>
+        /// Gets the flash state.
+        /// </summary>
+        /// <privilege>
+        /// http://tizen.org/privilege/camera
+        /// </privilege>
+        /// <param name="device">The device to get state.</param>
+        /// <returns>Returns the flash state of camera device</returns>
+        /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
         public static CameraFlashState GetFlashState(CameraDevice device)
         {
             CameraFlashState val = CameraFlashState.NotUsed;
@@ -481,18 +514,20 @@ namespace Tizen.Multimedia
 
         /// <summary>
         /// Starts capturing and drawing preview frames on the screen.
-        /// The display handle must be set using <see cref="Tizen.Multimedia.Camera.SetDisplay"/>
+        /// The display handle must be set using <see cref="CameraDisplay.SetInfo"/>
         /// before using this method.
-        /// If needed set fps <see cref="Tizen.Multimedia.CameraSetting.PreviewFps"/>, preview resolution
-        /// <see cref="Tizen.Multimedia.Camera.PreviewResolution"/>, or preview format <see cref="Tizen.Multimedia.Camera.PreviewFormat"/>
+        /// If needed set fps <see cref="CameraSettings.PreviewFps"/>, preview resolution
+        /// <see cref="CameraSettings.PreviewResolution"/>, or preview format <see cref="CameraSettings.PreviewPixelFormat"/>
         /// before using this method.
+        /// The camera must be in the <see cref="CameraState.Created"/> or <see cref="CameraState.Captured"/> state.
         /// </summary>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
-        /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
-        /// <exception cref="NotSupportedException">In case of this feature is not supported</exception>
-        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
+        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
         public void StartPreview()
         {
             ValidateState(CameraState.Created, CameraState.Captured);
@@ -506,15 +541,19 @@ namespace Tizen.Multimedia
 
         /// <summary>
         /// Stops capturing and drawing preview frames on the screen.
+        /// The camera must be in the <see cref="CameraState.Preview"/> state.
         /// </summary>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
-        /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
-        /// <exception cref="NotSupportedException">In case of this feature is not supported</exception>
-        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
+        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
         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
 
         /// <summary>
         /// Starts capturing of still images.
-        /// EventHandler must be set for capturing using <see cref="Tizen.Multimedia.Camera.Capturing"/>
-        /// and for completed using <see cref="Tizen.Multimedia.Camera.CaptureCompleted"/> before
-        /// calling this method.
+        /// EventHandler must be set for capturing using <see cref="Capturing"/>
+        /// and for completed using <see cref="CaptureCompleted"/> before calling this method.
+        /// The camera must be in the <see cref="CameraState.Preview"/> state.
         /// </summary>
         /// <privilege>
         /// http://tizen.org/privilege/camera
@@ -533,12 +572,12 @@ namespace Tizen.Multimedia
         /// <remarks>
         /// 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 <see cref="Tizen.Multimedia.Camera.StartPreview"/>
-        /// method.
+        /// The preview should be restarted by calling <see cref="StartPreview"/> method after capture is completed.
         /// </remarks>
-        /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
-        /// <exception cref="NotSupportedException">In case of this feature is not supported</exception>
-        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
+        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
         public void StartCapture()
         {
             ValidateState(CameraState.Preview);
@@ -551,26 +590,29 @@ namespace Tizen.Multimedia
 
         /// <summary>
         /// Starts continuously capturing still images.
-        /// EventHandler must be set for capturing using <see cref="Tizen.Multimedia.Camera.Capturing"/>
-        /// and for completed using <see cref="Tizen.Multimedia.Camera.CaptureCompleted"/> before
-        /// calling this method.
+        /// EventHandler must be set for capturing using <see cref="Capturing"/>
+        /// and for completed using <see cref="CaptureCompleted"/> before calling this method.
+        /// The camera must be in the <see cref="CameraState.Preview"/> state.
         /// </summary>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
         /// <param name="count">The number of still images.</param>
         /// <param name="interval">The interval of the capture(milliseconds).</param>
+        /// <param name="cancellationToken">The cancellation token to cancel capturing.</param>
+        /// <seealso cref="System.Threading.CancellationToken"/>
         /// <remarks>
         /// 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 <see cref="Tizen.Multimedia.Camera.Capturing"/> event.
-        /// The camera's preview should be restarted by calling <see cref="Tizen.Multimedia.Camera.StartPreview"/> method.
+        /// Each captured image will be delivered through Eventhandler set using <see cref="Capturing"/> event.
+        /// The preview should be restarted by calling <see cref="StartPreview"/> method after capture is completed.
         /// </remarks>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
-        /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
-        /// <exception cref="NotSupportedException">In case of this feature is not supported</exception>
-        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted</exception>
+        /// <exception cref="ArgumentOutOfRangeException">In case of invalid parameters.</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
+        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
         public void StartCapture(int count, int interval, CancellationToken cancellationToken)
         {
             ValidateState(CameraState.Preview);
@@ -604,18 +646,20 @@ namespace Tizen.Multimedia
 
         /// <summary>
         /// Starts camera auto-focusing, asynchronously.
+        /// The camera must be in the <see cref="CameraState.Preview"/> or <see cref="CameraState.Captured"/> state.
         /// </summary>
-        /// <param name="continuous">Continuous.</param>
+        /// <param name="continuous">Continuous auto focus</param>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
         /// <remarks>
         /// If continuous status is true, the camera continuously tries to focus.
         /// </remarks>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
-        /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
-        /// <exception cref="NotSupportedException">In case of this feature is not supported</exception>
-        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted</exception>
+        /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
+        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
         public void StartFocusing(bool continuous)
         {
             ValidateState(CameraState.Preview, CameraState.Captured);
@@ -626,13 +670,15 @@ namespace Tizen.Multimedia
 
         /// <summary>
         /// Stops camera auto focusing.
+        /// The camera must be in the <see cref="CameraState.Preview"/> or <see cref="CameraState.Captured"/> state.
         /// </summary>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
-        /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
-        /// <exception cref="NotSupportedException">In case of this feature is not supported</exception>
-        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
+        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
         public void StopFocusing()
         {
             ValidateState(CameraState.Preview, CameraState.Captured);
@@ -643,18 +689,20 @@ namespace Tizen.Multimedia
 
         /// <summary>
         /// Starts face detection.
+        /// The camera must be in the <see cref="CameraState.Preview"/> state.
         /// </summary>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
         /// <remarks>
-        /// This should be called after <see cref="Tizen.Multimedia.Camera.StartPreview"/> is started.
-        /// The Eventhandler set using <see cref="Tizen.Multimedia.Camera.FaceDetected"/> invoked when the face is detected in preview frame.
+        /// This should be called after <see cref="StartPreview"/> is started.
+        /// The Eventhandler set using <see cref="FaceDetected"/> invoked when the face is detected in preview frame.
         /// Internally it starts continuous focus and focusing on the detected face.
         /// </remarks>
-        /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
-        /// <exception cref="NotSupportedException">In case of this feature is not supported</exception>
-        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
+        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
         public void StartFaceDetection()
         {
             ValidateState(CameraState.Preview);
@@ -684,6 +732,7 @@ namespace Tizen.Multimedia
         /// </privilege>
         /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
         /// <exception cref="NotSupportedException">In case of this feature is not supported</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted</exception>
         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));
             };
index e9c4774..877deb0 100755 (executable)
@@ -35,6 +35,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The display mode.
         /// </summary>
+        /// <value>A <see cref="CameraDisplayMode"/> that specifies the display mode.</value>
+        /// <exception cref="ObjectDisposedException" > The camera already has been disposed.</exception>
         public CameraDisplayMode Mode
         {
             get
@@ -58,6 +60,7 @@ namespace Tizen.Multimedia
         /// The display visibility.
         /// True if camera display visible, otherwise false.
         /// </summary>
+        /// <exception cref="ObjectDisposedException" > The camera already has been disposed.</exception>
         public bool Visible
         {
             get
@@ -80,9 +83,11 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The display rotation.
         /// </summary>
+        /// <value>A <see cref="CameraRotation"/> that specifies the rotation of camera device.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera.
         /// </privilege>
+        /// <exception cref="ObjectDisposedException" > The camera already has been disposed.</exception>
         public CameraRotation Rotation
         {
             get
@@ -105,9 +110,11 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The display flip.
         /// </summary>
+        /// <value>A <see cref="CameraFlip"/> that specifies camera flip type.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera.
         /// </privilege>
+        /// <exception cref="ObjectDisposedException" > The camera already has been disposed.</exception>
         public CameraFlip Flip
         {
             get
@@ -130,6 +137,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// the ROI(Region Of Interest) area of display.
         /// </summary>
+        /// <exception cref="ObjectDisposedException" > The camera already has been disposed.</exception>
         public Rectangle RoiArea
         {
             get
@@ -154,6 +162,7 @@ namespace Tizen.Multimedia
 
         /// <summary>
         /// Sets the display type and handle to show preview images.
+        /// The camera must be in the <see cref="CameraState.Created"/> state.
         /// </summary>
         /// <param name="displayType">Display type.</param>
         /// <param name="preview">MediaView object to display preview.</param>
@@ -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.
         /// </remarks>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
-        /// <exception cref="InvalidOperationException">In case of any invalid operations</exception>
-        /// <exception cref="NotSupportedException">In case of this feature is not supported</exception>
-        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted</exception>
+        /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
+        /// <exception cref="ObjectDisposedException" > The camera already has been disposed.</exception>
+        /// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
         public void SetInfo(CameraDisplayType displayType, MediaView displayHandle)
         {
             _camera.ValidateState(CameraState.Created);
index 4d776fc..15862f3 100755 (executable)
@@ -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);
index a09d91f..374b7f4 100755 (executable)
@@ -34,6 +34,7 @@ namespace Tizen.Multimedia
         private List<CameraPixelFormat> _captureFormats;
         private List<CameraPixelFormat> _previewFormats;
         private List<CameraFps> _fps;
+        private List<CameraFps> _fpsByResolution;
         private List<CameraAutoFocusMode> _autoFocusModes;
         private List<CameraExposureMode> _exposureModes;
         private List<CameraIsoLevel> _isoLevels;
@@ -46,7 +47,7 @@ namespace Tizen.Multimedia
         private List<CameraFlip> _streamFlips;
         private List<CameraPtzType> _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.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<Size> SupportedPreviewResolutions
         {
             get
             {
                 if (_previewResolutions == null)
                 {
-                    _previewResolutions = new List<Size>();
-
-                    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<Size>();
+
+                        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
         /// <returns>
         /// It returns a list containing all the supported capture resolutions.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<Size> SupportedCaptureResolutions
         {
             get
             {
                 if (_cameraResolutions == null)
                 {
-                    _cameraResolutions = new List<Size>();
-
-                    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<Size>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported capture formats.
+        /// It returns a list containing all the supported <see cref="CameraPixelFormat"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraPixelFormat> SupportedCapturePixelFormats
         {
             get
             {
                 if (_captureFormats == null)
                 {
-                    _captureFormats = new List<CameraPixelFormat>();
-
-                    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<CameraPixelFormat>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported preview formats.
+        /// It returns a list containing all the supported <see cref="CameraPixelFormat"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraPixelFormat> SupportedPreviewPixelFormats
         {
             get
             {
                 if (_previewFormats == null)
                 {
-                    _previewFormats = new List<CameraPixelFormat>();
-
-                    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<CameraPixelFormat>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported fps.
+        /// It returns a list containing all the supported <see cref="CameraFps"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraFps> SupportedPreviewFps
         {
             get
             {
                 if (_fps == null)
                 {
-                    _fps = new List<CameraFps>();
-
-                    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<CameraFps>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported fps by resolution.
+        /// It returns a list containing all the supported <see cref="CameraFps"/> by resolution.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraFps> GetSupportedPreviewFpsByResolution(int width, int height)
         {
-            var result = new List<CameraFps>();
-
-            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<CameraFps>();
 
-            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;
         }
 
         /// <summary>
         /// Retrieves all the fps by resolution supported by the camera.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported fps by resolution.
+        /// It returns a list containing all the supported <see cref="CameraFps"/> by resolution.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraFps> GetSupportedPreviewFpsByResolution(Size size)
         {
             return GetSupportedPreviewFpsByResolution(size.Width, size.Height);
         }
 
         /// <summary>
-        /// Retrieves all the fps by resolution supported by the camera.
+        /// Retrieves all the auto focus modes supported by the camera.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported fps by resolution.
+        /// It returns a list containing all the supported <see cref="CameraAutoFocusMode"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraAutoFocusMode> SupportedAutoFocusModes
         {
             get
             {
                 if (_autoFocusModes == null)
                 {
-                    _autoFocusModes = new List<CameraAutoFocusMode>();
-
-                    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<CameraAutoFocusMode>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported camera exposure modes.
+        /// It returns a list containing all the supported <see cref="CameraExposureMode"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraExposureMode> SupportedExposureModes
         {
             get
             {
                 if (_exposureModes == null)
                 {
-                    _exposureModes = new List<CameraExposureMode>();
-
-                    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<CameraExposureMode>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported camera Iso levels.
+        /// It returns a list containing all the supported <see cref="CameraIsoLevel"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraIsoLevel> SupportedIsoLevels
         {
             get
             {
                 if (_isoLevels == null)
                 {
-                    _isoLevels = new List<CameraIsoLevel>();
-
-                    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<CameraIsoLevel>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported camera theater modes.
+        /// It returns a list containing all the supported <see cref="CameraTheaterMode"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraTheaterMode> SupportedTheaterModes
         {
             get
             {
                 if (_theaterModes == null)
                 {
-                    _theaterModes = new List<CameraTheaterMode>();
-
-                    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<CameraTheaterMode>();
+
+                        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
         }
 
         /// <summary>
-        /// Retrieves all the whitebalance mode supported by the camera.
+        /// Retrieves all the whitebalance modes supported by the camera.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported camera white balance modes.
+        /// It returns a list containing all the supported <see cref="CameraWhiteBalance"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraWhiteBalance> SupportedWhiteBalances
         {
             get
             {
                 if (_whitebalances == null)
                 {
-                    _whitebalances = new List<CameraWhiteBalance>();
-
-                    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<CameraWhiteBalance>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported camera flash modes.
+        /// It returns a list containing all the supported <see cref="CameraFlashMode"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraFlashMode> SupportedFlashModes
         {
             get
             {
                 if (_flashModes == null)
                 {
-                    _flashModes = new List<CameraFlashMode>();
-
-                    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<CameraFlashMode>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported camera scene modes.
+        /// It returns a list containing all the supported <see cref="CameraSceneMode"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraSceneMode> SupportedSceneModes
         {
             get
             {
                 if (_sceneModes == null)
                 {
-                    _sceneModes = new List<CameraSceneMode>();
-
-                    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<CameraSceneMode>();
+
+                        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
         }
 
         /// <summary>
-        /// Retrieves all the effects supported by the camera.
+        /// Retrieves all the effect modes supported by the camera.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported camera effects.
+        /// It returns a list containing all the supported <see cref="CameraEffectMode"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraEffectMode> SupportedEffects
         {
             get
             {
                 if (_effectModes == null)
                 {
-                    _effectModes = new List<CameraEffectMode>();
-
-                    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<CameraEffectMode>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported camera stream rotations.
+        /// It returns a list containing all the supported <see cref="CameraRotation"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraRotation> SupportedStreamRotations
         {
             get
             {
                 if (_streamRotations == null)
                 {
-                    _streamRotations = new List<CameraRotation>();
-
-                    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<CameraRotation>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported camera flip.
+        /// It returns a list containing all the supported <see cref="CameraFlip"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraFlip> SupportedStreamFlips
         {
             get
             {
                 if (_streamFlips == null)
                 {
-                    _streamFlips = new List<CameraFlip>();
-
-                    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<CameraFlip>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported ptz types.
+        /// It returns a list containing all the supported <see cref="CameraPtzType"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<CameraPtzType> SupportedPtzTypes
         {
             get
             {
                 if (_ptzTypes.Count == 0)
                 {
-                    _ptzTypes = new List<CameraPtzType>();
-
-                    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<CameraPtzType>();
+
+                        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;
index 16d3d6e..9a8845a 100755 (executable)
@@ -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
         /// <summary>
         /// Sets auto focus area.
         /// </summary>
+        /// <remarks>
+        /// <see cref="CameraAutoFocusMode"/> should not be the <see cref="CameraAutoFocusMode.None"/>.
+        /// </remarks>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
         /// <param name="x">X position</param>
         /// <param name="y">Y position</param>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void SetAutoFocusArea(int x, int y)
         {
             CameraErrorFactory.ThrowIfError(Interop.CameraSettings.SetAutoFocusArea(_camera.GetHandle(), x, y),
                 "Failed to set the autofocus area.");
         }
 
+        /// <summary>
+        /// Sets auto focus area.
+        /// </summary>
+        /// <remarks>
+        /// <see cref="CameraAutoFocusMode"/> should not be the <see cref="CameraAutoFocusMode.None"/>.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/camera
+        /// </privilege>
+        /// <param name="pos"><see cref="Point"/> structure including X, Y position</param>
+        /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void SetAutoFocusArea(Point pos)
         {
             CameraErrorFactory.ThrowIfError(Interop.CameraSettings.SetAutoFocusArea(_camera.GetHandle(), pos.X, pos.Y),
@@ -92,6 +110,7 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void ClearFocusArea()
         {
             CameraErrorFactory.ThrowIfError(Interop.CameraSettings.ClearAutoFocusArea(_camera.GetHandle()),
@@ -101,9 +120,11 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The auto focus mode.
         /// </summary>
+        /// <value>A <see cref="CameraAutoFocusMode"/> that specifies the auto focus mode.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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
         /// <summary>
@@ -131,6 +152,7 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int Contrast
         {
             get
@@ -157,6 +179,7 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public bool AutoContrast
         {
             get
@@ -181,11 +204,12 @@ namespace Tizen.Multimedia
         /// <remarks>
         /// If min value is greater than the max value, it means this feature is not supported.
         /// </remarks>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
         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
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int Brightness
         {
             get
@@ -227,11 +252,12 @@ namespace Tizen.Multimedia
         /// <remarks>
         /// If min value is greater than the max value, it means this feature is not supported.
         /// </remarks>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
         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
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int Exposure
         {
             get
@@ -270,9 +297,11 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The exposure mode.
         /// </summary>
+        /// <value>A <see cref="CameraExposureMode"/> that specifies the exposure mode.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraExposureMode ExposureMode
         {
             get
@@ -298,11 +327,12 @@ namespace Tizen.Multimedia
         /// <remarks>
         /// If min value is greater than the max value, it means this feature is not supported.
         /// </remarks>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
         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
         /// <summary>
@@ -320,6 +350,7 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera.
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int ZoomLevel
         {
             get
@@ -345,11 +376,12 @@ namespace Tizen.Multimedia
         /// <remarks>
         /// If min value is greater than the max value, it means this feature is not supported.
         /// </remarks>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
         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
         /// <summary>
         /// The whitebalance mode.
         /// </summary>
+        /// <value>A <see cref="CameraWhiteBalance"/> that specifies the white balance mode.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraWhiteBalance WhiteBalance
         {
             get
@@ -387,9 +421,11 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The ISO level.
         /// </summary>
+        /// <value>A <see cref="CameraIsoLevel"/> that specifies ISO level.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraIsoLevel IsoLevel
         {
             get
@@ -416,6 +452,7 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera.
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int ImageQuality
         {
             get
@@ -439,6 +476,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The preview frame rate.
         /// </summary>
+        /// <value>A <see cref="CameraFps"/> that specifies preview frame rate.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraFps PreviewFps
         {
             get
@@ -464,7 +503,8 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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.
         /// </remarks>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public Size RecommendedPreviewResolution
         {
             get
@@ -509,7 +550,9 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The preview data format.
         /// </summary>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <value>A <see cref="CameraPixelFormat"/> that specifies the pixel format of preview data.</value>
+        /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraPixelFormat PreviewPixelFormat
         {
             get
@@ -536,6 +579,7 @@ namespace Tizen.Multimedia
         /// http://tizen.org/privilege/camera
         /// </privilege>
         /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public Size CaptureResolution
         {
             get
@@ -561,7 +605,9 @@ namespace Tizen.Multimedia
         /// <summary>
         /// Format of an image to be captured.
         /// </summary>
+        /// <value>A <see cref="CameraPixelFormat"/> that specifies the pixel format of captured image.</value>
         /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraPixelFormat CapturePixelFormat
         {
             get
@@ -586,6 +632,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The bit rate of encoded preview.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int EncodedPreviewBitrate
         {
             get
@@ -608,6 +655,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// GOP(Group Of Pictures) interval of encoded preview.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int EncodedPreviewGopInterval
         {
             get
@@ -631,6 +679,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The theater mode.
         /// </summary>
+        /// <value>A <see cref="CameraTheaterMode"/> that specifies theater mode.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
@@ -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.
         /// </remarks>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraTheaterMode TheaterMode
         {
             get
@@ -660,9 +710,11 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The camera effect mode.
         /// </summary>
+        /// <value>A <see cref="CameraEffectMode"/> that specifies effect mode.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraEffectMode Effect
         {
             get
@@ -685,9 +737,11 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The scene mode.
         /// </summary>
+        /// <value>A <see cref="CameraSceneMode"/> that specifies scene mode.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraSceneMode SceneMode
         {
             get
@@ -710,9 +764,11 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The camera's flash mode.
         /// </summary>
+        /// <value>A <see cref="CameraFlashMode"/> that specifies flash mode.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraFlashMode FlashMode
         {
             get
@@ -735,6 +791,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// Gets the camera lens orientation angle.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int LensOrientation
         {
             get
@@ -751,6 +808,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The stream rotation.
         /// </summary>
+        /// <value>A <see cref="CameraRotation"/> that specifies the rotation of camera device.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraRotation StreamRotation
         {
             get
@@ -773,6 +832,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The stream flip.
         /// </summary>
+        /// <value>A <see cref="CameraFlip"/> that specifies camera flip type.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraFlip StreamFlip
         {
             get
@@ -795,6 +856,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The mode of HDR(High dynamic range) capture.
         /// </summary>
+        /// <value>A <see cref="CameraHdrMode"/> that specifies the HDR mode.</value>
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
@@ -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.
         /// </remarks>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraHdrMode HdrMode
         {
             get
@@ -826,6 +889,7 @@ namespace Tizen.Multimedia
         /// The anti shake feature.
         /// If true the antishake feature is enabled, otherwise false.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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.
         /// </remarks>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public bool VideoStabilization
         {
             get
@@ -882,6 +947,7 @@ namespace Tizen.Multimedia
         /// <remarks>
         /// In some countries, this operation is not permitted.
         /// </remarks>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public bool DisableShutterSound
         {
             set
@@ -895,6 +961,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// Sets the type of PTZ(Pan Tilt Zoom). Mechanical or Electronic.
         /// </summary>
+        /// <value>A <see cref="CameraPtzType"/> that specifies the type of PTZ.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraPtzType PtzType
         {
             set
@@ -910,9 +978,10 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
-        /// <param name="type">ptz move type.</param>
+        /// <param name="type">ptz move type. <seealso cref="CameraPtzMoveType"/></param>
         /// <param name="panStep">pan step</param>
         /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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
         /// </privilege>
         /// <returns>Returns the camera's horizontal position</returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int GetPan()
         {
             int val = 0;
@@ -945,6 +1015,7 @@ namespace Tizen.Multimedia
         /// <param name="type">ptz move type</param>
         /// <param name="tiltStep">tilt step</param>
         /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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
         /// </privilege>
         /// <returns>Returns the current vertical position</returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int GetTilt()
         {
             int val = 0;
@@ -974,11 +1046,12 @@ namespace Tizen.Multimedia
         /// <remarks>
         /// If min value is greater than the max value, it means this feature is not supported.
         /// </remarks>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
         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
         /// <remarks>
         /// If min value is greater than the max value, it means this feature is not supported.
         /// </remarks>
+        /// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
         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.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public bool EnableTag
         {
             get
@@ -1032,6 +1107,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The camera image description in the EXIF tag.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public string ImageDescriptionTag
         {
             get
@@ -1060,6 +1136,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The software information in the EXIF tag.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public string SoftwareTag
         {
             get
@@ -1089,6 +1166,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The geotag(GPS data) in the EXIF tag.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public Location GeoTag
         {
             get
@@ -1116,6 +1194,7 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void RemoveGeoTag()
         {
             CameraErrorFactory.ThrowIfError(Interop.CameraSettings.RemoveGeotag(_camera.GetHandle()),
@@ -1125,6 +1204,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The camera orientation in the tag.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public CameraTagOrientation OrientationTag
         {
             get
old mode 100644 (file)
new mode 100755 (executable)
index 8f82f37..45ee869
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index 513ca13..94a20af
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index d14860d..e7077de
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index bfc633a..f0c63c3
@@ -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);
         }
     }
 }
index 2f66bb6..aecb874 100755 (executable)
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index 73e12ad..58cc03f
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index 738394c..ce62a18
@@ -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
index 81558b9..f47e22e 100755 (executable)
@@ -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
         /// <summary>
         /// Audio recorder constructor.
         /// </summary>
+        /// /// <privilege>
+        /// http://tizen.org/privilege/microphone
+        /// </privilege>
         public Recorder()
         {
             RecorderErrorFactory.ThrowIfError(Interop.Recorder.Create(out _handle),
@@ -54,6 +56,8 @@ namespace Tizen.Multimedia
             Setting = new RecorderSettings(this);
 
             RegisterCallbacks();
+
+            SetState(RecorderState.Created);
         }
 
         /// <summary>
@@ -62,6 +66,9 @@ namespace Tizen.Multimedia
         /// <param name="camera">
         /// The camera object.
         /// </param>
+        /// <privilege>
+        /// http://tizen.org/privilege/camera
+        /// </privilege>
         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);
         }
 
         /// <summary>
@@ -202,10 +211,14 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The current state of the recorder.
         /// </summary>
+        /// <value>A <see cref="RecorderState"/> that specifies the state of recorder.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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
         /// <summary>
         /// Prepare the media recorder for recording.
+        /// The recorder must be in the <see cref="RecorderState.Created"/> state.
+        /// After this method is finished without any exception,
+        /// The state of recorder will be changed to <see cref="RecorderState.Ready"/> state.
         /// </summary>
         /// <remarks>
         /// Before calling the function, it is required to set AudioEncoder,
         /// videoencoder and fileformat properties of recorder.
         /// </remarks>
         /// <privilege>
-        /// http://tizen.org/privilege/recorder
+        /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone
         /// </privilege>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void Prepare()
         {
+            ValidateState(RecorderState.Created);
+
             RecorderErrorFactory.ThrowIfError(Interop.Recorder.Prepare(_handle),
                 "Failed to prepare media recorder for recording");
+
+            SetState(RecorderState.Ready);
         }
 
         /// <summary>
         /// Resets the media recorder.
+        /// The recorder must be in the <see cref="RecorderState.Ready"/> state.
+        /// After this method is finished without any exception,
+        /// The state of recorder will be changed to <see cref="RecorderState.Created"/> state.
         /// </summary>
         /// <privilege>
-        /// http://tizen.org/privilege/recorder
+        /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone
         /// </privilege>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void Unprepare()
         {
+            ValidateState(RecorderState.Ready);
+
             RecorderErrorFactory.ThrowIfError(Interop.Recorder.Unprepare(_handle),
                 "Failed to reset the media recorder");
+
+            SetState(RecorderState.Created);
         }
 
         /// <summary>
         /// Starts the recording.
+        /// The recorder must be in the <see cref="RecorderState.Ready"/> state.
+        /// After this method is finished without any exception,
+        /// The state of recorder will be changed to <see cref="RecorderState.Recording"/> state.
         /// </summary>
         /// <remarks>
         /// 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.
         /// </remarks>
         /// <privilege>
-        /// http://tizen.org/privilege/recorder
+        /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone
         /// </privilege>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void Start()
         {
+            ValidateState(RecorderState.Ready);
+
             RecorderErrorFactory.ThrowIfError(Interop.Recorder.Start(_handle),
                 "Failed to start the media recorder");
+
+            SetState(RecorderState.Recording);
         }
 
         /// <summary>
         /// Pause the recording.
+        /// The recorder must be in the <see cref="RecorderState.Recording"/> state.
+        /// After this method is finished without any exception,
+        /// The state of recorder will be changed to <see cref="RecorderState.Paused"/> state.
         /// </summary>
         /// <remarks>
         /// Recording can be resumed with Start().
         /// </remarks>
         /// <privilege>
-        /// http://tizen.org/privilege/recorder
+        /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone
         /// </privilege>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void Pause()
         {
+            ValidateState(RecorderState.Recording);
+
             RecorderErrorFactory.ThrowIfError(Interop.Recorder.Pause(_handle),
                 "Failed to pause the media recorder");
+
+            SetState(RecorderState.Paused);
         }
 
         /// <summary>
         /// Stops recording and saves the result.
+        /// The recorder must be in the <see cref="RecorderState.Recording"/> or <see cref="RecorderState.Paused"/> state.
+        /// After this method is finished without any exception,
+        /// The state of recorder will be changed to <see cref="RecorderState.Ready"/> state.
         /// </summary>
         /// <privilege>
-        /// http://tizen.org/privilege/recorder
+        /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone
         /// </privilege>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void Commit()
         {
+            ValidateState(RecorderState.Recording, RecorderState.Paused);
+
             RecorderErrorFactory.ThrowIfError(Interop.Recorder.Commit(_handle),
                 "Failed to save the recorded content");
+
+            SetState(RecorderState.Ready);
         }
 
         /// <summary>
         /// Cancels the recording.
         /// The recording data is discarded and not written in the recording file.
+        /// The recorder must be in the <see cref="RecorderState.Recording"/> or <see cref="RecorderState.Paused"/> state.
+        /// After this method is finished without any exception,
+        /// The state of recorder will be changed to <see cref="RecorderState.Ready"/> state.
         /// </summary>
         /// <privilege>
-        /// http://tizen.org/privilege/recorder
+        /// http://tizen.org/privilege/camera or http://tizen.org/privilege/microphone
         /// </privilege>
+        /// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public void Cancel()
         {
+            ValidateState(RecorderState.Recording, RecorderState.Paused);
+
             RecorderErrorFactory.ThrowIfError(Interop.Recorder.Cancel(_handle),
                 "Failed to cancel the recording");
+
+            SetState(RecorderState.Ready);
         }
 
         /// <summary>
         /// Sets the audio stream policy.
         /// </summary>
         /// <param name="policy">Policy.</param>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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),
index 7ca36b2..74a8b46 100755 (executable)
@@ -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);
index ee6a4e9..ed0d010 100755 (executable)
@@ -42,24 +42,32 @@ namespace Tizen.Multimedia
         /// Retrieves all the file formats supported by the recorder.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported file
-        /// formats by recorder.
+        /// It returns a list containing all the supported <see cref="RecorderFileFormat"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<RecorderFileFormat> SupportedFileFormats
         {
             get
             {
                 if (_fileFormats == null)
                 {
-                    _fileFormats = new List<RecorderFileFormat>();
-
-                    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<RecorderFileFormat>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported audio encoders
-        /// by recorder.
+        /// It returns a list containing all the supported <see cref="RecorderAudioCodec"/>.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<RecorderAudioCodec> SupportedAudioEncodings
         {
             get
             {
                 if (_audioCodec == null)
                 {
-                    _audioCodec = new List<RecorderAudioCodec>();
-
-                    Interop.RecorderFeatures.AudioEncoderCallback callback = (RecorderAudioCodec codec, IntPtr userData) =>
+                    try
+                    {
+                        _audioCodec = new List<RecorderAudioCodec>();
+
+                        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.
         /// </summary>
         /// <returns>
-        /// It returns a list containing all the supported video encoders
+        /// It returns a list containing all the supported <see cref="RecorderVideoCodec"/>.
         /// by recorder.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<RecorderVideoCodec> SupportedVideoEncodings
         {
             get
             {
                 if (_videoCodec == null)
                 {
-                    _videoCodec = new List<RecorderVideoCodec>();
-
-                    Interop.RecorderFeatures.VideoEncoderCallback callback = (RecorderVideoCodec codec, IntPtr userData) =>
+                    try
+                    {
+                        _videoCodec = new List<RecorderVideoCodec>();
+
+                        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.
         /// </returns>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public IEnumerable<Size> SupportedVideoResolutions
         {
             get
             {
                 if (_videoResolution == null)
                 {
-                    _videoResolution = new List<Size>();
-
-                    Interop.RecorderFeatures.VideoResolutionCallback callback = (int width, int height, IntPtr userData) =>
+                    try
+                    {
+                        _videoResolution = new List<Size>();
+
+                        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;
index 4dcaf2f..0f6192c 100755 (executable)
@@ -37,11 +37,11 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The number of audio channel.
         /// </summary>
-        /// <remarks>
-        /// The attribute is applied only in Created state.
+        /// <value>
         /// For mono recording, set channel to 1.
         /// For stereo recording, set channel to 2.
-        /// </remarks>
+        /// </value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int AudioChannel
         {
             get
@@ -64,6 +64,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The audio device for recording.
         /// </summary>
+        /// <value>A <see cref="RecorderAudioDevice"/> that specifies the type of audio device.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public RecorderAudioDevice AudioDevice
         {
             get
@@ -89,6 +91,7 @@ namespace Tizen.Multimedia
         /// <remarks>
         /// 0dB indicates maximum input level, -300dB indicates minimum input level.
         /// </remarks>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public double AudioLevel
         {
             get
@@ -105,6 +108,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The sampling rate of an audio stream in hertz.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int AudioSampleRate
         {
             get
@@ -127,6 +131,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The bitrate of an audio encoder in bits per second.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int AudioBitRate
         {
             get
@@ -149,6 +154,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The bitrate of an video encoder in bits per second.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int VideoBitRate
         {
             get
@@ -171,6 +177,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The audio codec for encoding an audio stream.
         /// </summary>
+        /// <value>A <see cref="RecorderAudioCodec"/> that specifies the type of audio codec.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public RecorderAudioCodec AudioCodec
         {
             get
@@ -193,6 +201,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The video codec for encoding video stream.
         /// </summary>
+        /// <value>A <see cref="RecorderVideoCodec"/> that specifies the type of video codec.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public RecorderVideoCodec VideoCodec
         {
             get
@@ -215,6 +225,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The file format for recording media stream.
         /// </summary>
+        /// <value>A <see cref="RecorderFileFormat"/> that specifies the file format.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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.
         /// </remarks>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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.
         /// </remarks>
-        ///
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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.
         /// </remarks>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public int TimeLimit
         {
             get
@@ -323,6 +337,7 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The mute state of a recorder.
         /// </summary>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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.
         /// </remarks>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public double MotionRate
         {
             get
@@ -367,6 +383,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// The orientation in a video metadata tag.
         /// </summary>
+        /// <value>A <see cref="RecorderOrientation"/> that specifies the type of orientation.</value>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         public RecorderOrientation OrientationTag
         {
             get
@@ -389,10 +407,8 @@ namespace Tizen.Multimedia
         /// <summary>
         /// Resolution of the video.
         /// </summary>
-        /// <privilege>
-        /// http://tizen.org/privilege/recorder
-        /// </privilege>
         /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
         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.");
             }
         }
index 42ba1e8..d7fdcc7 100755 (executable)
@@ -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": {}