| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #import "RTCMediaSource.h" | 11 #import "RTCVideoSource.h" |
| 12 | 12 |
| 13 #import "webrtc/api/objc/RTCMediaSource+Private.h" | 13 #import "webrtc/api/objc/RTCVideoSource+Private.h" |
| 14 | 14 |
| 15 @implementation RTCMediaSource { | 15 @implementation RTCVideoSource { |
| 16 rtc::scoped_refptr<webrtc::MediaSourceInterface> _nativeMediaSource; | 16 rtc::scoped_refptr<webrtc::VideoSourceInterface> _nativeVideoSource; |
| 17 } | 17 } |
| 18 | 18 |
| 19 - (RTCSourceState)state { | 19 - (RTCSourceState)state { |
| 20 return [[self class] sourceStateForNativeState:_nativeMediaSource->state()]; | 20 return [[self class] sourceStateForNativeState:_nativeVideoSource->state()]; |
| 21 } | 21 } |
| 22 | 22 |
| 23 - (NSString *)description { | 23 - (NSString *)description { |
| 24 return [NSString stringWithFormat:@"RTCMediaSource:\n%@", | 24 return [NSString stringWithFormat:@"RTCVideoSource:\n%@", |
| 25 [[self class] stringForState:self.state]]; | 25 [[self class] stringForState:self.state]]; |
| 26 } | 26 } |
| 27 | 27 |
| 28 #pragma mark - Private | 28 #pragma mark - Private |
| 29 | 29 |
| 30 - (rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource { | 30 - (rtc::scoped_refptr<webrtc::VideoSourceInterface>)nativeVideoSource { |
| 31 return _nativeMediaSource; | 31 return _nativeVideoSource; |
| 32 } | 32 } |
| 33 | 33 |
| 34 - (instancetype)initWithNativeMediaSource: | 34 - (instancetype)initWithNativeVideoSource: |
| 35 (rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource { | 35 (rtc::scoped_refptr<webrtc::VideoSourceInterface>)nativeVideoSource { |
| 36 NSParameterAssert(nativeMediaSource); | 36 NSParameterAssert(nativeVideoSource); |
| 37 if (self = [super init]) { | 37 if (self = [super init]) { |
| 38 _nativeMediaSource = nativeMediaSource; | 38 _nativeVideoSource = nativeVideoSource; |
| 39 } | 39 } |
| 40 return self; | 40 return self; |
| 41 } | 41 } |
| 42 | 42 |
| 43 + (webrtc::MediaSourceInterface::SourceState)nativeSourceStateForState: | 43 + (webrtc::MediaSourceInterface::SourceState)nativeSourceStateForState: |
| 44 (RTCSourceState)state { | 44 (RTCSourceState)state { |
| 45 switch (state) { | 45 switch (state) { |
| 46 case RTCSourceStateInitializing: | 46 case RTCSourceStateInitializing: |
| 47 return webrtc::MediaSourceInterface::kInitializing; | 47 return webrtc::MediaSourceInterface::kInitializing; |
| 48 case RTCSourceStateLive: | 48 case RTCSourceStateLive: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 75 case RTCSourceStateLive: | 75 case RTCSourceStateLive: |
| 76 return @"Live"; | 76 return @"Live"; |
| 77 case RTCSourceStateEnded: | 77 case RTCSourceStateEnded: |
| 78 return @"Ended"; | 78 return @"Ended"; |
| 79 case RTCSourceStateMuted: | 79 case RTCSourceStateMuted: |
| 80 return @"Muted"; | 80 return @"Muted"; |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 @end | 84 @end |
| OLD | NEW |