2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Runtime.InteropServices;
19 using Tizen.Multimedia;
21 internal static partial class Interop
23 internal static partial class MetadataExtractor
25 [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_create")]
26 internal static extern MetadataExtractorError Create(out IntPtr handle);
28 [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_set_path")]
29 internal static extern MetadataExtractorError SetPath(IntPtr handle, string path);
31 [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_set_buffer")]
32 internal static extern MetadataExtractorError SetBuffer(IntPtr handle, IntPtr buffer, int size);
34 [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_destroy")]
35 internal static extern MetadataExtractorError Destroy(IntPtr handle);
37 [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_metadata")]
38 private static extern MetadataExtractorError GetMetadata(IntPtr handle, MetadataExtractorAttr attribute, out IntPtr value);
40 internal static string GetMetadata(IntPtr handle, MetadataExtractorAttr attr)
42 IntPtr valuePtr = IntPtr.Zero;
46 var ret = GetMetadata(handle, attr, out valuePtr);
47 MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get value for " + attr);
48 return Marshal.PtrToStringAnsi(valuePtr);
56 [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_artwork")]
57 internal static extern MetadataExtractorError GetArtwork(IntPtr handle, out IntPtr artwork,
58 out int size, out IntPtr mimeType);
60 [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_frame")]
61 internal static extern MetadataExtractorError GetFrame(IntPtr handle, out IntPtr frame, out int size);
63 [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_synclyrics")]
64 internal static extern MetadataExtractorError GetSynclyrics(IntPtr handle, int index,
65 out uint timeStamp, out IntPtr lyrics);
67 [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_frame_at_time")]
68 internal static extern MetadataExtractorError GetFrameAtTime(IntPtr handle, uint timeStamp,
69 bool isAccurate, out IntPtr frame, out int size);