Skip to content

Commit

Permalink
Merge branch 'release/1.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
SUZUKI Tetsuya committed Sep 15, 2017
2 parents 0c4862e + b925f05 commit 85d266f
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 67 deletions.
14 changes: 14 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
- FIX
- バグ修正

## 1.2.4

### CHANGE

- armv7 に対応した

- API: MediaOption を struct に変更した

- API: ConnectionController: ロールとストリーム種別の選択制限を削除した

### FIX

- API: マルチストリーム時、配信者のストリームが二重に生成されてしまう現象を修正した

## 1.2.3

### CHANGE
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "shiguredo/sora-webrtc-ios" "60.9.1"
github "shiguredo/sora-webrtc-ios" "60.9.2"
github "shiguredo/SocketRocket" "0.5.1-carthage.1"
github "shiguredo/unbox" "2.5.0"
github "shiguredo/SDWebImage" "4.0.0"
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "shiguredo/SDWebImage" "4.0.0"
github "shiguredo/SocketRocket" "0.5.1-carthage.1"
github "shiguredo/sora-webrtc-ios" "60.9.1"
github "shiguredo/sora-webrtc-ios" "60.9.2"
github "shiguredo/unbox" "2.5.0"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Sora iOS SDK は [WebRTC SFU Sora](https://sora.shiguredo.jp) の iOS クライ
## システム条件

- iOS 10.0 以降 (シミュレーターは非対応)
- アーキテクチャ arm64, armv7
- Mac OS X 10.12.5 以降
- Xcode 8.3.3 以降
- Swift 3.1
Expand Down
19 changes: 15 additions & 4 deletions Sora.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
arm64,
armv7,
);
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -438,9 +442,10 @@
ONLY_ACTIVE_ARCH = YES;
PROVISIONING_PROFILE = "49e345ee-1e24-4cef-9228-9df5fc1f7525";
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = arm64;
VALID_ARCHS = "arm64 armv7";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -450,6 +455,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
arm64,
armv7,
);
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -482,12 +491,14 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = NO;
PROVISIONING_PROFILE = "49e345ee-1e24-4cef-9228-9df5fc1f7525";
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VALID_ARCHS = arm64;
VALID_ARCHS = "arm64 armv7";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -520,7 +531,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
VALID_ARCHS = arm64;
VALID_ARCHS = "arm64 armv7";
};
name = Debug;
};
Expand Down Expand Up @@ -550,7 +561,7 @@
PROVISIONING_PROFILE = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
VALID_ARCHS = arm64;
VALID_ARCHS = "arm64 armv7";
};
name = Release;
};
Expand Down
22 changes: 0 additions & 22 deletions Sora/ConnectionController/ConnectionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ public class ConnectionController: UIViewController {
}
}

public enum StreamType {
case single
case multiple
}

