Name: csapi-multimedia
Summary: Tizen Multimedia API for C#
-Version: 1.0.11
+Version: 1.0.12
Release: 0
Group: Development/Libraries
License: Apache-2.0
public MetadataExtractor(byte[] buffer)
{
int ret;
- int size = buffer.Length;
- IntPtr buf = Marshal.AllocHGlobal(size);
- if (buffer == null || size == 0)
+ if (buffer == null || buffer.Length == 0)
{
Log.Error(MetadataExtractorLog.LogTag, "buffer is null");
MetadataExtractorErrorFactory.ThrowException((int)MetadataExtractorError.InvalidParameter, "buffer is null");
}
else
- {
- Marshal.Copy(buffer, 0, buf, size);
+ {
+ int size = buffer.Length;
+ IntPtr buf = Marshal.AllocHGlobal(size);
+ Marshal.Copy(buffer, 0, buf, size);
+
ret = Interop.MetadataExtractor.Create(out _handle);
if (ret != (int)MetadataExtractorError.None)
{
{
internal static void ThrowException(int errorCode, string errorMessage = null, string paramName = null)
{
- MetadataExtractorError err = (MetadataExtractorError)errorCode;
- if(string.IsNullOrEmpty(errorMessage))
- {
- errorMessage = err.ToString();
- }
switch ((MetadataExtractorError)errorCode)
{
case MetadataExtractorError.InvalidParameter:
- throw new ArgumentException(errorMessage, paramName);
+ throw new ArgumentException("[" + errorCode.ToString() + "]" + errorMessage, paramName);
case MetadataExtractorError.OutOfMemory:
case MetadataExtractorError.FileExists:
case MetadataExtractorError.PermissionDenied:
case MetadataExtractorError.MetadataExtractorErrorOperationFailed:
- throw new InvalidOperationException(errorMessage);
+ throw new InvalidOperationException("[" + errorCode.ToString() + "]" + errorMessage);
}
}
}