Move RTCVideoSource to webrtc/api/objc.
BUG=
R=tkchin@webrtc.org
Review URL: https://codereview.webrtc.org/1546783002 .
Patch from Jon Hjelle <hjon@andyet.net>.
Cr-Original-Commit-Position: refs/heads/master@{#11325}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 065aacc2490478062fc8128799d4ce90f5c8bcd6
diff --git a/api/BUILD.gn b/api/BUILD.gn
index 7cfa083..26225c4 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -32,12 +32,12 @@
#"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/api/api.gyp b/api/api.gyp
index ba3fe8d..87f90d9 100644
--- a/api/api.gyp
+++ b/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/api/objc/RTCMediaSource+Private.h b/api/objc/RTCVideoSource+Private.h
similarity index 67%
rename from api/objc/RTCMediaSource+Private.h
rename to api/objc/RTCVideoSource+Private.h
index fcbaad8..2300848 100644
--- a/api/objc/RTCMediaSource+Private.h
+++ b/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<webrtc::MediaSourceInterface> nativeMediaSource;
+ rtc::scoped_refptr<webrtc::VideoSourceInterface> nativeVideoSource;
-/** Initialize an RTCMediaSource from a native MediaSourceInterface. */
-- (instancetype)initWithNativeMediaSource:
- (rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
+/** Initialize an RTCVideoSource from a native VideoSourceInterface. */
+- (instancetype)initWithNativeVideoSource:
+ (rtc::scoped_refptr<webrtc::VideoSourceInterface>)nativeVideoSource
NS_DESIGNATED_INITIALIZER;
+ (webrtc::MediaSourceInterface::SourceState)nativeSourceStateForState:
diff --git a/api/objc/RTCMediaSource.h b/api/objc/RTCVideoSource.h
similarity index 89%
rename from api/objc/RTCMediaSource.h
rename to api/objc/RTCVideoSource.h
index 0b36b8d..a98fa6c 100644
--- a/api/objc/RTCMediaSource.h
+++ b/api/objc/RTCVideoSource.h
@@ -19,9 +19,9 @@
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/api/objc/RTCMediaSource.mm b/api/objc/RTCVideoSource.mm
similarity index 76%
rename from api/objc/RTCMediaSource.mm
rename to api/objc/RTCVideoSource.mm
index 5f46ab8..35f30e3 100644
--- a/api/objc/RTCMediaSource.mm
+++ b/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<webrtc::MediaSourceInterface> _nativeMediaSource;
+@implementation RTCVideoSource {
+ rtc::scoped_refptr<webrtc::VideoSourceInterface> _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<webrtc::MediaSourceInterface>)nativeMediaSource {
- return _nativeMediaSource;
+- (rtc::scoped_refptr<webrtc::VideoSourceInterface>)nativeVideoSource {
+ return _nativeVideoSource;
}
-- (instancetype)initWithNativeMediaSource:
- (rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource {
- NSParameterAssert(nativeMediaSource);
+- (instancetype)initWithNativeVideoSource:
+ (rtc::scoped_refptr<webrtc::VideoSourceInterface>)nativeVideoSource {
+ NSParameterAssert(nativeVideoSource);
if (self = [super init]) {
- _nativeMediaSource = nativeMediaSource;
+ _nativeVideoSource = nativeVideoSource;
}
return self;
}