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

Unified Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2078943002: Rewrite CreateBlackFrame in webrtcvideoengine. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/media/engine/webrtcvideoengine2.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc
index 432c025e30f2a9d85106fcdde2dc0489cfeaf159..3857db9587b9339d82b08b44ffae67e1a91674bf 100644
--- a/webrtc/media/engine/webrtcvideoengine2.cc
+++ b/webrtc/media/engine/webrtcvideoengine2.cc
@@ -1577,24 +1577,6 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::~WebRtcVideoSendStream() {
DestroyVideoEncoder(&allocated_encoder_);
}
-static webrtc::VideoFrame CreateBlackFrame(int width,
- int height,
- int64_t render_time_ms_,
- webrtc::VideoRotation rotation) {
- webrtc::VideoFrame frame;
- frame.CreateEmptyFrame(width, height, width, (width + 1) / 2,
- (width + 1) / 2);
- memset(frame.video_frame_buffer()->MutableDataY(), 16,
- frame.allocated_size(webrtc::kYPlane));
- memset(frame.video_frame_buffer()->MutableDataU(), 128,
- frame.allocated_size(webrtc::kUPlane));
- memset(frame.video_frame_buffer()->MutableDataV(), 128,
- frame.allocated_size(webrtc::kVPlane));
- frame.set_rotation(rotation);
- frame.set_render_time_ms(render_time_ms_);
- return frame;
-}
-
void WebRtcVideoChannel2::WebRtcVideoSendStream::OnFrame(
const VideoFrame& frame) {
TRACE_EVENT0("webrtc", "WebRtcVideoSendStream::OnFrame");
@@ -1691,8 +1673,13 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetVideoSend(
// necessary to give this black frame a larger timestamp than the
// previous one.
last_frame_timestamp_ms_ += 1;
- stream_->Input()->IncomingCapturedFrame(CreateBlackFrame(
- last_frame_info_.width, last_frame_info_.height,
+ rtc::scoped_refptr<webrtc::I420Buffer> black_buffer(
+ webrtc::I420Buffer::Create(last_frame_info_.width,
+ last_frame_info_.height));
+ black_buffer->SetToBlack();
+
+ stream_->Input()->IncomingCapturedFrame(webrtc::VideoFrame(
+ black_buffer, 0 /* timestamp (90 kHz) */,
pbos-webrtc 2016/06/17 12:30:38 Is this (zero-timestamp) the same as before? If so
nisse-webrtc 2016/06/17 13:26:12 Before this cl, the 90 kHz timestamp on the frame
last_frame_timestamp_ms_, last_frame_info_.rotation));
}
source_ = source;
« no previous file with comments | « webrtc/common_video/video_frame_buffer.cc ('k') | webrtc/modules/video_coding/codecs/test/videoprocessor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698