Merge "seek expection handling bug" into tizen_2.2
[platform/framework/native/media.git] / src / FMediaVideoRecorder.cpp
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.cpp
20  * @brief                        This is the implementation file for the %VideoRecorder class.
21  */
22
23 #include <FMediaVideoRecorder.h>
24 #include <FBaseSysLog.h>
25 #include <FSec_AccessController.h>
26 #include "FMedia_VideoRecorderImpl.h"
27 #include "FMedia_CamPtrUtil.h"
28
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Security;
32
33 namespace Tizen { namespace Media
34 {
35
36 VideoRecorder::VideoRecorder(void)
37         : __pImpl(null)
38 {
39
40 }
41
42 VideoRecorder::~VideoRecorder(void)
43 {
44         if (__pImpl != null)
45         {
46                 delete __pImpl;
47         }
48 }
49
50 result
51 VideoRecorder::Construct(IVideoRecorderEventListener& listener, const Camera& camera)
52 {
53         SysAssertf(__pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
54         result r = E_SUCCESS;
55
56         std::unique_ptr <_VideoRecorderImpl> pImpl (new (std::nothrow) _VideoRecorderImpl());
57         SysTryReturn(NID_MEDIA, pImpl.get() != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.  The object is not created.");
58         r = pImpl->Construct(listener, camera);
59         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
60
61         __pImpl = pImpl.release();
62         return r;
63 }
64
65 result
66 VideoRecorder::CreateVideoFile(const Tizen::Base::String& mediaLocalPath, bool overwrite)
67 {
68         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
69         result r = E_SUCCESS;
70
71         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
72         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
73
74         r = __pImpl->CreateVideoFile(mediaLocalPath, overwrite);
75         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
76
77         return r;
78 }
79
80 result
81 VideoRecorder::AddAudioStreamFilter(IAudioStreamFilter& filter)
82 {
83         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
84         result r = E_SUCCESS;
85
86         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
87         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
88
89         r = __pImpl->AddAudioStreamFilter(filter);
90         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
91
92         return r;
93 }
94
95 result
96 VideoRecorder::RemoveAudioStreamFilter(IAudioStreamFilter& filter)
97 {
98         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
99         result r = E_SUCCESS;
100
101         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
102         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
103
104         r = __pImpl->RemoveAudioStreamFilter(filter);
105         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
106
107         return r;
108 }
109
110 result
111 VideoRecorder::Close(void)
112 {
113         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
114         result r = E_SUCCESS;
115
116         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
117         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
118
119         r = __pImpl->Close();
120         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
121
122         return r;
123 }
124
125 result
126 VideoRecorder::Record(void)
127 {
128         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
129         result r = E_SUCCESS;
130
131         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
132         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
133
134         r = __pImpl->Record();
135         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
136
137         return r;
138 }
139
140 result
141 VideoRecorder::Stop(void)
142 {
143         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
144         result r = E_SUCCESS;
145
146         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
147         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
148
149         r = __pImpl->Stop();
150         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
151
152         return r;
153 }
154
155 result
156 VideoRecorder::Pause(void)
157 {
158         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
159         result r = E_SUCCESS;
160
161         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
162         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
163
164         r = __pImpl->Pause();
165         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
166
167         return r;
168 }
169
170 result
171 VideoRecorder::Cancel(void)
172 {
173         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
174         result r = E_SUCCESS;
175
176         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
177         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
178
179         r = __pImpl->Cancel();
180         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
181
182         return r;
183 }
184
185 RecorderState
186 VideoRecorder::GetState(void) const
187 {
188         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
189         result r = E_SUCCESS;
190         RecorderState state = RECORDER_STATE_ERROR;
191         ClearLastResult();
192
193         state = __pImpl->GetState();
194         r = GetLastResult();
195         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
196
197         return state;
198
199 CATCH:
200         return (RecorderState) MEDIA_INVALID_VALUE;
201 }
202
203 long
204 VideoRecorder::GetRecordingTime(void) const
205 {
206         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
207         result r = E_SUCCESS;
208         long time = MEDIA_INVALID_VALUE;
209         ClearLastResult();
210
211         time = __pImpl->GetRecordingTime();
212         r = GetLastResult();
213         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
214
215         return time;
216
217 CATCH:
218         return MEDIA_INVALID_VALUE;
219 }
220
221 long
222 VideoRecorder::GetRecordingSize(void) const
223 {
224         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
225         result r = E_SUCCESS;
226         long size = MEDIA_INVALID_VALUE;
227         ClearLastResult();
228
229         size = __pImpl->GetRecordingSize();
230         r = GetLastResult();
231         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
232
233         return size;
234
235 CATCH:
236         return MEDIA_INVALID_VALUE;
237 }
238
239 result
240 VideoRecorder::SetMaxRecordingTime(long msTime)
241 {
242         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
243         result r = E_SUCCESS;
244
245         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
246         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
247
248         r = __pImpl->SetMaxRecordingTime(msTime);
249         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
250
251         return r;
252 }
253
254 long
255 VideoRecorder::GetMaxRecordingTime(void) const
256 {
257         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
258         result r = E_SUCCESS;
259         long time = MEDIA_INVALID_VALUE;
260         ClearLastResult();
261
262         time = __pImpl->GetMaxRecordingTime();
263         r = GetLastResult();
264         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
265
266         return time;
267
268 CATCH:
269         return MEDIA_INVALID_VALUE;
270 }
271
272 result
273 VideoRecorder::SetCodec(const Tizen::Base::String& codec)
274 {
275         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
276         result r = E_SUCCESS;
277         String realCodec;
278
279         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
280         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
281
282         r = __pImpl->SetCodec(codec);
283         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
284
285         return r;
286 }
287
288 Tizen::Base::String
289 VideoRecorder::GetCodec(void) const
290 {
291         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
292         result r = E_SUCCESS;
293         String codec;
294         ClearLastResult();
295
296         codec = __pImpl->GetCodec();
297         r = GetLastResult();
298         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
299
300         return codec;
301
302 CATCH:
303         codec.Clear();
304         return codec;
305 }
306
307 Tizen::Base::Collection::IList*
308 VideoRecorder::GetSupportedCodecListN(void) const
309 {
310         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
311         result r = E_SUCCESS;
312         ClearLastResult();
313
314         std::unique_ptr <IList, _ListPtrUtil::Remover> pCodecList (__pImpl->GetSupportedCodecListN(), _ListPtrUtil::remover);
315         SysTryReturn(NID_MEDIA, pCodecList.get() != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.  The object is not created.");
316         r = GetLastResult();
317         SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
318
319         return pCodecList.release();
320 }
321
322 result
323 VideoRecorder::SetFormat(VideoRecordingFormat format)
324 {
325         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
326         result r = E_SUCCESS;
327
328         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
329         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
330
331         r = __pImpl->SetFormat(format);
332         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
333
334         return r;
335 }
336
337 VideoRecordingFormat
338 VideoRecorder::GetFormat(void) const
339 {
340         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
341         result r = E_SUCCESS;
342         VideoRecordingFormat format = VIDEORECORDING_FORMAT_MP4;
343         ClearLastResult();
344
345         format = __pImpl->GetFormat();
346         r = GetLastResult();
347         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
348
349         return format;
350
351 CATCH:
352         return (VideoRecordingFormat) MEDIA_INVALID_VALUE;
353
354
355 }
356
357 result
358 VideoRecorder::SetFormat(CodecType audioCodec, CodecType videoCodec, MediaContainerType container)
359 {
360         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
361         result r = E_SUCCESS;
362
363         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
364         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
365
366         r = __pImpl->SetFormat(audioCodec, videoCodec, container);
367         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
368
369         return r;
370 }
371
372 result
373 VideoRecorder::GetFormat(CodecType& audioCodec, CodecType& videoCodec, MediaContainerType& container) const
374 {
375         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
376         result r = E_SUCCESS;
377
378         __pImpl->GetFormat(audioCodec, videoCodec, container);
379
380         return r;
381 }
382
383 Tizen::Base::Collection::IListT <CodecType>*
384 VideoRecorder::GetSupportedAudioCodecListN(void) const
385 {
386         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
387         result r = E_SUCCESS;
388         ClearLastResult();
389
390         std::unique_ptr <IListT<CodecType>, _ListPtrUtil::Remover> pDestList (__pImpl->GetSupportedAudioCodecListN());
391         r = GetLastResult();
392         SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
393
394         return pDestList.release();
395 }
396
397 Tizen::Base::Collection::IListT <CodecType>*
398 VideoRecorder::GetSupportedVideoCodecListN(void) const
399 {
400         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
401         result r = E_SUCCESS;
402         ClearLastResult();
403
404         std::unique_ptr <IListT<CodecType>, _ListPtrUtil::Remover> pDestList (__pImpl->GetSupportedVideoCodecListN());
405         r = GetLastResult();
406         SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
407
408         return pDestList.release();
409 }
410
411 Tizen::Base::Collection::IListT <MediaContainerType>*
412 VideoRecorder::GetSupportedContainerListN(void) const
413 {
414         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
415         result r = E_SUCCESS;
416         ClearLastResult();
417
418         std::unique_ptr <IListT<MediaContainerType>, _ListPtrUtil::Remover> pDestList (__pImpl->GetSupportedContainerListN());
419         r = GetLastResult();
420         SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
421
422         return pDestList.release();
423 }
424
425 result
426 VideoRecorder::SetMode(VideoRecorderMode mode)
427 {
428         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
429         result r = E_SUCCESS;
430
431         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
432         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
433
434         r = __pImpl->SetMode(mode);
435         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
436
437         return r;
438 }
439
440 VideoRecorderMode
441 VideoRecorder::GetMode(void) const
442 {
443         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
444         result r = E_SUCCESS;
445         VideoRecorderMode mode = VIDEORECORDER_MODE_VIDEO_WITH_AUDIO;
446         ClearLastResult();
447
448         mode = __pImpl->GetMode();
449         r = GetLastResult();
450         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
451
452         return mode;
453
454 CATCH:
455         return (VideoRecorderMode) MEDIA_INVALID_VALUE;
456 }
457
458 result
459 VideoRecorder::SetQuality(RecordingQuality quality)
460 {
461         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
462         result r = E_SUCCESS;
463
464         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
465         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
466
467         r = __pImpl->SetQuality(quality);
468         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
469
470         return r;
471 }
472
473 RecordingQuality
474 VideoRecorder::GetQuality(void) const
475 {
476         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
477         result r = E_SUCCESS;
478         RecordingQuality quality = RECORDING_QUALITY_LOW;
479         ClearLastResult();
480
481         quality = __pImpl->GetQuality();
482         r = GetLastResult();
483         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
484
485         return quality;
486
487 CATCH:
488         return (RecordingQuality) MEDIA_INVALID_VALUE;
489 }
490
491 result
492 VideoRecorder::SetRecordingResolution(const Tizen::Graphics::Dimension& resolution)
493 {
494         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
495         result r = E_SUCCESS;
496
497         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
498         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
499
500         r = __pImpl->SetRecordingResolution(resolution);
501         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
502
503         return r;
504 }
505
506 Tizen::Graphics::Dimension
507 VideoRecorder::GetRecordingResolution(void) const
508 {
509         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
510         result r = E_SUCCESS;
511         Tizen::Graphics::Dimension dimension;
512         ClearLastResult();
513
514         dimension = __pImpl->GetRecordingResolution();
515         r = GetLastResult();
516         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
517
518         return dimension;
519
520 CATCH:
521         return Tizen::Graphics::Dimension(0, 0);
522 }
523
524 Tizen::Base::Collection::IList*
525 VideoRecorder::GetSupportedRecordingResolutionListN(void) const
526 {
527         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
528         result r = E_SUCCESS;
529         ClearLastResult();
530
531         std::unique_ptr <IList, _ListPtrUtil::Remover> pResolutionList (__pImpl->GetSupportedRecordingResolutionListN(), _ListPtrUtil::remover);
532         r = GetLastResult();
533         SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
534
535         return pResolutionList.release();
536 }
537
538 int
539 VideoRecorder::GetSupportedMaxFrameRate(const Tizen::Graphics::Dimension& dim) const
540 {
541         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
542         result r = E_SUCCESS;
543         int maxFrameRate = MEDIA_INVALID_VALUE;
544         ClearLastResult();
545
546         maxFrameRate = __pImpl->GetSupportedMaxFrameRate(dim);
547         r = GetLastResult();
548         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
549
550
551         return maxFrameRate;
552
553 CATCH:
554         return MEDIA_INVALID_VALUE;
555 }
556
557 result
558 VideoRecorder::SetMute(bool mute)
559 {
560         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
561         result r = E_SUCCESS;
562
563         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
564         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
565
566         r = __pImpl->SetMute(mute);
567         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
568
569         return r;
570 }
571
572 bool
573 VideoRecorder::IsMuted(void) const
574 {
575         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
576         result r = E_SUCCESS;
577         bool mute = false;
578         ClearLastResult();
579
580         mute = __pImpl->IsMuted();
581         r = GetLastResult();
582         SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
583
584         return mute;
585
586 CATCH:
587         return false;
588 }
589
590 result
591 VideoRecorder::SetRecordingRotation(RecordingRotation rotation)
592 {
593         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
594         result r = E_SUCCESS;
595
596         r = _AccessController::CheckUserPrivilege(_PRV_VIDEORECORDER);
597         SysTryReturn(NID_MEDIA,  r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED]. This application does not have the privilege to call this method.");
598
599         r = __pImpl->SetRecordingRotation(rotation);
600         SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
601
602         return r;
603 }
604
605
606 RecordingRotation
607 VideoRecorder::GetRecordingRotation(void) const
608 {
609         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
610         RecordingRotation roation = RECORDING_ROTATION_NONE;
611
612         roation = __pImpl->GetRecordingRotation();
613         return roation;
614 }
615
616 }}// Osp::Media
617