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 public enum StreamRecorderError
32 InternalError = StreamRecorderErrorCode.InvalidOperation,
36 OutOfStorage = StreamRecorderErrorCode.OutOfStorage
40 /// Specifies the video source formats for <see cref="StreamRecorder"/>.
42 /// <since_tizen> 4 </since_tizen>
43 public enum StreamRecorderVideoFormat
59 #region Internal enums
62 /// Enumeration for Audio Codec.
64 internal enum StreamRecorderAudioCodec
81 /// Enumeration for the file container format.
83 internal enum StreamRecorderFileFormat
108 /// Enumeration for the recorder notify type.
110 internal enum StreamRecorderNotify
123 /// Enumeration for video codec.
125 internal enum StreamRecorderVideoCodec
138 /// Enumeration for source type.
140 internal enum StreamRecorderSourceType
156 internal static class StreamRecorderEnumExtensions
158 internal static RecorderVideoCodec ToRecorderEnum(this StreamRecorderVideoCodec value)
162 case StreamRecorderVideoCodec.H263:
163 return RecorderVideoCodec.H263;
165 case StreamRecorderVideoCodec.Mpeg4:
166 return RecorderVideoCodec.Mpeg4;
169 Debug.Fail("Unknown video codec value.");
173 internal static StreamRecorderVideoCodec ToStreamRecorderEnum(this RecorderVideoCodec value)
177 case RecorderVideoCodec.H263:
178 return StreamRecorderVideoCodec.H263;
180 case RecorderVideoCodec.Mpeg4:
181 return StreamRecorderVideoCodec.Mpeg4;
184 throw new NotSupportedException($"{value.ToString()} is not supported.");
188 internal static RecorderAudioCodec ToRecorderEnum(this StreamRecorderAudioCodec value)
192 case StreamRecorderAudioCodec.Aac:
193 return RecorderAudioCodec.Aac;
195 case StreamRecorderAudioCodec.Amr:
196 return RecorderAudioCodec.Amr;
198 case StreamRecorderAudioCodec.Pcm:
199 return RecorderAudioCodec.Pcm;
202 Debug.Fail("Unknown audio codec value.");
207 internal static StreamRecorderAudioCodec ToStreamRecorderEnum(this RecorderAudioCodec value)
211 case RecorderAudioCodec.Aac:
212 return StreamRecorderAudioCodec.Aac;
214 case RecorderAudioCodec.Amr:
215 return StreamRecorderAudioCodec.Amr;
217 case RecorderAudioCodec.Pcm:
218 return StreamRecorderAudioCodec.Pcm;
221 throw new NotSupportedException($"{value.ToString()} is not supported.");
225 internal static RecorderFileFormat ToRecorderEnum(this StreamRecorderFileFormat value)
229 case StreamRecorderFileFormat.ThreeGp:
230 return RecorderFileFormat.ThreeGp;
232 case StreamRecorderFileFormat.Mp4:
233 return RecorderFileFormat.Mp4;
235 case StreamRecorderFileFormat.Amr:
236 return RecorderFileFormat.Amr;
238 case StreamRecorderFileFormat.Adts:
239 return RecorderFileFormat.Adts;
241 case StreamRecorderFileFormat.Wav:
242 return RecorderFileFormat.Wav;
245 Debug.Fail("Unknown file format value.");
250 internal static StreamRecorderFileFormat ToStreamRecorderEnum(this RecorderFileFormat value)
254 case RecorderFileFormat.ThreeGp:
255 return StreamRecorderFileFormat.ThreeGp;
257 case RecorderFileFormat.Mp4:
258 return StreamRecorderFileFormat.Mp4;
260 case RecorderFileFormat.Amr:
261 return StreamRecorderFileFormat.Amr;
263 case RecorderFileFormat.Adts:
264 return StreamRecorderFileFormat.Adts;
266 case RecorderFileFormat.Wav:
267 return StreamRecorderFileFormat.Wav;
270 throw new NotSupportedException($"{value.ToString()} is not supported.");