Skip to content

Commit

Permalink
Suppress warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo4405 committed Sep 6, 2023
1 parent 61c5b48 commit c0ab299
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 10 deletions.
10 changes: 5 additions & 5 deletions HaishinKit.podspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Pod::Spec.new do |s|

s.name = "HaishinKit"
s.version = "1.5.7"
s.version = "1.6.0"
s.summary = "Camera and Microphone streaming library via RTMP, HLS for iOS, macOS and tvOS."
s.swift_version = "5.7"
s.swift_version = "5.8"

s.description = <<-DESC
HaishinKit. Camera and Microphone streaming library via RTMP, HLS for iOS, macOS and tvOS.
Expand All @@ -15,16 +15,16 @@ Pod::Spec.new do |s|
s.authors = { "shogo4405" => "[email protected]" }
s.source = { :git => "https://github.com/shogo4405/HaishinKit.swift.git", :tag => "#{s.version}" }

s.ios.deployment_target = "11.0"
s.ios.deployment_target = "12.0"
s.ios.source_files = "Platforms/iOS/*.{h,swift}"

s.osx.deployment_target = "10.13"
s.osx.source_files = "Platforms/iOS/*.{h,swift}"

s.tvos.deployment_target = "11.0"
s.tvos.deployment_target = "12.0"
s.tvos.source_files = "Platforms/iOS/*.{h,swift}"

s.source_files = "Sources/**/*.swift"
s.dependency 'Logboard', '~> 2.3.1'
s.dependency 'Logboard', '~> 2.4.1'

end
18 changes: 15 additions & 3 deletions HaishinKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
2EC97B7327880FF400D8BE32 /* Views.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EC97B6F27880FF400D8BE32 /* Views.swift */; };
2EC97B7427880FF400D8BE32 /* MTHKSwiftUiView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EC97B7027880FF400D8BE32 /* MTHKSwiftUiView.swift */; };
BC0394562AA8A384006EDE38 /* Logboard.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC34DFD125EBB12C005F975A /* Logboard.xcframework */; };
BC03945F2AA8AFF5006EDE38 /* ExpressibleByIntegerLiteral+ExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC03945E2AA8AFF5006EDE38 /* ExpressibleByIntegerLiteral+ExtensionTests.swift */; };
BC0BF4F22985FA9000D72CB4 /* HaishinKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2945CBBD1B4BE66000104112 /* HaishinKit.framework */; };
BC0BF4F529866FDE00D72CB4 /* IOMixerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0BF4F429866FDE00D72CB4 /* IOMixerTests.swift */; };
BC0D236D26331BAB001DDA0C /* DataBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC0D236C26331BAB001DDA0C /* DataBuffer.swift */; };
Expand Down Expand Up @@ -527,6 +528,7 @@
2EC97B6E27880FF400D8BE32 /* OnTapGestureView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnTapGestureView.swift; sourceTree = "<group>"; };
2EC97B6F27880FF400D8BE32 /* Views.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Views.swift; sourceTree = "<group>"; };
2EC97B7027880FF400D8BE32 /* MTHKSwiftUiView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MTHKSwiftUiView.swift; sourceTree = "<group>"; };
BC03945E2AA8AFF5006EDE38 /* ExpressibleByIntegerLiteral+ExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ExpressibleByIntegerLiteral+ExtensionTests.swift"; sourceTree = "<group>"; };
BC0BF4F429866FDE00D72CB4 /* IOMixerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IOMixerTests.swift; sourceTree = "<group>"; };
BC0D236C26331BAB001DDA0C /* DataBuffer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataBuffer.swift; sourceTree = "<group>"; };
BC11023D2917C35B00D48035 /* CVPixelBufferPool+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CVPixelBufferPool+Extension.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -959,16 +961,17 @@
29798E5A1CE60E5300F5CBD0 /* Tests */ = {
isa = PBXGroup;
children = (
29798E5D1CE60E5300F5CBD0 /* Info.plist */,
295018211FFA1C9D00358E10 /* CMAudioSampleBufferTestUtil.swift */,
294637A71EC89BC9008EEC71 /* Config.swift */,
291C2AD11CE9FF3E006F042B /* Asset */,
295018191FFA196800358E10 /* Codec */,
294637A71EC89BC9008EEC71 /* Config.swift */,
291C2AD21CE9FF48006F042B /* Core */,
BC03945D2AA8AFDD006EDE38 /* Extension */,
BC1DC5022A02893600E928ED /* FLV */,
29798E5D1CE60E5300F5CBD0 /* Info.plist */,
BC0BF4F329866FB700D72CB4 /* Media */,
291C2ACF1CE9FF2B006F042B /* MPEG */,
291C2ACE1CE9FF25006F042B /* RTMP */,
295018211FFA1C9D00358E10 /* CMAudioSampleBufferTestUtil.swift */,
291C2AD01CE9FF33006F042B /* Util */,
);
path = Tests;
Expand Down Expand Up @@ -1133,6 +1136,14 @@
path = View;
sourceTree = "<group>";
};
BC03945D2AA8AFDD006EDE38 /* Extension */ = {
isa = PBXGroup;
children = (
BC03945E2AA8AFF5006EDE38 /* ExpressibleByIntegerLiteral+ExtensionTests.swift */,
);
path = Extension;
sourceTree = "<group>";
};
BC0BF4F329866FB700D72CB4 /* Media */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1810,6 +1821,7 @@
BCCBCE9B29A9D96A0095B51C /* NALUnitReaderTests.swift in Sources */,
290EA8A11DFB61B100053022 /* RTMPChunkTests.swift in Sources */,
290EA89F1DFB61B100053022 /* AMF0SerializerTests.swift in Sources */,
BC03945F2AA8AFF5006EDE38 /* ExpressibleByIntegerLiteral+ExtensionTests.swift in Sources */,
290EA8AA1DFB61E700053022 /* CRC32Tests.swift in Sources */,
035AFA042263868E009DD0BB /* RTMPStreamTests.swift in Sources */,
290686031DFDB7A7008EB7ED /* RTMPConnectionTests.swift in Sources */,
Expand Down
5 changes: 3 additions & 2 deletions Sources/Extension/ExpressibleByIntegerLiteral+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import Foundation

