Skip to content

Commit

Permalink
Merge pull request #36 from 100mslive/0.3.1Release
Browse files Browse the repository at this point in the history
0.3.1 Release
  • Loading branch information
gzerad authored May 31, 2022
2 parents 6f9886c + 1aa0896 commit 5fefd93
Show file tree
Hide file tree
Showing 28 changed files with 1,109 additions and 157 deletions.
573 changes: 489 additions & 84 deletions Example/HMSSDKExample.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -67,6 +67,18 @@
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
<AdditionalOption
key = "MallocStackLogging"
value = ""
isEnabled = "YES">
</AdditionalOption>
<AdditionalOption
key = "PrefersMallocStackLoggingLite"
value = ""
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1330"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "87606EB028112CFD002BAB14"
BuildableName = "HMSScreenShare.appex"
BlueprintName = "HMSScreenShare"
ReferencedContainer = "container:HMSSDKExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "HMSSDKExample.app"
BlueprintName = "HMSSDKExample"
ReferencedContainer = "container:HMSSDKExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "1"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "HMSSDKExample.app"
BlueprintName = "HMSSDKExample"
ReferencedContainer = "container:HMSSDKExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "HMSSDKExample.app"
BlueprintName = "HMSSDKExample"
ReferencedContainer = "container:HMSSDKExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1330"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "87606EBB28112CFE002BAB14"
BuildableName = "HMSScreenShareSetupUI.appex"
BlueprintName = "HMSScreenShareSetupUI"
ReferencedContainer = "container:HMSSDKExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "HMSSDKExample.app"
BlueprintName = "HMSSDKExample"
ReferencedContainer = "container:HMSSDKExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "HMSSDKExample.app"
BlueprintName = "HMSSDKExample"
ReferencedContainer = "container:HMSSDKExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "HMSSDKExample.app"
BlueprintName = "HMSSDKExample"
ReferencedContainer = "container:HMSSDKExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
4 changes: 0 additions & 4 deletions Example/HMSSDKExample/Login/LoginViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ final class LoginViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
joinMeetingIDField.text = UserDefaults.standard.string(forKey: Constants.roomIDKey) ?? Constants.defaultRoomID
settingsButton.imageView?.rotate()
}

override func willTransition(to newCollection: UITraitCollection,
Expand Down Expand Up @@ -102,9 +101,6 @@ final class LoginViewController: UIViewController {
self?.showInputAlert()
}

_ = NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: .main) { [weak self] _ in
self?.settingsButton.imageView?.rotate()
}
}

