Merge "[Multimedia] Added feature tags and fixed errors in doc-comments of MediaVision." preview1-00335
authorcoderhyme <jhyo.kim@samsung.com>
Tue, 24 Oct 2017 07:33:47 +0000 (07:33 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 24 Oct 2017 07:33:47 +0000 (07:33 +0000)
12 files changed:
src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs
src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringAudioInfo.cs
src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringVideoInfo.cs
src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs
src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs
src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs
src/Tizen/Interop/Interop.CommonError.cs
src/Tizen/Interop/Interop.DotnetUtil.cs [new file with mode: 0644]
src/Tizen/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/Tizen/Tizen.Common/DotnetUtil.cs [new file with mode: 0644]
src/Tizen/Tizen.Common/DotnetUtilErrorFactory.cs [new file with mode: 0644]
src/Tizen/Tizen.csproj

index 2697e15..cc1b40f 100644 (file)
@@ -21,7 +21,7 @@ using System.Diagnostics;
 namespace Tizen.Multimedia.MediaCodec
 {
     /// <summary>
-    /// Provides the means to encode and decode the video and the audio data.
+    /// Provides a means to encode and decode the video and the audio data.
     /// </summary>
     public class MediaCodec : IDisposable
     {
index c3024ce..407ccf7 100644 (file)
@@ -38,7 +38,7 @@ namespace Tizen.Multimedia.Remoting
         /// </summary>
         /// <exception cref="InvalidOperationException">
         ///     Not connected to a source.<br/>
-        ///     <br/>
+        ///     -or-<br/>
         ///     An internal error occurs.
         /// </exception>
         /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
@@ -60,7 +60,7 @@ namespace Tizen.Multimedia.Remoting
         /// </summary>
         /// <exception cref="InvalidOperationException">
         ///     Not connected to a source.<br/>
-        ///     <br/>
+        ///     -or-<br/>
         ///     An internal error occurs.
         /// </exception>
         /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
@@ -82,7 +82,7 @@ namespace Tizen.Multimedia.Remoting
         /// </summary>
         /// <exception cref="InvalidOperationException">
         ///     Not connected to a source.<br/>
-        ///     <br/>
+        ///     -or-<br/>
         ///     An internal error occurs.
         /// </exception>
         /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
@@ -104,7 +104,7 @@ namespace Tizen.Multimedia.Remoting
         /// </summary>
         /// <exception cref="InvalidOperationException">
         ///     Not connected to a source.<br/>
-        ///     <br/>
+        ///     -or-<br/>
         ///     An internal error occurs.
         /// </exception>
         /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
index 35856f5..8acd950 100644 (file)
@@ -37,7 +37,7 @@ namespace Tizen.Multimedia.Remoting
         /// </summary>
         /// <exception cref="InvalidOperationException">
         ///     Not connected to a source.<br/>
-        ///     <br/>
+        ///     -or-<br/>
         ///     An internal error occurs.
         /// </exception>
         /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
@@ -59,7 +59,7 @@ namespace Tizen.Multimedia.Remoting
         /// </summary>
         /// <exception cref="InvalidOperationException">
         ///     Not connected to a source.<br/>
-        ///     <br/>
+        ///     -or-<br/>
         ///     An internal error occurs.
         /// </exception>
         /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
@@ -82,7 +82,7 @@ namespace Tizen.Multimedia.Remoting
         /// </summary>
         /// <exception cref="InvalidOperationException">
         ///     Not connected to a source.<br/>
-        ///     <br/>
+        ///     -or-<br/>
         ///     An internal error occurs.
         /// </exception>
         /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
index 6649e29..25f8f28 100644 (file)
@@ -28,7 +28,7 @@ namespace Tizen.Multimedia.Util
         /// Initializes a new instance of the <see cref="GifFrame"/> class with a buffer and a delay.
         /// </summary>
         /// <param name="buffer">The raw image buffer to be encoded.</param>
-        /// <param name="delay">The delay for this image, in 0.001 sec units.</param>
+        /// <param name="delay">The delay for this image in milliseconds.</param>
         /// <exception cref="ArgumentNullException"><paramref name="buffer"/> is null.</exception>
         /// <exception cref="ArgumentException">The length of <paramref name="buffer"/> is zero.</exception>
         public GifFrame(byte[] buffer, uint delay)
@@ -55,7 +55,7 @@ namespace Tizen.Multimedia.Util
         /// <summary>
         /// Gets or sets the delay for this image.
         /// </summary>
-        /// <value>Time delay in 0.001 sec units.</value>
+        /// <value>Time delay in milliseconds.</value>
         public uint Delay { get; set; }
     }
 }
index 502e31c..aeb2ab0 100644 (file)
@@ -95,9 +95,7 @@ namespace Tizen.Multimedia.Util
         /// <exception cref="ArgumentException">
         ///     <paramref name="inputFilePath"/> is an empty string.<br/>
         ///     -or-<br/>
-        ///     <paramref name="inputFilePath"/> is not a image file.<br/>
-        ///     -or-<br/>
-        ///     The format of <paramref name="inputFilePath"/> is not <see cref="InputFormat"/>.
+        ///     <paramref name="inputFilePath"/> is not a image file.
         /// </exception>
         /// <exception cref="FileNotFoundException"><paramref name="inputFilePath"/> does not exists.</exception>
         /// <exception cref="UnauthorizedAccessException">The caller does not have required permission to access the path.</exception>
@@ -140,11 +138,7 @@ namespace Tizen.Multimedia.Util
         /// <returns>A task that represents the asynchronous decoding operation.</returns>
         /// <remarks>Only Graphics Interchange Format(GIF) codec returns more than one frame.</remarks>
         /// <exception cref="ArgumentNullException"><paramref name="inputBuffer"/> is null.</exception>
-        /// <exception cref="ArgumentException">
-        ///     <paramref name="inputBuffer"/> is an empty array.<br/>
-        ///     -or-<br/>
-        ///     The format of <paramref name="inputBuffer"/> is not <see cref="InputFormat"/>.
-        /// </exception>
+        /// <exception cref="ArgumentException"><paramref name="inputBuffer"/> is an empty array.</exception>
         /// <exception cref="FileFormatException">The format of <paramref name="inputBuffer"/> is not <see cref="InputFormat"/>.</exception>
         /// <exception cref="ObjectDisposedException">The <see cref="ImageDecoder"/> has already been disposed of.</exception>
         public Task<IEnumerable<BitmapFrame>> DecodeAsync(byte[] inputBuffer)
index d68c82d..3c08449 100644 (file)
@@ -107,7 +107,7 @@ namespace Tizen.Multimedia.Util
         /// <exception cref="ArgumentOutOfRangeException">
         ///     index is less than 0.<br/>
         ///     -or-<br/>
-        ///     index is equal to or greater than Count.
+        ///     index is equal to or greater than <see cref="Count"/>.
         /// </exception>
         public ImageTransform this[int index]
         {
@@ -338,7 +338,7 @@ namespace Tizen.Multimedia.Util
         private Flips _flip;
 
         /// <summary>
-        /// Initializes a new instance of the <see cref="RotateTransform"/> class.
+        /// Initializes a new instance of the <see cref="FlipTransform"/> class.
         /// </summary>
         /// <param name="flip">The value how to flip an image.</param>
         /// <exception cref="ArgumentException"><paramref name="flip"/> is invalid.</exception>
@@ -349,7 +349,7 @@ namespace Tizen.Multimedia.Util
         }
 
         /// <summary>
-        /// Gets or sets the value how to rotate an image.
+        /// Gets or sets the value how to flip an image.
         /// </summary>
         /// <exception cref="ArgumentException"><paramref name="value"/> is invalid.</exception>
         /// <exception cref="ArgumentOutOfRangeException"><paramref name="value"/> is <see cref="Flips.None"/>.</exception>
index 284ba22..0710d5f 100644 (file)
@@ -19,11 +19,6 @@ using System.Runtime.InteropServices;
 
 internal static partial class Interop
 {
-    internal static partial class Libraries
-    {
-        public const string Base = "libcapi-base-common.so.0";
-    }
-
     internal static partial class CommonError
     {
         [DllImport(Libraries.Base, EntryPoint = "get_last_result")]
diff --git a/src/Tizen/Interop/Interop.DotnetUtil.cs b/src/Tizen/Interop/Interop.DotnetUtil.cs
new file mode 100644 (file)
index 0000000..68ba363
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class DotnetUtil
+    {
+        [DllImport(Libraries.Vconf, EntryPoint = "vconf_get_int")]
+        internal static extern int GetVconfInt(string key, out int value);
+    }
+}
diff --git a/src/Tizen/Interop/Interop.Libraries.cs b/src/Tizen/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..506d911
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Base = "libcapi-base-common.so.0";
+        public const string Vconf = "libvconf.so.0";
+    }
+}
diff --git a/src/Tizen/Tizen.Common/DotnetUtil.cs b/src/Tizen/Tizen.Common/DotnetUtil.cs
new file mode 100644 (file)
index 0000000..2799561
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.Common
+{
+    /// <summary>
+    /// The DotnetAPIs class provides the .NET api version.
+    /// </summary>
+    public static class DotnetUtil
+    {
+        /// <summary>
+        /// Gets the version of Tizen .NET API.
+        /// </summary>
+        /// <returns>The Tizen .NET API version</returns>
+        public static int TizenAPIVersion
+        {
+            get
+            {
+                int version = 0;
+                DotnetUtilError ret = (DotnetUtilError)Interop.DotnetUtil.GetVconfInt("db/dotnet/tizen_api_version", out version);
+                if (ret != DotnetUtilError.None)
+                {
+                    Log.Warn(DotnetUtilErrorFactory.LogTag, "unable to get Tizen .NET API version.");
+                }
+                return version;
+            }
+        }
+    }
+}
diff --git a/src/Tizen/Tizen.Common/DotnetUtilErrorFactory.cs b/src/Tizen/Tizen.Common/DotnetUtilErrorFactory.cs
new file mode 100644 (file)
index 0000000..677844a
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Common
+{
+    internal enum DotnetUtilError
+    {
+        None = ErrorCode.None,
+    }
+
+    internal static class DotnetUtilErrorFactory
+    {
+        internal const string LogTag = "Tizen.Common.DotnetUtil";
+
+        internal static void ThrowException(DotnetUtilError err)
+        {
+            DotnetUtilError error = err;
+            if (error != DotnetUtilError.None)
+            {
+                throw new ArgumentException("Vconf error");
+            }
+        }
+    }
+}
index dbdcea4..8b42da5 100644 (file)
@@ -4,4 +4,8 @@
     <TargetFramework>netstandard2.0</TargetFramework>
   </PropertyGroup>
 
+  <ItemGroup>
+    <ProjectReference Include="..\Tizen.Log\Tizen.Log.csproj" />
+  </ItemGroup>
+
 </Project>