OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mojo/services/mojo_renderer_service.h" | 5 #include "media/mojo/services/mojo_renderer_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 DCHECK_EQ(state_, STATE_INITIALIZING); | 113 DCHECK_EQ(state_, STATE_INITIALIZING); |
114 | 114 |
115 renderer_->Initialize( | 115 renderer_->Initialize( |
116 stream_provider_.get(), | 116 stream_provider_.get(), |
117 base::Bind( | 117 base::Bind( |
118 &MojoRendererService::OnRendererInitializeDone, weak_this_, callback), | 118 &MojoRendererService::OnRendererInitializeDone, weak_this_, callback), |
119 base::Bind(&MojoRendererService::OnUpdateStatistics, weak_this_), | 119 base::Bind(&MojoRendererService::OnUpdateStatistics, weak_this_), |
120 base::Bind(&MojoRendererService::OnBufferingStateChanged, weak_this_), | 120 base::Bind(&MojoRendererService::OnBufferingStateChanged, weak_this_), |
121 base::Bind(&PaintNothing), | 121 base::Bind(&PaintNothing), |
122 base::Bind(&MojoRendererService::OnRendererEnded, weak_this_), | 122 base::Bind(&MojoRendererService::OnRendererEnded, weak_this_), |
123 base::Bind(&MojoRendererService::OnError, weak_this_)); | 123 base::Bind(&MojoRendererService::OnError, weak_this_), |
| 124 base::Bind(base::DoNothing)); |
124 } | 125 } |
125 | 126 |
126 void MojoRendererService::OnRendererInitializeDone( | 127 void MojoRendererService::OnRendererInitializeDone( |
127 const mojo::Closure& callback, PipelineStatus status) { | 128 const mojo::Closure& callback, PipelineStatus status) { |
128 DVLOG(1) << __FUNCTION__; | 129 DVLOG(1) << __FUNCTION__; |
129 | 130 |
130 if (status != PIPELINE_OK && state_ != STATE_ERROR) | 131 if (status != PIPELINE_OK && state_ != STATE_ERROR) |
131 OnError(status); | 132 OnError(status); |
132 | 133 |
133 if (state_ == STATE_ERROR) { | 134 if (state_ == STATE_ERROR) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 186 } |
186 | 187 |
187 void MojoRendererService::OnFlushCompleted(const mojo::Closure& callback) { | 188 void MojoRendererService::OnFlushCompleted(const mojo::Closure& callback) { |
188 DVLOG(1) << __FUNCTION__; | 189 DVLOG(1) << __FUNCTION__; |
189 DCHECK_EQ(state_, STATE_FLUSHING); | 190 DCHECK_EQ(state_, STATE_FLUSHING); |
190 state_ = STATE_PLAYING; | 191 state_ = STATE_PLAYING; |
191 callback.Run(); | 192 callback.Run(); |
192 } | 193 } |
193 | 194 |
194 } // namespace media | 195 } // namespace media |
OLD | NEW |