Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Video.mm

Issue 2944643002: Support building WebRTC without audio and video for IOS (Closed)
Patch Set: Reponse to comments. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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)
tkchin_webrtc 2017/06/20 21:51:24 ditto: why separate file?
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];
tkchin_webrtc 2017/06/20 21:51:24 for the generic case, why do we need to special ca
55 #else
56 return nil;
57 #endif
58 }
59
60 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698