2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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.
17 * @file FCntVideoContentInfo.h
18 * @brief This is the header file for the %VideoContentInfo class.
20 * This header file contains the declarations of the %VideoContentInfo class.
23 #ifndef _FCNT_VIDEO_CONTENT_INFO_H_
24 #define _FCNT_VIDEO_CONTENT_INFO_H_
26 #include <FCntContentInfo.h>
28 namespace Tizen { namespace Content
31 class _VideoContentInfoImpl;
32 class _VideoContentData;
35 * @class VideoContentInfo
36 * @brief This class provides methods to access the video content information.
40 * @final This class is not intended for extension.
42 * The %VideoContentInfo class provides methods to access the video content information that is extracted from a
44 * Before getting the video content information, the ContentManager class must be used to create the content.
46 * For more information on the different types of content information, see
47 * <a href="../org.tizen.native.appprogramming/html/guide/content/device_content_mgmt.htm">
48 * Device Content Management</a>.
50 * The following example demonstrates how to use the %VideoContentInfo class.
54 * MyClass::TestVideoContentInfo(void)
56 * result r = E_SUCCESS;
58 * ContentId contentId;
59 * ContentManager contentManager;
60 * r = contentManager.Construct();
61 * TryReturn(!IsFailed(r), r, "Construct failed.");
63 * VideoContentInfo videoContentInfo;
64 * r = videoContentInfo.Construct(null);
65 * TryReturn(!IsFailed(r), r, "Construct failed.");
67 * Tizen::Base::String sourcePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/flower.wmv";
68 * Tizen::Base::String destPath = Tizen::System::Environment::GetMediaPath() + L"Videos/flower.wmv";
70 * contentId = contentManager.CreateContent(sourcePath, destPath, false, &videoContentInfo);
71 * TryReturn(Tizen::Base::UuId::GetInvalidUuId() != contentId, GetLastResult(), "CreateContent failed.");
77 class _OSP_EXPORT_ VideoContentInfo
78 : public Tizen::Content::ContentInfo
82 * The object is not fully constructed after this constructor is called. @n
83 * For full construction, the Construct() method must be called right after calling this constructor.
87 VideoContentInfo(void);
90 * This destructor overrides Tizen::Base::Object::~Object().
94 virtual ~VideoContentInfo(void);
97 * Initializes this instance of %VideoContentInfo with the specified parameter.
100 * @brief <i> [Compatibility] </i>
104 * @compatibility This method has compatibility issues with OSP compatible applications. @n
105 * For more information, see @ref CompVideoContentInfoConstructPage "here".
108 * @return An error code
109 * @param[in] pContentPath The content path @n
110 * The path should start with the directory path returned by
111 * either Tizen::System::Environment::GetMediaPath() or
112 * Tizen::System::Environment::GetExternalStoragePath() @n
113 * If the path is @c null, use ContentManager::CreateContent
114 * (const Tizen::Base::ByteBuffer&, const Tizen::Base::String&,
115 * const ContentInfo*) @n
116 * or ContentManager::CreateContent(const Tizen::Base::String&,
117 * const Tizen::Base::String&, bool, const ContentInfo*), instead of this
119 * @exception E_SUCCESS The method is successful.
120 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
121 * @exception E_INVALID_ARG The specified input parameter is invalid.
122 * @exception E_OUT_OF_MEMORY The memory is insufficient.
123 * @exception E_IO An I/O error has occurred.
124 * @exception E_SYSTEM An internal error has occurred.
126 result Construct(const Tizen::Base::String* pContentPath);
130 * @page CompVideoContentInfoConstructPage Compatibility for the file path.
131 * @section CompVideoContentInfoConstructPageIssueSection Issues
132 * The content path argument of this method in OSP compatible applications has the following issues: @n
133 * -# The content path should be a path that begins with an allowed path prefix. @n
134 * For example, L"/Media/Images/flower.jpg", L"/Storagecard/Media/Images/flower.jpg".
136 * @section CompVideoContentInfoConstructPageSolutionSection Resolutions
137 * This issue has been resolved in Tizen. @n
138 * -# The content path can be a path without a specific allowed path prefix. @n
139 * Applications do not need to know the specific allowed path prefixes. @n
140 * To get the directory path, use the following methods: @n
141 * - For accessing the media directory, use Tizen::System::Environment::GetMediaPath().
142 * - For accessing the external storage, use Tizen::System::Environment::GetExternalStoragePath().
149 * Initializes this instance of %VideoContentInfo with the specified parameters.
151 * @brief <i> [Deprecated] </i>
152 * @deprecated This method is deprecated as there is a problem in managing the user-defined thumbnail and
153 * device coordinates. @n
154 * Instead of using this method, use Construct(const Tizen::Base::String*). @n
155 * To set the coordinates in the ContentInfo instance, use
156 * ContentInfo::SetCoordinates(const Tizen::Locations::Coordinates&).
159 * @return An error code
160 * @param[in] contentPath The content path
161 * @param[in] thumbnailPath The thumbnail path
162 * @param[in] setGps Set to @c true to save the device's last known coordinates of the
163 * ContentInfo instance, @n
165 * The coordinate information may be incorrect if it is outdated or has
166 * never been updated @n
167 * To update the coordinate information or to get the exact value, use
168 * Tizen::Locations::LocationProvider::RequestLocationUpdates()
169 * before calling this method.
170 * @exception E_SUCCESS The method is successful.
171 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
172 * @exception E_INVALID_ARG The specified input parameter is invalid.
173 * @exception E_OUT_OF_MEMORY The memory is insufficient.
174 * @exception E_IO An I/O error has occurred.
176 * - The content path must start with @c '/Media' or @c '/Storagecard/Media'.
177 * - The thumbnail path must start with @c '/Home', @c '/Media', or @c '/Storagecard/Media'. @n
178 * The permitted format for a thumbnail image is bitmap (bmp).
181 virtual result Construct(const Tizen::Base::String& contentPath, const Tizen::Base::String& thumbnailPath = L"", bool setGps = false);
184 * Gets the genre of the video file.
188 * @return The genre of the video file, @n
189 * else @c Unknown if the value is empty
191 Tizen::Base::String GetGenre(void) const;
194 * Gets the artist of the video file.
198 * @return The artist of the video file, @n
199 * else @c Unknown if the value is empty
201 Tizen::Base::String GetArtist(void) const;
205 * Gets the bit rate of the video file.
207 * @brief <i> [Deprecated] </i>
208 * @deprecated This method is deprecated because a new method has been added. @n
209 * Instead of using this method, use GetAudioBitrate() or GetVideoBitrate().
212 * @return The bit rate in bits per second (bps)
214 * - There are two kinds of bit rates in a video file: audio and video.
215 * - The return value is the bit rate for the audio.
218 int GetBitrate(void) const;
221 * Gets the audio bit rate of the video file.
225 * @return The audio bit rate in bits per second (bps)
227 int GetAudioBitrate(void) const;
230 * Gets the video bit rate of the video file.
234 * @return The video bit rate in bits per second (bps)
236 int GetVideoBitrate(void) const;
239 * Gets the frame rate of the video file.
243 * @return The frame rate of the video file
245 int GetFramerate(void) const;
248 * Gets the width of the video file.
252 * @return The width of the video file
254 int GetWidth(void) const;
257 * Gets the height of the video file.
261 * @return The height of the video file
263 int GetHeight(void) const;
266 * Gets the title of the video file.
270 * @return The title of the video file, @n
271 * else @c Unknown if the value is empty
273 Tizen::Base::String GetTitle(void) const;
276 * Gets the album name of the video file.
280 * @return The album name of the video file, @n
281 * else @c Unknown if the value is empty
283 Tizen::Base::String GetAlbumName(void) const;
286 * Gets the duration of the video file.
290 * @return The duration of the video file in milliseconds
292 long GetDuration(void) const;
297 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
299 VideoContentInfo(const VideoContentInfo& rhs);
302 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
304 VideoContentInfo& operator =(const VideoContentInfo& rhs);
306 _VideoContentData* __pVideoContentData;
307 _VideoContentInfoImpl* __pVideoContentInfoImpl;
308 friend class _VideoContentInfoImpl;
310 }; // VideoContentInfo
314 #endif // _FCNT_VIDEO_CONTENT_INFO_H_