2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FMedia_RecorderUtil.h
20 * @brief This header file contains the declarations of the utility fuctions of recorder.
24 #ifndef _FMEDIA_INTERNAL_RECORDER_UTIL_H_
25 #define _FMEDIA_INTERNAL_RECORDER_UTIL_H_
28 #include <FMediaTypes.h>
29 #include <FMediaCameraTypes.h>
30 #include <FMediaRecorderTypes.h>
31 #include <FMediaAudioTypes.h>
32 #include "FMedia_CameraTypes.h"
34 namespace Tizen { namespace Media
37 * @class _RecorderUtil
38 * @brief This class is utility for recorder functionality.
42 : public Tizen::Base::Object
46 static result GetMmAudioCodec(CodecType value, recorder_audio_codec_e& mmAttr);
47 static result GetOspAudioCodec(recorder_audio_codec_e mmAttr, CodecType& value);
48 static result GetMmVideoCodec(CodecType value, recorder_video_codec_e& mmAttr);
49 static result GetOspVideoCodec(recorder_video_codec_e mmAttr, CodecType& value);
50 static result GetMmFileFormat(MediaContainerType value, recorder_file_format_e& mmAttr);
51 static result GetOspVideoContainer(recorder_file_format_e mmAttr, MediaContainerType& value);
52 static result GetOspAudioContainer(recorder_file_format_e mmAttr, MediaContainerType& value);
54 static result GetMmAudioQuality(CodecType audioCodec, RecordingQuality quality, int& mmAttrSamplerate, int& mmAttrChannel, int& mmAttrBitrate);
55 static result GetMmVideoQuality(_ResolutionType resolution, RecordingQuality quality, int& mmAttrBitrate);
57 static result GetMmRotation(RecordingRotation value, recorder_rotation_e& mmAttr);
58 static result GetOspRotation(recorder_rotation_e mmAttr, RecordingRotation& value);
60 static result GetRecorderRotation(CameraRotation cameraRotation, RecordingRotation& recorderRotation);
61 static result GetCameraRotation(RecordingRotation recorderRotation, CameraRotation& cameraRotation);
63 static bool CheckFormat(CodecType audioCodec, CodecType videoCodec, MediaContainerType container);
64 static result PrepareFile(const Tizen::Base::String &path, bool overwrite);
65 static AudioSampleType GetOspSampleType(audio_sample_type_e audioSampleType);
66 static AudioChannelType GetOspChannelType(int audioChannelType);
67 static int ConvertAudioSampleTypeToInt(AudioSampleType sampleType);
68 static int CalculateSampleRate(int size, int channel, int timeStamp, AudioSampleType sampleType);
74 _RecorderUtil(const _RecorderUtil& rhs);
75 _RecorderUtil& operator =(const _RecorderUtil& rhs);