Skip to content

Commit

Permalink
Merge pull request #1405 from shogo4405/feature/bump-to-up-os-versions
Browse files Browse the repository at this point in the history
Supported OS version.
  • Loading branch information
shogo4405 authored Apr 6, 2024
2 parents faf54e4 + 0fc527d commit 11a0883
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 182 deletions.
2 changes: 1 addition & 1 deletion Examples/iOS/Preference.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
struct Preference {
static var defaultInstance = Preference()

var uri: String? = "rtmp://192.168.1.4/live"
var uri: String? = "rtmp://192.168.1.10/live"
var streamName: String? = "live"
}
60 changes: 34 additions & 26 deletions HaishinKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import PackageDescription
let package = Package(
name: "HaishinKit",
platforms: [
.iOS(.v12),
.tvOS(.v12),
.iOS(.v13),
.tvOS(.v13),
.visionOS(.v1),
.macOS(.v10_13),
.macOS(.v10_15),
.macCatalyst(.v14)
],
products: [
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ open HaishinKit.xcodeproj
### OS
|-|iOS|tvOS|macOS|visionOS|watchOS|
|:----|:----:|:----:|:----:|:----:|:----:|
|HaishinKit|12.0+|12.0+|10.13+|1.0+|-|
|SRTHaishinKit|12.0+|-|13.0+|-|-|
|HaishinKit|13.0+|13.0+|10.15+|1.0+|-|
|SRTHaishinKit|13.0+|-|13.0+|-|-|

### Cocoa Keys
Please contains Info.plist.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Codec/VideoCodec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ final class VideoCodec<T: VideoCodecDelegate> {
var attributes: [NSString: AnyObject] = [:]
if let inputFormat {
// Specify the pixel format of the uncompressed video.
attributes[kCVPixelBufferPixelFormatTypeKey] = inputFormat._mediaSubType as CFNumber
attributes[kCVPixelBufferPixelFormatTypeKey] = inputFormat.mediaType.rawValue as CFNumber
}
return attributes.isEmpty ? nil : attributes
case .decompression:
Expand Down
9 changes: 1 addition & 8 deletions Sources/Extension/AVCaptureDevice.Format+Extension.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import AVFoundation
import Foundation

#if os(iOS)
extension AVCaptureDevice.Format {
@available(iOS, obsoleted: 13.0)
var isMultiCamSupported: Bool {
return false
}
}
#elseif os(macOS)
#if os(macOS)
extension AVCaptureDevice.Format {
var isMultiCamSupported: Bool {
return true
Expand Down
7 changes: 0 additions & 7 deletions Sources/Extension/AVCaptureSession.Preset+Extension.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import AVFoundation
import Foundation

#if os(macOS)
extension AVCaptureSession.Preset {
@available(macOS, obsoleted: 10.15)
private static let hd1920x1080 = AVCaptureSession.Preset(rawValue: "")
}
#endif

#if os(iOS) || os(tvOS) || os(macOS)
@available(tvOS 17.0, *)
extension AVCaptureSession.Preset {
Expand Down
7 changes: 0 additions & 7 deletions Sources/Extension/CMBlockBuffer+Extension.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import CoreMedia

extension CMBlockBuffer {
@available(iOS, obsoleted: 13.0)
@available(tvOS, obsoleted: 13.0)
@available(macOS, obsoleted: 10.15)
var dataLength: Int {
CMBlockBufferGetDataLength(self)
}

var data: Data? {
var length = 0
var buffer: UnsafeMutablePointer<Int8>?
Expand Down
11 changes: 0 additions & 11 deletions Sources/Extension/CMBufferQueue+Extension.swift

This file was deleted.

19 changes: 0 additions & 19 deletions Sources/Extension/CMFormatDescription+Extension.swift

This file was deleted.

63 changes: 0 additions & 63 deletions Sources/Extension/CMSampleBuffer+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,69 +14,6 @@ extension CMSampleBuffer {
}
}

@available(iOS, obsoleted: 13.0)
@available(tvOS, obsoleted: 13.0)
@available(macOS, obsoleted: 10.15)
var isValid: Bool {
CMSampleBufferIsValid(self)
}

@available(iOS, obsoleted: 13.0)
@available(tvOS, obsoleted: 13.0)
@available(macOS, obsoleted: 10.15)
var dataBuffer: CMBlockBuffer? {
get {
CMSampleBufferGetDataBuffer(self)
}
set {
_ = newValue.map {
CMSampleBufferSetDataBuffer(self, newValue: $0)
}
}
}

@available(iOS, obsoleted: 13.0)
@available(tvOS, obsoleted: 13.0)
@available(macOS, obsoleted: 10.15)
var imageBuffer: CVImageBuffer? {
CMSampleBufferGetImageBuffer(self)
}

@available(iOS, obsoleted: 13.0)
@available(tvOS, obsoleted: 13.0)
@available(macOS, obsoleted: 10.15)
var numSamples: CMItemCount {
CMSampleBufferGetNumSamples(self)
}

@available(iOS, obsoleted: 13.0)
@available(tvOS, obsoleted: 13.0)
@available(macOS, obsoleted: 10.15)
var duration: CMTime {
CMSampleBufferGetDuration(self)
}

@available(iOS, obsoleted: 13.0)
@available(tvOS, obsoleted: 13.0)
@available(macOS, obsoleted: 10.15)
var formatDescription: CMFormatDescription? {
CMSampleBufferGetFormatDescription(self)
}

@available(iOS, obsoleted: 13.0)
@available(tvOS, obsoleted: 13.0)
@available(macOS, obsoleted: 10.15)
var decodeTimeStamp: CMTime {
CMSampleBufferGetDecodeTimeStamp(self)
}

@available(iOS, obsoleted: 13.0)
@available(tvOS, obsoleted: 13.0)
@available(macOS, obsoleted: 10.15)
var presentationTimeStamp: CMTime {
CMSampleBufferGetPresentationTimeStamp(self)
}

func muted(_ muted: Bool) -> CMSampleBuffer {
guard muted else {
return self
Expand Down
7 changes: 0 additions & 7 deletions Sources/Extension/CMVideoFormatDescription+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ import CoreImage
import CoreMedia

extension CMVideoFormatDescription {
@available(iOS, obsoleted: 13.0)
@available(tvOS, obsoleted: 13.0)
@available(macOS, obsoleted: 10.15)
var dimensions: CMVideoDimensions {
CMVideoFormatDescriptionGetDimensions(self)
}

var isCompressed: Bool {
switch CMFormatDescriptionGetMediaSubType(self) {
case kCVPixelFormatType_1Monochrome,
Expand Down
22 changes: 0 additions & 22 deletions Sources/Extension/vImage_CGImageFormat+Extension.swift

This file was deleted.

6 changes: 3 additions & 3 deletions Sources/IO/IOStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,12 @@ open class IOStream: NSObject {
/// Append a CMSampleBuffer.
/// - Warning: This method can't use attachCamera or attachAudio method at the same time.
public func append(_ sampleBuffer: CMSampleBuffer, channel: UInt8 = 0) {
switch sampleBuffer.formatDescription?._mediaType {
case kCMMediaType_Audio:
switch sampleBuffer.formatDescription?.mediaType {
case .audio?:
mixer.audioIO.lockQueue.async {
self.mixer.audioIO.append(sampleBuffer, channel: channel)
}
case kCMMediaType_Video:
case .video?:
mixer.videoIO.lockQueue.async {
self.mixer.videoIO.append(sampleBuffer, channel: channel)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/IO/IOStreamRecorder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public final class IOStreamRecorder {
guard isRunning.value else {
return
}
let mediaType: AVMediaType = (sampleBuffer.formatDescription?._mediaType == kCMMediaType_Video) ? .video : .audio
let mediaType: AVMediaType = (sampleBuffer.formatDescription?.mediaType == .video) ? .video : .audio
lockQueue.async {
guard
let writer = self.writer,
Expand Down
2 changes: 1 addition & 1 deletion Tests/Media/IORecorderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AVFoundation

@testable import HaishinKit

final class IORecorderTests: XCTestCase, IORecorderDelegate {
final class IORecorderTests: XCTestCase, IOStreamRecorderDelegate {
func testRecorder2channel() {
let recorder = IOStreamRecorder()
recorder.delegate = self
Expand Down

0 comments on commit 11a0883

Please sign in to comment.