| 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/gpu_video_decoder.h" | 5 #include "media/filters/gpu_video_decoder.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "media/base/demuxer_stream.h" | 10 #include "media/base/demuxer_stream.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 SHMBuffer* ret = available_shm_segments_.back(); | 406 SHMBuffer* ret = available_shm_segments_.back(); |
| 407 available_shm_segments_.pop_back(); | 407 available_shm_segments_.pop_back(); |
| 408 return ret; | 408 return ret; |
| 409 } | 409 } |
| 410 | 410 |
| 411 void GpuVideoDecoder::PutSHM(SHMBuffer* shm_buffer) { | 411 void GpuVideoDecoder::PutSHM(SHMBuffer* shm_buffer) { |
| 412 DCHECK(MessageLoop::current() == message_loop_); | 412 DCHECK(MessageLoop::current() == message_loop_); |
| 413 available_shm_segments_.push_back(shm_buffer); | 413 available_shm_segments_.push_back(shm_buffer); |
| 414 } | 414 } |
| 415 | 415 |
| 416 void GpuVideoDecoder::NotifyEndOfStream() { | |
| 417 // TODO(fischman): remove with http://crbug.com/109819 | |
| 418 NOTREACHED() << "NotifyEndOfStream is never called."; | |
| 419 } | |
| 420 | |
| 421 void GpuVideoDecoder::NotifyEndOfBitstreamBuffer(int32 id) { | 416 void GpuVideoDecoder::NotifyEndOfBitstreamBuffer(int32 id) { |
| 422 if (MessageLoop::current() != message_loop_) { | 417 if (MessageLoop::current() != message_loop_) { |
| 423 message_loop_->PostTask(FROM_HERE, base::Bind( | 418 message_loop_->PostTask(FROM_HERE, base::Bind( |
| 424 &GpuVideoDecoder::NotifyEndOfBitstreamBuffer, this, id)); | 419 &GpuVideoDecoder::NotifyEndOfBitstreamBuffer, this, id)); |
| 425 return; | 420 return; |
| 426 } | 421 } |
| 427 | 422 |
| 428 std::map<int32, BufferPair>::iterator it = | 423 std::map<int32, BufferPair>::iterator it = |
| 429 bitstream_buffers_in_decoder_.find(id); | 424 bitstream_buffers_in_decoder_.find(id); |
| 430 if (it == bitstream_buffers_in_decoder_.end()) { | 425 if (it == bitstream_buffers_in_decoder_.end()) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 &GpuVideoDecoder::NotifyError, this, error)); | 486 &GpuVideoDecoder::NotifyError, this, error)); |
| 492 return; | 487 return; |
| 493 } | 488 } |
| 494 vda_ = NULL; | 489 vda_ = NULL; |
| 495 DLOG(ERROR) << "VDA Error: " << error; | 490 DLOG(ERROR) << "VDA Error: " << error; |
| 496 if (host()) | 491 if (host()) |
| 497 host()->SetError(PIPELINE_ERROR_DECODE); | 492 host()->SetError(PIPELINE_ERROR_DECODE); |
| 498 } | 493 } |
| 499 | 494 |
| 500 } // namespace media | 495 } // namespace media |
| OLD | NEW |