diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs index 6e470084b88..e490c601aa7 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs @@ -861,122 +861,6 @@ public bool Move(string mediaId, string newPath) return true; } - #region CreateThumbnailAsync - /// - /// Creates the thumbnail image for the given media. - /// If the thumbnail already exists for the given media, the existing path will be returned. - /// - /// http://tizen.org/privilege/content.write - /// The media ID to create the thumbnail. - /// A task that represents the asynchronous operation. The task result contains the thumbnail path. - /// - /// The is disconnected.
- /// -or-
- /// An internal error occurred while executing. - ///
- /// The has already been disposed. - /// An error occurred while executing the command. - /// is null. - /// does not exist in the database. - /// - /// is a zero-length string, contains only white space. - /// - /// The file of the media does not exists; moved or deleted. - /// - /// The thumbnail is not available for the given media.
- /// -or-
- /// The media is in the external USB storage. - ///
- /// 4 - [Obsolete("Deprecated since API10. Will be removed in API12. Please use CreateThumbnail instead.")] - public Task CreateThumbnailAsync(string mediaId) - { - return CreateThumbnailAsync(mediaId, CancellationToken.None); - } - - /// - /// Creates the thumbnail image for the given media. - /// If the thumbnail already exists for the given media, the existing path will be returned. - /// - /// http://tizen.org/privilege/content.write - /// The media ID to create the thumbnail. - /// The token to cancel the operation. - /// A task that represents the asynchronous operation. The task result contains the thumbnail path. - /// - /// The is disconnected.
- /// -or-
- /// An internal error occurred while executing. - ///
- /// The has already been disposed. - /// An error occurred while executing the command. - /// is null. - /// does not exist in the database. - /// - /// is a zero-length string, contains only white space. - /// - /// The file of the media does not exists; moved or deleted. - /// - /// The thumbnail is not available for the given media.
- /// -or-
- /// The media is in the external USB storage. - ///
- /// 4 - [Obsolete("Deprecated since API10. Will be removed in API12. Please use CreateThumbnail instead.")] - public Task CreateThumbnailAsync(string mediaId, CancellationToken cancellationToken) - { - ValidateDatabase(); - - return cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : - CreateThumbnailAsyncCore(mediaId, cancellationToken); - } - - private async Task CreateThumbnailAsyncCore(string mediaId, CancellationToken cancellationToken) - { - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - var tcs = new TaskCompletionSource(); - - using (var handle = ValidateFile(mediaId)) - { - string thumbnailPath = null; - MediaContentError ret = MediaContentError.None; - Task thumbTask = null; - - if (cancellationToken.CanBeCanceled) - { - cancellationToken.Register(() => - { - if (tcs.Task.IsCompleted) - { - return; - } - - tcs.TrySetCanceled(); - }); - } - - thumbTask = Task.Factory.StartNew( () => - { - ret = Interop.MediaInfo.GenerateThumbnail(handle); - - if (ret != MediaContentError.None) - { - tcs.TrySetException(ret.AsException("Failed to create thumbnail")); - } - else - { - thumbnailPath = InteropHelper.GetString(handle, Interop.MediaInfo.GetThumbnailPath, true); - tcs.TrySetResult(thumbnailPath); - } - }, cancellationToken, - TaskCreationOptions.DenyChildAttach | TaskCreationOptions.LongRunning, - TaskScheduler.Default); - - return await tcs.Task; - } - } - #endregion - /// /// Creates the thumbnail image for the given media. /// If the thumbnail already exists for the given media, the existing path will be returned.