| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 if (kDemuxerIsWebm && (stream->codec->codec_id != CODEC_ID_VP8 && | 440 if (kDemuxerIsWebm && (stream->codec->codec_id != CODEC_ID_VP8 && |
| 441 stream->codec->codec_id != CODEC_ID_VORBIS)) { | 441 stream->codec->codec_id != CODEC_ID_VORBIS)) { |
| 442 packet_streams_.push_back(NULL); | 442 packet_streams_.push_back(NULL); |
| 443 continue; | 443 continue; |
| 444 } | 444 } |
| 445 | 445 |
| 446 FFmpegDemuxerStream* demuxer_stream | 446 FFmpegDemuxerStream* demuxer_stream |
| 447 = new FFmpegDemuxerStream(this, stream); | 447 = new FFmpegDemuxerStream(this, stream); |
| 448 | 448 |
| 449 DCHECK(demuxer_stream); | 449 DCHECK(demuxer_stream); |
| 450 streams_.push_back(demuxer_stream); | 450 streams_.push_back(make_scoped_refptr(demuxer_stream)); |
| 451 packet_streams_.push_back(demuxer_stream); | 451 packet_streams_.push_back(make_scoped_refptr(demuxer_stream)); |
| 452 max_duration = std::max(max_duration, demuxer_stream->duration()); | 452 max_duration = std::max(max_duration, demuxer_stream->duration()); |
| 453 } else { | 453 } else { |
| 454 packet_streams_.push_back(NULL); | 454 packet_streams_.push_back(NULL); |
| 455 } | 455 } |
| 456 } | 456 } |
| 457 if (streams_.empty()) { | 457 if (streams_.empty()) { |
| 458 host()->SetError(DEMUXER_ERROR_NO_SUPPORTED_STREAMS); | 458 host()->SetError(DEMUXER_ERROR_NO_SUPPORTED_STREAMS); |
| 459 callback->Run(); | 459 callback->Run(); |
| 460 return; | 460 return; |
| 461 } | 461 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 read_event_.Wait(); | 611 read_event_.Wait(); |
| 612 return last_read_bytes_; | 612 return last_read_bytes_; |
| 613 } | 613 } |
| 614 | 614 |
| 615 void FFmpegDemuxer::SignalReadCompleted(size_t size) { | 615 void FFmpegDemuxer::SignalReadCompleted(size_t size) { |
| 616 last_read_bytes_ = size; | 616 last_read_bytes_ = size; |
| 617 read_event_.Signal(); | 617 read_event_.Signal(); |
| 618 } | 618 } |
| 619 | 619 |
| 620 } // namespace media | 620 } // namespace media |
| OLD | NEW |