[DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_get_video_resolution")]
internal static extern WebRTCErrorCode GetVideoResolution(IntPtr handle, uint sourceId, out int width, out int height);
+ [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_video_framerate")]
+ internal static extern WebRTCErrorCode SetVideoFrameRate(IntPtr handle, uint sourceId, int frameRate);
+
+ [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_get_video_framerate")]
+ internal static extern WebRTCErrorCode GetVideoFrameRate(IntPtr handle, uint sourceId, out int frameRate);
+
[DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_audio_loopback")]
internal static extern WebRTCErrorCode SetAudioLoopback(IntPtr handle, uint sourceId, AudioStreamPolicyHandle streamInfo, out uint trackId);
[DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_video_loopback_to_ecore_wl")]
internal static extern WebRTCErrorCode SetEcoreVideoLoopback(IntPtr handle, uint sourceId, IntPtr display, out uint trackId);
+ [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_bundle_policy")]
+ internal static extern WebRTCErrorCode SetBundlePolicy(IntPtr handle, WebRTCBundlePolicy bundlePolicy);
+
+ [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_bundle_policy")]
+ internal static extern WebRTCErrorCode GetBundlePolicy(IntPtr handle, out WebRTCBundlePolicy bundlePolicy);
+
[DllImport(Libraries.WebRTC, EntryPoint = "webrtc_mic_source_set_sound_stream_info")]
internal static extern WebRTCErrorCode SetAudioStreamPolicyToMicrophoneSource(IntPtr handle, uint sourceId, AudioStreamPolicyHandle streamInfo);
/// <summary>
/// Gets or sets the video resolution of the current media source.
/// </summary>
- /// <value>A value that specifies the mute status.</value>
+ /// <value>A value that specifies the video resolution.</value>
/// <exception cref="InvalidOperationException">
/// MediaSource is not attached yet.<br/>
/// -or-<br/>
- /// This MediaSource is not Video
+ /// This MediaSource is not Video.
/// </exception>
/// <exception cref="ObjectDisposedException">The WebRTC has already been disposed.</exception>
/// <since_tizen> 9 </since_tizen>
}
/// <summary>
+ /// Gets or sets the video frame rate of the current media source.
+ /// </summary>
+ /// <remarks>
+ /// This API is only supported in video media source, especially <see cref="MediaCameraSource"/>,
+ /// <see cref="MediaScreenSource"/>, <see cref="MediaTestSource"/>.<br/>
+ /// </remarks>
+ /// <value>A value that specifies the video frame rate.</value>
+ /// <exception cref="ArgumentException">VideoFrameRate is less than or equal to zero.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// MediaSource is not attached yet.<br/>
+ /// -or-<br/>
+ /// This MediaSource is not Video.
+ /// -or-<br/>
+ /// This MediaSource is not supported type of MediaSource.
+ /// </exception>
+ /// <exception cref="ObjectDisposedException">The WebRTC has already been disposed.</exception>
+ /// <since_tizen> 10 </since_tizen>
+ public int VideoFrameRate
+ {
+ get
+ {
+ if (!SourceId.HasValue)
+ {
+ throw new InvalidOperationException("MediaSource is not attached yet. Call AddSource() first.");
+ }
+ if (MediaType != MediaType.Video)
+ {
+ throw new InvalidOperationException("This property is only for video.");
+ }
+ if (this is MediaFileSource || this is MediaPacketSource)
+ {
+ throw new InvalidOperationException($"This property is not supported in {this.GetType()}.");
+ }
+
+ NativeWebRTC.GetVideoFrameRate(WebRtc.Handle, SourceId.Value, out int frameRate).
+ ThrowIfFailed("Failed to get video frame rate");
+
+ return frameRate;
+ }
+ set
+ {
+ if (value <= 0)
+ {
+ throw new ArgumentException($"VideoFrameRate should be greater than zero.");
+ }
+ if (!SourceId.HasValue)
+ {
+ throw new InvalidOperationException("MediaSource is not attached yet. Call AddSource() first.");
+ }
+ if (MediaType != MediaType.Video)
+ {
+ throw new InvalidOperationException("This property is only for video.");
+ }
+ if (this is MediaFileSource || this is MediaPacketSource)
+ {
+ throw new InvalidOperationException($"This property is not supported in {this.GetType()}.");
+ }
+
+ NativeWebRTC.SetVideoFrameRate(WebRtc.Handle, SourceId.Value, value).
+ ThrowIfFailed("Failed to set video frame rate");
+ }
+ }
+
+ /// <summary>
/// Enables the audio loopback. The local audio will be played with <paramref name="policy"/>.
/// </summary>
/// <param name="policy">The <see cref="AudioStreamPolicy"/> to apply.</param>
ThrowIfFailed("Failed to set ICE transport policy");
}
}
+
+ /// <summary>
+ /// Gets or sets the bundle policy.<br/>
+ /// The default bundle policy is <see cref="WebRTCBundlePolicy.MaxBundle"/>.
+ /// </summary>
+ /// <value>The policy of bundle</value>
+ /// <exception cref="ObjectDisposedException">The WebRTC has already been disposed.</exception>
+ /// <since_tizen> 10 </since_tizen>
+ public WebRTCBundlePolicy BundlePolicy
+ {
+ get
+ {
+ ValidateNotDisposed();
+
+ NativeWebRTC.GetBundlePolicy(Handle, out WebRTCBundlePolicy bundlePolicy).
+ ThrowIfFailed("Failed to get bundle policy");
+
+ return bundlePolicy;
+ }
+ set
+ {
+ ValidateNotDisposed();
+
+ NativeWebRTC.SetBundlePolicy(Handle, value).
+ ThrowIfFailed("Failed to set bundle policy");
+ }
+ }
}
}
}
/// <summary>
+ /// Specifies the bundle policy.
+ /// </summary>
+ /// <remarks>
+ /// The details of bundle policy enum is described in https://www.w3.org/TR/webrtc/#rtcbundlepolicy-enum.
+ /// </remarks>
+ /// <since_tizen> 10 </since_tizen>
+ public enum WebRTCBundlePolicy
+ {
+ /// <summary>
+ /// No bundle.
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// Bundle all media tracks into a stream when it's transfered to remote peer.
+ /// </summary>
+ MaxBundle
+ }
+
+ /// <summary>
/// Specifies the signaling message type.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]