{
private static NativeHandle CreateHandle()
{
+ if (!Features.IsSupported(RecorderFeatures.AudioRecorder))
+ {
+ throw new NotSupportedException("Audio Recorder is not supported.");
+ }
+
Native.Create(out var handle).ThrowIfError("Failed to create Audio recorder");
return handle;
/// </summary>
/// <param name="audioCodec">The codec for audio encoding.</param>
/// <param name="fileFormat">The format of result file.</param>
- /// <feature>http://tizen.org/feature/microphone</feature>
+ /// <feature>http://tizen.org/feature/media.audio_recording</feature>
/// <exception cref="InvalidOperationException">An internal error occurred.</exception>
/// <exception cref="NotSupportedException">
/// A required feature is not supported.<br/>
private static Capabilities LoadCapabilities()
{
+ if (!Features.IsSupported(RecorderFeatures.AudioRecorder))
+ {
+ throw new NotSupportedException("Audio Recorder is not supported.");
+ }
+
var ret = Native.Create(out var handle);
if (ret == RecorderErrorCode.NotSupported)
/// <summary>
/// Gets the file formats that the current device supports.
/// </summary>
+ /// <feature>http://tizen.org/feature/media.audio_recording</feature>
+ /// <exception cref="NotSupportedException">A required feature is not supported.</exception>
/// <since_tizen> 4 </since_tizen>
public static IEnumerable<RecorderFileFormat> GetSupportedFileFormats() => Capabilities.Value.SupportedFileFormats;
/// <summary>
/// Gets the audio encoders that the current device supports.
/// </summary>
+ /// <feature>http://tizen.org/feature/media.audio_recording</feature>
+ /// <exception cref="NotSupportedException">A required feature is not supported.</exception>
/// <since_tizen> 4 </since_tizen>
public static IEnumerable<RecorderAudioCodec> GetSupportedAudioCodecs() => Capabilities.Value.SupportedAudioCodecs;
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Tizen.Multimedia
+{
+ internal static class RecorderFeatures
+ {
+ internal const string AudioRecorder = "http://tizen.org/feature/media.audio_recording";
+ internal const string VideoRecorder = "http://tizen.org/feature/media.video_recording";
+ }
+}
private static IEnumerable<Size> LoadVideoResolutions(CameraDevice device)
{
+ if (!Features.IsSupported(RecorderFeatures.VideoRecorder))
+ {
+ throw new NotSupportedException("Video Recorder is not supported.");
+ }
+
using (var camera = new Camera(device))
{
Native.CreateVideo(camera.Handle, out var handle).ThrowIfError("Failed to get the resolutions");
/// <summary>
/// Gets the video resolutions that the current device supports.
/// </summary>
- /// <feature>http://tizen.org/feature/camera</feature>
+ /// <feature>http://tizen.org/feature/media.video_recording</feature>
/// <param name="device">The camera device to retrieve the supported resolutions.</param>
/// <exception cref="NotSupportedException">A required feature is not supported.</exception>
/// <exception cref="ArgumentException"><paramref name="device"/> is invalid.</exception>
/// <summary>
/// Gets the video encoders that the current device supports.
/// </summary>
- /// <feature>http://tizen.org/feature/camera</feature>
+ /// <feature>http://tizen.org/feature/media.video_recording</feature>
/// <exception cref="NotSupportedException">A required feature is not supported.</exception>
/// <since_tizen> 4 </since_tizen>
public static IEnumerable<RecorderVideoCodec> GetSupportedVideoCodecs()
throw new ArgumentNullException(nameof(camera));
}
+ if (!Features.IsSupported(RecorderFeatures.VideoRecorder))
+ {
+ throw new NotSupportedException("Video Recorder is not supported.");
+ }
+
Native.CreateVideo(camera.Handle, out var handle).
ThrowIfError("Failed to create video recorder.");
/// <param name="camera">The camera object.</param>
/// <param name="videoCodec">The codec for video encoding.</param>
/// <param name="fileFormat">The format of result file.</param>
- /// <feature>http://tizen.org/feature/camera</feature>
+ /// <feature>http://tizen.org/feature/media.video_recording</feature>
/// <exception cref="InvalidOperationException">An internal error occurred.</exception>
/// <exception cref="NotSupportedException">
/// A required feature is not supported.<br/>
/// <param name="videoCodec">The codec for video encoding.</param>
/// <param name="audioCodec">The codec for audio encoding.</param>
/// <param name="fileFormat">The format of result file.</param>
- /// <feature>http://tizen.org/feature/camera</feature>
+ /// <feature>http://tizen.org/feature/media.video_recording</feature>
/// <exception cref="InvalidOperationException">An internal error occurred.</exception>
/// <exception cref="NotSupportedException">
/// A required feature is not supported.<br/>