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

Side by Side Diff: content/renderer/media/webmediaplayer_ms_compositor.cc

Issue 2767963002: Revert of Remove |remote| and |readonly| members of MediaStreamTrack. (Closed)
Patch Set: rebase Created 3 years, 9 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webmediaplayer_ms_compositor.h" 5 #include "content/renderer/media/webmediaplayer_ms_compositor.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 total_frame_count_(0), 138 total_frame_count_(0),
139 dropped_frame_count_(0), 139 dropped_frame_count_(0),
140 stopped_(true) { 140 stopped_(true) {
141 main_message_loop_ = base::MessageLoop::current(); 141 main_message_loop_ = base::MessageLoop::current();
142 io_thread_checker_.DetachFromThread(); 142 io_thread_checker_.DetachFromThread();
143 143
144 blink::WebVector<blink::WebMediaStreamTrack> video_tracks; 144 blink::WebVector<blink::WebMediaStreamTrack> video_tracks;
145 if (!web_stream.isNull()) 145 if (!web_stream.isNull())
146 web_stream.videoTracks(video_tracks); 146 web_stream.videoTracks(video_tracks);
147 147
148 if (video_tracks.size() > 0 && 148 const bool remote_video =
149 !base::CommandLine::ForCurrentProcess()->HasSwitch( 149 video_tracks.size() && video_tracks[0].source().remote();
150 switches::kDisableRTCSmoothnessAlgorithm)) { 150
151 if (remote_video && !base::CommandLine::ForCurrentProcess()->HasSwitch(
152 switches::kDisableRTCSmoothnessAlgorithm)) {
151 base::AutoLock auto_lock(current_frame_lock_); 153 base::AutoLock auto_lock(current_frame_lock_);
152 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( 154 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm(
153 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, 155 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks,
154 base::Unretained(this)))); 156 base::Unretained(this))));
155 } 157 }
156 158
157 // Just for logging purpose. 159 // Just for logging purpose.
158 std::string stream_id = 160 std::string stream_id =
159 web_stream.isNull() ? std::string() : web_stream.id().utf8(); 161 web_stream.isNull() ? std::string() : web_stream.id().utf8();
160 serial_ = base::Hash(stream_id);; 162 const uint32_t hash_value = base::Hash(stream_id);
163 serial_ = (hash_value << 1) | (remote_video ? 1 : 0);
161 } 164 }
162 165
163 WebMediaPlayerMSCompositor::~WebMediaPlayerMSCompositor() { 166 WebMediaPlayerMSCompositor::~WebMediaPlayerMSCompositor() {
164 DCHECK(!video_frame_provider_client_) 167 DCHECK(!video_frame_provider_client_)
165 << "Must call StopUsingProvider() before dtor!"; 168 << "Must call StopUsingProvider() before dtor!";
166 } 169 }
167 170
168 gfx::Size WebMediaPlayerMSCompositor::GetCurrentSize() { 171 gfx::Size WebMediaPlayerMSCompositor::GetCurrentSize() {
169 DCHECK(thread_checker_.CalledOnValidThread()); 172 DCHECK(thread_checker_.CalledOnValidThread());
170 base::AutoLock auto_lock(current_frame_lock_); 173 base::AutoLock auto_lock(current_frame_lock_);
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } 456 }
454 457
455 if (!rendering_frame_buffer_) { 458 if (!rendering_frame_buffer_) {
456 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( 459 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm(
457 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, 460 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks,
458 base::Unretained(this)))); 461 base::Unretained(this))));
459 } 462 }
460 } 463 }
461 464
462 } // namespace content 465 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698