| Index: webrtc/sdk/objc/Framework/Classes/RTCMediaSource.mm
|
| diff --git a/webrtc/sdk/objc/Framework/Classes/RTCVideoSource.mm b/webrtc/sdk/objc/Framework/Classes/RTCMediaSource.mm
|
| similarity index 69%
|
| copy from webrtc/sdk/objc/Framework/Classes/RTCVideoSource.mm
|
| copy to webrtc/sdk/objc/Framework/Classes/RTCMediaSource.mm
|
| index eddf5e0c684d7ad51a0d0360053d700fc0942b00..996563b6506764e560e2a9fe4a6ccd0e5d77521b 100644
|
| --- a/webrtc/sdk/objc/Framework/Classes/RTCVideoSource.mm
|
| +++ b/webrtc/sdk/objc/Framework/Classes/RTCMediaSource.mm
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
| + * Copyright 2016 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
|
| @@ -8,36 +8,33 @@
|
| * be found in the AUTHORS file in the root of the source tree.
|
| */
|
|
|
| -#import "RTCVideoSource+Private.h"
|
| +#import "RTCMediaSource+Private.h"
|
|
|
| -@implementation RTCVideoSource {
|
| - rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> _nativeVideoSource;
|
| -}
|
| -
|
| -- (RTCSourceState)state {
|
| - return [[self class] sourceStateForNativeState:_nativeVideoSource->state()];
|
| -}
|
| +#include "webrtc/base/checks.h"
|
|
|
| -- (NSString *)description {
|
| - return [NSString stringWithFormat:@"RTCVideoSource:\n%@",
|
| - [[self class] stringForState:self.state]];
|
| +@implementation RTCMediaSource {
|
| + RTCMediaSourceType _type;
|
| }
|
|
|
| -#pragma mark - Private
|
| -
|
| -- (rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>)nativeVideoSource {
|
| - return _nativeVideoSource;
|
| -}
|
| +@synthesize nativeMediaSource = _nativeMediaSource;
|
|
|
| -- (instancetype)initWithNativeVideoSource:
|
| - (rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>)nativeVideoSource {
|
| - NSParameterAssert(nativeVideoSource);
|
| +- (instancetype)initWithNativeMediaSource:
|
| + (rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
|
| + type:(RTCMediaSourceType)type {
|
| + RTC_DCHECK(nativeMediaSource);
|
| if (self = [super init]) {
|
| - _nativeVideoSource = nativeVideoSource;
|
| + _nativeMediaSource = nativeMediaSource;
|
| + _type = type;
|
| }
|
| return self;
|
| }
|
|
|
| +- (RTCSourceState)state {
|
| + return [[self class] sourceStateForNativeState:_nativeMediaSource->state()];
|
| +}
|
| +
|
| +#pragma mark - Private
|
| +
|
| + (webrtc::MediaSourceInterface::SourceState)nativeSourceStateForState:
|
| (RTCSourceState)state {
|
| switch (state) {
|
|
|