From ba5bea39c1c91df79b0da7d17831d82cd22f2e5e Mon Sep 17 00:00:00 2001 From: alexlapa Date: Tue, 3 Oct 2023 16:00:57 +0300 Subject: [PATCH] ios --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++ ios/Classes/model/Encoding.swift | 5 ++--- lib/src/model/transceiver.dart | 21 ++++++++++++-------- 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 798d813e31..be2ecdc941 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: needs: - build - build-linux + - clippy - dartanalyze - dartfmt - ktfmt @@ -43,6 +44,35 @@ jobs: # Linting and formatting # ########################## + clippy: + strategy: + fail-fast: false + matrix: + platform: + - linux + - macos + - windows + runs-on: ${{ (matrix.platform == 'linux' && 'ubuntu-latest') + || (matrix.platform == 'windows' && 'windows-latest') + || 'macos-latest' }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@v1 + with: + toolchain: stable + components: clippy + + - name: Install `${{ matrix.platform }}` platform dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + libgtk-3-dev libpulse-dev libudev-dev libxcomposite-dev \ + libxdamage-dev libxfixes-dev libxrandr-dev libxtst-dev \ + ninja-build + if: ${{ matrix.platform == 'linux' }} + + - run: make cargo.lint + dartanalyze: runs-on: ubuntu-latest steps: @@ -181,6 +211,9 @@ jobs: platform: - android - ios + - linux + - macos + - windows runs-on: ${{ (matrix.platform == 'linux' && 'ubuntu-latest') || (matrix.platform == 'windows' && 'windows-latest') || 'macos-13' }} @@ -303,6 +336,7 @@ jobs: needs: - build - build-linux + - clippy - dartanalyze - dartfmt - ktfmt diff --git a/ios/Classes/model/Encoding.swift b/ios/Classes/model/Encoding.swift index fa8fdf4459..dff566c567 100755 --- a/ios/Classes/model/Encoding.swift +++ b/ios/Classes/model/Encoding.swift @@ -3,8 +3,7 @@ import WebRTC /// Encoding describes a single configuration of a codec for an RTCRtpSender. class Encoding { /// A string which, if set, specifies an RTP stream ID (RID) to be sent using - /// the RID header - /// extension. + /// the RID header extension. var rid: String /// If true, the described encoding is currently actively being used. @@ -34,7 +33,7 @@ class Encoding { self.scaleResolutionDownBy = scaleResolutionDownBy } - /// Converts this `RtpTransceiverInit` into an `RTCRtpTransceiverInit`. + /// Converts this `Encoding` into an `RTCRtpEncodingParameters`. func intoWebRtc() -> RTCRtpEncodingParameters { let params = RTCRtpEncodingParameters() params.rid = self.rid diff --git a/lib/src/model/transceiver.dart b/lib/src/model/transceiver.dart index 401ef25151..7f434606c9 100644 --- a/lib/src/model/transceiver.dart +++ b/lib/src/model/transceiver.dart @@ -43,27 +43,32 @@ class RtpTransceiverInit { } } -/// Config for an `RtpTransceiver` encoder. +/// Encoding describes a single configuration of a codec for an RTCRtpSender. class SendEncodingParameters { - /// Creates a new [SendEncodingParameters] with the provided `rid` and `active`. + /// A string which, if set, specifies an RTP stream ID (RID) to be sent using + /// the RID header extension. SendEncodingParameters(this.rid, this.active); - /// `rid` of this [SendEncodingParameters]. + /// A string which, if set, specifies an RTP stream ID (RID) to be sent using + /// the RID header extension. late String rid; - /// `active` of this [SendEncodingParameters]. + /// If true, the described encoding is currently actively being used. late bool active; - /// `maxBitrate` of this [SendEncodingParameters]. + /// Indicates the maximum number of bits per second to allow for this + /// encoding. int? maxBitrate; - /// `maxFramerate` of this [SendEncodingParameters]. + /// A value specifying the maximum number of frames per second to allow for + /// this encoding. double? maxFramerate; - /// `scaleResolutionDownBy` of this [SendEncodingParameters]. + /// This is a double-precision floating-point value specifying a factor by + /// which to scale down the video during encoding. double? scaleResolutionDownBy; - /// `scalability` of this [SendEncodingParameters]. + /// Scalability mode describes layers within the media stream. String? scalabilityMode; /// Converts this model to the [Map] expected by Flutter.