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