[DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_date_taken", CallingConvention = CallingConvention.Cdecl)]
internal static extern MediaContentError GetDateTaken(IntPtr handle, out IntPtr dateTaken);
- [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_burst_id", CallingConvention = CallingConvention.Cdecl)]
- internal static extern MediaContentError GetBurstId(IntPtr handle, out IntPtr burstId);
-
[DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_exposure_time", CallingConvention = CallingConvention.Cdecl)]
internal static extern MediaContentError GetExposureTime(IntPtr handle, out IntPtr exposureTime);
[DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_model", CallingConvention = CallingConvention.Cdecl)]
internal static extern MediaContentError GetModel(IntPtr handle, out IntPtr model);
- [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_is_burst_shot", CallingConvention = CallingConvention.Cdecl)]
- internal static extern MediaContentError IsBurstShot(IntPtr handle, out bool isBurstShot);
-
[DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_media_id", CallingConvention = CallingConvention.Cdecl)]
internal static extern MediaContentError GetMediaId(IntPtr handle, out IntPtr mediaId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void InsertCompletedCallback(MediaContentError error, IntPtr userData);
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void InsertBurstShotCompletedCallback(MediaContentError error, IntPtr userData);
-
[DllImport(Libraries.MediaContent, EntryPoint = "media_info_insert_to_db")]
internal static extern MediaContentError Insert(string filePath, out MediaInfoHandle info);
internal static extern MediaContentError BatchInsert(string[] filePathArray, int arrayLength,
InsertCompletedCallback callback, IntPtr userData = default(IntPtr));
- [DllImport(Libraries.MediaContent, EntryPoint = "media_info_insert_burst_shot_to_db")]
- internal static extern MediaContentError BurstShotInsert(string[] filePathArray, int arrayLength,
- InsertBurstShotCompletedCallback callback, IntPtr userData = default(IntPtr));
-
[DllImport(Libraries.MediaContent, EntryPoint = "media_info_delete_from_db")]
internal static extern MediaContentError Delete(string mediaId);
- [DllImport(Libraries.MediaContent, EntryPoint = "media_info_delete_batch_from_db")]
- internal static extern MediaContentError BatchDelete(FilterHandle filter);
-
[DllImport(Libraries.MediaContent, EntryPoint = "media_info_destroy")]
internal static extern MediaContentError Destroy(IntPtr handle);
[DllImport(Libraries.MediaContent, EntryPoint = "media_info_cancel_thumbnail")]
internal static extern MediaContentError CancelThumbnail(MediaInfoHandle mediaInformationHandle);
-
[DllImport(Libraries.MediaContent, EntryPoint = "media_info_start_face_detection")]
internal static extern MediaContentError StartFaceDetection(MediaInfoHandle handle,
FaceDetectionCompletedCallback callback, IntPtr userData = default(IntPtr));
public static string Orientation => "MEDIA_ORIENTATION";
/// <summary>
- /// Gets the column name for the burst ID of media.
- /// </summary>
- /// <value>The column name for the burst ID of media.</value>
- /// <remarks>
- /// The value type is string.
- /// </remarks>
- /// <seealso cref="ImageInfo.BurstId"/>
- public static string BurstId => "BURST_ID";
-
- /// <summary>
/// Gets the column name for the rating of media.
/// </summary>
/// <value>The column name for the rating of media.</value>
/// <seealso cref="MediaInfo.Category"/>
public static string Category => "MEDIA_CATEGORY";
-
/// <summary>
/// Gets the column name for the location tag of media.
/// </summary>
public static string Model => "MEDIA_MODEL";
}
-
/// <summary>
/// Provides the folder column names that can be used for Select and Count commands.
/// </summary>
Orientation = InteropHelper.GetValue<Orientation>(imageHandle, Interop.ImageInfo.GetOrientation);
DateTaken = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetDateTaken);
- BurstId = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetBurstId);
ExposureTime = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetExposureTime);
FNumber = InteropHelper.GetValue<double>(imageHandle, Interop.ImageInfo.GetFNumber);
Model = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetModel);
- IsBurstShot = InteropHelper.GetValue<bool>(imageHandle, Interop.ImageInfo.IsBurstShot);
-
}
finally
{
public string DateTaken { get; }
/// <summary>
- /// Gets the burst shot ID.
- /// </summary>
- /// <value>The burst shot ID if it is a burst shot, otherwise an empty string.</value>
- /// <seealso cref="IsBurstShot"/>
- public string BurstId { get; }
-
- /// <summary>
/// Gets the exposure time from EXIF.
/// </summary>
/// <value>The exposure time from EXIF.</value>
/// <summary>
/// Gets the FNumber from EXIF.
/// </summary>
- /// <value>The FNumber from exif.</value>
+ /// <value>The FNumber from EXIF.</value>
public double FNumber { get; }
/// <summary>
/// </summary>
/// <value>The model from EXIF.</value>
public string Model { get; }
-
- /// <summary>
- /// Gets the value indicating whether the media is a burst shot image.
- /// </summary>
- /// <value>true if the media is a burst shot image, otherwise false.</value>
- public bool IsBurstShot { get; }
}
}
}
}
-
private static readonly Interop.Content.MediaContentDBUpdatedCallback _folderUpdatedCb = (
MediaContentError error, int pid, ItemType updateItem, OperationType updateType,
MediaType mediaType, string uuid, string filePath, string mimeType, IntPtr _) =>
/// </summary>
Altitude,
/// <summary>
- /// Burst shot.
- /// </summary>
- BurstImage,
- /// <summary>
/// Rating.
/// </summary>
Rating = 20,
Bookmark.FromHandle);
}
-
/// <summary>
/// Retrieves the number of the face information added to or detected from the media.
/// </summary>
Tag.FromHandle);
}
-
/// <summary>
/// Retrieves the number of the media information.
/// </summary>
}
}
- /// <summary>
- /// Adds burst shot images into the media database.
- /// </summary>
- /// <param name="paths">The paths of the burst shot images to add.</param>
- /// <returns>A task that represents the asynchronous add operation.</returns>
- /// <remarks>
- /// The paths that already exist in the database.\n
- /// At most 300 items can be added at once.
- /// \n
- /// If you want to access internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n
- /// If you want to access external storage, you should add privilege http://tizen.org/privilege/externalstorage.
- /// </remarks>
- /// <privilege>http://tizen.org/privilege/content.write</privilege>
- /// <privilege>http://tizen.org/privilege/mediastorage</privilege>
- /// <privilege>http://tizen.org/privilege/externalstorage</privilege>
- /// <exception cref="InvalidOperationException">The <see cref="MediaDatabase"/> is disconnected.</exception>
- /// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed of.</exception>
- /// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
- /// <exception cref="ArgumentNullException"><paramref name="paths"/> is null.</exception>
- /// <exception cref="ArgumentException">
- /// <paramref name="paths"/> contains null.\n
- /// -or-\n
- /// <paramref name="paths"/> contains the invalid path.\n
- /// -or-\n
- /// The number of <paramref name="paths"/> is 300 or more items.
- /// </exception>
- /// <exception cref="FileNotFoundException"><paramref name="paths"/> contains a path that does not exist.</exception>
- /// <exception cref="UnauthorizedAccessException">The caller has no required privilege.</exception>
- public async Task AddBurstShotImagesAsync(IEnumerable<string> paths)
- {
- ValidateDatabase();
-
- ValidatePaths(paths);
-
- var tcs = new TaskCompletionSource<bool>(TaskContinuationOptions.RunContinuationsAsynchronously);
- string[] pathArray = paths.ToArray();
-
- Interop.MediaInfo.InsertBurstShotCompletedCallback callback = (error, _) =>
- {
- if (error == MediaContentError.None)
- {
- tcs.TrySetResult(true);
- }
- else
- {
- tcs.TrySetException(error.AsException("Failed to add burst shot images"));
- }
- };
-
- using (ObjectKeeper.Get(callback))
- {
- Interop.MediaInfo.BurstShotInsert(pathArray, pathArray.Length, callback).
- ThrowIfError("Failed to add burst shots to db");
-
- await tcs.Task;
- }
- }
-
private static void SetUpdateValue<T>(Interop.MediaInfoHandle handle, T value,
Func<Interop.MediaInfoHandle, T, MediaContentError> func)
{
}
}
-
private static void SetUpdateValue<T>(Interop.MediaInfoHandle handle, Nullable<T> value,
Func<Interop.MediaInfoHandle, T, MediaContentError> func) where T : struct
{