diff --git a/webrtc/api/BUILD.gn b/webrtc/api/BUILD.gn index 7cfa083a6b..26225c43a8 100644 --- a/webrtc/api/BUILD.gn +++ b/webrtc/api/BUILD.gn @@ -32,12 +32,12 @@ if (is_ios) { #"objc/RTCIceCandidate+Private.h", #"objc/RTCIceCandidate.h", #"objc/RTCIceCandidate.mm", - #"objc/RTCMediaSource+Private.h", - #"objc/RTCMediaSource.h", - #"objc/RTCMediaSource.mm", #"objc/RTCMediaStreamTrack+Private.h", #"objc/RTCMediaStreamTrack.h", #"objc/RTCMediaStreamTrack.mm", + #"objc/RTCVideoSource+Private.h", + #"objc/RTCVideoSource.h", + #"objc/RTCVideoSource.mm", "objc/RTCIceServer+Private.h", "objc/RTCIceServer.h", "objc/RTCIceServer.mm", diff --git a/webrtc/api/api.gyp b/webrtc/api/api.gyp index ba3fe8d0bd..87f90d9364 100644 --- a/webrtc/api/api.gyp +++ b/webrtc/api/api.gyp @@ -28,9 +28,6 @@ 'objc/RTCMediaConstraints+Private.h', 'objc/RTCMediaConstraints.h', 'objc/RTCMediaConstraints.mm', - 'objc/RTCMediaSource+Private.h', - 'objc/RTCMediaSource.h', - 'objc/RTCMediaSource.mm', 'objc/RTCMediaStreamTrack+Private.h', 'objc/RTCMediaStreamTrack.h', 'objc/RTCMediaStreamTrack.mm', @@ -46,6 +43,9 @@ 'objc/RTCVideoFrame.h', 'objc/RTCVideoFrame.mm', 'objc/RTCVideoRenderer.h', + 'objc/RTCVideoSource+Private.h', + 'objc/RTCVideoSource.h', + 'objc/RTCVideoSource.mm', ], 'conditions': [ ['OS=="ios"', { diff --git a/webrtc/api/objc/RTCMediaSource+Private.h b/webrtc/api/objc/RTCVideoSource+Private.h similarity index 66% rename from webrtc/api/objc/RTCMediaSource+Private.h rename to webrtc/api/objc/RTCVideoSource+Private.h index fcbaad8e45..2300848610 100644 --- a/webrtc/api/objc/RTCMediaSource+Private.h +++ b/webrtc/api/objc/RTCVideoSource+Private.h @@ -8,24 +8,24 @@ * be found in the AUTHORS file in the root of the source tree. */ -#import "RTCMediaSource.h" +#import "RTCVideoSource.h" -#include "talk/app/webrtc/mediastreaminterface.h" +#include "talk/app/webrtc/videosourceinterface.h" NS_ASSUME_NONNULL_BEGIN -@interface RTCMediaSource () +@interface RTCVideoSource () /** - * The MediaSourceInterface object passed to this RTCMediaSource during + * The VideoSourceInterface object passed to this RTCVideoSource during * construction. */ @property(nonatomic, readonly) - rtc::scoped_refptr nativeMediaSource; + rtc::scoped_refptr nativeVideoSource; -/** Initialize an RTCMediaSource from a native MediaSourceInterface. */ -- (instancetype)initWithNativeMediaSource: - (rtc::scoped_refptr)nativeMediaSource +/** Initialize an RTCVideoSource from a native VideoSourceInterface. */ +- (instancetype)initWithNativeVideoSource: + (rtc::scoped_refptr)nativeVideoSource NS_DESIGNATED_INITIALIZER; + (webrtc::MediaSourceInterface::SourceState)nativeSourceStateForState: diff --git a/webrtc/api/objc/RTCMediaSource.h b/webrtc/api/objc/RTCVideoSource.h similarity index 89% rename from webrtc/api/objc/RTCMediaSource.h rename to webrtc/api/objc/RTCVideoSource.h index 0b36b8d709..a98fa6c6bb 100644 --- a/webrtc/api/objc/RTCMediaSource.h +++ b/webrtc/api/objc/RTCVideoSource.h @@ -19,9 +19,9 @@ typedef NS_ENUM(NSInteger, RTCSourceState) { NS_ASSUME_NONNULL_BEGIN -@interface RTCMediaSource : NSObject +@interface RTCVideoSource : NSObject -/** The current state of the RTCMediaSource. */ +/** The current state of the RTCVideoSource. */ @property(nonatomic, readonly) RTCSourceState state; - (instancetype)init NS_UNAVAILABLE; diff --git a/webrtc/api/objc/RTCMediaSource.mm b/webrtc/api/objc/RTCVideoSource.mm similarity index 76% rename from webrtc/api/objc/RTCMediaSource.mm rename to webrtc/api/objc/RTCVideoSource.mm index 5f46ab8318..35f30e3b38 100644 --- a/webrtc/api/objc/RTCMediaSource.mm +++ b/webrtc/api/objc/RTCVideoSource.mm @@ -8,34 +8,34 @@ * be found in the AUTHORS file in the root of the source tree. */ -#import "RTCMediaSource.h" +#import "RTCVideoSource.h" -#import "webrtc/api/objc/RTCMediaSource+Private.h" +#import "webrtc/api/objc/RTCVideoSource+Private.h" -@implementation RTCMediaSource { - rtc::scoped_refptr _nativeMediaSource; +@implementation RTCVideoSource { + rtc::scoped_refptr _nativeVideoSource; } - (RTCSourceState)state { - return [[self class] sourceStateForNativeState:_nativeMediaSource->state()]; + return [[self class] sourceStateForNativeState:_nativeVideoSource->state()]; } - (NSString *)description { - return [NSString stringWithFormat:@"RTCMediaSource:\n%@", + return [NSString stringWithFormat:@"RTCVideoSource:\n%@", [[self class] stringForState:self.state]]; } #pragma mark - Private -- (rtc::scoped_refptr)nativeMediaSource { - return _nativeMediaSource; +- (rtc::scoped_refptr)nativeVideoSource { + return _nativeVideoSource; } -- (instancetype)initWithNativeMediaSource: - (rtc::scoped_refptr)nativeMediaSource { - NSParameterAssert(nativeMediaSource); +- (instancetype)initWithNativeVideoSource: + (rtc::scoped_refptr)nativeVideoSource { + NSParameterAssert(nativeVideoSource); if (self = [super init]) { - _nativeMediaSource = nativeMediaSource; + _nativeVideoSource = nativeVideoSource; } return self; }