2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Diagnostics;
20 namespace Tizen.Multimedia
24 /// Specifies errors for <see cref="StreamRecorder"/>/
26 public enum StreamRecorderError
31 InternalError = StreamRecorderErrorCode.InvalidOperation,
35 OutOfStorage = StreamRecorderErrorCode.OutOfStorage
39 /// Specifies the video source formats for <see cref="StreamRecorder"/>.
41 public enum StreamRecorderVideoFormat
57 #region Internal enums
60 /// Enumeration for Audio Codec.
62 internal enum StreamRecorderAudioCodec
79 /// Enumeration for the file container format.
81 internal enum StreamRecorderFileFormat
106 /// Enumeration for the recorder notify type.
108 internal enum StreamRecorderNotify
121 /// Enumeration for video codec.
123 internal enum StreamRecorderVideoCodec
136 /// Enumeration for source type.
138 internal enum StreamRecorderSourceType
154 internal static class StreamRecorderEnumExtensions
156 internal static RecorderVideoCodec ToRecorderEnum(this StreamRecorderVideoCodec value)
160 case StreamRecorderVideoCodec.H263:
161 return RecorderVideoCodec.H263;
163 case StreamRecorderVideoCodec.Mpeg4:
164 return RecorderVideoCodec.Mpeg4;
167 Debug.Fail("Unknown video codec value.");
171 internal static StreamRecorderVideoCodec ToStreamRecorderEnum(this RecorderVideoCodec value)
175 case RecorderVideoCodec.H263:
176 return StreamRecorderVideoCodec.H263;
178 case RecorderVideoCodec.Mpeg4:
179 return StreamRecorderVideoCodec.Mpeg4;
182 throw new NotSupportedException($"{value.ToString()} is not supported.");
186 internal static RecorderAudioCodec ToRecorderEnum(this StreamRecorderAudioCodec value)
190 case StreamRecorderAudioCodec.Aac:
191 return RecorderAudioCodec.Aac;
193 case StreamRecorderAudioCodec.Amr:
194 return RecorderAudioCodec.Amr;
196 case StreamRecorderAudioCodec.Pcm:
197 return RecorderAudioCodec.Pcm;
200 Debug.Fail("Unknown audio codec value.");
205 internal static StreamRecorderAudioCodec ToStreamRecorderEnum(this RecorderAudioCodec value)
209 case RecorderAudioCodec.Aac:
210 return StreamRecorderAudioCodec.Aac;
212 case RecorderAudioCodec.Amr:
213 return StreamRecorderAudioCodec.Amr;
215 case RecorderAudioCodec.Pcm:
216 return StreamRecorderAudioCodec.Pcm;
219 throw new NotSupportedException($"{value.ToString()} is not supported.");
223 internal static RecorderFileFormat ToRecorderEnum(this StreamRecorderFileFormat value)
227 case StreamRecorderFileFormat.ThreeGp:
228 return RecorderFileFormat.ThreeGp;
230 case StreamRecorderFileFormat.Mp4:
231 return RecorderFileFormat.Mp4;
233 case StreamRecorderFileFormat.Amr:
234 return RecorderFileFormat.Amr;
236 case StreamRecorderFileFormat.Adts:
237 return RecorderFileFormat.Adts;
239 case StreamRecorderFileFormat.Wav:
240 return RecorderFileFormat.Wav;
243 Debug.Fail("Unknown file format value.");
248 internal static StreamRecorderFileFormat ToStreamRecorderEnum(this RecorderFileFormat value)
252 case RecorderFileFormat.ThreeGp:
253 return StreamRecorderFileFormat.ThreeGp;
255 case RecorderFileFormat.Mp4:
256 return StreamRecorderFileFormat.Mp4;
258 case RecorderFileFormat.Amr:
259 return StreamRecorderFileFormat.Amr;
261 case RecorderFileFormat.Adts:
262 return StreamRecorderFileFormat.Adts;
264 case RecorderFileFormat.Wav:
265 return StreamRecorderFileFormat.Wav;
268 throw new NotSupportedException($"{value.ToString()} is not supported.");