Merge "remove Doxygen warning" into tizen_2.1
[platform/framework/native/media.git] / inc / FMediaVideoRecorder.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                        FMediaVideoRecorder.h
20  * @brief                       This is the header file for the %VideoRecorder class.
21  *
22  * This header file contains the declarations of the %VideoRecorder class.
23  */
24
25 #ifndef _FMEDIA_VIDEO_RECORDER_H_
26 #define _FMEDIA_VIDEO_RECORDER_H_
27
28 #include <FMediaVideoRecorderTypes.h>
29 #include <FMediaIVideoRecorderEventListener.h>
30 #include <FMediaCamera.h>
31 #include <FMediaTypes.h>
32
33 namespace Tizen { namespace Media
34 {
35
36 class _VideoRecorderImpl;
37 class IAudioStreamFilter;
38
39 /**
40  * @class       VideoRecorder
41  * @brief       This class records a video.
42  *
43  * @since               2.0
44  *
45  * The %VideoRecorder class provides video recording from the camera device. All the input sources must be
46  * controlled independently from the video recording operation. The supported codecs and resolutions are
47  * device-dependent and the available list can be retrieved using the methods available in this class.
48  * The recording operation is limited by the maximum time or size.
49  *
50  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/media/recording_video.htm">Recording Video</a>.
51  *
52  * The following example demonstrates how to use the %VideoRecorder class.
53  *
54  * @code
55  * #include <FBase.h>
56  * #include <FGraphics.h>
57  * #include <FUi.h>
58  * #include <FApp.h>
59  * #include <FMedia.h>
60  *
61  * using namespace Tizen::Base;
62  * using namespace Tizen::Graphics;
63  * using namespace Tizen::Ui;
64  * using namespace Tizen::Ui::Controls;
65  * using namespace Tizen::Media;
66  *
67  * class VideoRecorderSample
68  *     : public Tizen::Ui::Controls::Form
69  *     , public Tizen::Media::ICameraEventListener
70  *     , public Tizen::Media::IVideoRecorderEventListener
71  * {
72  * public:
73  *     VideoRecorderSample(void);
74  *     result Start(void);
75  *     void Stop(void);
76  *
77  * protected:
78  *     // ICameraEventListener
79  *     virtual void OnCameraAutoFocused(bool completeCondition) {}
80  *     virtual void OnCameraCaptured(Tizen::Base::ByteBuffer &capturedData, result r) {}
81  *     virtual void OnCameraErrorOccurred(CameraErrorReason err) {}
82  *     virtual void OnCameraPreviewed(Tizen::Base::ByteBuffer &previewedData, result r) {}
83  *
84  *     // IVideoRecorderEventListener
85  *     virtual void OnVideoRecorderCanceled(result r) {}
86  *     virtual void OnVideoRecorderClosed(result r) {}
87  *     virtual void OnVideoRecorderEndReached(RecordingEndCondition endCondition) {}
88  *     virtual void OnVideoRecorderErrorOccurred( RecorderErrorReason r) {}
89  *     virtual void OnVideoRecorderPaused(result r) {}
90  *     virtual void OnVideoRecorderStarted(result r) {}
91  *     virtual void OnVideoRecorderStopped(result r) {}
92  *
93  * private:
94  *     Camera __camera;
95  *     VideoRecorder __recorder;
96  *     OverlayRegion *__pOverlay;
97  * };
98  *
99  *
100  * VideoRecorderSample::VideoRecorderSample(void)
101  * {
102  *     __pOverlay = null;
103  * }
104  *
105  * result
106  * VideoRecorderSample::Start(void)
107  * {
108  *     result r = E_SUCCESS;
109  *     Tizen::Graphics::Rectangle rect(0, 0, 320, 240);
110  *     BufferInfo bufferInfo;
111  *     String filePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/test.mp4";
112  *
113  *     __pOverlay = GetOverlayRegionN(rect, OVERLAY_REGION_TYPE_PRIMARY_CAMERA);
114  *     if (__pOverlay == null)
115  *     {
116  *         return GetLastResult();
117  *     }
118  *
119  *      __pOverlay->GetBackgroundBufferInfo(bufferInfo);
120  *
121  *      r = __camera.Construct(*this);
122  *      if (IsFailed(r))
123  *     {
124  *          goto CATCH;
125  *     }
126  *
127  *      r = __camera.PowerOn();
128  *      if (IsFailed(r))
129  *     {
130  *          goto CATCH;
131  *     }
132  *
133  *      r = __recorder.Construct(*this, __camera);
134  *      if (IsFailed(r))
135  *     {
136  *          goto CATCH;
137  *     }
138  *
139  *      r = __camera.StartPreview(&bufferInfo, false);
140  *      if (IsFailed(r))
141  *     {
142  *          goto CATCH;
143  *     }
144  *
145  *      r = __recorder.CreateVideoFile(filePath, true);
146  *      if (IsFailed(r))
147  *     {
148  *          goto CATCH;
149  *     }
150  *
151  *      r = __recorder.Record();
152  *      if (IsFailed(r))
153  *     {
154  *          goto CATCH;
155  *     }
156  *
157  *      return E_SUCCESS;
158  *
159  * CATCH:
160  *      if (__pOverlay)
161  *      {
162  *          delete __pOverlay;
163  *          __pOverlay = null;
164  *      }
165  *      return r;
166  * }
167  *
168  * void
169  * VideoRecorderSample::Stop(void)
170  * {
171  *     __recorder.Stop();
172  *     __camera.StopPreview();
173  *     __camera.PowerOff();
174  *     if (__pOverlay)
175  *     {
176  *         delete __pOverlay;
177  *         __pOverlay = null;
178  *     }
179  * }
180  *
181  *
182  * @endcode
183  *
184  */
185 class _OSP_EXPORT_ VideoRecorder
186         : public Tizen::Base::Object
187 {
188 public:
189         /**
190          * This is the default constructor for this class.
191          *
192          * @since               2.0
193          *
194          * @remarks     The object is not fully constructed after this constructor is called. For full construction,
195          * the Construct() method must be called right after calling this constructor.
196          */
197         VideoRecorder(void);
198
199         /**
200          * This is the destructor for this class. @n
201          * All allocated resources are deallocated by this method. This method must be called in the same thread in
202          * which the Construct() method is called.This polymorphic destructor should be overridden if required. This way,
203          * the destructors of the derived classes are called when the destructor of this interface is called.
204          *
205          * @since               2.0
206          *
207          */
208         virtual ~VideoRecorder(void);
209
210         /**
211         * Initializes this instance of %VideoRecorder with an associated listener and an input source.
212         *
213         * @since                2.0
214         *
215         * @return               An error code
216         * @param[in]    listener                        An event listener object
217         * @param[in]    camera                          A Camera object for the input source
218         * @exception    E_SUCCESS                       The method is successful.
219         * @exception    E_SYSTEM                        A system error has occurred.
220         * @exception    E_OUT_OF_MEMORY The memory is insufficient.
221         * @exception    E_DEVICE_BUSY           The recorder is under use by other application or already used in this application.
222         * @exception    E_UNSUPPORTED_OPERATION This video recorder usage is not supported.
223         */
224         result Construct(IVideoRecorderEventListener& listener, const Camera& camera);
225
226         /**
227         * Creates a video file for a recording.
228         *
229         * @if OSPCOMPAT
230         * @brief <i> [Compatibility] </i>
231         * @endif
232         * @since                2.0
233         * @if OSPCOMPAT
234         * @compatibility        This method has compatibility issues with OSP compatible applications. @n
235         *                                       For more information, see @ref CompIoPathPage "here".
236         * @endif
237         * @privlevel        public
238         * @privilege    %http://tizen.org/privilege/videorecorder
239         *
240         * @return               An error code
241         * @param[in]    destMediaPath                           The destination for the file that is written @n
242         *                                                                               The available paths start with prefixes retrieved from the functions such as: @n
243         *                                                                                       Tizen::App::App::GetInstance()->GetAppRootPath() @n
244         *                                                                                       Tizen::System::Environment::GetMediaPath() @n
245         *                                                                                       Tizen::System::Environment::GetExternalStoragePath()
246         * @param[in]    overwrite                       Set to @c true to overwrite the file, @n
247         *                                                                                       else @c false
248         * @exception    E_SUCCESS                                       The method is successful.
249         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
250         * @exception    E_RESOURCE_UNAVAILABLE          The required file path is unavailable.
251         * @exception    E_FILE_ALREADY_EXIST            The specified file already exists.
252         * @exception    E_STORAGE_FULL                          The storage is full.
253         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
254         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
255         * @remarks              The application can register newly created files into the Contents database using Tizen::Content::ContentManager::CreateContent().
256         * @see          Close()
257         */
258         result CreateVideoFile(const Tizen::Base::String& destMediaPath, bool overwrite);
259
260         /**
261         * Closes the video file. @n
262         * The %Close() method is a synchronous method.
263         *
264         * @since                2.0
265         * @privlevel        public
266         * @privilege    %http://tizen.org/privilege/videorecorder
267         *
268         * @return               An error code
269         * @exception    E_SUCCESS                               The method is successful.
270         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
271         * @exception    E_SYSTEM                                A system error has occurred.
272         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
273         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
274         * @see                  CreateVideoFile()
275         */
276         result Close(void);
277
278         /**
279         * Records the video file. @n
280         * Resumes the recording if Pause() has been called.
281         *
282         * @since                2.0
283         * @privlevel        public
284         * @privilege    %http://tizen.org/privilege/videorecorder
285         *
286         * @return               An error code
287         * @exception    E_SUCCESS                               The method is successful.
288         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
289         * @exception    E_SYSTEM                                A system error has occurred.
290         * @exception    E_DEVICE_BUSY                   The recorder is under use by other application.
291         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
292         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
293         * @remarks      This method must be called after the input media source is started (for example, Camera::StartPreview()).
294         * @see                  Stop()
295         */
296         result Record(void);
297
298         /**
299         * Stops the recording.
300         *
301         * @since                2.0
302         * @privlevel        public
303         * @privilege    %http://tizen.org/privilege/videorecorder
304         *
305         * @return               An error code
306         * @exception    E_SUCCESS                               The method is successful.
307         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
308         * @exception    E_SYSTEM                                A system error has occurred.
309         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
310         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
311         * @see                  Record()
312         * @see                  Pause()
313         */
314         result Stop(void);
315
316         /**
317         * Pauses the recording. @n
318         * To resume the recording after the %Pause() method is called, Record() must be called.
319         *
320         * @since                2.0
321         * @privlevel        public
322         * @privilege    %http://tizen.org/privilege/videorecorder
323         *
324         * @return               An error code
325         * @exception    E_SUCCESS                               The method is successful.
326         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
327         * @exception    E_SYSTEM                                A system error has occurred.
328         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
329         * @exception    E_PRIVILEGE_DENIED          The application does not have the privilege to call this method.
330         * @see                  Stop()
331         */
332         result Pause(void);
333
334         /**
335         * Cancels the recording operation without saving the data.
336         *
337         * @since                2.0
338         * @privlevel        public
339         * @privilege    %http://tizen.org/privilege/videorecorder
340         *
341         * @return               An error code
342         * @exception    E_SUCCESS                               The method is successful.
343         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
344         * @exception    E_SYSTEM                                A system error has occurred.
345         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
346         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
347         * @remarks              When this method is called, the state is changed to ::RECORDER_STATE_STOPPING. @n
348         *                               After IVideoRecorderEventListener::OnVideoRecorderCanceled() is called, the state is changed to
349         *                               @c RECORDER_STATE_STOPPED.
350         * @see                  Record()
351         * @see                  Stop()
352         */
353         result Cancel(void);
354
355         /**
356         * Gets the state of a recorder.
357         *
358         * @since                2.0
359         *
360         * @return               The current state of the video recorder
361         * @see                  CreateVideoFile()
362         * @see                  Close()
363         * @see                  Record()
364         * @see                  Stop()
365         * @see                  Pause()
366         * @see                  RecorderState
367         */
368         RecorderState GetState(void) const;
369
370         /**
371         * Gets the current recording time.
372         *
373         * @since                2.0
374         *
375         * @return               The current recording time in milliseconds, @n
376         *                               else @c -1 if the recording has not started as yet
377         */
378         long GetRecordingTime(void) const;
379
380         /**
381         * Gets the current recording size.
382         *
383         * @since                2.0
384         *
385         * @return               A @c long value indicating the current recording size in bytes, @n
386         *                               else @c -1 if the recording has not started as yet
387         */
388         long GetRecordingSize(void) const;
389
390         /**
391         * Sets the time limit for the recording in milliseconds.
392         *
393         * @since                2.0
394         * @privlevel        public
395         * @privilege    %http://tizen.org/privilege/videorecorder
396         *
397         * @return               An error code
398         * @param[in]    msTime                          The maximum recording time in milliseconds @n
399         *                                                                       The time must be greater than @c 0.
400         * @exception    E_SUCCESS                       The method is successful.
401         * @exception    E_INVALID_STATE         This instance is in an invalid state for this method.
402         * @exception    E_OUT_OF_RANGE          The specified time is out of range.
403         * @exception    E_OUT_OF_MEMORY         The memory is insufficient.
404         * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
405         * @remarks              The default time is @c 60 seconds.
406         * @see                  GetMaxRecordingTime()
407         */
408         result SetMaxRecordingTime(long msTime);
409
410         /**
411         * Gets the time limit of the recording in milliseconds.
412         *
413         * @since                2.0
414         *
415         * @return               A @c long value indicating the maximum recording time in milliseconds, @n
416         *                               else @c -1 if the recording has not started as yet
417         * @see                  SetMaxRecordingTime()
418         */
419         long GetMaxRecordingTime(void) const;
420
421         /**
422         * @if OSPDEPREC
423         * Sets the codec for the recorder. @n
424         * Initially, the default codec from the internal configuration is set.
425         *
426         * @brief <i> [Deprecated]  </i>
427         * @deprecated   This method is deprecated. @n
428         * Instead of using this method, use the SetFormat(CodecType audioCodec, CodecType videoCodec, MediaContainerType container) method that
429         * sets the audio/video codec and container together.
430         * @since                2.0
431         * @privlevel        public
432         * @privilege    %http://tizen.org/privilege/videorecorder
433         *
434         * @return               An error code
435         * @param[in]    codec                                   The codec name @n
436         *                                                                               It must be one of the strings listed by GetSupportedCodecListN(). @n
437         *                                                                               GetSupportedCodecListN() returns the list of strings in the following formats: @n
438         *                                                                               - "VIDEO_CODEC_H263" @n
439         *                                                                               - "VIDEO_CODEC_MPEG4SP" @n
440         *                                                                               The returned strings are different depending on each device. @n
441         *                                                                               The following string is always operated upon. This value is different
442         *                                                                               for each device. @n
443         *                                                                               "VIDEO_CODEC_DEFAULT": the default codec
444         * @exception    E_SUCCESS                               The method is successful.
445         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
446         * @exception    E_UNSUPPORTED_CODEC             The specified codec is not supported.
447         * @exception    E_SYSTEM                                A system error has occurred.
448         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
449         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
450         * @see                  GetCodec()
451         * @endif
452         */
453         result SetCodec(const Tizen::Base::String& codec);
454
455         /**
456         * @if OSPDEPREC
457         * Gets the codec for the recorder.
458         *
459         * @brief <i> [Deprecated]  </i>
460         * @deprecated   This method is deprecated. @n
461             * Instead of using this method, use the GetFormat(CodecType& audioCodec, CodecType& videoCodec, MediaContainerType& container) const
462         * method that gets the audio/video codec and container together.
463         * @since                2.0
464         *
465         * @return               The current codec
466         * @see                  SetCodec()
467         * @see                  GetSupportedCodecListN()
468         * @endif
469         */
470         Tizen::Base::String GetCodec(void) const;
471
472         /**
473         * @if OSPDEPREC
474         * Gets the list of supported video recorder codecs. @n
475         * Each item in the list is a Tizen::Base::String value.
476         *
477         * @brief <i> [Deprecated]  </i>
478         * @deprecated   This method is deprecated. @n
479         * Instead of using this method, use the GetSupportedAudioCodecListN() and GetSupportedVideoCodecListN() methods.
480         * @since                2.0
481         *
482         * @return       The list of strings that represents the supported video recorder codecs, @n
483         *                               else @c null if no codec is supported or if an exception occurs
484         * @exception    E_SUCCESS                                       The method is successful.
485         * @exception    E_SYSTEM                                        A system error has occurred.
486         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
487         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
488         *               The return value must be released by the caller. @n
489         *               All items in the list must be released by the caller.
490         * @see                  SetCodec()
491         * @see                  GetCodec()
492         * @endif
493         */
494         Tizen::Base::Collection::IList* GetSupportedCodecListN(void) const;
495
496         /**
497         * Gets the list of supported audio codecs. @n
498         * Each item in the list has a ::CodecType value.
499         *
500         * @since                2.0
501         *
502         * @return       A list of supported audio codecs, @n
503         *                               else @c null if no codec is supported or if an exception occurs
504         * @exception    E_SUCCESS                       The method is successful.
505         * @exception    E_SYSTEM                        A system error has occurred.
506         * @exception    E_OUT_OF_MEMORY         The memory is insufficient.
507         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
508         *               The return value must be released by the caller.
509         * @see                  SetFormat( CodecType audioCodec, CodecType videoCodec, MediaContainerType container )
510         * @see                  GetFormat( CodecType& audioCodec, CodecType& videoCodec, MediaContainerType& container ) const
511         */
512         Tizen::Base::Collection::IListT <CodecType>* GetSupportedAudioCodecListN(void) const;
513
514         /**
515         * Gets the list of supported video codecs. @n
516         * Each item in the list has a ::CodecType value.
517         *
518         * @since                2.0
519         *
520         * @return       A list of supported video codecs, @n
521         *                               else @c null if no codec is supported or if an exception occurs
522         * @exception    E_SUCCESS                               The method is successful.
523         * @exception    E_SYSTEM                                A system error has occurred.
524         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
525         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
526         *               The return value must be released by the caller.
527         * @see                  SetFormat( CodecType audioCodec, CodecType videoCodec, MediaContainerType container )
528         * @see                  GetFormat( CodecType& audioCodec, CodecType& videoCodec, MediaContainerType& container ) const
529         */
530         Tizen::Base::Collection::IListT <CodecType>* GetSupportedVideoCodecListN(void) const;
531
532         /**
533         * Gets the list of supported containers. @n
534         * Each item in the list has a ::MediaContainerType value.
535         *
536         * @since                2.0
537         *
538         * @return       A list of supported containers, @n
539         *                               else @c null if no container is supported or if an exception occurs
540         * @exception    E_SUCCESS                               The method is successful.
541         * @exception    E_SYSTEM                                A system error has occurred.
542         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
543         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
544         *               The return value must be released by the caller.
545         * @see                  SetFormat( CodecType audioCodec, CodecType videoCodec, MediaContainerType container )
546         * @see                  GetFormat( CodecType& audioCodec, CodecType& videoCodec, MediaContainerType& container ) const
547         */
548         Tizen::Base::Collection::IListT <MediaContainerType>* GetSupportedContainerListN(void) const;
549
550         /**
551         * @if OSPDEPREC
552         * Sets the video format of the recorder. @n
553         * Initially, the default format from internal configuration is set.
554         *
555         * @brief <i> [Deprecated]  </i>
556         * @deprecated   This method is deprecated. @n
557         * Instead of using this method, use the SetFormat(CodecType audioCodec, CodecType videoCodec, MediaContainerType container) method that sets
558         * the audio/video codec and container together.
559         * @since                2.0
560         * @privlevel        public
561         * @privilege    %http://tizen.org/privilege/videorecorder
562         *
563         * @return               An error code
564         * @param[in]    format                                  The video format @n
565         *                                                                               ::VIDEORECORDING_FORMAT_DEFAULT sets the system's default recording format.
566         * @exception    E_SUCCESS                               The method is successful.
567         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
568         * @exception    E_UNSUPPORTED_FORMAT    The specified format is not supported.
569         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
570         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
571         * @see                  GetFormat()
572         * @endif
573         */
574         result SetFormat(VideoRecordingFormat format);
575
576         /**
577         * @if OSPDEPREC
578         * Gets the current format that has been set for the recorder.
579         *
580         * @brief <i> [Deprecated]  </i>
581         * @deprecated   This method is deprecated. @n
582         * Instead of using this method, use the GetFormat(CodecType& audioCodec, CodecType& videoCodec, MediaContainerType& container) const method
583         * that gets the audio/video codec and container together.
584         * @since                2.0
585         *
586         * @return               The current video format, @n
587         *               else the default format if SetFormat() is not called before this method
588         * @see                  SetFormat()
589         * @endif
590         */
591         VideoRecordingFormat GetFormat(void) const;
592
593         /**
594         * @if OSPDEPREC
595         * Sets the mode of the recorder.
596         *
597         * @brief <i> [Deprecated]  </i>
598         * @deprecated   This method is deprecated. @n
599         * Instead of using this method, use the SetFormat(CodecType audioCodec, CodecType videoCodec, MediaContainerType container) method that
600         * determines whether the video recorder includes the audio codec.
601         * @since                2.0
602         * @privlevel        public
603         * @privilege    %http://tizen.org/privilege/videorecorder
604         *
605         * @return               An error code
606         * @param[in]    mode                            The mode for the recording @n
607         *                                                                       The default mode is ::VIDEORECORDER_MODE_VIDEO_WITH_AUDIO.
608         * @exception    E_SUCCESS                       The method is successful.
609         * @exception    E_INVALID_STATE         This instance is in an invalid state for this method.
610         * @exception    E_INVALID_ARG           The specified @c mode is not supported.
611         * @exception    E_OUT_OF_MEMORY         The memory is insufficient.
612         * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
613         * @see                  GetMode()
614         * @endif
615         */
616         result SetMode(VideoRecorderMode mode);
617
618         /**
619         * @if OSPDEPREC
620         * Gets the mode of the recorder.
621         *
622         * @brief <i> [Deprecated]  </i>
623         * @deprecated   This method is deprecated. @n
624         * Instead of using this method, use the GetFormat(CodecType& audioCodec, CodecType& videoCodec, MediaContainerType& container) const
625         * method that determines whether the video recorder includes the audio codec.
626         * @since                2.0
627         *
628         * @return               The current mode
629         * @see                  SetMode()
630         * @endif
631         */
632         VideoRecorderMode GetMode(void) const;
633
634         /**
635         * Sets the audio and video codecs, and the container of the recorder. @n
636         * Initially, the default codec and container format are set with the internal configuration.
637         *
638         * @since                2.0
639         * @privlevel        public
640         * @privilege    %http://tizen.org/privilege/videorecorder
641         *
642         * @return               An error code
643         * @param[in]    audioCodec                              The audio codec to set @n
644         *                                                                               ::CODEC_NONE makes the audio stream empty.
645         * @param[in]    videoCodec                              The video codec to set @n
646         *                                                                               ::CODEC_NONE cannot be set.
647         * @param[in]    container                               The media container to set
648         * @exception    E_SUCCESS                               The method is successful.
649         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
650         * @exception    E_UNSUPPORTED_CODEC             The specified codec is not supported.
651         * @exception    E_UNSUPPORTED_FORMAT    The specified container format is not supported.
652         * @exception    E_SYSTEM                                A system error has occurred.
653         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
654         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
655         * @remarks              If the audio codec is ::CODEC_NONE, the audio will be ignored, and only the video stream will be recorded. @n
656         *                               If the specified container does not support the specified codec, @c E_UNSUPPORTED_FORMAT may be returned.
657         * @see                  GetFormat( CodecType& audioCodec, CodecType& videoCodec, MediaContainerType& container ) const
658         */
659         result SetFormat(CodecType audioCodec, CodecType videoCodec, MediaContainerType container);
660
661         /**
662         * Gets the audio and video codecs, and the container of the recorder.
663         *
664         * @since                2.0
665         *
666         * @return               An error code
667         * @param[out]   audioCodec                      The retrieved audio codec
668         * @param[out]   videoCodec                      The retrieved video codec
669         * @param[out]   container                       The retrieved container
670         * @exception    E_SUCCESS                       The method is successful.
671         * @remarks              The default codecs and container are retrieved, if SetFormat( CodecType audioCodec, CodecType
672         *                               videoCodec, MediaContainerType container) is not called before calling this method. @n
673         *                               This method always returns E_SUCCESS.
674         * @see                  SetFormat( CodecType audioCodec, CodecType videoCodec, MediaContainerType container )
675         */
676         result GetFormat(CodecType& audioCodec, CodecType& videoCodec, MediaContainerType& container) const;
677
678         /**
679         * Sets the quality of the recorder.
680         *
681         * @since                2.0
682         * @privlevel        public
683         * @privilege    %http://tizen.org/privilege/videorecorder
684         *
685         * @return               An error code
686         * @param[in]    quality                         The quality of the recorder @n
687         *                                                                       The default quality is ::RECORDING_QUALITY_MEDIUM.
688         * @exception    E_SUCCESS                       The method is successful.
689         * @exception    E_INVALID_STATE         This instance is in an invalid state for this method.
690         * @exception    E_INVALID_ARG           The specified @c quality is not supported.
691         * @exception    E_OUT_OF_MEMORY         The memory is insufficient.
692         * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
693         * @see                  GetQuality()
694         */
695         result SetQuality(RecordingQuality quality);
696
697         /**
698         * Gets the quality of the recorder.
699         *
700         * @since                2.0
701         *
702         * @return               The current quality
703         * @see                  SetQuality()
704         */
705         RecordingQuality GetQuality(void) const;
706
707         /**
708         * Sets the recording resolution of the recorder. @n
709         * Initially, the default resolution from the internal configuration is set.
710         *
711         * @since                2.0
712         * @privlevel        public
713         * @privilege    %http://tizen.org/privilege/videorecorder
714         *
715         * @return               An error code
716         * @param[in]    resolution                      The recording resolution @n
717         *                                                                       It must be one of the listed strings extracted from
718         *                                                                       GetSupportedRecordingResolutionListN().
719         * @exception    E_SUCCESS                       The method is successful.
720         * @exception    E_INVALID_STATE         This instance is in an invalid state for this method.
721         * @exception    E_OUT_OF_RANGE          The specified resolution is out of range.
722         * @exception    E_SYSTEM                        A system error has occurred.
723         * @exception    E_OUT_OF_MEMORY         The memory is insufficient.
724         * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
725         * @remarks              If the input source is Tizen::Media::Camera, its preview resolution value must be same as that
726         *                               of this recording resolution.
727         * @see                  GetRecordingResolution()
728         */
729         result SetRecordingResolution(const Tizen::Graphics::Dimension& resolution);
730
731         /**
732         * Gets the recording resolution.
733         *
734         * @since                2.0
735         *
736         * @return               The recording resolution
737         * @see                  GetSupportedRecordingResolutionListN()
738         */
739         Tizen::Graphics::Dimension GetRecordingResolution(void) const;
740
741         /**
742         * Gets a list of the supported video recorder resolutions. @n
743         * Each list item is a Tizen::Graphics::Dimension value.
744         *
745         * @since                2.0
746         *
747         * @return               A list of strings representing the supported video recorder resolutions, @n
748         *                               else an empty list if no recording resolution is supported or if an exception occurs
749         * @exception    E_SUCCESS                               The method is successful.
750         * @exception    E_SYSTEM                                A system error has occurred.
751         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
752         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
753         *                               The return value must be released by the calling method. @n
754         *                               All items in the list must be released by the calling method.
755         * @see                  SetRecordingResolution()
756         * @see                  GetRecordingResolution()
757         */
758         Tizen::Base::Collection::IList* GetSupportedRecordingResolutionListN(void) const;
759
760         /**
761         * Gets the maximum supported frame rate of the input resolution.
762         *
763         * @since                2.0
764         *
765         * @return               The maximum frame rate of the input recording resolution
766         * @param[in]    dim                                             The preview resolution of the source
767         * @exception    E_SUCCESS                               The method is successful.
768         * @exception    E_INVALID_ARG                   The specified input resolution is invalid.
769         * @exception    E_SYSTEM                                A system error has occurred.
770         * @remarks              The specific error code can be accessed using the GetLastResult method.
771         * @see                  Camera::SetPreviewFrameRate()
772         */
773         int GetSupportedMaxFrameRate(const Tizen::Graphics::Dimension& dim) const;
774
775         /**
776         * Sets the mute state of a recorder.
777         *
778         * @since                2.0
779         * @privlevel        public
780         * @privilege    %http://tizen.org/privilege/videorecorder
781         *
782         * @return               An error code
783         * @param[in]    mute                Set to @c true to enable the mute state of the recorder, @n
784         *                                                                       else @c false
785         *                                   By default, the mute state is disabled.
786         * @exception    E_SUCCESS                       The method is successful.
787         * @exception    E_INVALID_STATE         This instance is in an invalid state for this method.
788         * @exception    E_OUT_OF_MEMORY         The memory is insufficient.
789         * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
790         * @remarks              The recording continues even in the mute state.
791         * @see                  IsMuted()
792         */
793         result SetMute(bool mute);
794
795         /**
796         * Checks whether the mute state of the recorder is enabled.
797         *
798         * @since                2.0
799         *
800         * @return               The mute state of the recorder
801         * @see                  SetMute()
802         */
803         bool IsMuted(void) const;
804
805         /**
806         * Sets the recording rotation of the recorder.
807         *
808         * @since                2.0
809         * @privlevel        public
810         * @privilege    %http://tizen.org/privilege/videorecorder
811         *
812         * @return               An error code
813         * @param[in]    rotation                        The rotation of the recorder
814         * @exception    E_SUCCESS                       The method is successful.
815         * @exception    E_INVALID_STATE         This method is invalid for the current state of this instance.
816         * @exception    E_INVALID_ARG           The specified @c rotation is not supported.
817         * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
818         * @remarks              This method add the rotation information to the video file.
819         *                     A video player can rotate the surface or the stream using this information to display correctly.
820         * @see                  GetRecordingRotation()
821         */
822         result SetRecordingRotation(RecordingRotation rotation);
823
824         /**
825         * Gets the rotation of the recorder.
826         *
827         * @since                2.0
828         *
829         * @return               The current recording rotation
830         * @see                  SetRecordingRotation()
831         */
832         RecordingRotation GetRecordingRotation(void) const;
833
834         /**
835         * Adds a stream filter to process the audio stream data while recording.
836         *
837         * @since                2.1
838         * @privlevel    public
839         * @privilege    %http://tizen.org/privilege/videorecorder
840         *
841         * @return               An error code
842         * @param[in]    filter                  An instance of IAudioStreamFilter
843         * @exception    E_SUCCESS                       The method is successful.
844         * @exception    E_OBJ_ALREADY_EXIST     The filter already exists.
845         * @exception    E_OUT_OF_MEMORY     The memory is insufficient.
846         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
847         * @remarks IAudioStreamFilter::ProcessAudioStream() is called when the audio frame is ready.
848         */
849         result AddAudioStreamFilter(IAudioStreamFilter& filter);
850
851         /**
852         * Removes a stream filter to stop processing the audio stream data.
853         *
854         * @since                2.1
855         * @privlevel    public
856         * @privilege    %http://tizen.org/privilege/videorecorder
857         *
858         * @return               An error code
859         * @param[in]    filter                  An instance of IAudioStreamFilter
860         * @exception    E_SUCCESS                       The method is successful.
861         * @exception    E_OBJ_NOT_FOUND        The filter is not found.
862         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
863         */
864         result RemoveAudioStreamFilter(IAudioStreamFilter& filter);
865
866 private:
867         /**
868          * This is the copy constructor for this class.
869          *
870          * @since               2.0
871          *
872          * @remarks         The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
873          * @see                 Construct()
874          */
875         VideoRecorder(const VideoRecorder& videoRecorder);
876         /**
877          * This is the copy assignment operator for this class.
878          *
879          * @since               2.0
880          *
881          * @remarks         The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
882          *
883          */
884         VideoRecorder& operator =(const VideoRecorder& videoRecorder);
885
886         friend class _VideoRecorderImpl;
887         _VideoRecorderImpl* __pImpl;
888 };
889
890 }}// Tizen::Media
891
892 #endif