From 43729e6e38e1f0f57e9fb859b7383c788493dec6 Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Mon, 5 Feb 2024 16:09:50 +0900 Subject: [PATCH] [MediaContent] Deprecate infrequent meta fields (#5915) --- .../Interop/Interop.BookInfo.cs | 4 ++-- .../Interop/Interop.MediaInfo.cs | 2 +- .../Interop/Interop.VideoInfo.cs | 6 +++--- .../Tizen.Content.MediaContent/BookInfo.cs | 6 ++++-- .../Tizen.Content.MediaContent/VideoInfo.cs | 10 ++++++---- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.BookInfo.cs b/src/Tizen.Content.MediaContent/Interop/Interop.BookInfo.cs index 4bc192c64..2db62cbcd 100644 --- a/src/Tizen.Content.MediaContent/Interop/Interop.BookInfo.cs +++ b/src/Tizen.Content.MediaContent/Interop/Interop.BookInfo.cs @@ -35,10 +35,10 @@ internal static partial class Interop internal static extern MediaContentError GetAuthor(IntPtr handle, out IntPtr author); [DllImport(Libraries.MediaContent, EntryPoint = "book_meta_get_date")] - internal static extern MediaContentError GetDate(IntPtr handle, out IntPtr date); + internal static extern MediaContentError GetDate(IntPtr handle, out IntPtr date); // Deprecated since API12 [DllImport(Libraries.MediaContent, EntryPoint = "book_meta_get_publisher")] - internal static extern MediaContentError GetPublisher(IntPtr handle, out IntPtr publisher); + internal static extern MediaContentError GetPublisher(IntPtr handle, out IntPtr publisher); // Deprecated since API12 [DllImport(Libraries.MediaContent, EntryPoint = "book_meta_get_path_with_keyword")] internal static extern MediaContentError GetPathByKeyword(string keyword, out IntPtr path, out uint length); diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs b/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs index b5778b402..deed1a6ee 100644 --- a/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs +++ b/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs @@ -71,7 +71,7 @@ internal static partial class Interop internal static extern MediaContentError GetImage(MediaInfoHandle handle, out IntPtr imageHandle); [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_video")] - internal static extern MediaContentError GetVideo(MediaInfoHandle handle, out IntPtr videoHandle); + internal static extern MediaContentError GetVideo(MediaInfoHandle handle, out IntPtr videoHandle); // Deprecated since API12 [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_audio")] internal static extern MediaContentError GetAudio(MediaInfoHandle handle, out IntPtr audioHandle); diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.VideoInfo.cs b/src/Tizen.Content.MediaContent/Interop/Interop.VideoInfo.cs index e1a78f629..8a92a7667 100644 --- a/src/Tizen.Content.MediaContent/Interop/Interop.VideoInfo.cs +++ b/src/Tizen.Content.MediaContent/Interop/Interop.VideoInfo.cs @@ -23,7 +23,7 @@ internal static partial class Interop internal static partial class VideoInfo { [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_destroy", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError Destroy(IntPtr handle); + internal static extern MediaContentError Destroy(IntPtr handle); // Deprecated since API12 [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_album", CallingConvention = CallingConvention.Cdecl)] internal static extern MediaContentError GetAlbum(IntPtr handle, out IntPtr albumName); // Deprecated since API12 @@ -59,9 +59,9 @@ internal static partial class Interop internal static extern MediaContentError GetDuration(IntPtr handle, out int duration); // Deprecated since API12 [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_width", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetWidth(IntPtr handle, out int width); + internal static extern MediaContentError GetWidth(IntPtr handle, out int width); // Deprecated since API12 [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_height", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetHeight(IntPtr handle, out int width); + internal static extern MediaContentError GetHeight(IntPtr handle, out int width); // Deprecated since API12 } } diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookInfo.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookInfo.cs index fbd8bf33a..20d8a9230 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookInfo.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookInfo.cs @@ -37,8 +37,8 @@ namespace Tizen.Content.MediaContent Subject = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetSubject); Author = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetAuthor); - DatePublished = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetDate); - Publisher = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetPublisher); + DatePublished = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetDate); // Deprecated since API12 + Publisher = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetPublisher); // Deprecated since API12 } finally { @@ -65,6 +65,7 @@ namespace Tizen.Content.MediaContent /// /// The published date. /// 9 + [Obsolete("Deprecated since API12; Will be removed in API14.")] public string DatePublished { get; } /// @@ -72,6 +73,7 @@ namespace Tizen.Content.MediaContent /// /// The publisher. /// 9 + [Obsolete("Deprecated since API12; Will be removed in API14.")] public string Publisher { get; } } } diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInfo.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInfo.cs index 69ac8cb6d..946b5ad4b 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInfo.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInfo.cs @@ -31,7 +31,7 @@ namespace Tizen.Content.MediaContent try { - Interop.MediaInfo.GetVideo(handle, out videoHandle).ThrowIfError("Failed to retrieve data"); + Interop.MediaInfo.GetVideo(handle, out videoHandle).ThrowIfError("Failed to retrieve data"); // Deprecated since API12 Debug.Assert(videoHandle != IntPtr.Zero); @@ -47,12 +47,12 @@ namespace Tizen.Content.MediaContent BitRate = InteropHelper.GetValue(videoHandle, Interop.VideoInfo.GetBitRate); // Deprecated since API12 Duration = InteropHelper.GetValue(videoHandle, Interop.VideoInfo.GetDuration); // Deprecated since API12 - Width = InteropHelper.GetValue(videoHandle, Interop.VideoInfo.GetWidth); - Height = InteropHelper.GetValue(videoHandle, Interop.VideoInfo.GetHeight); + Width = InteropHelper.GetValue(videoHandle, Interop.VideoInfo.GetWidth); // Deprecated since API12 + Height = InteropHelper.GetValue(videoHandle, Interop.VideoInfo.GetHeight); // Deprecated since API12 } finally { - Interop.VideoInfo.Destroy(videoHandle); + Interop.VideoInfo.Destroy(videoHandle); // Deprecated since API12 } } @@ -149,6 +149,7 @@ namespace Tizen.Content.MediaContent /// /// The width of the video in pixels. /// 4 + [Obsolete("Deprecated since API12; Will be removed in API14.")] public int Width { get; } /// @@ -156,6 +157,7 @@ namespace Tizen.Content.MediaContent /// /// The height of the video in pixels. /// 4 + [Obsolete("Deprecated since API12; Will be removed in API14.")] public int Height { get; } } -- 2.34.1