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 /// <since_tizen> 4 </since_tizen>
27 [Obsolete("Deprecated in API10; Will be removed in API12")]
28 public enum StreamRecorderError
33 InternalError = StreamRecorderErrorCode.InvalidOperation,
37 OutOfStorage = StreamRecorderErrorCode.OutOfStorage
41 /// Specifies the video source formats for <see cref="StreamRecorder"/>.
43 /// <since_tizen> 4 </since_tizen>
44 [Obsolete("Deprecated in API10; Will be removed in API12")]
45 public enum StreamRecorderVideoFormat
61 #region Internal enums
64 /// Enumeration for Audio Codec.
66 internal enum StreamRecorderAudioCodec
83 /// Enumeration for the file container format.
85 internal enum StreamRecorderFileFormat
100 /// ADTS file format.
110 /// Enumeration for the recorder notify type.
112 internal enum StreamRecorderNotify
125 /// Enumeration for video codec.
127 internal enum StreamRecorderVideoCodec
140 /// Enumeration for source type.
142 internal enum StreamRecorderSourceType
158 internal static class StreamRecorderEnumExtensions
160 internal static RecorderVideoCodec ToRecorderEnum(this StreamRecorderVideoCodec value)
164 case StreamRecorderVideoCodec.H263:
165 return RecorderVideoCodec.H263;
167 case StreamRecorderVideoCodec.Mpeg4:
168 return RecorderVideoCodec.Mpeg4;
171 Debug.Fail("Unknown video codec value.");
175 internal static StreamRecorderVideoCodec ToStreamRecorderEnum(this RecorderVideoCodec value)
179 case RecorderVideoCodec.H263:
180 return StreamRecorderVideoCodec.H263;
182 case RecorderVideoCodec.Mpeg4:
183 return StreamRecorderVideoCodec.Mpeg4;
186 throw new NotSupportedException($"{value.ToString()} is not supported.");
190 internal static RecorderAudioCodec ToRecorderEnum(this StreamRecorderAudioCodec value)
194 case StreamRecorderAudioCodec.Aac:
195 return RecorderAudioCodec.Aac;
197 case StreamRecorderAudioCodec.Amr:
198 return RecorderAudioCodec.Amr;
200 case StreamRecorderAudioCodec.Pcm:
201 return RecorderAudioCodec.Pcm;
204 Debug.Fail("Unknown audio codec value.");
209 internal static StreamRecorderAudioCodec ToStreamRecorderEnum(this RecorderAudioCodec value)
213 case RecorderAudioCodec.Aac:
214 return StreamRecorderAudioCodec.Aac;
216 case RecorderAudioCodec.Amr:
217 return StreamRecorderAudioCodec.Amr;
219 case RecorderAudioCodec.Pcm:
220 return StreamRecorderAudioCodec.Pcm;
223 throw new NotSupportedException($"{value.ToString()} is not supported.");
227 internal static RecorderFileFormat ToRecorderEnum(this StreamRecorderFileFormat value)
231 case StreamRecorderFileFormat.ThreeGp:
232 return RecorderFileFormat.ThreeGp;
234 case StreamRecorderFileFormat.Mp4:
235 return RecorderFileFormat.Mp4;
237 case StreamRecorderFileFormat.Amr:
238 return RecorderFileFormat.Amr;
240 case StreamRecorderFileFormat.Adts:
241 return RecorderFileFormat.Adts;
243 case StreamRecorderFileFormat.Wav:
244 return RecorderFileFormat.Wav;
247 Debug.Fail("Unknown file format value.");
252 internal static StreamRecorderFileFormat ToStreamRecorderEnum(this RecorderFileFormat value)
256 case RecorderFileFormat.ThreeGp:
257 return StreamRecorderFileFormat.ThreeGp;
259 case RecorderFileFormat.Mp4:
260 return StreamRecorderFileFormat.Mp4;
262 case RecorderFileFormat.Amr:
263 return StreamRecorderFileFormat.Amr;
265 case RecorderFileFormat.Adts:
266 return StreamRecorderFileFormat.Adts;
268 case RecorderFileFormat.Wav:
269 return StreamRecorderFileFormat.Wav;
272 throw new NotSupportedException($"{value.ToString()} is not supported.");