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;
34 * @class VideoContentInfo
35 * @brief This class provides methods to access the video content information.
39 * @final This class is not intended for extension.
41 * The %VideoContentInfo class provides methods to access the video content information that is extracted from a physical file. @n
42 * Before getting the video content information, the ContentManager class must be used to create the content.
44 * For more information on the different types of content information, see <a href="../org.tizen.native.appprogramming/html/guide/content/device_content_mgmt.htm">Device Content Management</a>.
46 * The following example demonstrates how to use the %VideoContentInfo class.
50 * MyClass::TestVideoContentInfo(void)
52 * result r = E_SUCCESS;
54 * ContentId contentId;
55 * ContentManager contentManager;
56 * r = contentManager.Construct();
57 * TryReturn(!IsFailed(r), r, "Construct failed.");
59 * VideoContentInfo videoContentInfo;
60 * r = videoContentInfo.Construct(null);
61 * TryReturn(!IsFailed(r), r, "Construct failed.");
63 * Tizen::Base::String sourcePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/flower.wmv";
64 * Tizen::Base::String destPath = Tizen::System::Environment::GetMediaPath() + L"Videos/flower.wmv";
66 * contentId = contentManager.CreateContent(sourcePath, destPath, false, &videoContentInfo);
67 * TryReturn(Tizen::Base::UuId::GetInvalidUuId() != contentId, GetLastResult(), "CreateContent failed.");
73 class _OSP_EXPORT_ VideoContentInfo
74 : public Tizen::Content::ContentInfo
78 * The object is not fully constructed after this constructor is called. @n
79 * For full construction, the Construct() method must be called right after calling this constructor.
83 VideoContentInfo(void);
86 * This destructor overrides Tizen::Base::Object::~Object().
90 virtual ~VideoContentInfo(void);
93 * Initializes this instance of %VideoContentInfo with the specified parameter.
96 * @brief <i> [Compatibility] </i>
100 * @compatibility This method has compatibility issues with OSP compatible applications. @n
101 * For more information, see @ref CompVideoContentInfoConstructPage "here".
104 * @return An error code
105 * @param[in] pContentPath The content path @n
106 * The path should be started with directory path returned by
107 * either Tizen::System::Environment::GetMediaPath() or Tizen::System::Environment::GetExternalStoragePath(). @n
108 * If the path is @c null,
109 * use ContentManager::CreateContent(const Tizen::Base::ByteBuffer&, const Tizen::Base::String&, const ContentInfo*) @n
110 * or ContentManager::CreateContent(const Tizen::Base::String&, const Tizen::Base::String&, bool, const ContentInfo*),
111 * instead of this method.
112 * @exception E_SUCCESS The method is successful.
113 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
114 * @exception E_INVALID_ARG The specified input parameter is invalid.
115 * @exception E_OUT_OF_MEMORY The memory is insufficient.
116 * @exception E_IO An I/O error has occurred.
117 * @exception E_SYSTEM An internal error has occurred.
120 result Construct(const Tizen::Base::String* pContentPath);
124 * @page CompVideoContentInfoConstructPage Compatibility for the file path.
125 * @section CompVideoContentInfoConstructPageIssueSection Issues
126 * The content path argument of this method in OSP compatible applications has the following issues: @n
127 * -# The content path should be a path that begins with an allowed path prefix. @n
128 * For example, L"/Media/Images/flower.jpg", L"/Storagecard/Media/Images/flower.jpg".
130 * @section CompVideoContentInfoConstructPageSolutionSection Resolutions
131 * This issue has been resolved in Tizen. @n
132 * -# The content path can be a path without a specific allowed path prefix. @n
133 * Application do not need to know the specific allowed path prefixes. @n
134 * To get the directory path, use the following methods: @n
135 * - For accessing the media directory, use Tizen::System::Environment::GetMediaPath().
136 * - For accessing the external storage, use Tizen::System::Environment::GetExternalStoragePath().
143 * Initializes this instance of %VideoContentInfo with the specified parameters.
145 * @brief <i> [Deprecated] </i>
146 * @deprecated This method is deprecated as there is a problem in managing the user-defined thumbnail and device coordinates. @n
147 * Instead of using this method, use Construct(const Tizen::Base::String*). @n
148 * To set the coordinates in the ContentInfo instance, use ContentInfo::SetCoordinates(const Tizen::Locations::Coordinates&).
151 * @return An error code
152 * @param[in] contentPath The content path
153 * @param[in] thumbnailPath The thumbnail path
154 * @param[in] setGps Set to @c true to save the device's last known coordinates in the ContentInfo instance, @n
156 * The coordinate information may be incorrect if it is outdated or has never been updated. @n
157 * To update the coordinate information or to get the exact value,
158 * use Tizen::Locations::LocationProvider::RequestLocationUpdates() before calling this method.
159 * @exception E_SUCCESS The method is successful.
160 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
161 * @exception E_INVALID_ARG The specified input parameter is invalid.
162 * @exception E_OUT_OF_MEMORY The memory is insufficient.
163 * @exception E_IO An I/O error has occurred.
165 * - The content path must start with @c '/Media' or @c '/Storagecard/Media'.
166 * - The thumbnail path must start with @c '/Home', @c '/Media', or @c '/Storagecard/Media'. @n
167 * The permitted format for a thumbnail image is bitmap (bmp).
170 virtual result Construct(const Tizen::Base::String& contentPath, const Tizen::Base::String& thumbnailPath = L"", bool setGps = false);
173 * Gets the genre of the video file.
177 * @return The genre of the video file, @n
178 * else @c Unknown if the value is empty
180 Tizen::Base::String GetGenre(void) const;
183 * Gets the artist of the video file.
187 * @return The artist of the video file, @n
188 * else @c Unknown if the value is empty
190 Tizen::Base::String GetArtist(void) const;
194 * Gets the bit rate of the video file.
196 * @brief <i> [Deprecated] </i>
197 * @deprecated This method is deprecated because a new method has been added. @n
198 * Instead of using this method, use GetAudioBitrate() or GetVideoBitrate().
201 * @return The bit rate in bits per second (bps)
202 * @remarks There are two kinds of bit rates in a video file: audio and video. @n
203 * The return value is the bit rate for the audio.
206 int GetBitrate(void) const;
209 * Gets the audio bit rate of the video file.
213 * @return The audio bit rate in bits per second (bps)
215 int GetAudioBitrate(void) const;
218 * Gets the video bit rate of the video file.
222 * @return The video bit rate in bits per second (bps)
224 int GetVideoBitrate(void) const;
227 * Gets the frame rate of the video file.
231 * @return The frame rate of the video file
233 int GetFramerate(void) const;
236 * Gets the width of the video file.
240 * @return The width of the video file
242 int GetWidth(void) const;
245 * Gets the height of the video file.
249 * @return The height of the video file
251 int GetHeight(void) const;
254 * Gets the title of the video file.
258 * @return The title of the video file, @n
259 * else @c Unknown if the value is empty
261 Tizen::Base::String GetTitle(void) const;
264 * Gets the album name of the video file.
268 * @return The album name of the video file, @n
269 * else @c Unknown if the value is empty
271 Tizen::Base::String GetAlbumName(void) const;
274 * Gets the duration of the video file.
278 * @return The duration of the video file in milliseconds
280 long GetDuration(void) const;
283 class _VideoContentData
296 , pAlbumName(null) {}
304 Tizen::Base::String* pArtist;
305 Tizen::Base::String* pGenre;
306 Tizen::Base::String* pTitle;
307 Tizen::Base::String* pAlbumName;
311 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
313 VideoContentInfo(const VideoContentInfo& rhs);
316 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
318 VideoContentInfo& operator =(const VideoContentInfo& rhs);
320 result SetVideoContentData(const _VideoContentData* pVideoContentData);
322 _VideoContentData* GetVideoContentData(void);
324 result GetVideoMetadata(void) const;
327 _VideoContentData* __pVideoContentData;
329 friend class _ContentManagerImpl;
330 friend class _ContentSearchImpl;
331 friend class _ContentDirectoryImpl;
332 friend class _ContentUtility;
333 friend class _PlayListManagerImpl;
334 friend class _PlayListImpl;
336 friend class _VideoContentInfoImpl;
337 _VideoContentInfoImpl* __pImpl;
339 }; // Class VideoContentInfo
343 #endif // _FCNT_VIDEO_CONTENT_INFO_H_