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

Side by Side Diff: webrtc/media/base/videobroadcaster.cc

Issue 2315663002: Make cricket::VideoFrame inherit webrtc::VideoFrame. (Closed)
Patch Set: Created 4 years, 3 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 (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 rtc::CritScope cs(&sinks_and_wants_lock_); 49 rtc::CritScope cs(&sinks_and_wants_lock_);
50 return current_wants_; 50 return current_wants_;
51 } 51 }
52 52
53 void VideoBroadcaster::OnFrame(const cricket::VideoFrame& frame) { 53 void VideoBroadcaster::OnFrame(const cricket::VideoFrame& frame) {
54 rtc::CritScope cs(&sinks_and_wants_lock_); 54 rtc::CritScope cs(&sinks_and_wants_lock_);
55 for (auto& sink_pair : sink_pairs()) { 55 for (auto& sink_pair : sink_pairs()) {
56 if (sink_pair.wants.black_frames) { 56 if (sink_pair.wants.black_frames) {
57 sink_pair.sink->OnFrame(cricket::WebRtcVideoFrame( 57 sink_pair.sink->OnFrame(cricket::WebRtcVideoFrame(
58 GetBlackFrameBuffer(frame.width(), frame.height()), frame.rotation(), 58 GetBlackFrameBuffer(frame.width(), frame.height()), frame.rotation(),
59 frame.timestamp_us(), frame.transport_frame_id())); 59 frame.timestamp_us()));
60 } else { 60 } else {
61 sink_pair.sink->OnFrame(frame); 61 sink_pair.sink->OnFrame(frame);
62 } 62 }
63 } 63 }
64 } 64 }
65 65
66 void VideoBroadcaster::UpdateWants() { 66 void VideoBroadcaster::UpdateWants() {
67 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 67 RTC_DCHECK(thread_checker_.CalledOnValidThread());
68 68
69 VideoSinkWants wants; 69 VideoSinkWants wants;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 rtc::scoped_refptr<webrtc::I420Buffer> buffer = 102 rtc::scoped_refptr<webrtc::I420Buffer> buffer =
103 new RefCountedObject<webrtc::I420Buffer>(width, height); 103 new RefCountedObject<webrtc::I420Buffer>(width, height);
104 buffer->SetToBlack(); 104 buffer->SetToBlack();
105 black_frame_buffer_ = buffer; 105 black_frame_buffer_ = buffer;
106 } 106 }
107 107
108 return black_frame_buffer_; 108 return black_frame_buffer_;
109 } 109 }
110 110
111 } // namespace rtc 111 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698