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