2123d787efe652d811d9dcb05bfbf36ea5f77bf4
[platform/framework/native/content.git] / inc / FCntVideoMetadata.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16 /**
17  * @file                FCntVideoMetadata.h
18  * @brief               This is the header file for the %VideoMetadata class.
19  *
20  * This header file contains the declarations of the %VideoMetadata class.
21  */
22
23 #ifndef _FCNT_VIDEO_METADATA_H_
24 #define _FCNT_VIDEO_METADATA_H_
25
26 #include <FBaseObject.h>
27
28 namespace Tizen { namespace Graphics
29 {
30 class Bitmap;
31 }}
32
33 namespace Tizen { namespace Content
34 {
35
36 class _VideoMetadataImpl;
37
38 /**
39  * @class                       VideoMetadata
40  * @brief                       This class provides methods to access the video metadata.
41  *
42  * @since                       2.0
43  *
44  * The %VideoMetadata class provides methods to access the video metadata that contains video content-specific
45  * attributes.
46  *
47  * The following example demonstrates how to use the %VideoMetadata class.
48  *
49  * @code
50  * result
51  * MyClass::TestVideoMetadata(void)
52  * {
53  *              Tizen::Base::String contentPath = Tizen::System::Environment::GetMediaPath() + L"Videos/video.mp4";
54  *              VideoMetadata* pVideoMeta = ContentManagerUtil::GetVideoMetaN(contentPath);
55  *              TryReturn(pVideoMeta != null, GetLastResult(), "ContentManagerUtil::GetVideoMetaN failed.");
56  *
57  *              // Width
58  *              pVideoMeta->GetWidth();
59  *
60  *              // Height
61  *              pVideoMeta->GetHeight();
62  *
63  *              // Duration
64  *              pVideoMeta->GetDuration();
65  *
66  *              delete pVideoMeta;
67  *
68  *              return E_SUCCESS;
69  * }
70  * @endcode
71  */
72 class _OSP_EXPORT_ VideoMetadata
73         : virtual public Tizen::Base::Object
74 {
75 public:
76         /**
77          * This is the default constructor for this class.
78          *
79          * @since               2.0
80          */
81         VideoMetadata(void);
82
83         /**
84          * Copying of objects using this copy constructor is allowed.
85          *
86          * @since               2.0
87          *
88          * @param[in]   rhs     An instance of %VideoMetadata to copy
89          */
90         VideoMetadata(const VideoMetadata& rhs);
91
92         /**
93          * This destructor overrides Tizen::Base::Object::~Object().
94          *
95          * @since               2.0
96          */
97         virtual ~VideoMetadata(void);
98
99         /**
100          * Gets the width.
101          *
102          * @since               2.0
103          *
104          * @return              The width
105          */
106         int GetWidth(void) const;
107
108         /**
109          * Gets the height.
110          *
111          * @since               2.0
112          *
113          * @return              The height
114          */
115         int GetHeight(void) const;
116
117         /**
118          * Gets the duration.
119          *
120          * @since               2.0
121          *
122          * @return              The duration in milliseconds
123          */
124         long GetDuration(void) const;
125
126         /**
127          * Gets the frame rate.
128          *
129          * @since               2.0
130          *
131          * @return              The frame rate
132          */
133         int GetFramerate(void) const;
134
135         /**
136          * @if                  OSPDEPREC
137          * Gets the bit rate.
138          *
139          * @brief               <i> [Deprecated] </i>
140          * @deprecated  This method is deprecated because a new method has been added. @n
141          *              Instead of using this method, use GetAudioBitrate() or GetVideoBitrate().
142          * @since               2.0
143          *
144          * @return              The bit rate in bits per second (bps)
145          * @remarks     
146          *                              - There are two kinds of bit rates in a video file: audio and video.
147          *                              - The return value is the bit rate for the audio.
148          * @endif
149          */
150         int GetBitrate(void) const;
151
152         /**
153          * Gets the audio bit rate.
154          *
155          * @since     2.0
156          *
157          * @return    The audio bit rate in bits per second (bps)
158          */
159         int GetAudioBitrate(void) const;
160
161         /**
162          * Gets the video bit rate.
163          *
164          * @since     2.0
165          *
166          * @return    The video bit rate in bits per second (bps)
167          */
168         int GetVideoBitrate(void) const;
169
170         /**
171          * Gets the genre.
172          *
173          * @since               2.0
174          *
175          * @return              The genre
176          */
177         Tizen::Base::String GetGenre(void) const;
178
179         /**
180          * Gets the comment of the video file.
181          *
182          * @since               2.1
183          *
184          * @return              The comment of the video file
185          */
186         Tizen::Base::String GetComment(void) const;
187
188         /**
189          * Gets the description of the video file.
190          *
191          * @since               2.1
192          *
193          * @return              The description of the video file
194          */
195         Tizen::Base::String GetDescription(void) const;
196
197         /**
198          * Gets the album art of the video.
199          *
200          * @since               2.0
201          *
202          * @return              A pointer to the album art
203          * @exception   E_SUCCESS                               The method is successful.
204          * @exception   E_DATA_NOT_FOUND                The album art does not exist.
205          * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
206          * @remarks             The specific error code can be accessed using the GetLastResult() method.
207          */
208         Tizen::Graphics::Bitmap* GetAlbumArtN(void) const;
209
210         /**
211          * Compares the equality of the values between two %VideoMetadata objects by overriding the
212          * Tizen::Base::Object::Equals() method.
213          *
214          * @since       2.0
215          *
216          * @return      @c true if all the fields in the objects are equal, @n
217          *              else @c false
218          * @param[in]   rhs    The Tizen::Base::Object with which the comparison is done @n
219          *                                         An instance of Tizen::Graphics::Bitmap is not taken into account in
220          *                                         the comparisons.
221          */
222         virtual bool Equals(const Tizen::Base::Object& rhs) const;
223
224         /**
225          * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
226          *
227          * @since       2.0
228          *
229          * @return      The hash value of the current instance
230          */
231         virtual int GetHashCode(void) const;
232
233         /**
234          * Copying of objects using this copy assignment operator is allowed.
235          *
236          * @since       2.0
237          *
238          * @return      A reference to this instance
239          * @param[in]   rhs     An instance of %VideoMetadata to copy
240          */
241         VideoMetadata& operator =(const VideoMetadata& rhs);
242
243 private:
244         friend class _VideoMetadataImpl;
245         _VideoMetadataImpl* __pImpl;
246
247 };  // Class VideoMetadata
248
249 }}  // Tizen::Content
250
251 #endif  // _FCNT_VIDEO_METADATA_H_