TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut,
OperationFailed = -0x030C0000 | 0x01,
}
-
- [DllImport(Libraries.Libc, EntryPoint = "malloc")]
- internal static extern IntPtr Malloc(int size);
}
}
internal static partial class Libraries
{
public const string Cion = "libcion.so.1";
- public const string Libc = "libc.so.6";
}
}
Marshal.Copy(data, receivedData, 0, dataSize);
byte[] returnDataRaw = OnDataReceived(receivedData, new PeerInfo(clone));
returnDataSize = returnDataRaw.Length;
- returnData = Interop.Cion.Malloc(returnDataSize);
+ returnData = Marshal.AllocHGlobal(returnDataSize);
Marshal.Copy(returnDataRaw, 0, returnData, returnDataSize);
});
ret = Interop.CionServer.CionServerSetDataReceivedCb(_handle, _dataReceivedCb, IntPtr.Zero);
+++ /dev/null
-/*
- * Copyright (c) 2017 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);
- }
-}
internal static partial class Libraries
{
public const string WidgetService = "libwidget_service.so.1";
- public const string Libc = "libc.so.6";
}
}
}
w = new int[cnt1];
Marshal.Copy(wPtr, w, 0, cnt1);
- Interop.Libc.Free(wPtr);
+ Marshal.FreeHGlobal(wPtr);
h = new int[cnt1];
Marshal.Copy(hPtr, h, 0, cnt1);
- Interop.Libc.Free(hPtr);
+ Marshal.FreeHGlobal(hPtr);
err = Interop.WidgetService.GetSupportedSizeTypes(Id, ref cnt2, out typesPtr);
switch (err)
types = new int[cnt2];
Marshal.Copy(typesPtr, types, 0, cnt2);
- Interop.Libc.Free(typesPtr);
+ Marshal.FreeHGlobal(typesPtr);
for (int i = 0; i < cnt1; i++)
{
+++ /dev/null
-/*
- * 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);
- }
-}
internal static partial class Libraries
{
public const string MediaContent = "libcapi-content-media-content.so.0";
- public const string Libc = "libc.so.6";
}
}
}
finally
{
- Interop.Libc.Free(val);
+ Marshal.FreeHGlobal(val);
}
}
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)));
}
}
+++ /dev/null
-/*
- * 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);
- }
-}
{
public const string Mime = "libcapi-content-mime-type.so.0";
public const string Glib = "libglib-2.0.so.0";
- public const string Libc = "libc.so.6";
}
}
foreach (IntPtr extension in extensionList)
{
coll.Add(Marshal.PtrToStringAnsi(extension));
- Interop.Libc.Free(extension);
+ Marshal.FreeHGlobal(extension);
}
- Interop.Libc.Free(extensionArray);
+ Marshal.FreeHGlobal(extensionArray);
return coll;
}
}
finally
{
- LibcSupport.Free(val);
+ Marshal.FreeHGlobal(val);
}
}
}
finally
{
- LibcSupport.Free(val);
+ Marshal.FreeHGlobal(val);
}
}
}
finally
{
- LibcSupport.Free(code);
+ // LibcSupport.Free(code);
+ // Marshal.FreeHGlobal(Marshal.ReadIntPtr(code));
+ Marshal.FreeHGlobal(code);
}
}
}
finally
{
- LibcSupport.Free(audioPtr);
- LibcSupport.Free(videoPtr);
+ Marshal.FreeHGlobal(audioPtr);
+ Marshal.FreeHGlobal(videoPtr);
}
}
}
finally
{
- LibcSupport.Free(ptr);
+ Marshal.FreeHGlobal(ptr);
}
}
+++ /dev/null
-/*
- * 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);
- }
-}
{
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";
}
}
using System.IO;
using System.Runtime.InteropServices;
+using Native = Interop.MetadataEditor;
+
namespace Tizen.Multimedia
{
/// <summary>
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);
}
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);
}
}
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");
}
/// <summary>
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");
}
/// <summary>
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)
{
if (data != IntPtr.Zero)
{
- Interop.Libc.Free(data);
+ Marshal.FreeHGlobal(data);
}
if (mimeType != IntPtr.Zero)
{
- Interop.Libc.Free(mimeType);
+ Marshal.FreeHGlobal(mimeType);
}
}
}
throw new InvalidOperationException("The media file is read-only.");
}
- Interop.MetadataEditor.AddPicture(Handle, path).
+ Native.AddPicture(Handle, path).
ThrowIfError("Failed to append picture");
}
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");
}
/// <summary>
{
if (_handle != IntPtr.Zero)
{
- Interop.MetadataEditor.Destroy(_handle);
+ Native.Destroy(_handle);
_handle = IntPtr.Zero;
}
using System;
using System.Diagnostics;
-using static Interop.MetadataExtractor;
namespace Tizen.Multimedia
{
using System.IO;
using System.Runtime.InteropServices;
+using Native = Interop.MetadataExtractor;
+
namespace Tizen.Multimedia
{
/// <summary>
private void Create(Func<MetadataExtractorError> initFunc)
{
MetadataExtractorRetValidator.ThrowIfError(
- Interop.MetadataExtractor.Create(out _handle), "Failed to create metadata");
+ Native.Create(out _handle), "Failed to create metadata");
try
{
throw new ArgumentNullException(nameof(path));
}
- Create(() => Interop.MetadataExtractor.SetPath(_handle, path));
+ Create(() => Native.SetPath(_handle, path));
}
/// <summary>
try
{
- Create(() => Interop.MetadataExtractor.SetBuffer(_handle, _buffer, buffer.Length));
+ Create(() => Native.SetBuffer(_handle, _buffer, buffer.Length));
}
catch (Exception)
{
{
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)
}
finally
{
- Interop.Libc.Free(data);
- Interop.Libc.Free(mimeType);
+ Marshal.FreeHGlobal(data);
+ Marshal.FreeHGlobal(mimeType);
}
}
{
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)
}
finally
{
- Interop.Libc.Free(lyrics);
+ Marshal.FreeHGlobal(lyrics);
}
}
{
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)
}
finally
{
- Interop.Libc.Free(data);
+ Marshal.FreeHGlobal(data);
}
}
{
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)
}
finally
{
- Interop.Libc.Free(data);
+ Marshal.FreeHGlobal(data);
}
}
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}.");
using System.Diagnostics;
using System.Runtime.InteropServices;
using Native = Interop.MetadataExtractor;
-using static Interop;
namespace Tizen.Multimedia
{
}
finally
{
- Libc.Free(valuePtr);
+ Marshal.FreeHGlobal(valuePtr);
}
}
}
finally
{
- Tizen.Multimedia.LibcSupport.Free(valuePtr);
+ Marshal.FreeHGlobal(valuePtr);
}
}
}
finally
{
- Tizen.Multimedia.LibcSupport.Free(valuePtr);
+ Marshal.FreeHGlobal(valuePtr);
}
}
}
finally
{
- Tizen.Multimedia.LibcSupport.Free(playlistName);
- Tizen.Multimedia.LibcSupport.Free(index);
+ Marshal.FreeHGlobal(playlistName);
+ Marshal.FreeHGlobal(index);
}
}
}
finally
{
- Tizen.Multimedia.LibcSupport.Free(valuePtr);
+ Marshal.FreeHGlobal(valuePtr);
}
}
{
if (outBuffer != IntPtr.Zero)
{
- LibcSupport.Free(outBuffer);
+ Marshal.FreeHGlobal(outBuffer);
}
if (imageHandle != IntPtr.Zero)
}
finally
{
- Interop.Libc.Free(outBuffer);
+ Marshal.FreeHGlobal(outBuffer);
}
}
using System.IO;
using System.Threading;
using System.Threading.Tasks;
+using System.Runtime.InteropServices;
using Native = Interop.ThumbnailExtractor;
namespace Tizen.Multimedia.Util
{
if (thumbData != IntPtr.Zero)
{
- LibcSupport.Free(thumbData);
+ Marshal.FreeHGlobal(thumbData);
}
}
}
}
finally
{
- LibcSupport.Free(ptr);
+ Marshal.FreeHGlobal(ptr);
}
}
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)));
}
}
{
if (unmangedArray != IntPtr.Zero)
{
- LibcSupport.Free(unmangedArray);
+ Marshal.FreeHGlobal(unmangedArray);
}
}
}
}
finally
{
- LibcSupport.Free(roiPtr);
+ Marshal.FreeHGlobal(roiPtr);
}
}
set
[assembly: InternalsVisibleTo("Tizen.Multimedia.Radio, " + PublicKey.Value)]
+[assembly: InternalsVisibleTo("Tizen.Multimedia.Metadata, " + PublicKey.Value)]
+
internal static class PublicKey
{
internal const string Value =
+++ /dev/null
-/*
- * 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);
- }
- }
-}
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);
}
}
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";
}
}
}
public partial class Model : View
{
private bool isBuilt = false;
+ private Position modelPivotPoint = new Position();
internal Model(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}
}
/// <summary>
+ /// Get The original pivot point of the model
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Position ModelPivotPoint
+ {
+ get
+ {
+ return modelPivotPoint;
+ }
+ }
+
+ /// <summary>
/// Set/Get the ImageBasedLight ScaleFactor.
/// Scale factor controls light source intensity in [0.0f, 1.0f]
/// </summary>
{
this.ModelRoot.Build();
isBuilt = true;
+ this.modelPivotPoint.X = this.PivotPoint.X;
+ this.modelPivotPoint.Y = this.PivotPoint.Y;
+ this.modelPivotPoint.Z = this.PivotPoint.Z;
}
}
[DllImport(Libraries.Glib, EntryPoint = "g_idle_add", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint IdleAdd(GSourceFunc d, IntPtr data);
+
+ [DllImport(Libraries.Glib, EntryPoint = "g_free", CallingConvention = CallingConvention.Cdecl)]
+ internal static extern void Gfree(IntPtr ptr);
}
}
byte[] hashArr = new byte[hashLength];
Marshal.Copy(hash, hashArr, 0, hashLength);
oobData.HashValue = hashArr;
- Interop.Libc.Free(hash);
+ Interop.Glib.Gfree(hash);
}
if (randomizerLength > 0) {
byte[] randomizerArr = new byte[randomizerLength];
Marshal.Copy(randomizer, randomizerArr, 0, randomizerLength);
oobData.RandomizerValue = randomizerArr;
- Interop.Libc.Free(randomizer);
+ Interop.Glib.Gfree(randomizer);
}
return oobData;
foreach (IntPtr uuids in uuidList)
{
list.Add(Marshal.PtrToStringAnsi(uuids));
- Interop.Libc.Free(uuids);
+ Interop.Glib.Gfree(uuids);
}
- Interop.Libc.Free(uuidListArray);
+ Interop.Glib.Gfree(uuidListArray);
Marshal.FreeHGlobal(scanDataStruct.AdvData);
Marshal.FreeHGlobal(scanDataStruct.ScanData);
return list;
foreach (IntPtr uuids in uuidList)
{
list.Add(Marshal.PtrToStringAnsi(uuids));
- Interop.Libc.Free(uuids);
+ Interop.Glib.Gfree(uuids);
}
- Interop.Libc.Free(uuidListArray);
+ Interop.Glib.Gfree(uuidListArray);
Marshal.FreeHGlobal(scanDataStruct.AdvData);
Marshal.FreeHGlobal(scanDataStruct.ScanData);
return list;
Marshal.Copy(manufData, data.Data, 0, data.DataLength);
}
- Interop.Libc.Free(manufData);
+ Interop.Glib.Gfree(manufData);
Marshal.FreeHGlobal(scanDataStruct.AdvData);
Marshal.FreeHGlobal(scanDataStruct.ScanData);
return data;
+++ /dev/null
-/*
-* 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 ptr);
- }
-}
{
internal const string RuntimeInfo = "libcapi-system-runtime-info.so.0";
internal const string SystemInfo = "libcapi-system-info.so.0";
- internal const string Libc = "libc.so.6";
}
}
}
finally
{
- Interop.Libc.Free(ptr);
+ Marshal.FreeHGlobal(ptr);
}
}
}
finally
{
- Interop.Libc.Free(ptr);
+ Marshal.FreeHGlobal(ptr);
}
Gpus = GetProcessMemoryValueInt(Interop.RuntimeInfo.ProcessMemoryInfoKey.Gpu, pid);