Files
platform-external-webrtc/webrtc/base/objc/RTCDispatcher.m
haysc edd8fefa9b Add new view that renders local video using AVCaptureLayerPreview.
BUG=

Review URL: https://codereview.webrtc.org/1497393002

Cr-Commit-Position: refs/heads/master@{#10940}
2015-12-08 19:08:44 +00:00

47 lines
1.3 KiB
Objective-C

/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#import "RTCDispatcher.h"
static dispatch_queue_t kCaptureSessionQueue = nil;
@implementation RTCDispatcher {
dispatch_queue_t _captureSessionQueue;
}
+ (void)initialize {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
kCaptureSessionQueue = dispatch_queue_create(
"org.webrtc.RTCDispatcherCaptureSession",
DISPATCH_QUEUE_SERIAL);
});
}
+ (void)dispatchAsyncOnType:(RTCDispatcherQueueType)dispatchType
block:(dispatch_block_t)block {
dispatch_queue_t queue = [self dispatchQueueForType:dispatchType];
dispatch_async(queue, block);
}
#pragma mark - Private
+ (dispatch_queue_t)dispatchQueueForType:(RTCDispatcherQueueType)dispatchType {
switch (dispatchType) {
case RTCDispatcherTypeMain:
return dispatch_get_main_queue();
case RTCDispatcherTypeCaptureSession:
return kCaptureSessionQueue;
}
}
@end