Skip to content

Commit

Permalink
Use custom WebRTC
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Nov 26, 2024
1 parent 1bf0b61 commit f733588
Show file tree
Hide file tree
Showing 149 changed files with 179 additions and 217 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Foundation
import StreamVideo
import StreamWebRTC
import WebRTC

final class RobotVoiceFilter: AudioFilter {

Expand Down
2 changes: 1 addition & 1 deletion DemoApp/Sources/Components/Router.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Foundation
import GoogleSignIn
import StreamVideo
import StreamVideoSwiftUI
import StreamWebRTC
import WebRTC
import SwiftUI
#if canImport(StreamVideoNoiseCancellation)
import StreamVideoNoiseCancellation
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/Sources/DemoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import GoogleSignIn
import StreamVideo
import StreamVideoSwiftUI
import StreamWebRTC
import WebRTC
import SwiftUI

@main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import StreamVideo
import StreamVideoSwiftUI
import SwiftUI
import Combine
import StreamWebRTC
import WebRTC

@MainActor
fileprivate func content() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import StreamVideoSwiftUI
import CoreImage
import SwiftUI
import Vision
import StreamWebRTC
import WebRTC

@MainActor
fileprivate func content() {
Expand Down Expand Up @@ -250,7 +250,7 @@ fileprivate func content() {
}
}
}

