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

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

Issue 512413002: Move Preload enum to BufferedDataSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.h ('k') | no next file » | 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 WebMediaPlayerImpl::WebMediaPlayerImpl( 143 WebMediaPlayerImpl::WebMediaPlayerImpl(
144 blink::WebLocalFrame* frame, 144 blink::WebLocalFrame* frame,
145 blink::WebMediaPlayerClient* client, 145 blink::WebMediaPlayerClient* client,
146 base::WeakPtr<WebMediaPlayerDelegate> delegate, 146 base::WeakPtr<WebMediaPlayerDelegate> delegate,
147 const WebMediaPlayerParams& params) 147 const WebMediaPlayerParams& params)
148 : frame_(frame), 148 : frame_(frame),
149 network_state_(WebMediaPlayer::NetworkStateEmpty), 149 network_state_(WebMediaPlayer::NetworkStateEmpty),
150 ready_state_(WebMediaPlayer::ReadyStateHaveNothing), 150 ready_state_(WebMediaPlayer::ReadyStateHaveNothing),
151 preload_(AUTO), 151 preload_(BufferedDataSource::AUTO),
152 main_task_runner_(base::MessageLoopProxy::current()), 152 main_task_runner_(base::MessageLoopProxy::current()),
153 media_task_runner_( 153 media_task_runner_(
154 RenderThreadImpl::current()->GetMediaThreadTaskRunner()), 154 RenderThreadImpl::current()->GetMediaThreadTaskRunner()),
155 media_log_(new RenderMediaLog()), 155 media_log_(new RenderMediaLog()),
156 pipeline_(media_task_runner_, media_log_.get()), 156 pipeline_(media_task_runner_, media_log_.get()),
157 load_type_(LoadTypeURL), 157 load_type_(LoadTypeURL),
158 opaque_(false), 158 opaque_(false),
159 paused_(true), 159 paused_(true),
160 seeking_(false), 160 seeking_(false),
161 playback_rate_(0.0f), 161 playback_rate_(0.0f),
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 373
374 void WebMediaPlayerImpl::setVolume(double volume) { 374 void WebMediaPlayerImpl::setVolume(double volume) {
375 DVLOG(1) << __FUNCTION__ << "(" << volume << ")"; 375 DVLOG(1) << __FUNCTION__ << "(" << volume << ")";
376 DCHECK(main_task_runner_->BelongsToCurrentThread()); 376 DCHECK(main_task_runner_->BelongsToCurrentThread());
377 377
378 pipeline_.SetVolume(volume); 378 pipeline_.SetVolume(volume);
379 } 379 }
380 380
381 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, chromium_name) \ 381 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, chromium_name) \
382 COMPILE_ASSERT(static_cast<int>(WebMediaPlayer::webkit_name) == \ 382 COMPILE_ASSERT(static_cast<int>(WebMediaPlayer::webkit_name) == \
383 static_cast<int>(content::chromium_name), \ 383 static_cast<int>(BufferedDataSource::chromium_name), \
384 mismatching_enums) 384 mismatching_enums)
385 COMPILE_ASSERT_MATCHING_ENUM(PreloadNone, NONE); 385 COMPILE_ASSERT_MATCHING_ENUM(PreloadNone, NONE);
386 COMPILE_ASSERT_MATCHING_ENUM(PreloadMetaData, METADATA); 386 COMPILE_ASSERT_MATCHING_ENUM(PreloadMetaData, METADATA);
387 COMPILE_ASSERT_MATCHING_ENUM(PreloadAuto, AUTO); 387 COMPILE_ASSERT_MATCHING_ENUM(PreloadAuto, AUTO);
388 #undef COMPILE_ASSERT_MATCHING_ENUM 388 #undef COMPILE_ASSERT_MATCHING_ENUM
389 389
390 void WebMediaPlayerImpl::setPreload(WebMediaPlayer::Preload preload) { 390 void WebMediaPlayerImpl::setPreload(WebMediaPlayer::Preload preload) {
391 DVLOG(1) << __FUNCTION__ << "(" << preload << ")"; 391 DVLOG(1) << __FUNCTION__ << "(" << preload << ")";
392 DCHECK(main_task_runner_->BelongsToCurrentThread()); 392 DCHECK(main_task_runner_->BelongsToCurrentThread());
393 393
394 preload_ = static_cast<content::Preload>(preload); 394 preload_ = static_cast<BufferedDataSource::Preload>(preload);
395 if (data_source_) 395 if (data_source_)
396 data_source_->SetPreload(preload_); 396 data_source_->SetPreload(preload_);
397 } 397 }
398 398
399 bool WebMediaPlayerImpl::hasVideo() const { 399 bool WebMediaPlayerImpl::hasVideo() const {
400 DCHECK(main_task_runner_->BelongsToCurrentThread()); 400 DCHECK(main_task_runner_->BelongsToCurrentThread());
401 401
402 return pipeline_metadata_.has_video; 402 return pipeline_metadata_.has_video;
403 } 403 }
404 404
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 compositor_task_runner_->PostTask(FROM_HERE, 1030 compositor_task_runner_->PostTask(FROM_HERE,
1031 base::Bind(&GetCurrentFrameAndSignal, 1031 base::Bind(&GetCurrentFrameAndSignal,
1032 base::Unretained(compositor_), 1032 base::Unretained(compositor_),
1033 &video_frame, 1033 &video_frame,
1034 &event)); 1034 &event));
1035 event.Wait(); 1035 event.Wait();
1036 return video_frame; 1036 return video_frame;
1037 } 1037 }
1038 1038
1039 } // namespace content 1039 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698