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;
174 Debug.Fail("Unknown video codec value.");
178 internal static StreamRecorderVideoCodec ToStreamRecorderEnum(this RecorderVideoCodec value)
182 case RecorderVideoCodec.H263:
183 return StreamRecorderVideoCodec.H263;
185 case RecorderVideoCodec.Mpeg4:
186 return StreamRecorderVideoCodec.Mpeg4;
192 throw new NotSupportedException($"{value.ToString()} is not supported.");
196 internal static RecorderAudioCodec ToRecorderEnum(this StreamRecorderAudioCodec value)
200 case StreamRecorderAudioCodec.Aac:
201 return RecorderAudioCodec.Aac;
203 case StreamRecorderAudioCodec.Amr:
204 return RecorderAudioCodec.Amr;
206 case StreamRecorderAudioCodec.Pcm:
207 return RecorderAudioCodec.Pcm;
213 Debug.Fail("Unknown audio codec value.");
218 internal static StreamRecorderAudioCodec ToStreamRecorderEnum(this RecorderAudioCodec value)
222 case RecorderAudioCodec.Aac:
223 return StreamRecorderAudioCodec.Aac;
225 case RecorderAudioCodec.Amr:
226 return StreamRecorderAudioCodec.Amr;
228 case RecorderAudioCodec.Pcm:
229 return StreamRecorderAudioCodec.Pcm;
235 throw new NotSupportedException($"{value.ToString()} is not supported.");
239 internal static RecorderFileFormat ToRecorderEnum(this StreamRecorderFileFormat value)
243 case StreamRecorderFileFormat.ThreeGp:
244 return RecorderFileFormat.ThreeGp;
246 case StreamRecorderFileFormat.Mp4:
247 return RecorderFileFormat.Mp4;
249 case StreamRecorderFileFormat.Amr:
250 return RecorderFileFormat.Amr;
252 case StreamRecorderFileFormat.Adts:
253 return RecorderFileFormat.Adts;
255 case StreamRecorderFileFormat.Wav:
256 return RecorderFileFormat.Wav;
262 Debug.Fail("Unknown file format value.");
267 internal static StreamRecorderFileFormat ToStreamRecorderEnum(this RecorderFileFormat value)
271 case RecorderFileFormat.ThreeGp:
272 return StreamRecorderFileFormat.ThreeGp;
274 case RecorderFileFormat.Mp4:
275 return StreamRecorderFileFormat.Mp4;
277 case RecorderFileFormat.Amr:
278 return StreamRecorderFileFormat.Amr;
280 case RecorderFileFormat.Adts:
281 return StreamRecorderFileFormat.Adts;
283 case RecorderFileFormat.Wav:
284 return StreamRecorderFileFormat.Wav;
290 throw new NotSupportedException($"{value.ToString()} is not supported.");