From: Haesu Gwon Date: Wed, 9 Aug 2023 01:55:24 +0000 (+0900) Subject: [WebRTC] Add display feature for video APIs (#5442) X-Git-Tag: accepted/tizen/unified/20231205.024657~217 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=e486384fbdc23b5226766d780e66eacd602e116d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [WebRTC] Add display feature for video APIs (#5442) --- diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaScreenSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaScreenSource.cs index 7be1574..391a13a 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaScreenSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaScreenSource.cs @@ -34,6 +34,11 @@ namespace Tizen.Multimedia.Remoting /// /// Initializes a new instance of the class. /// + /// http://tizen.org/feature/display + /// + /// If display feature is not supported, NotSupportedException will be thrown + /// when MediaScreenSource is added by or . + /// /// 9 public MediaScreenSource() : base(MediaType.Video) {} diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaSource.cs index a4a2306..7768f69 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaSource.cs @@ -615,6 +615,8 @@ namespace Tizen.Multimedia.Remoting /// Enables the video loopback. The local video will be diaplayed in . /// /// The to apply. + /// http://tizen.org/feature/display + /// The required feature is not supported. /// The display has already been assigned to another. /// is null. /// @@ -628,6 +630,10 @@ namespace Tizen.Multimedia.Remoting { uint trackId = 0; + if (!Features.IsSupported(WebRTCFeatures.Display)) + { + throw new NotSupportedException("Display feature is not supported."); + } if (!SourceId.HasValue) { throw new InvalidOperationException("MediaSource is not attached yet. Call AddSource() first."); diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaStreamTrack.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaStreamTrack.cs index 3862f67..1d154e9 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaStreamTrack.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaStreamTrack.cs @@ -64,6 +64,8 @@ namespace Tizen.Multimedia.Remoting /// If remote track, must be set in event.
/// The display is created with . /// + /// http://tizen.org/feature/display + /// The required feature is not supported. /// The WebRTC has already been disposed of. /// The value has already been assigned to another WebRTC. /// @@ -74,9 +76,22 @@ namespace Tizen.Multimedia.Remoting /// 9 public Display Display { - get => _display; + get + { + if (!Features.IsSupported(WebRTCFeatures.Display)) + { + throw new NotSupportedException("Display feature is not supported."); + } + + return _display; + } set { + if (!Features.IsSupported(WebRTCFeatures.Display)) + { + throw new NotSupportedException("Display feature is not supported."); + } + if (Type != MediaType.Video) { throw new InvalidOperationException("This property is only for video track."); @@ -122,6 +137,8 @@ namespace Tizen.Multimedia.Remoting /// /// This property is meaningful only in overlay or EVAS surface display type. /// + /// http://tizen.org/feature/display + /// The required feature is not supported. /// A that specifies the display mode. /// Display mode type is incorrect. /// is not set. @@ -130,6 +147,11 @@ namespace Tizen.Multimedia.Remoting { get { + if (!Features.IsSupported(WebRTCFeatures.Display)) + { + throw new NotSupportedException("Display feature is not supported."); + } + if (Type != MediaType.Video) { throw new InvalidOperationException("This property is only for video track."); @@ -142,6 +164,11 @@ namespace Tizen.Multimedia.Remoting } set { + if (!Features.IsSupported(WebRTCFeatures.Display)) + { + throw new NotSupportedException("Display feature is not supported."); + } + if (Type != MediaType.Video) { throw new InvalidOperationException("This property is only for video track."); @@ -161,12 +188,19 @@ namespace Tizen.Multimedia.Remoting /// /// This property is meaningful only in overlay or EVAS surface display type. /// + /// http://tizen.org/feature/display + /// The required feature is not supported. /// is not set. /// 9 public bool DisplayVisible { get { + if (!Features.IsSupported(WebRTCFeatures.Display)) + { + throw new NotSupportedException("Display feature is not supported."); + } + if (Type != MediaType.Video) { throw new InvalidOperationException("This property is only for video track."); @@ -179,6 +213,11 @@ namespace Tizen.Multimedia.Remoting } set { + if (!Features.IsSupported(WebRTCFeatures.Display)) + { + throw new NotSupportedException("Display feature is not supported."); + } + if (Type != MediaType.Video) { throw new InvalidOperationException("This property is only for video track."); diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTC.cs b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTC.cs index dd6ecff..7564e86 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTC.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTC.cs @@ -386,6 +386,7 @@ namespace Tizen.Multimedia.Remoting /// The media sources to add. /// http://tizen.org/feature/camera /// http://tizen.org/feature/microphone + /// http://tizen.org/feature/display /// http://tizen.org/privilege/camera /// http://tizen.org/privilege/mediastorage /// http://tizen.org/privilege/externalstorage @@ -433,6 +434,7 @@ namespace Tizen.Multimedia.Remoting /// The media sources to add. /// http://tizen.org/feature/camera /// http://tizen.org/feature/microphone + /// http://tizen.org/feature/display /// http://tizen.org/privilege/camera /// http://tizen.org/privilege/mediastorage /// http://tizen.org/privilege/externalstorage diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCFeatures.cs b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCFeatures.cs index b10644c..56c772d 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCFeatures.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCFeatures.cs @@ -21,5 +21,6 @@ namespace Tizen.Multimedia.Remoting internal const string Wifi = "http://tizen.org/feature/network.wifi"; internal const string Telephony = "http://tizen.org/feature/network.telephony"; internal const string Ethernet = "http://tizen.org/feature/network.ethernet"; + internal const string Display = "http://tizen.org/feature/display"; } }