[Camera/Recorder]
authorHaesu Gwon <haesu.gwon@samsung.com>
Mon, 26 Dec 2016 02:05:00 +0000 (11:05 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Mon, 26 Dec 2016 02:10:02 +0000 (11:10 +0900)
1. Remove wrong exception description
2. Change method parameter

Change-Id: I2177eb671d09108257acfe1782ce16c7a3b7146d
Signed-off-by: Haesu Gwon <haesu.gwon@samsung.com>
packaging/csapi-multimedia.spec
src/Tizen.Multimedia/Camera/Camera.cs
src/Tizen.Multimedia/Interop/Interop.Recorder.cs
src/Tizen.Multimedia/Recorder/Recorder.cs [changed mode: 0644->0755]

index 1c8afac..266efef 100644 (file)
@@ -1,6 +1,6 @@
 Name:       csapi-multimedia
 Summary:    Tizen Multimedia API for C#
-Version:    1.0.22
+Version:    1.0.23
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0
index 8fbf2c3..4cddb36 100755 (executable)
@@ -39,7 +39,7 @@ namespace Tizen.Multimedia
     /// </privilege>
     public class Camera : IDisposable
     {
-        private IntPtr _handle;
+        private IntPtr _handle = IntPtr.Zero;
         private bool _disposed = false;
         private Interop.Camera.CapturingCallback _capturingCallback;
         private Interop.Camera.CaptureCompletedCallback _captureCompletedCallback;
@@ -83,6 +83,12 @@ namespace Tizen.Multimedia
             Dispose(false);
         }
 
+        internal IntPtr GetHandle()
+        {
+            ValidateNotDisposed();
+            return _handle;
+        }
+
         /// <summary>
         /// Event that occurs when there is change in HDR capture progress.
         /// </summary>
@@ -702,7 +708,6 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
-        /// <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>
@@ -721,7 +726,6 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
-        /// <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>
@@ -749,7 +753,6 @@ namespace Tizen.Multimedia
         /// The camera's preview should be restarted by calling <see cref="Tizen.Multimedia.Camera.StartPreview"/>
         /// 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>
@@ -806,7 +809,6 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
-        /// <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>
@@ -936,7 +938,6 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
-        /// <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>
@@ -960,7 +961,6 @@ namespace Tizen.Multimedia
         /// The Eventhandler set using <see cref="Tizen.Multimedia.Camera.FaceDetected"/> invoked when the face is detected in preview frame.
         /// Internally it starts continuous focus and focusing on the detected face.
         /// </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>
@@ -995,7 +995,6 @@ namespace Tizen.Multimedia
         /// <privilege>
         /// http://tizen.org/privilege/camera
         /// </privilege>
-        /// <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>
@@ -1074,6 +1073,14 @@ namespace Tizen.Multimedia
             }
         }
 
+        internal void ValidateNotDisposed()
+        {
+            if (_disposed)
+            {
+                throw new ObjectDisposedException(nameof(Camera));
+            }
+        }
+
         [DllImport(Interop.Libraries.Camera, EntryPoint = "camera_add_device_state_changed_cb")]
         internal static extern int AddDeviceChangedCallback(DeviceChangedCallback callback, IntPtr userData, out int callbackId);
 
index d33f8cc..f0d279c 100755 (executable)
@@ -31,7 +31,7 @@ internal static partial class Interop
         internal delegate void RecorderErrorCallback(RecorderErrorCode error, RecorderState current, IntPtr userData);
 
         [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_videorecorder")]
-        internal static extern int CreateVideo(Tizen.Multimedia.Camera camera, out IntPtr handle);
+        internal static extern int CreateVideo(IntPtr cameraHandle, out IntPtr handle);
 
         [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_audiorecorder")]
         internal static extern int Create(out IntPtr handle);
old mode 100644 (file)
new mode 100755 (executable)
index 4d528dc..041ada2
@@ -81,7 +81,7 @@ namespace Tizen.Multimedia
         /// </param>
         public Recorder(Camera camera)
         {
-                       int ret = Interop.Recorder.CreateVideo (camera, out _handle);
+                       int ret = Interop.Recorder.CreateVideo (camera.GetHandle(), out _handle);
                        if (ret != (int)RecorderError.None)
                        {
                                RecorderErrorFactory.ThrowException (ret, "Failed to create Video recorder");