| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/filters/decrypting_demuxer_stream.h" | 5 #include "media/filters/decrypting_demuxer_stream.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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 state_ = kIdle; | 76 state_ = kIdle; |
| 77 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); | 77 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void DecryptingDemuxerStream::Read(const ReadCB& read_cb) { | 80 void DecryptingDemuxerStream::Read(const ReadCB& read_cb) { |
| 81 DVLOG(3) << __func__; | 81 DVLOG(3) << __func__; |
| 82 DCHECK(task_runner_->BelongsToCurrentThread()); | 82 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 83 DCHECK_EQ(state_, kIdle) << state_; | 83 DCHECK_EQ(state_, kIdle) << state_; |
| 84 DCHECK(!read_cb.is_null()); | 84 DCHECK(!read_cb.is_null()); |
| 85 CHECK(read_cb_.is_null()) << "Overlapping reads are not supported."; | 85 // Overlapping reads are not supported. |
| 86 CHECK(read_cb_.is_null()); |
| 86 | 87 |
| 87 read_cb_ = BindToCurrentLoop(read_cb); | 88 read_cb_ = BindToCurrentLoop(read_cb); |
| 88 state_ = kPendingDemuxerRead; | 89 state_ = kPendingDemuxerRead; |
| 89 demuxer_stream_->Read( | 90 demuxer_stream_->Read( |
| 90 base::Bind(&DecryptingDemuxerStream::DecryptBuffer, weak_this_)); | 91 base::Bind(&DecryptingDemuxerStream::DecryptBuffer, weak_this_)); |
| 91 } | 92 } |
| 92 | 93 |
| 93 void DecryptingDemuxerStream::Reset(const base::Closure& closure) { | 94 void DecryptingDemuxerStream::Reset(const base::Closure& closure) { |
| 94 DVLOG(2) << __func__ << " - state: " << state_; | 95 DVLOG(2) << __func__ << " - state: " << state_; |
| 95 DCHECK(task_runner_->BelongsToCurrentThread()); | 96 DCHECK(task_runner_->BelongsToCurrentThread()); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 break; | 392 break; |
| 392 } | 393 } |
| 393 | 394 |
| 394 default: | 395 default: |
| 395 NOTREACHED(); | 396 NOTREACHED(); |
| 396 return; | 397 return; |
| 397 } | 398 } |
| 398 } | 399 } |
| 399 | 400 |
| 400 } // namespace media | 401 } // namespace media |
| OLD | NEW |