OLD | NEW |
---|---|
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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 #define BIND_TO_RENDER_LOOP(function) \ | 97 #define BIND_TO_RENDER_LOOP(function) \ |
98 (DCHECK(main_task_runner_->BelongsToCurrentThread()), \ | 98 (DCHECK(main_task_runner_->BelongsToCurrentThread()), \ |
99 BindToCurrentLoop(base::Bind(function, AsWeakPtr()))) | 99 BindToCurrentLoop(base::Bind(function, AsWeakPtr()))) |
100 | 100 |
101 #define BIND_TO_RENDER_LOOP1(function, arg1) \ | 101 #define BIND_TO_RENDER_LOOP1(function, arg1) \ |
102 (DCHECK(main_task_runner_->BelongsToCurrentThread()), \ | 102 (DCHECK(main_task_runner_->BelongsToCurrentThread()), \ |
103 BindToCurrentLoop(base::Bind(function, AsWeakPtr(), arg1))) | 103 BindToCurrentLoop(base::Bind(function, AsWeakPtr(), arg1))) |
104 | 104 |
105 static void LogMediaSourceError(const scoped_refptr<MediaLog>& media_log, | 105 static void LogMediaSourceError(const scoped_refptr<MediaLog>& media_log, |
106 const std::string& error) { | 106 const std::string& error) { |
107 DVLOG(1) << "MediaLog: " << error; | |
gunsch
2015/01/28 03:30:35
why DVLOG? These are highly useful messages, and n
| |
107 media_log->AddEvent(media_log->CreateMediaSourceErrorEvent(error)); | 108 media_log->AddEvent(media_log->CreateMediaSourceErrorEvent(error)); |
108 } | 109 } |
109 | 110 |
110 WebMediaPlayerImpl::WebMediaPlayerImpl( | 111 WebMediaPlayerImpl::WebMediaPlayerImpl( |
111 blink::WebLocalFrame* frame, | 112 blink::WebLocalFrame* frame, |
112 blink::WebMediaPlayerClient* client, | 113 blink::WebMediaPlayerClient* client, |
113 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 114 base::WeakPtr<WebMediaPlayerDelegate> delegate, |
114 scoped_ptr<RendererFactory> renderer_factory, | 115 scoped_ptr<RendererFactory> renderer_factory, |
115 scoped_ptr<CdmFactory> cdm_factory, | 116 scoped_ptr<CdmFactory> cdm_factory, |
116 const WebMediaPlayerParams& params) | 117 const WebMediaPlayerParams& params) |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
998 | 999 |
999 // pause() may be called after playback has ended and the HTMLMediaElement | 1000 // pause() may be called after playback has ended and the HTMLMediaElement |
1000 // requires that currentTime() == duration() after ending. We want to ensure | 1001 // requires that currentTime() == duration() after ending. We want to ensure |
1001 // |paused_time_| matches currentTime() in this case or a future seek() may | 1002 // |paused_time_| matches currentTime() in this case or a future seek() may |
1002 // incorrectly discard what it thinks is a seek to the existing time. | 1003 // incorrectly discard what it thinks is a seek to the existing time. |
1003 paused_time_ = | 1004 paused_time_ = |
1004 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); | 1005 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); |
1005 } | 1006 } |
1006 | 1007 |
1007 } // namespace media | 1008 } // namespace media |
OLD | NEW |