blob: 83a8b79ebe72339a6fc89b8cdf4a0188d81c8779 [file] [log] [blame]
Jon Hjellef6c318e2016-01-11 14:39:01 -08001/*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
tkchin9eeb6242016-04-27 01:54:20 -070011#import "RTCVideoSource+Private.h"
Jon Hjellef6c318e2016-01-11 14:39:01 -080012
tkchind4bfbfc2016-08-30 11:56:05 -070013#include "webrtc/base/checks.h"
14
Jon Hjelle065aacc2016-01-20 13:25:44 -080015@implementation RTCVideoSource {
perkja3ede6c2016-03-08 01:27:48 +010016 rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> _nativeVideoSource;
Jon Hjellef6c318e2016-01-11 14:39:01 -080017}
18
tkchind4bfbfc2016-08-30 11:56:05 -070019- (instancetype)initWithNativeVideoSource:
20 (rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>)nativeVideoSource {
21 RTC_DCHECK(nativeVideoSource);
22 if (self = [super initWithNativeMediaSource:nativeVideoSource
23 type:RTCMediaSourceTypeVideo]) {
24 _nativeVideoSource = nativeVideoSource;
25 }
26 return self;
27}
28
29- (instancetype)initWithNativeMediaSource:
30 (rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
31 type:(RTCMediaSourceType)type {
32 RTC_NOTREACHED();
33 return nil;
Jon Hjellef6c318e2016-01-11 14:39:01 -080034}
35
36- (NSString *)description {
tkchind4bfbfc2016-08-30 11:56:05 -070037 NSString *stateString = [[self class] stringForState:self.state];
38 return [NSString stringWithFormat:@"RTCVideoSource( %p ): %@", self, stateString];
Jon Hjellef6c318e2016-01-11 14:39:01 -080039}
40
41#pragma mark - Private
42
perkja3ede6c2016-03-08 01:27:48 +010043- (rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>)nativeVideoSource {
Jon Hjelle065aacc2016-01-20 13:25:44 -080044 return _nativeVideoSource;
Jon Hjellef6c318e2016-01-11 14:39:01 -080045}
46
Jon Hjellef6c318e2016-01-11 14:39:01 -080047@end