OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2017 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 |
| 11 #import "RTCPeerConnectionFactory+Private.h" |
| 12 |
| 13 #import "NSString+StdString.h" |
| 14 #import "RTCAVFoundationVideoSource+Private.h" |
| 15 #import "RTCAudioSource+Private.h" |
| 16 #import "RTCAudioTrack+Private.h" |
| 17 #import "RTCMediaConstraints+Private.h" |
| 18 #import "RTCMediaStream+Private.h" |
| 19 #import "RTCPeerConnection+Private.h" |
| 20 #import "RTCVideoSource+Private.h" |
| 21 #import "RTCVideoTrack+Private.h" |
| 22 #import "WebRTC/RTCLogging.h" |
| 23 |
| 24 #include "Video/objcvideotracksource.h" |
| 25 #include "VideoToolbox/videocodecfactory.h" |
| 26 #include "webrtc/api/videosourceproxy.h" |
| 27 |
| 28 @implementation RTCPeerConnectionFactory (Video) |
| 29 |
| 30 - (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints: |
| 31 (nullable RTCMediaConstraints *)constraints { |
| 32 #ifdef HAVE_RTC_VIDEO |
| 33 return [[RTCAVFoundationVideoSource alloc] initWithFactory:self constraints:co
nstraints]; |
| 34 #else |
| 35 return nil; |
| 36 #endif |
| 37 } |
| 38 |
| 39 - (RTCVideoSource *)videoSource { |
| 40 #ifdef HAVE_RTC_VIDEO |
| 41 rtc::scoped_refptr<webrtc::ObjcVideoTrackSource> objcVideoTrackSource( |
| 42 new rtc::RefCountedObject<webrtc::ObjcVideoTrackSource>()); |
| 43 return [[RTCVideoSource alloc] |
| 44 initWithNativeVideoSource:webrtc::VideoTrackSourceProxy::Create(_signaling
Thread.get(), |
| 45 _workerThr
ead.get(), |
| 46 objcVideoT
rackSource)]; |
| 47 #else |
| 48 return nil; |
| 49 #endif |
| 50 } |
| 51 |
| 52 - (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source trackId:(NSStri
ng *)trackId { |
| 53 #ifdef HAVE_RTC_VIDEO |
| 54 return [[RTCVideoTrack alloc] initWithFactory:self source:source trackId:track
Id]; |
| 55 #else |
| 56 return nil; |
| 57 #endif |
| 58 } |
| 59 |
| 60 @end |
OLD | NEW |