extension ExpressibleByIntegerLiteral {
var data: Data {
var value: Self = self
return Data(bytes: &value, count: MemoryLayout<Self>.size)
return withUnsafePointer(to: self) { value in
return Data(bytes: UnsafeRawPointer(value), count: MemoryLayout<Self>.size)
}
}

init(data: Data) {
Expand Down
30 changes: 30 additions & 0 deletions Tests/Extension/ExpressibleByIntegerLiteral+ExtensionTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import Foundation
import XCTest

@testable import HaishinKit

final class ExpressibleByIntegerLiteralTests: XCTestCase {
func testInt32() {
XCTAssertEqual(Int32.min.bigEndian.data, Data([128, 0, 0, 0]))
XCTAssertEqual(Int32(32).bigEndian.data, Data([0, 0, 0, 32]))
XCTAssertEqual(Int32.max.bigEndian.data, Data([127, 255, 255, 255]))
}

func testUInt32() {
XCTAssertEqual(UInt32.min.bigEndian.data, Data([0, 0, 0, 0]))
XCTAssertEqual(UInt32(32).bigEndian.data, Data([0, 0, 0, 32]))
XCTAssertEqual(UInt32.max.bigEndian.data, Data([255, 255, 255, 255]))
}

func testInt64() {
XCTAssertEqual(Int64.min.bigEndian.data, Data([128, 0, 0, 0, 0, 0, 0, 0]))
XCTAssertEqual(Int64(32).bigEndian.data, Data([0, 0, 0, 0, 0, 0, 0, 32]))
XCTAssertEqual(Int64.max.bigEndian.data, Data([127,255,255, 255, 255, 255, 255, 255]))
}

func testUInt64() {
XCTAssertEqual(UInt64.min.bigEndian.data, Data([0, 0, 0, 0, 0, 0, 0, 0]))
XCTAssertEqual(UInt64(32).bigEndian.data, Data([0, 0, 0, 0, 0, 0, 0, 32]))
XCTAssertEqual(UInt64.max.bigEndian.data, Data([255, 255, 255, 255, 255, 255, 255, 255]))
}
}

0 comments on commit c0ab299

Please sign in to comment.