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

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

Issue 1639583003: Fixing bug in MediaStream.java that caused double disposal of track. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing placement of GUARDED_BY. Created 4 years, 10 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/webrtc/webrtcvideoengine2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/webrtc/webrtcvideoengine2.cc
diff --git a/webrtc/media/webrtc/webrtcvideoengine2.cc b/webrtc/media/webrtc/webrtcvideoengine2.cc
index c2b65ced276d0e9a85bee4fd4d37d3ab06b2cc9f..69ff870513937d11bf172a712a83b752eb974522 100644
--- a/webrtc/media/webrtc/webrtcvideoengine2.cc
+++ b/webrtc/media/webrtc/webrtcvideoengine2.cc
@@ -1544,7 +1544,8 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::~WebRtcVideoSendStream() {
static void CreateBlackFrame(webrtc::VideoFrame* video_frame,
int width,
- int height) {
+ int height,
+ webrtc::VideoRotation rotation) {
video_frame->CreateEmptyFrame(width, height, width, (width + 1) / 2,
(width + 1) / 2);
memset(video_frame->buffer(webrtc::kYPlane), 16,
@@ -1553,6 +1554,7 @@ static void CreateBlackFrame(webrtc::VideoFrame* video_frame,
video_frame->allocated_size(webrtc::kUPlane));
memset(video_frame->buffer(webrtc::kVPlane), 128,
video_frame->allocated_size(webrtc::kVPlane));
+ video_frame->set_rotation(rotation);
}
void WebRtcVideoChannel2::WebRtcVideoSendStream::InputFrame(
@@ -1574,9 +1576,9 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::InputFrame(
if (muted_) {
// Create a black frame to transmit instead.
- CreateBlackFrame(&video_frame,
- static_cast<int>(frame->GetWidth()),
- static_cast<int>(frame->GetHeight()));
+ CreateBlackFrame(&video_frame, static_cast<int>(frame->GetWidth()),
+ static_cast<int>(frame->GetHeight()),
+ frame->GetVideoRotation());
}
int64_t frame_delta_ms = frame->GetTimeStamp() / rtc::kNumNanosecsPerMillisec;
@@ -1590,6 +1592,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::InputFrame(
// Reconfigure codec if necessary.
SetDimensions(
video_frame.width(), video_frame.height(), capturer->IsScreencast());
+ last_rotation_ = video_frame.rotation();
stream_->Input()->IncomingCapturedFrame(video_frame);
}
@@ -1614,7 +1617,7 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetCapturer(
webrtc::VideoFrame black_frame;
CreateBlackFrame(&black_frame, last_dimensions_.width,
- last_dimensions_.height);
+ 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
« no previous file with comments | « webrtc/media/webrtc/webrtcvideoengine2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698