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

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

Issue 1900673002: Delete webrtc::VideoFrame methods buffer and stride. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 8 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
« no previous file with comments | « webrtc/media/base/videoframe.h ('k') | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine2.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc
index 383f29a9228250f4ab9fa171802e1da8f586ca19..d2e6b2ded44d32e1c1f2224c36a4cd572c317bc7 100644
--- a/webrtc/media/engine/webrtcvideoengine2.cc
+++ b/webrtc/media/engine/webrtcvideoengine2.cc
@@ -1560,19 +1560,22 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::~WebRtcVideoSendStream() {
DestroyVideoEncoder(&allocated_encoder_);
}
-static void CreateBlackFrame(webrtc::VideoFrame* video_frame,
- int width,
- int height,
- webrtc::VideoRotation rotation) {
- video_frame->CreateEmptyFrame(width, height, width, (width + 1) / 2,
- (width + 1) / 2);
- memset(video_frame->buffer(webrtc::kYPlane), 16,
- video_frame->allocated_size(webrtc::kYPlane));
- memset(video_frame->buffer(webrtc::kUPlane), 128,
- video_frame->allocated_size(webrtc::kUPlane));
- memset(video_frame->buffer(webrtc::kVPlane), 128,
- video_frame->allocated_size(webrtc::kVPlane));
- video_frame->set_rotation(rotation);
+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(
@@ -1630,19 +1633,17 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetSource(
if (source == NULL) {
if (stream_ != NULL) {
LOG(LS_VERBOSE) << "Disabling capturer, sending black frame.";
- webrtc::VideoFrame black_frame;
-
- CreateBlackFrame(&black_frame, last_dimensions_.width,
- last_dimensions_.height, last_rotation_);
-
// Force this black frame not to be dropped due to timestamp order
// check. As IncomingCapturedFrame will drop the frame if this frame's
// timestamp is less than or equal to last frame's timestamp, it is
// necessary to give this black frame a larger timestamp than the
// previous one.
last_frame_timestamp_ms_ += 1;
- black_frame.set_render_time_ms(last_frame_timestamp_ms_);
- stream_->Input()->IncomingCapturedFrame(black_frame);
+ stream_->Input()->IncomingCapturedFrame(
+ CreateBlackFrame(last_dimensions_.width, last_dimensions_.height,
+ last_frame_timestamp_ms_, last_rotation_));
+
+
}
}
}
« no previous file with comments | « webrtc/media/base/videoframe.h ('k') | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698