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