Skip to content

Commit

Permalink
Bump to up 1.7.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo4405 committed Oct 28, 2023
1 parent fb93781 commit 436e1ac
Show file tree
Hide file tree
Showing 1,540 changed files with 99,948 additions and 1,795 deletions.
4 changes: 2 additions & 2 deletions HaishinKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Pod::Spec.new do |s|

s.name = "HaishinKit"
s.version = "1.7.0"
s.summary = "Camera and Microphone streaming library via RTMP for iOS, macOS, tvOS and visionOS."
s.summary = "Camera and Microphone streaming library via RTMP and SRT for iOS, macOS, tvOS and visionOS."
s.swift_version = "5.9"

s.description = <<-DESC
HaishinKit. Camera and Microphone streaming library via RTMP for iOS, macOS, tvOS and visionOS.
HaishinKit. Camera and Microphone streaming library via RTMP and SRT for iOS, macOS, tvOS and visionOS.
DESC

s.homepage = "https://github.com/shogo4405/HaishinKit.swift"
Expand Down
8 changes: 4 additions & 4 deletions HaishinKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.7.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -2278,7 +2278,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.7.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
ONLY_ACTIVE_ARCH = NO;
Expand Down Expand Up @@ -2586,7 +2586,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.7.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -2640,7 +2640,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.7.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20";
MTL_FAST_MATH = YES;
Expand Down
64 changes: 20 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

* Camera and Microphone streaming library via RTMP and SRT for iOS, macOS, tvOS and visionOS.
* README.md contains unreleased content, which can be tested on the main branch.
* [API Documentation](https://shogo4405.github.io/HaishinKit.swift/documentation/haishinkit)
* [API Documentation](https://shogo4405.github.io/HaishinKit.swift/)

<p align="center">
<strong>Sponsored with 💖 by</strong><br />
Expand Down Expand Up @@ -46,7 +46,7 @@ Project name |Notes |License
- [x] Authentication
- [x] Publish and Recording
- [x] _Playback (Beta)_
- [x] [Adaptive bitrate streaming](../../issues/1308))
- [x] [Adaptive bitrate streaming](../../issues/1308)
- [ ] Action Message Format
- [x] AMF0
- [ ] AMF3
Expand Down Expand Up @@ -248,21 +248,31 @@ stream.play()
```

## 📓 Settings
### Capture
```swift
stream.frameRate = 30
stream.sessionPreset = AVCaptureSession.Preset.medium

/// Specifies the video capture settings.
stream.videoCapture(for: 0).isVideoMirrored = false
stream.videoCapture(for: 0).preferredVideoStabilizationMode = .auto
// stream.videoCapture(for: 1).isVideoMirrored = false
// stream.videoCapture(for: 0).isVideoMirrored = false
```

// Specifies the audio codec settings.
### AudioCodecSetting
When you specify the sampling rate, it will perform resampling. Additionally, in the case of multiple channels, downsampling can be applied.
```
stream.audioSettings = AudioCodecSettings(
bitRate: 64 * 1000
bitRate: Int = 64 * 1000,
sampleRate: Float64 = 0,
channels: UInt32 = 0,
downmix: Bool = false,
channelMap: [Int]? = nil
)
```

// Specifies the video codec settings.
### VideoCodecSettings
```
stream.videoSettings = VideoCodecSettings(
videoSize: .init(width: 854, height: 480),
profileLevel: kVTProfileLevel_H264_Baseline_3_1 as String,
Expand All @@ -273,9 +283,12 @@ stream.videoSettings = VideoCodecSettings(
allowFrameReordering: nil,
isHardwareEncoderEnabled: true
)
```

### Recording
```
// Specifies the recording settings. 0" means the same of input.
stream.startRecording([
stream.startRecording(self, settings: [
AVMediaType.audio: [
AVFormatIDKey: Int(kAudioFormatMPEG4AAC),
AVSampleRateKey: 0,
Expand All @@ -295,43 +308,6 @@ stream.startRecording([
*/
]
])

stream.attachAudio(AVCaptureDevice.default(for: .audio))
```

```swift
// picrure in picrure settings.
stream.multiCamCaptureSettings = MultiCamCaptureSetting(
mode: .pip,
cornerRadius: 16.0,
regionOfInterest: .init(
origin: CGPoint(x: 16, y: 16),
size: .init(width: 160, height: 160)
)
)
```

```swift
// split settings.
stream.multiCamCaptureSettings = MultiCamCaptureSetting(
mode: .split(direction: .east),
cornerRadius: 0.0,
regionOfInterest: .init(
origin: .zero,
size: .zero
)
)
```

### Screen Capture
```swift
// iOS
let screen = IOUIScreenCaptureUnit(shared: UIApplication.shared)
screen.delegate = stream
screen.startRunning()

// macOS
stream.attachScreen(AVCaptureScreenInput(displayID: CGMainDisplayID()))
```

## 💠 Sponsorship
Expand Down
6 changes: 6 additions & 0 deletions Sources/RTMP/EventDispatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,23 @@ public final class Event {
// swiftlint:disable:next nesting
public typealias StringLiteralType = String

/// A type name for Sync event.
public static let sync: Name = "sync"
/// A type name for Event.
public static let event: Name = "event"
/// A type name for IO_Error event.
public static let ioError: Name = "ioError"
/// A type name for RTMPStatus event.
public static let rtmpStatus: Name = "rtmpStatus"

public let rawValue: String

/// Create a Event.Name by rawValue.
public init(rawValue: String) {
self.rawValue = rawValue
}

/// Create a Event.Name by stringLiteral.
public init(stringLiteral value: String) {
self.rawValue = value
}
Expand Down
Loading

0 comments on commit 436e1ac

Please sign in to comment.