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

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/RTCVideoTrack.mm

Issue 2391123002: Add iOS static library GN build script. (Closed)
Patch Set: Update comment Created 4 years, 2 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
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 if (source) { 62 if (source) {
63 _source = [[RTCVideoSource alloc] initWithNativeVideoSource:source.get()]; 63 _source = [[RTCVideoSource alloc] initWithNativeVideoSource:source.get()];
64 } 64 }
65 } 65 }
66 return _source; 66 return _source;
67 } 67 }
68 68
69 - (void)addRenderer:(id<RTCVideoRenderer>)renderer { 69 - (void)addRenderer:(id<RTCVideoRenderer>)renderer {
70 // Make sure we don't have this renderer yet. 70 // Make sure we don't have this renderer yet.
71 for (RTCVideoRendererAdapter *adapter in _adapters) { 71 for (RTCVideoRendererAdapter *adapter in _adapters) {
72 // Getting around unused variable error 72 if (adapter.videoRenderer == renderer) {
kthelgason 2016/10/05 07:46:24 This seems strange. Is this a bug that you're fixi
tkchin_webrtc 2016/10/05 16:42:26 See other comment.
73 if (adapter.videoRenderer != renderer) {
74 NSAssert(NO, @"|renderer| is already attached to this track"); 73 NSAssert(NO, @"|renderer| is already attached to this track");
74 return;
75 } 75 }
76 } 76 }
77 // Create a wrapper that provides a native pointer for us. 77 // Create a wrapper that provides a native pointer for us.
78 RTCVideoRendererAdapter* adapter = 78 RTCVideoRendererAdapter* adapter =
79 [[RTCVideoRendererAdapter alloc] initWithNativeRenderer:renderer]; 79 [[RTCVideoRendererAdapter alloc] initWithNativeRenderer:renderer];
80 [_adapters addObject:adapter]; 80 [_adapters addObject:adapter];
81 self.nativeVideoTrack->AddOrUpdateSink(adapter.nativeVideoRenderer, 81 self.nativeVideoTrack->AddOrUpdateSink(adapter.nativeVideoRenderer,
82 rtc::VideoSinkWants()); 82 rtc::VideoSinkWants());
83 } 83 }
84 84
(...skipping 16 matching lines...) Expand all
101 [_adapters removeObjectAtIndex:indexToRemove]; 101 [_adapters removeObjectAtIndex:indexToRemove];
102 } 102 }
103 103
104 #pragma mark - Private 104 #pragma mark - Private
105 105
106 - (rtc::scoped_refptr<webrtc::VideoTrackInterface>)nativeVideoTrack { 106 - (rtc::scoped_refptr<webrtc::VideoTrackInterface>)nativeVideoTrack {
107 return static_cast<webrtc::VideoTrackInterface *>(self.nativeTrack.get()); 107 return static_cast<webrtc::VideoTrackInterface *>(self.nativeTrack.get());
108 } 108 }
109 109
110 @end 110 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698