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-Commit-Position: refs/heads/master@{#11325}
This commit is contained in:
Jon Hjelle 2016-01-20 13:25:44 -08:00 committed by Zeke Chin
parent d8dccd57ea
commit 065aacc249
5 changed files with 28 additions and 28 deletions

View File

@ -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",

View File

@ -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"', {

View File

@ -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:

View File

@ -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;

View File

@ -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;
}