private func checkIfInMeeting() -> Bool {
Expand Down
34 changes: 30 additions & 4 deletions Example/HMSSDKExample/Meeting/Base.lproj/Meeting.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Renderer View Controller-->
<scene sceneID="jxa-33-rWK">
<objects>
<viewController storyboardIdentifier="Renderer" id="Wji-vq-dRm" userLabel="Renderer View Controller" customClass="Renderer" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="hnD-UL-2YV">
<rect key="frame" x="0.0" y="0.0" width="390" height="844"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="juO-5b-3xO"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="43O-Lo-TvK" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-803" y="54"/>
</scene>
<!--Meeting View Controller-->
<scene sceneID="AB1-0p-zeJ">
<objects>
Expand Down Expand Up @@ -71,8 +86,15 @@
<action selector="muteRemoteStreamsTapped:" destination="mjG-Ba-if7" eventType="touchUpInside" id="Jbp-9w-rfQ"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6PQ-EF-D0Z">
<rect key="frame" x="206" y="45" width="44" height="42"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="width" constant="44" id="efE-lH-XKC"/>
</constraints>
</view>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gdt-Kd-OJO">
<rect key="frame" x="8" y="44" width="246" height="44"/>
<rect key="frame" x="8" y="44" width="198" height="44"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle2"/>
<state key="normal" title="Room ">
<color key="titleColor" systemColor="linkColor"/>
Expand Down Expand Up @@ -385,18 +407,21 @@
<constraints>
<constraint firstItem="K2O-AH-YXe" firstAttribute="top" secondItem="NKq-UE-p7N" secondAttribute="bottom" id="0lS-Zz-6am"/>
<constraint firstItem="DyH-bp-NTF" firstAttribute="top" secondItem="gdt-Kd-OJO" secondAttribute="bottom" constant="8" symbolic="YES" id="6BK-wy-0t3"/>
<constraint firstItem="i1F-BP-LLz" firstAttribute="leading" secondItem="6PQ-EF-D0Z" secondAttribute="trailing" id="6FG-G7-hEe"/>
<constraint firstItem="kDS-UD-GQA" firstAttribute="trailing" secondItem="NKq-UE-p7N" secondAttribute="trailing" id="6G9-wL-MJg"/>
<constraint firstItem="kDS-UD-GQA" firstAttribute="trailing" secondItem="DyH-bp-NTF" secondAttribute="trailing" id="93z-Xv-J5z"/>
<constraint firstItem="gdt-Kd-OJO" firstAttribute="bottom" secondItem="6PQ-EF-D0Z" secondAttribute="bottom" constant="1" id="9MA-j1-gy1"/>
<constraint firstItem="kDS-UD-GQA" firstAttribute="trailing" secondItem="Zy8-cT-272" secondAttribute="trailing" id="BaR-jR-XPe"/>
<constraint firstItem="gdt-Kd-OJO" firstAttribute="top" secondItem="i1F-BP-LLz" secondAttribute="top" id="DZN-P3-ehW"/>
<constraint firstItem="e9C-pq-ppt" firstAttribute="top" secondItem="dbh-7g-s3g" secondAttribute="top" id="EaT-W8-Za3"/>
<constraint firstItem="e9C-pq-ppt" firstAttribute="bottom" secondItem="dbh-7g-s3g" secondAttribute="bottom" id="H2q-rx-LEt"/>
<constraint firstItem="e9C-pq-ppt" firstAttribute="leading" secondItem="i1F-BP-LLz" secondAttribute="trailing" id="Iix-A7-yaH"/>
<constraint firstItem="DyH-bp-NTF" firstAttribute="top" secondItem="kDS-UD-GQA" secondAttribute="top" id="Ny9-re-MbV"/>
<constraint firstItem="DyH-bp-NTF" firstAttribute="top" secondItem="6PQ-EF-D0Z" secondAttribute="bottom" id="Ny9-re-MbV"/>
<constraint firstItem="DyH-bp-NTF" firstAttribute="leading" secondItem="kDS-UD-GQA" secondAttribute="leading" id="OJf-s2-MkC"/>
<constraint firstItem="i1F-BP-LLz" firstAttribute="top" secondItem="e9C-pq-ppt" secondAttribute="top" id="OvR-sO-FCg"/>
<constraint firstItem="kDS-UD-GQA" firstAttribute="trailing" secondItem="dbh-7g-s3g" secondAttribute="trailing" constant="8" id="XEz-uO-kgn"/>
<constraint firstItem="i1F-BP-LLz" firstAttribute="leading" secondItem="gdt-Kd-OJO" secondAttribute="trailing" constant="-4" id="Y3D-QU-DJO"/>
<constraint firstItem="6PQ-EF-D0Z" firstAttribute="leading" secondItem="gdt-Kd-OJO" secondAttribute="trailing" id="Y3D-QU-DJO"/>
<constraint firstItem="6PQ-EF-D0Z" firstAttribute="top" secondItem="gdt-Kd-OJO" secondAttribute="top" constant="1" id="Y7w-9P-98J"/>
<constraint firstItem="K2O-AH-YXe" firstAttribute="leading" secondItem="kDS-UD-GQA" secondAttribute="leading" id="YoD-sn-wZC"/>
<constraint firstItem="DyH-bp-NTF" firstAttribute="top" secondItem="dbh-7g-s3g" secondAttribute="bottom" id="ZNn-6N-Bo0"/>
<constraint firstItem="i1F-BP-LLz" firstAttribute="bottom" secondItem="e9C-pq-ppt" secondAttribute="bottom" id="Zkr-SO-5Bf"/>
Expand Down Expand Up @@ -446,6 +471,7 @@
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="broadcasterPickerContainer" destination="6PQ-EF-D0Z" id="esm-Pr-1Hh"/>
<outlet property="collectionView" destination="DyH-bp-NTF" id="pNW-T6-NPM"/>
<outlet property="hlsContainer" destination="K2O-AH-YXe" id="3Dd-bc-NeZ"/>
<outlet property="loadingIcon" destination="Zy8-cT-272" id="f5F-JG-r68"/>
Expand All @@ -458,7 +484,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dZE-GK-SnT" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="82.6171875" y="62.811127379209367"/>
<point key="canvasLocation" x="81.538461538461533" y="62.559241706161131"/>
</scene>
<!--Role Preview View Controller-->
<scene sceneID="N2p-5T-n6b">
Expand Down
79 changes: 79 additions & 0 deletions Example/HMSSDKExample/Meeting/GrayscaleVideoPlugin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
//
// GrayscaleVideoPlugin.swift
// HMSSDKExample
//
// Created by Pawan Dixit on 16/04/22.
// Copyright © 2022 100ms. All rights reserved.
//

import Foundation
import HMSSDK

class GrayscaleVideoPlugin: HMSVideoPlugin {

static let defaultAttributes: [NSString: NSObject] = [
kCVPixelBufferPixelFormatTypeKey: NSNumber(value: kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange),
kCVPixelBufferIOSurfacePropertiesKey : [:] as NSDictionary
]

private var attributes: [NSString: NSObject] {
var attributes: [NSString: NSObject] = Self.defaultAttributes
attributes[kCVPixelBufferWidthKey] = NSNumber(value: Int(extent.width))
attributes[kCVPixelBufferHeightKey] = NSNumber(value: Int(extent.height))
return attributes
}

private var _pixelBufferPool: CVPixelBufferPool?
private var pixelBufferPool: CVPixelBufferPool! {
get {
if _pixelBufferPool == nil {
var pixelBufferPool: CVPixelBufferPool?
CVPixelBufferPoolCreate(nil, nil, attributes as CFDictionary?, &pixelBufferPool)
_pixelBufferPool = pixelBufferPool
}
return _pixelBufferPool!
}
set {
_pixelBufferPool = newValue
}
}

private var extent = CGRect.zero {
didSet {
guard extent != oldValue else { return }
pixelBufferPool = nil
}
}

let ciContext = CIContext(options: nil)

override func process(_ frame: CVPixelBuffer) -> CVPixelBuffer {
let inputImage = CIImage(cvPixelBuffer: frame)

guard let outputImage = inputImage.grayscale else { return frame }

var outputBuffer: CVImageBuffer?

extent = outputImage.extent

CVPixelBufferPoolCreatePixelBuffer(nil, pixelBufferPool, &outputBuffer)

if let outputBuffer = outputBuffer {
ciContext.render(outputImage, to: outputBuffer)
}
return outputBuffer ?? frame
}
}

extension CIImage {
var grayscale: CIImage? {
let context = CIContext(options: nil)
guard let currentFilter = CIFilter(name: "CIPhotoEffectNoir") else { return nil }
currentFilter.setValue(self, forKey: kCIInputImageKey)
if let output = currentFilter.outputImage,
let cgImage = context.createCGImage(output, from: output.extent) {
return CIImage(cgImage: cgImage)
}
return nil
}
}
Loading

0 comments on commit 5fefd93

Please sign in to comment.