This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections.Generic; | |
using Voximplant; | |
public class Conference : MonoBehaviour | |
{ | |
VoximplantSDK vox; | |
public GameObject quad; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to update image buffer in NV12 format with BGRA pixel buffer | |
// Assumptions: | |
// bgra buffer is 32bpp | |
// bgra buffer width and height equal to imageBuffer | |
// bgra buffer stride is equal to imageBuffer width | |
int UpdateSampleBufferWithBGRAPixels(CVImageBufferRef imageBuffer, void *bgraPixels) { | |
const OSType pixelFormat = CVPixelBufferGetPixelFormatType(imageBuffer); | |
assert(pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange || pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange); | |
const size_t width = CVPixelBufferGetWidth(imageBuffer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
class PerformanceTest: XCTestCase { | |
func testString() { // 0.265s on iPhone X | |
var array = [String]() | |
let strings = Array(1 ... 1_000_000).map { String($0) } | |
measure { | |
strings.forEach { | |
array.append($0) | |
} |