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.
55 * #include <FContent.h>
56 * #include <FSystem.h>
58 * using namespace Tizen::Content;
61 * MyClass::TestVideoContentInfo(void)
63 * ContentManager contentManager;
64 * result r = contentManager.Construct();
66 * VideoContentInfo videoContentInfo;
67 * r = videoContentInfo.Construct(null);
69 * Tizen::Base::String sourcePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/flower.wmv";
70 * Tizen::Base::String destPath = Tizen::System::Environment::GetMediaPath() + L"Videos/flower.wmv";
72 * ContentId contentId = contentManager.CreateContent(sourcePath, destPath, false, &videoContentInfo);
73 * r = GetLastResult();
79 class _OSP_EXPORT_ VideoContentInfo
80 : public Tizen::Content::ContentInfo
84 * The object is not fully constructed after this constructor is called. @n
85 * For full construction, the Construct() method must be called right after calling this constructor.
89 VideoContentInfo(void);
92 * This destructor overrides Tizen::Base::Object::~Object().
96 virtual ~VideoContentInfo(void);
99 * Initializes this instance of %VideoContentInfo with the specified parameter.
102 * @brief <i> [Compatibility] </i>
106 * @compatibility This method has compatibility issues with OSP compatible applications. @n
107 * For more information, see @ref CompVideoContentInfoConstructPage "here".
110 * @return An error code
111 * @param[in] pContentPath The content path @n
112 * The path should start with the directory path returned by
113 * either Tizen::System::Environment::GetMediaPath() or
114 * Tizen::System::Environment::GetExternalStoragePath() @n
115 * If the path is @c null, use ContentManager::CreateContent
116 * (const Tizen::Base::ByteBuffer&, const Tizen::Base::String&,
117 * const ContentInfo*) @n
118 * or ContentManager::CreateContent(const Tizen::Base::String&,
119 * const Tizen::Base::String&, bool, const ContentInfo*), instead of this
121 * @exception E_SUCCESS The method is successful.
122 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
123 * @exception E_INVALID_ARG The specified input parameter is invalid.
124 * @exception E_OUT_OF_MEMORY The memory is insufficient.
125 * @exception E_IO An I/O error has occurred.
126 * @exception E_SYSTEM An internal error has occurred.
128 result Construct(const Tizen::Base::String* pContentPath);
132 * @page CompVideoContentInfoConstructPage Compatibility for the file path.
133 * @section CompVideoContentInfoConstructPageIssueSection Issues
134 * The content path argument of this method in OSP compatible applications has the following issues: @n
135 * -# The content path should be a path that begins with an allowed path prefix. @n
136 * For example, L"/Media/Images/flower.jpg", L"/Storagecard/Media/Images/flower.jpg".
138 * @section CompVideoContentInfoConstructPageSolutionSection Resolutions
139 * This issue has been resolved in Tizen. @n
140 * -# The content path can be a path without a specific allowed path prefix. @n
141 * Applications do not need to know the specific allowed path prefixes. @n
142 * To get the directory path, use the following methods: @n
143 * - For accessing the media directory, use Tizen::System::Environment::GetMediaPath().
144 * - For accessing the external storage, use Tizen::System::Environment::GetExternalStoragePath().
151 * Initializes this instance of %VideoContentInfo with the specified parameters.
153 * @brief <i> [Deprecated] </i>
154 * @deprecated This method is deprecated as there is a problem in managing the user-defined thumbnail and
155 * device coordinates. @n
156 * Instead of using this method, use Construct(const Tizen::Base::String*). @n
157 * To set the coordinates in the ContentInfo instance, use
158 * ContentInfo::SetCoordinates(const Tizen::Locations::Coordinates&).
161 * @return An error code
162 * @param[in] contentPath The content path
163 * @param[in] thumbnailPath The thumbnail path
164 * @param[in] setGps Set to @c true to save the device's last known coordinates of the
165 * ContentInfo instance, @n
167 * The coordinate information may be incorrect if it is outdated or has
168 * never been updated @n
169 * To update the coordinate information or to get the exact value, use
170 * Tizen::Locations::LocationProvider::RequestLocationUpdates()
171 * before calling this method.
172 * @exception E_SUCCESS The method is successful.
173 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
174 * @exception E_INVALID_ARG The specified input parameter is invalid.
175 * @exception E_OUT_OF_MEMORY The memory is insufficient.
176 * @exception E_IO An I/O error has occurred.
178 * - The content path must start with @c '/Media' or @c '/Storagecard/Media'.
179 * - The thumbnail path must start with @c '/Home', @c '/Media', or @c '/Storagecard/Media'. @n
180 * The permitted format for a thumbnail image is bitmap (bmp).
183 virtual result Construct(const Tizen::Base::String& contentPath, const Tizen::Base::String& thumbnailPath = L"", bool setGps = false);
186 * Gets the genre of the video file.
190 * @return The genre of the video file, @n
191 * else @c Unknown if the value is empty
193 Tizen::Base::String GetGenre(void) const;
196 * Gets the artist of the video file.
200 * @return The artist of the video file, @n
201 * else @c Unknown if the value is empty
203 Tizen::Base::String GetArtist(void) const;
207 * Gets the bit rate of the video file.
209 * @brief <i> [Deprecated] </i>
210 * @deprecated This method is deprecated because a new method has been added. @n
211 * Instead of using this method, use GetAudioBitrate() or GetVideoBitrate().
214 * @return The bit rate in bits per second (bps)
216 * - There are two kinds of bit rates in a video file: audio and video.
217 * - The return value is the bit rate for the audio.
220 int GetBitrate(void) const;
223 * Gets the audio bit rate of the video file.
227 * @return The audio bit rate in bits per second (bps)
229 int GetAudioBitrate(void) const;
232 * Gets the video bit rate of the video file.
236 * @return The video bit rate in bits per second (bps)
238 int GetVideoBitrate(void) const;
241 * Gets the frame rate of the video file.
245 * @return The frame rate of the video file
247 int GetFramerate(void) const;
250 * Gets the width of the video file.
254 * @return The width of the video file
256 int GetWidth(void) const;
259 * Gets the height of the video file.
263 * @return The height of the video file
265 int GetHeight(void) const;
268 * Gets the title of the video file.
272 * @return The title of the video file, @n
273 * else @c Unknown if the value is empty
275 Tizen::Base::String GetTitle(void) const;
278 * Gets the album name of the video file.
282 * @return The album name of the video file, @n
283 * else @c Unknown if the value is empty
285 Tizen::Base::String GetAlbumName(void) const;
288 * Gets the duration of the video file.
292 * @return The duration of the video file in milliseconds
294 long GetDuration(void) const;
299 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
301 VideoContentInfo(const VideoContentInfo& rhs);
304 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
306 VideoContentInfo& operator =(const VideoContentInfo& rhs);
308 _VideoContentData* __pVideoContentData;
309 _VideoContentInfoImpl* __pVideoContentInfoImpl;
310 friend class _VideoContentInfoImpl;
312 }; // VideoContentInfo
316 #endif // _FCNT_VIDEO_CONTENT_INFO_H_