Skip to content

Commit

Permalink
Minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Oct 4, 2023
1 parent ba5bea3 commit 6b53e7a
Show file tree
Hide file tree
Showing 12 changed files with 700 additions and 656 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ All user visible changes to this project will be documented in this file. This p

### Added

- `RtpTransceiverInit.sendEncodings` field with `SendEncodingParameters`s. ([#125])
- `RtpTransceiverInit.sendEncodings` field with `SendEncodingParameters`. ([#125])

### Changed

Expand Down
6 changes: 3 additions & 3 deletions crates/libwebrtc-sys/include/bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,16 @@ std::unique_ptr<RTCOfferAnswerOptions> create_rtc_offer_answer_options(
// Creates a new default `RtpTransceiverInit`.
std::unique_ptr<RtpTransceiverInit> create_default_rtp_transceiver_init();

// Sets a `RtpTransceiverDirection` for the provided `RtpTransceiverInit`.
// Sets an `RtpTransceiverDirection` for the provided `RtpTransceiverInit`.
void set_rtp_transceiver_init_direction(RtpTransceiverInit& init,
RtpTransceiverDirection direction);

// Adds a `RtpEncodingParameters` into the provided `RtpTransceiverInit`.
// Adds an `RtpEncodingParameters` to the provided `RtpTransceiverInit`.
void add_rtp_transceiver_init_send_encoding(
RtpTransceiverInit& init,
const RtpEncodingParametersContainer& params);

// Creates a new default `RtpEncodingParameters`.
// Creates new default `RtpEncodingParameters`.
RtpEncodingParametersContainer create_rtp_encoding_parameters();

// Creates a new `CreateSessionDescriptionObserver` from the provided
Expand Down
10 changes: 6 additions & 4 deletions crates/libwebrtc-sys/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1527,19 +1527,21 @@ pub(crate) mod webrtc {
#[must_use]
pub fn create_default_rtp_transceiver_init() -> UniquePtr<RtpTransceiverInit>;

/// Sets a [`RtpTransceiverDirection`] for the provided [`RtpTransceiverInit`].
/// Sets an [`RtpTransceiverDirection`] for the provided
/// [`RtpTransceiverInit`].
pub fn set_rtp_transceiver_init_direction(
init: Pin<&mut RtpTransceiverInit>,
direction: RtpTransceiverDirection
);

/// Adds a [`RtpEncodingParameters`] into the provided [`RtpTransceiverInit`].
/// Adds an [`RtpEncodingParameters`] into the provided
/// [`RtpTransceiverInit`].
pub fn add_rtp_transceiver_init_send_encoding(
init: Pin<&mut RtpTransceiverInit>,
encoding: &RtpEncodingParametersContainer
);

/// Creates a new default [`RtpEncodingParameters`].
/// Creates new default [`RtpEncodingParameters`].
#[must_use]
pub fn create_rtp_encoding_parameters() -> RtpEncodingParametersContainer;
}
Expand Down Expand Up @@ -1617,7 +1619,7 @@ pub(crate) mod webrtc {
pub fn rtp_encoding_parameters_scale_resolution_down_by(
encoding: &RtpEncodingParameters,
) -> Result<f64>;

/// Sets the `scale_resolution_down_by` of the provided
/// [`RtpEncodingParameters`].
pub fn set_rtp_encoding_parameters_scale_resolution_down_by(
Expand Down
8 changes: 4 additions & 4 deletions crates/libwebrtc-sys/src/cpp/bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -618,26 +618,26 @@ std::unique_ptr<RTCOfferAnswerOptions> create_rtc_offer_answer_options(
ice_restart, use_rtp_mux);
}

// Creates a new `RtpTransceiverInit`.
// Creates a new default `RtpTransceiverInit`.
std::unique_ptr<RtpTransceiverInit> create_default_rtp_transceiver_init() {
return std::make_unique<RtpTransceiverInit>();
}

// Sets a `RtpTransceiverDirection` for the provided `RtpTransceiverInit`.
// Sets an `RtpTransceiverDirection` for the provided `RtpTransceiverInit`.
void set_rtp_transceiver_init_direction(
RtpTransceiverInit& init,
webrtc::RtpTransceiverDirection direction) {
init.direction = direction;
}

// Adds a `RtpEncodingParameters` to the provided `RtpTransceiverInit`.
// Adds an `RtpEncodingParameters` to the provided `RtpTransceiverInit`.
void add_rtp_transceiver_init_send_encoding(
RtpTransceiverInit& init,
const RtpEncodingParametersContainer& params) {
init.send_encodings.push_back(*params.ptr);
}

// Creates a new `RtpEncodingParameters`.
// Creates new default `RtpEncodingParameters`.
RtpEncodingParametersContainer create_rtp_encoding_parameters() {
RtpEncodingParametersContainer res = {
std::make_unique<webrtc::RtpEncodingParameters>()};
Expand Down
7 changes: 4 additions & 3 deletions crates/libwebrtc-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ impl RtpExtension {

/// [RTCRtpTransceiverInit][0] representation.
///
/// [0]: https://w3.org/TR/webrtc/#dictionary-rtcrtptransceiverinit-members
/// [0]: https://w3.org/TR/webrtc#dictionary-rtcrtptransceiverinit-members
pub struct RtpTransceiverInit(UniquePtr<webrtc::RtpTransceiverInit>);

impl RtpTransceiverInit {
Expand All @@ -1054,7 +1054,8 @@ impl RtpTransceiverInit {
webrtc::set_rtp_transceiver_init_direction(self.0.pin_mut(), direction);
}

/// Adds the [`RtpEncodingParameters`] to this [`RtpTransceiverInit`].
/// Adds the provided [`RtpEncodingParameters`] to this
/// [`RtpTransceiverInit`].
pub fn add_encoding(&mut self, encoding: &RtpEncodingParameters) {
webrtc::add_rtp_transceiver_init_send_encoding(
self.0.pin_mut(),
Expand All @@ -1078,7 +1079,7 @@ unsafe impl Send for webrtc::RtpTransceiverInit {}
pub struct RtpEncodingParameters(webrtc::RtpEncodingParametersContainer);

impl RtpEncodingParameters {
/// Creates a new [`RtpEncodingParameters`].
/// Creates new [`RtpEncodingParameters`].
#[must_use]
pub fn new() -> Self {
Self(webrtc::create_rtp_encoding_parameters())
Expand Down
6 changes: 3 additions & 3 deletions crates/native/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,7 @@ pub fn create_transceiver_init() -> RustOpaque<Arc<RtpTransceiverInit>> {
RustOpaque::new(Arc::new(RtpTransceiverInit::new()))
}

/// Sets a provided [`RtpTransceiverDirection`] to the [`RtpTransceiverInit`].
/// Sets the provided [`RtpTransceiverDirection`] to the [`RtpTransceiverInit`].
#[allow(clippy::needless_pass_by_value)]
pub fn set_transceiver_init_direction(
init: RustOpaque<Arc<RtpTransceiverInit>>,
Expand All @@ -1935,7 +1935,7 @@ pub fn set_transceiver_init_direction(
init.set_direction(direction);
}

/// Adds a provided [`RtpEncodingParameters`] to the [`RtpTransceiverInit`].
/// Adds the provided [`RtpEncodingParameters`] to the [`RtpTransceiverInit`].
#[allow(clippy::needless_pass_by_value)]
pub fn add_transceiver_init_send_encoding(
init: RustOpaque<Arc<RtpTransceiverInit>>,
Expand All @@ -1944,7 +1944,7 @@ pub fn add_transceiver_init_send_encoding(
init.add_encoding(&encoding);
}

/// Creates a new [`RtpEncodingParameters`] with provided settings.
/// Creates new [`RtpEncodingParameters`] with the provided settings.
#[allow(clippy::needless_pass_by_value)]
pub fn create_encoding_parameters(
rid: String,
Expand Down
7 changes: 4 additions & 3 deletions crates/native/src/bridge_generated.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(
non_camel_case_types,
unused,
Expand All @@ -14,8 +13,10 @@

use crate::api::*;
use core::panic::UnwindSafe;
use flutter_rust_bridge::{rust2dart::IntoIntoDart, *};
use std::{ffi::c_void, sync::Arc};
use flutter_rust_bridge::rust2dart::IntoIntoDart;
use flutter_rust_bridge::*;
use std::ffi::c_void;
use std::sync::Arc;

// Section: imports

Expand Down
1 change: 1 addition & 0 deletions crates/native/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mod api;
clippy::wildcard_imports,
let_underscore_drop
)]
#[rustfmt::skip]
mod bridge_generated;
mod devices;
mod pc;
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/model/PeerConnectionConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class TransceiverInit {
/// Direction of the transceiver, created from this configuration.
private var direction: TransceiverDirection

/// A sequence containing parameters for sending RTP encodings of media.
/// Sequence containing parameters for sending RTP encodings of media.
private var encodings: [Encoding]

/// Initializes a new `TransceiverInit` configuration with the provided data.
Expand Down
6 changes: 3 additions & 3 deletions lib/src/api/bridge.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,23 @@ abstract class MedeaFlutterWebrtcNative {

FlutterRustBridgeTaskConstMeta get kCreateTransceiverInitConstMeta;

/// Sets a provided [`RtpTransceiverDirection`] to the [`RtpTransceiverInit`].
/// Sets the provided [`RtpTransceiverDirection`] to the [`RtpTransceiverInit`].
Future<void> setTransceiverInitDirection(
{required ArcRtpTransceiverInit init,
required RtpTransceiverDirection direction,
dynamic hint});

FlutterRustBridgeTaskConstMeta get kSetTransceiverInitDirectionConstMeta;

/// Adds a provided [`RtpEncodingParameters`] to the [`RtpTransceiverInit`].
/// Adds the provided [`RtpEncodingParameters`] to the [`RtpTransceiverInit`].
Future<void> addTransceiverInitSendEncoding(
{required ArcRtpTransceiverInit init,
required ArcRtpEncodingParameters encoding,
dynamic hint});

FlutterRustBridgeTaskConstMeta get kAddTransceiverInitSendEncodingConstMeta;

/// Creates a new [`RtpEncodingParameters`] with provided `rid` and `active`.
/// Creates new [`RtpEncodingParameters`] with the provided settings.
Future<ArcRtpEncodingParameters> createEncodingParameters(
{required String rid,
required bool active,
Expand Down
Loading

0 comments on commit 6b53e7a

Please sign in to comment.