2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FCntVideoContentInfo.h
19 * @brief This is the header file for the %VideoContentInfo class.
21 * This header file contains the declarations of the %VideoContentInfo class.
24 #ifndef _FCNT_VIDEO_CONTENT_INFO_H_
25 #define _FCNT_VIDEO_CONTENT_INFO_H_
27 #include <FCntContentInfo.h>
29 namespace Tizen { namespace Content
32 class _VideoContentInfoImpl;
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 physical file. @n
43 * Before getting the video content information, the ContentManager class must be used to create the content.
45 * 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>.
47 * The following example demonstrates how to use the %VideoContentInfo class.
51 * MyClass::TestVideoContentInfo(void)
53 * result r = E_SUCCESS;
55 * ContentId contentId;
56 * ContentManager contentManager;
57 * r = contentManager.Construct();
58 * TryReturn(!IsFailed(r), r, "Construct failed.");
60 * VideoContentInfo videoContentInfo;
61 * r = videoContentInfo.Construct(null);
62 * TryReturn(!IsFailed(r), r, "Construct failed.");
64 * Tizen::Base::String sourcePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/flower.wmv";
65 * Tizen::Base::String destPath = Tizen::System::Environment::GetMediaPath() + L"Videos/flower.wmv";
67 * contentId = contentManager.CreateContent(sourcePath, destPath, false, &videoContentInfo);
68 * TryReturn(Tizen::Base::UuId::GetInvalidUuId() != contentId, GetLastResult(), "CreateContent failed.");
74 class _OSP_EXPORT_ VideoContentInfo
75 : public Tizen::Content::ContentInfo
79 * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
83 * @remarks After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
85 VideoContentInfo(void);
88 * This destructor overrides Tizen::Base::Object::~Object().
92 virtual ~VideoContentInfo(void);
95 * Initializes this instance of %VideoContentInfo with the specified parameter.
98 * @brief <i> [Compatibility] </i>
102 * @compatibility This method has compatibility issues with OSP compatible applications. @n
103 * For more information, see @ref CompVideoContentInfoConstructPage "here".
106 * @return An error code
107 * @param[in] pContentPath The content path
108 * @exception E_SUCCESS The method is successful.
109 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
110 * @exception E_INVALID_ARG The specified input parameter is invalid.
111 * @exception E_OUT_OF_MEMORY The memory is insufficient.
112 * @exception E_IO An I/O error has occurred.
113 * @exception E_SYSTEM An internal error has occurred.
114 * @remarks The @c pContentPath should start with directory path returned by either Tizen::System::Environment::GetMediaPath() or Tizen::System::Environment::GetExternalStoragePath(). @n
115 * If @c pContentPath is @c null, use ContentManager::CreateContent(const Tizen::Base::ByteBuffer&, const Tizen::Base::String&, const ContentInfo*)
116 * or ContentManager::CreateContent(const Tizen::Base::String&, const Tizen::Base::String&, bool, const ContentInfo*).
118 result Construct(const Tizen::Base::String* pContentPath);
122 * @page CompVideoContentInfoConstructPage Compatibility for the file path.
123 * @section CompVideoContentInfoConstructPageIssueSection Issues
124 * The content path argument of this method in OSP compatible applications has the following issues: @n
125 * -# The content path should be a path that begins with an allowed path prefix. @n
126 * For example, L"/Media/Images/flower.jpg", L"/Storagecard/Media/Images/flower.jpg".
128 * @section CompVideoContentInfoConstructPageSolutionSection Resolutions
129 * This issue has been resolved in Tizen. @n
130 * -# The content path can be a path without a specific allowed path prefix. @n
131 * Application do not need to know the specific allowed path prefixes. @n
132 * To get the directory path, use the following methods: @n
133 * - For accessing the media directory, use Tizen::System::Environment::GetMediaPath().
134 * - For accessing the external storage, use Tizen::System::Environment::GetExternalStoragePath().
141 * Initializes this instance of %VideoContentInfo with the specified parameters.
143 * @brief <i> [Deprecated] </i>
144 * @deprecated This method is deprecated as there is a problem in managing the user-defined thumbnail and device coordinates. @n
145 * Instead of using this method, use Construct(const Tizen::Base::String*). @n
146 * To set the coordinates in the ContentInfo instance, use ContentInfo::SetCoordinates(const Tizen::Locations::Coordinates&).
149 * @return An error code
150 * @param[in] contentPath The content path
151 * @param[in] thumbnailPath The thumbnail path
152 * @param[in] setGps Set to @c true to save the device's last known coordinates in the ContentInfo instance, @n
154 * The coordinate information may be incorrect if it is outdated or has never been updated. @n
155 * To update the coordinate information or to get the exact value,
156 * use Tizen::Locations::LocationProvider::RequestLocationUpdates() before calling this method.
157 * @exception E_SUCCESS The method is successful.
158 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
159 * @exception E_INVALID_ARG The specified input parameter is invalid.
160 * @exception E_OUT_OF_MEMORY The memory is insufficient.
161 * @exception E_IO An I/O error has occurred.
162 * @remarks The content path must start with @c '/Media' or @c '/Storagecard/Media'. @n
163 * The thumbnail path must start with @c '/Home', @c '/Media', or @c '/Storagecard/Media'. @n
164 * The permitted format for a thumbnail image is bitmap (bmp).
167 virtual result Construct(const Tizen::Base::String& contentPath, const Tizen::Base::String& thumbnailPath = L"", bool setGps = false);
170 * Gets the genre of the video file.
174 * @return The genre of the video file, @n
175 * else @c Unknown if the value is empty
177 Tizen::Base::String GetGenre(void) const;
180 * Gets the artist of the video file.
184 * @return The artist of the video file, @n
185 * else @c Unknown if the value is empty
187 Tizen::Base::String GetArtist(void) const;
191 * Gets the bit rate of the video file.
193 * @brief <i> [Deprecated] </i>
194 * @deprecated This method is deprecated because a new method has been added. @n
195 * Instead of using this method, use GetAudioBitrate() or GetVideoBitrate().
198 * @return The bit rate in bits per second (bps)
199 * @remarks There are two kinds of bit rates in a video file: audio and video. @n
200 * The return value is the bit rate for the audio.
203 int GetBitrate(void) const;
206 * Gets the audio bit rate of the video file.
210 * @return The audio bit rate in bits per second (bps)
212 int GetAudioBitrate(void) const;
215 * Gets the video bit rate of the video file.
219 * @return The video bit rate in bits per second (bps)
221 int GetVideoBitrate(void) const;
224 * Gets the frame rate of the video file.
228 * @return The frame rate of the video file
230 int GetFramerate(void) const;
233 * Gets the width of the video file.
237 * @return The width of the video file
239 int GetWidth(void) const;
242 * Gets the height of the video file.
246 * @return The height of the video file
248 int GetHeight(void) const;
251 * Gets the title of the video file.
255 * @return The title of the video file, @n
256 * else @c Unknown if the value is empty
258 Tizen::Base::String GetTitle(void) const;
261 * Gets the album name of the video file.
265 * @return The album name of the video file, @n
266 * else @c Unknown if the value is empty
268 Tizen::Base::String GetAlbumName(void) const;
271 * Gets the duration of the video file.
275 * @return The duration of the video file in milliseconds
277 long GetDuration(void) const;
280 class _VideoContentData
293 , pAlbumName(null) {}
301 Tizen::Base::String* pArtist;
302 Tizen::Base::String* pGenre;
303 Tizen::Base::String* pTitle;
304 Tizen::Base::String* pAlbumName;
308 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
310 VideoContentInfo(const VideoContentInfo& rhs);
313 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
315 VideoContentInfo& operator =(const VideoContentInfo& rhs);
317 result SetVideoContentData(const _VideoContentData* pVideoContentData);
319 _VideoContentData* GetVideoContentData(void);
321 result GetVideoMetadata(void) const;
324 _VideoContentData* __pVideoContentData;
326 friend class _ContentManagerImpl;
327 friend class _ContentSearchImpl;
328 friend class _ContentDirectoryImpl;
329 friend class _ContentUtility;
330 friend class _PlayListManagerImpl;
331 friend class _PlayListImpl;
333 friend class _VideoContentInfoImpl;
334 _VideoContentInfoImpl* __pImpl;
336 }; // Class VideoContentInfo
340 #endif // _FCNT_VIDEO_CONTENT_INFO_H_