public class Request {

public var URL: URL
Expand Down Expand Up @@ -105,30 +100,19 @@ public class ConnectionController: UIViewController {
public var audioEnabled: Bool = true
public var audioCodec: AudioCodec? = .default

public var availableRoles: [Role] = [.publisher, .subscriber]
public var availableStreamTypes: [StreamType] = [.single, .multiple]
public var userDefaultsSuiteName: String? = "jp.shiguredo.SoraConnectionController"

public var userDefaults: UserDefaults? {
get { return UserDefaults(suiteName: userDefaultsSuiteName) }
}

var tupleOfAvailableStreamTypes: (Bool, Bool) {
get {
return (availableStreamTypes.contains(.single),
availableStreamTypes.contains(.multiple))
}
}

// MARK: Initialization

public init(WebSocketSSLEnabled: Bool = true,
host: String? = nil,
port: Int? = nil,
signalingPath: String? = "signaling",
channelId: String? = nil,
availableRoles: [Role]? = nil,
availableStreamTypes: [StreamType]? = nil,
userDefaultsSuiteName: String? = nil,
useUserDefaults: Bool = true) {
super.init(nibName: nil, bundle: nil)
Expand All @@ -150,12 +134,6 @@ public class ConnectionController: UIViewController {
self.port = port
self.signalingPath = signalingPath
self.channelId = channelId
if let roles = availableRoles {
self.availableRoles = roles
}
if let streamTypes = availableStreamTypes {
self.availableStreamTypes = streamTypes
}
self.userDefaultsSuiteName = userDefaultsSuiteName

if useUserDefaults {
Expand Down
20 changes: 1 addition & 19 deletions Sora/ConnectionController/ConnectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -302,19 +302,6 @@ class ConnectionViewController: UITableViewController {

updateControls()

switch shared.tupleOfAvailableStreamTypes {
case (true, true), (false, false):
break
case (true, false):
enableMultistreamLabel.textColor = UIColor.lightGray
enableMultistreamSwitch.isOn = false
enableMultistreamSwitch.isEnabled = false
case (false, true):
enableMultistreamLabel.textColor = UIColor.lightGray
enableMultistreamSwitch.isOn = true
enableMultistreamSwitch.isEnabled = false
}

// build info
if let version = BuildInfo.WebRTCVersion {
WebRTCVersionValueLabel.text = version
Expand Down Expand Up @@ -384,6 +371,7 @@ class ConnectionViewController: UITableViewController {
let labels: [UILabel] = [
enableWebSocketSSLLabel, hostLabel, portLabel,
signalingPathLabel, channelIdLabel, roleLabel,
enableMultistreamLabel,
enableVideoLabel, videoCodecLabel,
bitRateLabel, enableSnapshotLabel,
enableAudioLabel, audioCodecLabel,
Expand All @@ -392,12 +380,6 @@ class ConnectionViewController: UITableViewController {
label.isEnabled = isEnabled
}

switch shared.tupleOfAvailableStreamTypes {
case (true, false), (false, true):
enableMultistreamLabel.isEnabled = false
default:
enableMultistreamLabel.isEnabled = true
}

let fields: [UITextField] = [hostTextField,
portTextField,
Expand Down
12 changes: 2 additions & 10 deletions Sora/ConnectionController/RoleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@ class RoleViewController: UITableViewController {
didSet {
for comp in components {
comp.cell.accessoryType = .none
if connectionController.availableRoles.contains(comp.role) {
comp.label.textColor = UIColor.black
comp.cell.isUserInteractionEnabled = true
if selectedRoles.contains(comp.role) {
comp.cell.accessoryType = .checkmark
}
} else {
comp.label.textColor = UIColor.lightGray
comp.cell.isUserInteractionEnabled = false
}
comp.label.textColor = UIColor.lightGray
comp.cell.isUserInteractionEnabled = false
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions Sora/MediaCapturer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@ import WebRTC

class MediaCapturer {

public var mediaOption: MediaOption?
public var videoCaptureTrack: RTCVideoTrack
public var videoCaptureSource: RTCAVFoundationVideoSource
public var audioCaptureTrack: RTCAudioTrack
public var cameraVideoCapturer: RTCCameraVideoCapturer?

init(factory: RTCPeerConnectionFactory, mediaOption: MediaOption?) {
self.mediaOption = mediaOption
videoCaptureSource = factory
.avFoundationVideoSource(with:
mediaOption?.videoCaptureSourceMediaConstraints ??
MediaOption.defaultMediaConstraints)
videoCaptureTrack = factory
.videoTrack(with: videoCaptureSource,
trackId: mediaOption?.videoCaptureTrackId ??
trackId: self.mediaOption?.videoCaptureTrackId ??
MediaOption.createCaptureTrackId())
audioCaptureTrack = factory
.audioTrack(withTrackId: mediaOption?.audioCaptureTrackId ??
.audioTrack(withTrackId: self.mediaOption?.audioCaptureTrackId ??
MediaOption.createCaptureTrackId())
}

Expand Down
2 changes: 1 addition & 1 deletion Sora/MediaOption.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum AudioCodec {

}

public class MediaOption {
public struct MediaOption {

public var videoCodec: VideoCodec = .default
public var audioCodec: AudioCodec = .default
Expand Down
6 changes: 3 additions & 3 deletions Sora/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ struct SignalingConnect {

// スナップショットの設定
if mediaOption.snapshotEnabled {
mediaOption.videoCodec = .VP8
mediaOption.videoEnabled = true
mediaOption.audioEnabled = true
self.mediaOption.videoCodec = .VP8
self.mediaOption.videoEnabled = true
self.mediaOption.audioEnabled = true
}
}

Expand Down
6 changes: 2 additions & 4 deletions Sora/PeerConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -997,11 +997,10 @@ class PeerConnectionContext: NSObject, SRWebSocketDelegate, RTCPeerConnectionDel
return
}

peerConnectionEventHandlers?.onAddStreamHandler?(nativePeerConnection, stream)
nativePeerConnection.add(stream)
let wrap = MediaStream(peerConnection: peerConnection!,
nativeMediaStream: stream)
peerConnection!.mediaConnection!.addMediaStream(wrap)
peerConnectionEventHandlers?.onAddStreamHandler?(nativePeerConnection, stream)

}
}
Expand All @@ -1015,10 +1014,9 @@ class PeerConnectionContext: NSObject, SRWebSocketDelegate, RTCPeerConnectionDel
break

default:
peerConnection?.mediaConnection?.removeMediaStream(stream.streamId)
peerConnectionEventHandlers?
.onRemoveStreamHandler?(nativePeerConnection, stream)
nativePeerConnection.remove(stream)
peerConnection?.mediaConnection?.removeMediaStream(stream.streamId)
}
}

Expand Down

0 comments on commit 85d266f

Please sign in to comment.