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
// | |
// Created by Gregory McQuillan on 12/23/16. | |
// Copyright (c) 2016 One Big Function. All rights reserved. | |
// | |
import WebRTC | |
import Foundation | |
class ARDSDPUtils { | |
/** |
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
// MARK: - AVCaptureVideoDataOutputSampleBufferDelegate extension {{{ | |
extension CtsVideoCallView: AVCaptureVideoDataOutputSampleBufferDelegate { | |
func captureOutput(_ captureOutput: AVCaptureOutput!, | |
didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, | |
from: AVCaptureConnection!) { | |
// get image size for preview and resize preview view accordingly | |
let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) | |
let attachments = CMCopyDictionaryOfAttachments(kCFAllocatorDefault, | |
sampleBuffer, kCMAttachmentMode_ShouldPropagate) as! Dictionary | |
let ciImage = CIImage(cvPixelBuffer: imageBuffer, options: attachments) |
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
var videoSources: [CtsVideoSource] { | |
var sources = [CtsVideoSource]() | |
for lv in left { | |
// for each left video | |
if let source = lv.videoSource { | |
sources.append(source) | |
} | |
} | |
for rv in right { |
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
// MARK: - AVCaptureVideoDataOutputSampleBufferDelegate extension {{{ | |
extension CtsVideoCallView: AVCaptureVideoDataOutputSampleBufferDelegate { | |
func captureOutput(_ captureOutput: AVCaptureOutput!, | |
didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, | |
from: AVCaptureConnection!) { | |
// get image size for preview and resize preview view accordingly | |
let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) | |
let attachmentMode = CMAttachmentMode(kCMAttachmentMode_ShouldPropagate) | |
let attachments = CMCopyDictionaryOfAttachments(kCFAllocatorDefault, sampleBuffer, attachmentMode) | |
let ciImage:CIImage = CIImage(cvPixelBuffer: pixelBuffer!, options: attachments as! [String : Any]?) |
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
pathadd() { | |
new_path=$1 | |
if [[ -z "$TMUX" ]]; then | |
if [[ -d "$new_path" ]]; then | |
if [[ $PATH =~ $new_path ]]; then | |
#echo -e "pathadd: not adding $new_path to \$PATH". | |
else | |
export -U PATH=$new_path:$PATH | |
fi | |
fi |
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
@objc(User) | |
final class User: NSObject, NSCoding { | |
let userId: Int | |
var email: String? | |
let name: String | |
var recentGames: [Int]? | |
/// nscoding keys | |
private static let ID_KEY = "id" |
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 System.Collections.Generic; | |
using NUnit.Framework; | |
using UnityEngine; | |
public class TestMaps | |
{ | |
[Test] | |
public void CyclicDependency() | |
{ | |
var machine = new FakeMachine<FakeStates, IFakeState>(); |
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 System.Collections.Generic; | |
using UnityEngine; | |
namespace Shaninja.Scripts { | |
public interface IInventory | |
{ | |
void AddCoin(); | |
void SetTotalCoins(int total); | |
void Reset(); |
OlderNewer