From 898bb43dfb83618af0b07f9e38da1448c5efe6cc Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Mon, 6 Nov 2023 17:03:28 +0900 Subject: [PATCH] [Multimedia] Fix ASAN crash issue (#5699) * [Multimedia] Fix ASAN crash issue --- .../Interop/Interop.Libc.cs | 27 --------------------- .../Interop/Interop.Libraries.cs | 1 - .../Tizen.Content.MediaContent/InteropHelper.cs | 2 +- .../Tizen.Content.MediaContent/MediaInfoCommand.cs | 2 +- .../Camera/CameraSettings.cs | 4 ++-- .../Player/PlayerTrackInfo.cs | 4 +++- .../Player/StreamInfo.cs | 6 ++--- .../Interop/Interop.Libc.cs | 27 --------------------- .../Interop/Interop.Libraries.cs | 1 - .../MetadataEditor/MetadataEditor.cs | 26 ++++++++++---------- .../MetadataExtractor/Metadata.cs | 1 - .../MetadataExtractor/MetadataExtractor.cs | 28 ++++++++++++---------- .../MetadataExtractorExtensions.cs | 3 +-- .../Interop/Interop.MediaControllerPlaylist.cs | 10 ++++---- .../ImageUtil/ImageDecoder.cs | 2 +- .../ImageUtil/ImageEncoder.cs | 2 +- .../ThumbnailExtractor/ThumbnailExtractor.cs | 3 ++- .../MediaVision/EngineConfiguration.cs | 4 ++-- .../MediaVision/FaceRecognitionModel.cs | 2 +- .../MediaVision/SurveillanceEngine.cs | 2 +- src/Tizen.Multimedia/AssemblyAttrs.cs | 2 ++ .../Common.Internal/LibcSupport.cs | 28 ---------------------- src/Tizen.Multimedia/Interop/Interop.Libc.cs | 4 ++-- src/Tizen.Multimedia/Interop/Interop.Libraries.cs | 1 + 24 files changed, 58 insertions(+), 134 deletions(-) delete mode 100755 src/Tizen.Content.MediaContent/Interop/Interop.Libc.cs delete mode 100644 src/Tizen.Multimedia.Metadata/Interop/Interop.Libc.cs delete mode 100644 src/Tizen.Multimedia/Common.Internal/LibcSupport.cs diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Libc.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Libc.cs deleted file mode 100755 index 825599e..0000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Libraries.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Libraries.cs index 67fdba7..991cc43 100755 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Libraries.cs +++ b/src/Tizen.Content.MediaContent/Interop/Interop.Libraries.cs @@ -19,6 +19,5 @@ internal static partial class Interop internal static partial class Libraries { public const string MediaContent = "libcapi-content-media-content.so.0"; - public const string Libc = "libc.so.6"; } } diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/InteropHelper.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/InteropHelper.cs index e40b1f5..368985e 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/InteropHelper.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/InteropHelper.cs @@ -39,7 +39,7 @@ namespace Tizen.Content.MediaContent } finally { - Interop.Libc.Free(val); + Marshal.FreeHGlobal(val); } } diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs index ef0303e..708b9bd 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs @@ -517,7 +517,7 @@ namespace Tizen.Content.MediaContent var current = path; for (int i = 0; i < length; i++) { - Interop.Libc.Free(Marshal.ReadIntPtr(current)); + Marshal.FreeHGlobal(current); current = (IntPtr)((long)current + Marshal.SizeOf(typeof(IntPtr))); } } diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs b/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs index 46b0798..4ed0e53 100644 --- a/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs @@ -1395,7 +1395,7 @@ namespace Tizen.Multimedia } finally { - LibcSupport.Free(val); + Marshal.FreeHGlobal(val); } } @@ -1426,7 +1426,7 @@ namespace Tizen.Multimedia } finally { - LibcSupport.Free(val); + Marshal.FreeHGlobal(val); } } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs index 5cb0007..806f479 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs @@ -121,7 +121,9 @@ namespace Tizen.Multimedia } finally { - LibcSupport.Free(code); + // LibcSupport.Free(code); + // Marshal.FreeHGlobal(Marshal.ReadIntPtr(code)); + Marshal.FreeHGlobal(code); } } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs b/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs index 3f0519c..67674e5 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs @@ -222,8 +222,8 @@ namespace Tizen.Multimedia } finally { - LibcSupport.Free(audioPtr); - LibcSupport.Free(videoPtr); + Marshal.FreeHGlobal(audioPtr); + Marshal.FreeHGlobal(videoPtr); } } @@ -394,7 +394,7 @@ namespace Tizen.Multimedia } finally { - LibcSupport.Free(ptr); + Marshal.FreeHGlobal(ptr); } } diff --git a/src/Tizen.Multimedia.Metadata/Interop/Interop.Libc.cs b/src/Tizen.Multimedia.Metadata/Interop/Interop.Libc.cs deleted file mode 100644 index 8e0fa30..0000000 --- a/src/Tizen.Multimedia.Metadata/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free")] - public static extern void Free(IntPtr userData); - } -} diff --git a/src/Tizen.Multimedia.Metadata/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.Metadata/Interop/Interop.Libraries.cs index df5d155..01ba226 100644 --- a/src/Tizen.Multimedia.Metadata/Interop/Interop.Libraries.cs +++ b/src/Tizen.Multimedia.Metadata/Interop/Interop.Libraries.cs @@ -20,6 +20,5 @@ internal static partial class Interop { public const string MetadataEditor = "libcapi-media-metadata-editor.so"; public const string MetadataExtractor = "libcapi-media-metadata-extractor.so"; - public const string Libc = "libc.so.6"; } } diff --git a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs b/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs index 79dc010..b9d723c 100644 --- a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs @@ -18,6 +18,8 @@ using System; using System.IO; using System.Runtime.InteropServices; +using Native = Interop.MetadataEditor; + namespace Tizen.Multimedia { /// @@ -72,11 +74,11 @@ namespace Tizen.Multimedia throw new ArgumentException($"{nameof(path)} is a zero-length string.", nameof(path)); } - Interop.MetadataEditor.Create(out _handle).ThrowIfError("Failed to create metadata"); + Native.Create(out _handle).ThrowIfError("Failed to create metadata"); try { - Interop.MetadataEditor.SetPath(Handle, path).ThrowIfError("Failed to set path"); + Native.SetPath(Handle, path).ThrowIfError("Failed to set path"); _isFileReadOnly = File.GetAttributes(path).HasFlag(FileAttributes.ReadOnly); } @@ -93,14 +95,14 @@ namespace Tizen.Multimedia try { - Interop.MetadataEditor.GetMetadata(Handle, attr, out val) + Native.GetMetadata(Handle, attr, out val) .ThrowIfError("Failed to get metadata"); return Marshal.PtrToStringAnsi(val); } finally { - Interop.Libc.Free(val); + Marshal.FreeHGlobal(val); } } @@ -111,7 +113,7 @@ namespace Tizen.Multimedia throw new InvalidOperationException("The media file is read-only."); } - Interop.MetadataEditor.SetMetadata(Handle, attr, value).ThrowIfError("Failed to set value"); + Native.SetMetadata(Handle, attr, value).ThrowIfError("Failed to set value"); } /// @@ -445,7 +447,7 @@ namespace Tizen.Multimedia throw new InvalidOperationException("The media file is read-only."); } - Interop.MetadataEditor.UpdateMetadata(Handle).ThrowIfError("Failed to update file"); + Native.UpdateMetadata(Handle).ThrowIfError("Failed to update file"); } /// @@ -480,7 +482,7 @@ namespace Tizen.Multimedia try { - Interop.MetadataEditor.GetPicture(Handle, index, out data, out var size, out mimeType). + Native.GetPicture(Handle, index, out data, out var size, out mimeType). ThrowIfError("Failed to get the value"); if (size > 0) @@ -497,12 +499,12 @@ namespace Tizen.Multimedia { if (data != IntPtr.Zero) { - Interop.Libc.Free(data); + Marshal.FreeHGlobal(data); } if (mimeType != IntPtr.Zero) { - Interop.Libc.Free(mimeType); + Marshal.FreeHGlobal(mimeType); } } } @@ -541,7 +543,7 @@ namespace Tizen.Multimedia throw new InvalidOperationException("The media file is read-only."); } - Interop.MetadataEditor.AddPicture(Handle, path). + Native.AddPicture(Handle, path). ThrowIfError("Failed to append picture"); } @@ -579,7 +581,7 @@ namespace Tizen.Multimedia throw new InvalidOperationException("The media file is read-only."); } - Interop.MetadataEditor.RemovePicture(Handle, index).ThrowIfError("Failed to remove picture"); + Native.RemovePicture(Handle, index).ThrowIfError("Failed to remove picture"); } /// @@ -603,7 +605,7 @@ namespace Tizen.Multimedia { if (_handle != IntPtr.Zero) { - Interop.MetadataEditor.Destroy(_handle); + Native.Destroy(_handle); _handle = IntPtr.Zero; } diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs index a37caf0..d5ca764 100644 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs @@ -16,7 +16,6 @@ using System; using System.Diagnostics; -using static Interop.MetadataExtractor; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs index 83911e0..071fa49 100644 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs @@ -18,6 +18,8 @@ using System; using System.IO; using System.Runtime.InteropServices; +using Native = Interop.MetadataExtractor; + namespace Tizen.Multimedia { /// @@ -33,7 +35,7 @@ namespace Tizen.Multimedia private void Create(Func initFunc) { MetadataExtractorRetValidator.ThrowIfError( - Interop.MetadataExtractor.Create(out _handle), "Failed to create metadata"); + Native.Create(out _handle), "Failed to create metadata"); try { @@ -62,7 +64,7 @@ namespace Tizen.Multimedia throw new ArgumentNullException(nameof(path)); } - Create(() => Interop.MetadataExtractor.SetPath(_handle, path)); + Create(() => Native.SetPath(_handle, path)); } /// @@ -89,7 +91,7 @@ namespace Tizen.Multimedia try { - Create(() => Interop.MetadataExtractor.SetBuffer(_handle, _buffer, buffer.Length)); + Create(() => Native.SetBuffer(_handle, _buffer, buffer.Length)); } catch (Exception) { @@ -146,7 +148,7 @@ namespace Tizen.Multimedia { int size = 0; - var ret = Interop.MetadataExtractor.GetArtwork(Handle, out data, out size, out mimeType); + var ret = Native.GetArtwork(Handle, out data, out size, out mimeType); MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get value"); if (size > 0) @@ -161,8 +163,8 @@ namespace Tizen.Multimedia } finally { - Interop.Libc.Free(data); - Interop.Libc.Free(mimeType); + Marshal.FreeHGlobal(data); + Marshal.FreeHGlobal(mimeType); } } @@ -182,7 +184,7 @@ namespace Tizen.Multimedia { uint timestamp = 0; - var ret = Interop.MetadataExtractor.GetSynclyrics(Handle, index, out timestamp, out lyrics); + var ret = Native.GetSynclyrics(Handle, index, out timestamp, out lyrics); MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get sync lyrics"); if (lyrics == IntPtr.Zero) @@ -194,7 +196,7 @@ namespace Tizen.Multimedia } finally { - Interop.Libc.Free(lyrics); + Marshal.FreeHGlobal(lyrics); } } @@ -213,7 +215,7 @@ namespace Tizen.Multimedia { int size = 0; - var ret = Interop.MetadataExtractor.GetFrame(Handle, out data, out size); + var ret = Native.GetFrame(Handle, out data, out size); MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get value"); if (size == 0) @@ -228,7 +230,7 @@ namespace Tizen.Multimedia } finally { - Interop.Libc.Free(data); + Marshal.FreeHGlobal(data); } } @@ -250,7 +252,7 @@ namespace Tizen.Multimedia { int size = 0; - var ret = Interop.MetadataExtractor.GetFrameAtTime(Handle, timeStamp, accurate, out data, out size); + var ret = Native.GetFrameAtTime(Handle, timeStamp, accurate, out data, out size); MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get value"); if (size == 0) @@ -265,7 +267,7 @@ namespace Tizen.Multimedia } finally { - Interop.Libc.Free(data); + Marshal.FreeHGlobal(data); } } @@ -303,7 +305,7 @@ namespace Tizen.Multimedia if (_handle != IntPtr.Zero) { - var ret = Interop.MetadataExtractor.Destroy(_handle); + var ret = Native.Destroy(_handle); if (ret != MetadataExtractorError.None) { Log.Error(typeof(MetadataExtractor).FullName, $"DestroyHandle failed : {ret}."); diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorExtensions.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorExtensions.cs index f3b72ee..756db79 100644 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorExtensions.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorExtensions.cs @@ -18,7 +18,6 @@ using System; using System.Diagnostics; using System.Runtime.InteropServices; using Native = Interop.MetadataExtractor; -using static Interop; namespace Tizen.Multimedia { @@ -38,7 +37,7 @@ namespace Tizen.Multimedia } finally { - Libc.Free(valuePtr); + Marshal.FreeHGlobal(valuePtr); } } diff --git a/src/Tizen.Multimedia.Remoting/Interop/Interop.MediaControllerPlaylist.cs b/src/Tizen.Multimedia.Remoting/Interop/Interop.MediaControllerPlaylist.cs index 4e49285..6feb12e 100644 --- a/src/Tizen.Multimedia.Remoting/Interop/Interop.MediaControllerPlaylist.cs +++ b/src/Tizen.Multimedia.Remoting/Interop/Interop.MediaControllerPlaylist.cs @@ -66,7 +66,7 @@ internal static partial class Interop } finally { - Tizen.Multimedia.LibcSupport.Free(valuePtr); + Marshal.FreeHGlobal(valuePtr); } } @@ -141,7 +141,7 @@ internal static partial class Interop } finally { - Tizen.Multimedia.LibcSupport.Free(valuePtr); + Marshal.FreeHGlobal(valuePtr); } } @@ -161,8 +161,8 @@ internal static partial class Interop } finally { - Tizen.Multimedia.LibcSupport.Free(playlistName); - Tizen.Multimedia.LibcSupport.Free(index); + Marshal.FreeHGlobal(playlistName); + Marshal.FreeHGlobal(index); } } @@ -184,7 +184,7 @@ internal static partial class Interop } finally { - Tizen.Multimedia.LibcSupport.Free(valuePtr); + Marshal.FreeHGlobal(valuePtr); } } diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs index 1ec4f87..e2eae47 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs @@ -247,7 +247,7 @@ namespace Tizen.Multimedia.Util { if (outBuffer != IntPtr.Zero) { - LibcSupport.Free(outBuffer); + Marshal.FreeHGlobal(outBuffer); } if (imageHandle != IntPtr.Zero) diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs index df40539..f9af44e 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs @@ -131,7 +131,7 @@ namespace Tizen.Multimedia.Util } finally { - Interop.Libc.Free(outBuffer); + Marshal.FreeHGlobal(outBuffer); } } diff --git a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs index c939838..da21203 100644 --- a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs +++ b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs @@ -18,6 +18,7 @@ using System; using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Runtime.InteropServices; using Native = Interop.ThumbnailExtractor; namespace Tizen.Multimedia.Util @@ -290,7 +291,7 @@ namespace Tizen.Multimedia.Util { if (thumbData != IntPtr.Zero) { - LibcSupport.Free(thumbData); + Marshal.FreeHGlobal(thumbData); } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs index 38cda12..16be9b7 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs @@ -148,7 +148,7 @@ namespace Tizen.Multimedia.Vision } finally { - LibcSupport.Free(ptr); + Marshal.FreeHGlobal(ptr); } } @@ -178,7 +178,7 @@ namespace Tizen.Multimedia.Vision var current = values; for (int i = 0; i < size; i++) { - LibcSupport.Free(Marshal.ReadIntPtr(current)); + Marshal.FreeHGlobal(current); current = (IntPtr)((long)current + Marshal.SizeOf(typeof(IntPtr))); } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs index 8d0f730..4770a52 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs @@ -101,7 +101,7 @@ namespace Tizen.Multimedia.Vision { if (unmangedArray != IntPtr.Zero) { - LibcSupport.Free(unmangedArray); + Marshal.FreeHGlobal(unmangedArray); } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs index 0d52836..cfbd25a 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs @@ -93,7 +93,7 @@ namespace Tizen.Multimedia.Vision } finally { - LibcSupport.Free(roiPtr); + Marshal.FreeHGlobal(roiPtr); } } set diff --git a/src/Tizen.Multimedia/AssemblyAttrs.cs b/src/Tizen.Multimedia/AssemblyAttrs.cs index 51179d6..ed3637c 100644 --- a/src/Tizen.Multimedia/AssemblyAttrs.cs +++ b/src/Tizen.Multimedia/AssemblyAttrs.cs @@ -41,6 +41,8 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Tizen.Multimedia.Radio, " + PublicKey.Value)] +[assembly: InternalsVisibleTo("Tizen.Multimedia.Metadata, " + PublicKey.Value)] + internal static class PublicKey { internal const string Value = diff --git a/src/Tizen.Multimedia/Common.Internal/LibcSupport.cs b/src/Tizen.Multimedia/Common.Internal/LibcSupport.cs deleted file mode 100644 index c888cd7..0000000 --- a/src/Tizen.Multimedia/Common.Internal/LibcSupport.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.Multimedia -{ - internal static class LibcSupport - { - internal static void Free(IntPtr ptr) - { - Interop.Libc.Free(ptr); - } - } -} diff --git a/src/Tizen.Multimedia/Interop/Interop.Libc.cs b/src/Tizen.Multimedia/Interop/Interop.Libc.cs index 407352c..96ba300 100644 --- a/src/Tizen.Multimedia/Interop/Interop.Libc.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Libc.cs @@ -29,10 +29,10 @@ namespace Tizen.Multimedia internal const int R_OK = 0x04; } - [DllImport(Libraries.Libc, EntryPoint = "free")] + [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] public static extern void Free(IntPtr ptr); - [DllImport(Libraries.Libc, EntryPoint = "access")] + [DllImport(Libraries.Libc, EntryPoint = "access", CallingConvention = CallingConvention.Cdecl)] public static extern int Access(string path, int mode); } } diff --git a/src/Tizen.Multimedia/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia/Interop/Interop.Libraries.cs index f0ce791..cd7fdf5 100644 --- a/src/Tizen.Multimedia/Interop/Interop.Libraries.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Libraries.cs @@ -23,6 +23,7 @@ namespace Tizen.Multimedia public const string SoundManager = "libcapi-media-sound-manager.so.0"; public const string MediaTool = "libcapi-media-tool.so.0"; public const string Libc = "libc.so.6"; + public const string GLib = "libglib-2.0.so.0"; } } } -- 2.7.4