container {
// Get a call object
let call = streamVideo.call(callType: "default", callId: UUID().uuidString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import StreamVideoSwiftUI
import SwiftUI
import Combine
import CoreImage
import StreamWebRTC
import WebRTC

var apiKey = ""
var user = User(id: "")
Expand Down Expand Up @@ -250,7 +250,7 @@ final class UnsecureRepository: VoIPTokenHandler {
func save(voIPPushToken: String?) {

}

func currentVoIPPushToken() -> String? {
nil
}
Expand Down Expand Up @@ -279,7 +279,7 @@ protocol VoIPTokenHandler {
}

final class CallKitService {

func reportIncomingCall(
callCid: String,
displayName: String,
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let package = Package(
name: "StreamVideo",
dependencies: [
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
.product(name: "StreamWebRTC", package: "stream-video-swift-webrtc")
.product(name: "WebRTC", package: "stream-video-swift-webrtc")
]
),
.target(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<img id="stream-video-label" alt="StreamVideo" src="https://img.shields.io/badge/StreamVideo-7.56%20MB-blue"/>
<img id="stream-video-swiftui-label" alt="StreamVideoSwiftUI" src="https://img.shields.io/badge/StreamVideoSwiftUI-2.18%20MB-blue"/>
<img id="stream-video-uikit-label" alt="StreamVideoUIKit" src="https://img.shields.io/badge/StreamVideoUIKit-2.31%20MB-blue"/>
<img id="stream-web-rtc-label" alt="StreamWebRTC" src="https://img.shields.io/badge/StreamWebRTC-8.69%20MB-blue"/>
<img id="stream-web-rtc-label" alt="WebRTC" src="https://img.shields.io/badge/WebRTC-8.69%20MB-blue"/>
</p>

![Stream Video for iOS Header image](https://github.com/GetStream/stream-video-swift/assets/12433593/e4a44ae5-a8eb-4ac7-8910-28187aa011f6)
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Call.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import AVFoundation
import Combine
import Foundation
import StreamWebRTC
import WebRTC

/// Observable object that provides info about the call state, as well as methods for updating it.
public class Call: @unchecked Sendable, WSEventsSubscriber {
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Controllers/CallController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Combine
import Foundation
import StreamWebRTC
import WebRTC

/// Class that handles a particular call.
class CallController: @unchecked Sendable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Models/CallParticipant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
@preconcurrency import StreamWebRTC
@preconcurrency import WebRTC

/// Represents a participant in the call.
public struct CallParticipant: Identifiable, Sendable, Hashable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Models/CallStatsReport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
@preconcurrency import StreamWebRTC
@preconcurrency import WebRTC

/// A struct representing a call stats report.
public struct CallStatsReport: Sendable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Models/ConnectOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
@preconcurrency import StreamWebRTC
@preconcurrency import WebRTC

public struct ConnectOptions: Sendable {
let rtcConfiguration: RTCConfiguration
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Models/ScreenSharingSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

public struct ScreenSharingSession {
public let track: RTCVideoTrack?
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Models/VideoCodec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

/// Represents supported video codecs for WebRTC communication.
///
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Models/VideoOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
@preconcurrency import StreamWebRTC
@preconcurrency import WebRTC

/// Configuration for the video options for a call.
struct VideoOptions: Sendable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/StreamVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Combine
import Foundation
import StreamWebRTC
import WebRTC
import SwiftProtobuf

public typealias UserTokenProvider = (@escaping (Result<UserToken, Error>) -> Void) -> Void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import AVFoundation
import Combine
import Foundation
import StreamWebRTC
import WebRTC

/// This class abstracts the usage of AVAudioRecorder, providing a convenient way to record and manage
/// audio streams. It handles setting up the recording environment, starting and stopping recording, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import AVFoundation
import Foundation
import StreamWebRTC
import WebRTC

/// A protocol defining the interface for managing an audio session,
/// with properties and methods to control audio settings, activation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright © 2024 Stream.io Inc. All rights reserved.
//

import StreamWebRTC
import WebRTC

extension RTCAudioSessionConfiguration {
/// Provides a default configuration for `RTCAudioSessionConfiguration`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import AVFoundation
import Combine
import Foundation
import StreamWebRTC
import WebRTC

/// The `StreamAudioSessionAdapter` class manages the device's audio session
/// for an app, enabling control over activation, configuration, and routing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import AVFoundation
import Foundation
import StreamWebRTC
import WebRTC

/// A class implementing the `AudioSessionProtocol` that manages the WebRTC
/// audio session for the application, handling settings and route management.
Expand Down Expand Up @@ -60,7 +60,7 @@ final class StreamRTCAudioSession: AudioSessionProtocol {
/// - Parameter mode: The audio mode to set.
/// - Throws: An error if setting the mode fails.
func setMode(_ mode: String) throws {
try source.setMode(mode)
try source.setMode(AVAudioSession.Mode(rawValue: mode))
}

/// Configures the audio category and category options for the session.
Expand All @@ -73,7 +73,7 @@ final class StreamRTCAudioSession: AudioSessionProtocol {
_ category: String,
with categoryOptions: AVAudioSession.CategoryOptions
) throws {
try source.setCategory(category, with: categoryOptions)
try source.setCategory(AVAudioSession.Category(rawValue: category), with: categoryOptions)
}

/// Activates or deactivates the audio session.
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/VideoConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

public final class VideoConfig: Sendable {
/// An array of `VideoFilter` objects representing the filters to apply to the video.
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/WebRTC/AudioFilter/AudioFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

/// AudioFilter protocol defines the structure for audio filtering implementations.
public protocol AudioFilter: Sendable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

/// A concrete implementation of `AudioFilter` that applies noise cancellation effects.
public final class NoiseCancellationFilter: AudioFilter, @unchecked Sendable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

/// A protocol defining requirements for an audio filter capture post-processing module.
public protocol AudioFilterCapturePostProcessingModule: RTCAudioCustomProcessingDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

/// A protocol defining requirements for an audio processing module that supports audio filters.
public protocol AudioProcessingModule: RTCAudioProcessingModule, Sendable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/WebRTC/DefaultRTCConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

extension RTCConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

extension RTCMediaConstraints {

Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/WebRTC/PeerConnectionFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

/// A factory class for creating WebRTC-related objects such as peer connections,
/// video sources, and audio tracks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

class BroadcastBufferConnection: NSObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import CoreImage
import CoreVideo
import Foundation
import StreamWebRTC
import WebRTC

private class Message {
static let imageContextVar: CIContext? = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

class BroadcastBufferUploadConnection: BroadcastBufferConnection {
var onOpen: (() -> Void)?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Foundation
import ReplayKit
import StreamWebRTC
import WebRTC

actor BroadcastBufferUploader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Foundation
import ReplayKit
import StreamWebRTC
import WebRTC

class BroadcastScreenCapturer: VideoCapturing {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Foundation
import ReplayKit
import StreamWebRTC
import WebRTC

class ScreenshareCapturer: VideoCapturing {
private var videoCapturer: RTCVideoCapturer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

/// A wrapper around RTCStatistics that can be used to easily access its properties.
@dynamicMemberLookup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import StreamWebRTC
import WebRTC

final class SimulatorScreenCapturer: RTCVideoCapturer {
private var displayLink: CADisplayLink?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Combine
import Foundation
@preconcurrency import StreamWebRTC
@preconcurrency import WebRTC

final class StreamVideoCaptureHandler: NSObject, RTCVideoCapturerDelegate {

Expand Down
Loading

0 comments on commit f733588

Please sign in to comment.