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

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

Issue 65803002: Replace MessageLoopProxy with SingleThreadTaskRunner for media/filters/ + associated code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/rtc_video_encoder.cc ('k') | media/base/bind_to_loop.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_impl.h" 5 #include "content/renderer/media/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 pending_repaint_(false), 165 pending_repaint_(false),
166 pending_size_change_(false), 166 pending_size_change_(false),
167 video_frame_provider_client_(NULL), 167 video_frame_provider_client_(NULL),
168 text_track_index_(0) { 168 text_track_index_(0) {
169 media_log_->AddEvent( 169 media_log_->AddEvent(
170 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); 170 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED));
171 171
172 pipeline_.reset(new media::Pipeline(media_loop_, media_log_.get())); 172 pipeline_.reset(new media::Pipeline(media_loop_, media_log_.get()));
173 173
174 // |gpu_factories_| requires that its entry points be called on its 174 // |gpu_factories_| requires that its entry points be called on its
175 // |GetMessageLoop()|. Since |pipeline_| will own decoders created from the 175 // |GetTaskRunner()|. Since |pipeline_| will own decoders created from the
176 // factories, require that their message loops are identical. 176 // factories, require that their message loops are identical.
177 DCHECK(!gpu_factories_ || (gpu_factories_->GetMessageLoop() == media_loop_)); 177 DCHECK(!gpu_factories_ || (gpu_factories_->GetTaskRunner() == media_loop_));
178 178
179 // Let V8 know we started new thread if we did not do it yet. 179 // Let V8 know we started new thread if we did not do it yet.
180 // Made separate task to avoid deletion of player currently being created. 180 // Made separate task to avoid deletion of player currently being created.
181 // Also, delaying GC until after player starts gets rid of starting lag -- 181 // Also, delaying GC until after player starts gets rid of starting lag --
182 // collection happens in parallel with playing. 182 // collection happens in parallel with playing.
183 // 183 //
184 // TODO(enal): remove when we get rid of per-audio-stream thread. 184 // TODO(enal): remove when we get rid of per-audio-stream thread.
185 main_loop_->PostTask( 185 main_loop_->PostTask(
186 FROM_HERE, 186 FROM_HERE,
187 base::Bind(&WebMediaPlayerImpl::IncrementExternallyAllocatedMemory, 187 base::Bind(&WebMediaPlayerImpl::IncrementExternallyAllocatedMemory,
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 // The |current_frame_| wasn't painted, it is being replaced, and we haven't 1302 // The |current_frame_| wasn't painted, it is being replaced, and we haven't
1303 // even gotten the chance to request a repaint for it yet. Mark it as dropped. 1303 // even gotten the chance to request a repaint for it yet. Mark it as dropped.
1304 TRACE_EVENT0("media", "WebMediaPlayerImpl:frameDropped"); 1304 TRACE_EVENT0("media", "WebMediaPlayerImpl:frameDropped");
1305 DVLOG(1) << "Frame dropped before being painted: " 1305 DVLOG(1) << "Frame dropped before being painted: "
1306 << current_frame_->GetTimestamp().InSecondsF(); 1306 << current_frame_->GetTimestamp().InSecondsF();
1307 if (frames_dropped_before_paint_ < kuint32max) 1307 if (frames_dropped_before_paint_ < kuint32max)
1308 frames_dropped_before_paint_++; 1308 frames_dropped_before_paint_++;
1309 } 1309 }
1310 1310
1311 } // namespace content 1311 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_encoder.cc ('k') | media/base/bind_to_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698