[Recorder] Fix errors
authorHaesu Gwon <haesu.gwon@samsung.com>
Fri, 24 Mar 2017 04:44:45 +0000 (13:44 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Fri, 24 Mar 2017 04:45:57 +0000 (21:45 -0700)
1. Add missing register callback statement.
2. Add new property of SteamLength.
3. Fix RecorderErrorFactory bug.

Change-Id: I17818278e874e9b97667e5b577d3fbf1abd15f07
Signed-off-by: Haesu Gwon <haesu.gwon@samsung.com>
packaging/csapi-multimedia.spec
src/Tizen.Multimedia/Recorder/AudioStreamDeliveredEventArgs.cs
src/Tizen.Multimedia/Recorder/Recorder.cs
src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs

index 7556c91..28dbf74 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       csapi-multimedia
 Summary:    Tizen Multimedia API for C#
-Version:    1.0.43
+Version:    1.0.44
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0
index 2fb736f..0d04461 100755 (executable)
@@ -28,6 +28,7 @@ namespace Tizen.Multimedia
         {
             Stream = new byte[streamSize];
             Marshal.Copy(stream, Stream, 0, streamSize);
+            StreamLength = streamSize;
             Type = type;
             Channel = channel;
             RecordingTime = recordingTime;
@@ -39,6 +40,11 @@ namespace Tizen.Multimedia
         public byte[] Stream { get; }
 
         /// <summary>
+        /// The length of audio stream data.
+        /// </summary>
+        public int StreamLength { get; }
+
+        /// <summary>
         /// The audio format type.
         /// </summary>
         public AudioSampleType Type { get; }
index d3314c8..73d62b5 100755 (executable)
@@ -47,11 +47,13 @@ namespace Tizen.Multimedia
         /// </summary>
         public Recorder()
         {
-            RecorderErrorFactory.ThrowIfError (Interop.Recorder.Create(out _handle),
+            RecorderErrorFactory.ThrowIfError(Interop.Recorder.Create(out _handle),
                 "Failed to create Audio recorder");
 
             Feature = new RecorderFeatures(this);
             Setting = new RecorderSettings(this);
+
+            RegisterCallbacks();
         }
 
         /// <summary>
@@ -67,6 +69,8 @@ namespace Tizen.Multimedia
 
             Feature = new RecorderFeatures(this);
             Setting = new RecorderSettings(this);
+
+            RegisterCallbacks();
         }
 
         /// <summary>
index 48605f2..c7ef1e6 100755 (executable)
@@ -43,11 +43,12 @@ namespace Tizen.Multimedia
         internal static void ThrowIfError(int errorCode, string errorMessage = null)
         {
             RecorderError err = (RecorderError)errorCode;
-            if(string.IsNullOrEmpty(errorMessage)) {
-                errorMessage = err.ToString();
+            if (err == RecorderError.None)
+            {
+                return;
             }
 
-            Log.Info(RecorderLog.Tag, "errorCode : " + errorMessage);
+            Log.Info(RecorderLog.Tag, "errorCode : " + err.ToString());
 
             switch (err)
             {