Tizen 2.0 Release
[framework/osp/media.git] / src / FMedia_VideoFrameExtractorImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file   FMedia_VideoFrameExtractorImpl.h
20  * @brief  This is the header file for the %_VideoFrameExtractorImpl Implementation class.
21  *
22  * This header file contains the declarations of the %_VideoFrameExtractorImpl implementation class.
23  */
24
25 #ifndef _FMEDIA_VIDEO_FRAME_EXTRACTOR_IMPL_H_
26 #define _FMEDIA_VIDEO_FRAME_EXTRACTOR_IMPL_H_
27
28 #include <FBaseObject.h>
29 #include <FMediaImageBuffer.h>
30 #include <FMediaVideoFrameExtractor.h>
31
32 namespace Tizen { namespace Media {
33
34 class _VideoFrameExtractorImpl
35         : public Tizen::Base::Object
36 {
37 public:
38         /**
39          * @see  VideoFrameExtractor::VideoFrameExtractor()
40          */
41
42         _VideoFrameExtractorImpl(void);
43
44         /**
45          * @see  VideoFrameExtractor::~VideoFrameExtractor()
46          */
47         virtual ~_VideoFrameExtractorImpl(void);
48
49         /**
50          * @see  VideoFrameExtractor::Construct()
51          */
52         result Construct(const Tizen::Base::String &filePath, MediaPixelFormat pixelFormat);
53
54         /**
55          * @see  VideoFrameExtractor::GetWidth()
56          */
57         int GetWidth(void) const;
58
59         /**
60          * @see  VideoFrameExtractor::GetHeight()
61          */
62         int GetHeight(void) const;
63
64         /**
65          * @see  VideoFrameExtractor::GetDuration()
66          */
67         long GetDuration(void) const;
68
69         /**
70          * @see  VideoFrameExtractor::GetFrameN()
71          */
72         ImageBuffer* GetFrameN(long timestamp);
73
74         /**
75          * @see  VideoFrameExtractor::GetFrameN()
76          */
77         static ImageBuffer* GetFrameN(const Tizen::Base::String& path, MediaPixelFormat pixelFormat, long timestamp);
78
79         static _VideoFrameExtractorImpl* GetInstance(VideoFrameExtractor *pVideoFrameExtractor);
80         static const _VideoFrameExtractorImpl* GetInstance(const VideoFrameExtractor *pVideoFrameExtractor);
81
82         static  result ToResult(int ret);
83         static  result GetMetaDataValue(struct metadata_extractor_s*& extractor,int key, int &value);
84
85 private:
86
87         struct metadata_extractor_s* __extractor;
88         MediaPixelFormat __pixelFormat;
89         int __width;
90         int __height;
91         long __duration;
92 };
93
94
95 }} // Tizen::Media
96
97 #endif //_FMEDIA_VIDEO_FRAME_EXTRACTOR_IMPL_H_
98