From: hancepark Date: Wed, 25 Mar 2020 06:08:50 +0000 (+0900) Subject: [StreamRecorder] Handle NotSupportedException as new feature added (#1483) X-Git-Tag: accepted/tizen/unified/20210219.040944~814 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2273b23511d7c2a9ebfc9ae5a6c4cc3244437ac;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [StreamRecorder] Handle NotSupportedException as new feature added (#1483) * Adds new feature exception As new feature added, related API is modified. Signed-off-by: Hyunsoo Park * Adds description -Tizen.Multimedia.StreamRecorder.StreamRecorder() Signed-off-by: Hyunsoo Park * Change feature information Signed-off-by: Hyunsoo Park * Change feature applied API information Signed-off-by: Hyunsoo Park * Remove exception which doesn't return NOT_SUPPORTED Signed-off-by: Hyunsoo Park * Remove NOT_SUPPORTED exception on start api Signed-off-by: Hyunsoo Park * !fixup 'Remove NOT_SUPPORTED exception on start api' Signed-off-by: Hyunsoo Park Co-authored-by: Hyunsoo Park --- diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.cs old mode 100644 new mode 100755 index fd62136..14e7fca --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.cs +++ b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.cs @@ -34,14 +34,27 @@ namespace Tizen.Multimedia private bool _audioEnabled; private bool _videoEnabled; private StreamRecorderVideoFormat _sourceFormat; + private const string Feature = "http://tizen.org/feature/multimedia.stream_recorder"; + + private static bool IsSupported() + { + return System.Information.TryGetValue(Feature, out bool isSupported) && isSupported; + } /// /// Initialize a new instance of the class. /// /// The feature is not supported. /// 3 + /// http://tizen.org/feature/multimedia.stream_recorder public StreamRecorder() { + if (IsSupported() == false) + { + throw new NotSupportedException( + $"The feature({Feature}) is not supported on the current device."); + } + try { Native.Create(out _handle).ThrowIfError("Failed to create stream recorder.");