| 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/base/text_renderer.h" | 5 #include "media/base/text_renderer.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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 const TextTrackConfig& config) { | 119 const TextTrackConfig& config) { |
| 120 DCHECK(task_runner_->BelongsToCurrentThread()); | 120 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 121 DCHECK(state_ != kUninitialized) << "state_ " << state_; | 121 DCHECK(state_ != kUninitialized) << "state_ " << state_; |
| 122 DCHECK_NE(state_, kStopPending); | 122 DCHECK_NE(state_, kStopPending); |
| 123 DCHECK_NE(state_, kStopped); | 123 DCHECK_NE(state_, kStopped); |
| 124 DCHECK(text_track_state_map_.find(text_stream) == | 124 DCHECK(text_track_state_map_.find(text_stream) == |
| 125 text_track_state_map_.end()); | 125 text_track_state_map_.end()); |
| 126 DCHECK(pending_eos_set_.find(text_stream) == | 126 DCHECK(pending_eos_set_.find(text_stream) == |
| 127 pending_eos_set_.end()); | 127 pending_eos_set_.end()); |
| 128 | 128 |
| 129 media::AddTextTrackDoneCB done_cb = | 129 AddTextTrackDoneCB done_cb = BindToCurrentLoop( |
| 130 media::BindToLoop(task_runner_, | 130 base::Bind(&TextRenderer::OnAddTextTrackDone, weak_this_, text_stream)); |
| 131 base::Bind(&TextRenderer::OnAddTextTrackDone, | |
| 132 weak_this_, | |
| 133 text_stream)); | |
| 134 | 131 |
| 135 add_text_track_cb_.Run(config, done_cb); | 132 add_text_track_cb_.Run(config, done_cb); |
| 136 } | 133 } |
| 137 | 134 |
| 138 void TextRenderer::RemoveTextStream(DemuxerStream* text_stream) { | 135 void TextRenderer::RemoveTextStream(DemuxerStream* text_stream) { |
| 139 DCHECK(task_runner_->BelongsToCurrentThread()); | 136 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 140 | 137 |
| 141 TextTrackStateMap::iterator itr = text_track_state_map_.find(text_stream); | 138 TextTrackStateMap::iterator itr = text_track_state_map_.find(text_stream); |
| 142 DCHECK(itr != text_track_state_map_.end()); | 139 DCHECK(itr != text_track_state_map_.end()); |
| 143 | 140 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 357 |
| 361 TextRenderer::TextTrackState::TextTrackState(scoped_ptr<TextTrack> tt) | 358 TextRenderer::TextTrackState::TextTrackState(scoped_ptr<TextTrack> tt) |
| 362 : read_state(kReadIdle), | 359 : read_state(kReadIdle), |
| 363 text_track(tt.Pass()) { | 360 text_track(tt.Pass()) { |
| 364 } | 361 } |
| 365 | 362 |
| 366 TextRenderer::TextTrackState::~TextTrackState() { | 363 TextRenderer::TextTrackState::~TextTrackState() { |
| 367 } | 364 } |
| 368 | 365 |
| 369 } // namespace media | 366 } // namespace media |
| OLD | NEW |