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

Unified Diff: remoting/protocol/webrtc_video_capturer_adapter.cc

Issue 1571543002: Implement missing features in WebrtcVideoStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/webrtc_video_capturer_adapter.cc
diff --git a/remoting/protocol/webrtc_video_capturer_adapter.cc b/remoting/protocol/webrtc_video_capturer_adapter.cc
index fcf7972ca44e40dc828080a2a69146866156b2bb..f40ff9505fd6a38978288f1604e1ee42931542a6 100644
--- a/remoting/protocol/webrtc_video_capturer_adapter.cc
+++ b/remoting/protocol/webrtc_video_capturer_adapter.cc
@@ -29,6 +29,12 @@ WebrtcVideoCapturerAdapter::~WebrtcVideoCapturerAdapter() {
DCHECK(!capture_timer_);
}
+void WebrtcVideoCapturerAdapter::SetSizeCallback(
+ const SizeCallback& size_callback) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ size_callback_ = size_callback;
+}
+
bool WebrtcVideoCapturerAdapter::GetBestCaptureFormat(
const cricket::VideoFormat& desired,
cricket::VideoFormat* best_format) {
@@ -160,6 +166,9 @@ void WebrtcVideoCapturerAdapter::OnCaptureCompleted(
size_t height = frame->size().height();
if (!yuv_frame_ || yuv_frame_->GetWidth() != width ||
yuv_frame_->GetHeight() != height) {
+ if (!size_callback_.is_null())
+ size_callback_.Run(frame->size());
+
scoped_ptr<cricket::WebRtcVideoFrame> webrtc_frame(
new cricket::WebRtcVideoFrame());
webrtc_frame->InitToEmptyBuffer(width, height, 1, 1, 0);

Powered by Google App Engine
This is Rietveld 408576698