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.Diagnostics;
20 namespace Tizen.Content.MediaContent
23 /// Represents a video media information.
25 /// <since_tizen> 4 </since_tizen>
26 public class VideoInfo : MediaInfo
28 internal VideoInfo(Interop.MediaInfoHandle handle) : base(handle)
30 IntPtr videoHandle = IntPtr.Zero;
34 Interop.MediaInfo.GetVideo(handle, out videoHandle).ThrowIfError("Failed to retrieve data"); // Deprecated since API12
36 Debug.Assert(videoHandle != IntPtr.Zero);
38 Album = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetAlbum); // Deprecated since API12
39 Artist = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetArtist); // Deprecated since API12
40 AlbumArtist = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetAlbumArtist); // Deprecated since API12
41 Genre = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetGenre); // Deprecated since API12
42 Composer = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetComposer); // Deprecated since API12
43 Year = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetYear); // Deprecated since API12
44 DateRecorded = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetRecordedDate); // Deprecated since API12
45 Copyright = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetCopyright); // Deprecated since API12
46 TrackNumber = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetTrackNum); // Deprecated since API12
48 BitRate = InteropHelper.GetValue<int>(videoHandle, Interop.VideoInfo.GetBitRate); // Deprecated since API12
49 Duration = InteropHelper.GetValue<int>(videoHandle, Interop.VideoInfo.GetDuration); // Deprecated since API12
50 Width = InteropHelper.GetValue<int>(videoHandle, Interop.VideoInfo.GetWidth); // Deprecated since API12
51 Height = InteropHelper.GetValue<int>(videoHandle, Interop.VideoInfo.GetHeight); // Deprecated since API12
55 Interop.VideoInfo.Destroy(videoHandle); // Deprecated since API12
60 /// Gets the album name.
62 /// <value>The album name from the metadata.</value>
63 /// <since_tizen> 4 </since_tizen>
64 [Obsolete("Deprecated since API12; Will be removed in API14.")]
65 public string Album { get; }
68 /// Gets the artist name.
70 /// <value>The artist name from the metadata.</value>
71 /// <since_tizen> 4 </since_tizen>
72 [Obsolete("Deprecated since API12; Will be removed in API14.")]
73 public string Artist { get; }
76 /// Gets the album artist name.
78 /// <value>The album artist name from the metadata.</value>
79 /// <since_tizen> 4 </since_tizen>
80 [Obsolete("Deprecated since API12; Will be removed in API14.")]
81 public string AlbumArtist { get; }
86 /// <value>The genre name from the metadata.</value>
87 /// <since_tizen> 4 </since_tizen>
88 [Obsolete("Deprecated since API12; Will be removed in API14.")]
89 public string Genre { get; }
92 /// Gets the composer name.
94 /// <value>The composer name from the metadata.</value>
95 /// <since_tizen> 4 </since_tizen>
96 [Obsolete("Deprecated since API12; Will be removed in API14.")]
97 public string Composer { get; }
102 /// <value>The year from the metadata.</value>
103 /// <since_tizen> 4 </since_tizen>
104 [Obsolete("Deprecated since API12; Will be removed in API14.")]
105 public string Year { get; }
108 /// Gets the recorded date.
110 /// <value>The recorded date information from the metadata if exists; otherwise, the modified date of the file.</value>
111 /// <since_tizen> 4 </since_tizen>
112 [Obsolete("Deprecated since API12; Will be removed in API14.")]
113 public string DateRecorded { get; }
116 /// Gets the copyright notice.
118 /// <value>The copyright notice from the metadata.</value>
119 /// <since_tizen> 4 </since_tizen>
120 [Obsolete("Deprecated since API12; Will be removed in API14.")]
121 public string Copyright { get; }
124 /// Gets the track number.
126 /// <value>The track number from the metadata.</value>
127 /// <since_tizen> 4 </since_tizen>
128 [Obsolete("Deprecated since API12; Will be removed in API14.")]
129 public string TrackNumber { get; }
132 /// Gets the bitrate in bit per second.
134 /// <value>The bit rate of the video.</value>
135 /// <since_tizen> 4 </since_tizen>
136 [Obsolete("Deprecated since API12; Will be removed in API14.")]
137 public int BitRate { get; }
140 /// Gets the track duration in milliseconds.
142 /// <value>The track duration of the video in milliseconds.</value>
143 /// <since_tizen> 4 </since_tizen>
144 [Obsolete("Deprecated since API12; Will be removed in API14.")]
145 public int Duration { get; }
148 /// Gets the video width in pixels.
150 /// <value>The width of the video in pixels.</value>
151 /// <since_tizen> 4 </since_tizen>
152 [Obsolete("Deprecated since API12; Will be removed in API14.")]
153 public int Width { get; }
156 /// Gets the video height in pixels.
158 /// <value>The height of the video in pixels.</value>
159 /// <since_tizen> 4 </since_tizen>
160 [Obsolete("Deprecated since API12; Will be removed in API14.")]
161 public int Height { get; }