Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ All user visible changes to this project will be documented in this file. This p

### Added

- Support `PeerConnection.videoDecoders()` and `PeerConnection.videoEncoders()` on iOS. ([#148])
- Support for system audio capturing on [Windows] via `getDisplayMedia()`. ([#245], [#244])

### Changed

- Upgraded [libwebrtc] to [139.0.7258.127] version. ([#248], [todo])

[#148]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/148
[#244]: https://github.com/instrumentisto/medea-flutter-webrtc/issues/244
[#245]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/245
[#248]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/248
Expand Down
42 changes: 2 additions & 40 deletions ios/Classes/controller/PeerConnectionFactoryController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,48 +73,10 @@ class PeerConnectionFactoryController {

result(capabilities.asFlutterResult())
case "videoEncoders":
let res = [
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.VP8
),
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.VP9
),
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.AV1
),
VideoCodecInfo(
isHardwareAccelerated: true,
codec: VideoCodec.H264
),
].map {
$0.asFlutterResult()
}
let res = self.peerFactory.videoEncoders().map { $0.asFlutterResult() }
result(res)
case "videoDecoders":
let res = [
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.VP8
),
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.VP9
),
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.AV1
),
VideoCodecInfo(
isHardwareAccelerated: true,
codec: VideoCodec.H264
),
].map {
$0.asFlutterResult()
}
let res = self.peerFactory.videoDecoders().map { $0.asFlutterResult() }
result(res)
case "dispose":
self.channel.setMethodCallHandler(nil)
Expand Down
51 changes: 51 additions & 0 deletions ios/Classes/proxy/PeerConnectionFactoryProxy.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import VideoToolbox
import WebRTC

/// Returns `RtpCapabilities` based on the provided `RTCRtpCapabilities`.
Expand Down Expand Up @@ -93,6 +94,56 @@ class PeerConnectionFactoryProxy {
return peerProxy
}

/// Returns list containing information about video encoders for the different
/// video codecs.
func videoEncoders() -> [VideoCodecInfo] {
[
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.VP8
),
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.VP9
),
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.AV1
),
VideoCodecInfo(
isHardwareAccelerated: VTIsHardwareDecodeSupported(
kCMVideoCodecType_H264
),
codec: VideoCodec.H264
),
]
}

/// Returns list containing information about video decoders for the different
/// video codecs.
func videoDecoders() -> [VideoCodecInfo] {
[
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.VP8
),
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.VP9
),
VideoCodecInfo(
isHardwareAccelerated: false,
codec: VideoCodec.AV1
),
VideoCodecInfo(
isHardwareAccelerated: VTIsHardwareDecodeSupported(
kCMVideoCodecType_H264
),
codec: VideoCodec.H264
),
]
}

/// Removes the specified `PeerObserver` from the `peerObservers`.
private func remotePeerObserver(id: Int) {
self.peerObservers.removeValue(forKey: id)
Expand Down
Loading