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/ffmpeg_demuxer.h" | 5 #include "media/filters/ffmpeg_demuxer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 return; | 739 return; |
740 | 740 |
741 is_enabled_ = enabled; | 741 is_enabled_ = enabled; |
742 av_stream()->discard = enabled ? AVDISCARD_DEFAULT : AVDISCARD_ALL; | 742 av_stream()->discard = enabled ? AVDISCARD_DEFAULT : AVDISCARD_ALL; |
743 if (is_enabled_) { | 743 if (is_enabled_) { |
744 waiting_for_keyframe_ = true; | 744 waiting_for_keyframe_ = true; |
745 } | 745 } |
746 if (!is_enabled_ && !read_cb_.is_null()) { | 746 if (!is_enabled_ && !read_cb_.is_null()) { |
747 DVLOG(1) << "Read from disabled stream, returning EOS"; | 747 DVLOG(1) << "Read from disabled stream, returning EOS"; |
748 base::ResetAndReturn(&read_cb_).Run(kOk, DecoderBuffer::CreateEOSBuffer()); | 748 base::ResetAndReturn(&read_cb_).Run(kOk, DecoderBuffer::CreateEOSBuffer()); |
749 return; | |
750 } | 749 } |
751 if (!stream_status_change_cb_.is_null()) | 750 if (!stream_status_change_cb_.is_null()) |
752 stream_status_change_cb_.Run(this, is_enabled_, timestamp); | 751 stream_status_change_cb_.Run(this, is_enabled_, timestamp); |
753 } | 752 } |
754 | 753 |
755 void FFmpegDemuxerStream::SetStreamStatusChangeCB( | 754 void FFmpegDemuxerStream::SetStreamStatusChangeCB( |
756 const StreamStatusChangeCB& cb) { | 755 const StreamStatusChangeCB& cb) { |
757 DCHECK(!cb.is_null()); | 756 DCHECK(!cb.is_null()); |
758 stream_status_change_cb_ = cb; | 757 stream_status_change_cb_ = cb; |
759 } | 758 } |
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1868 | 1867 |
1869 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { | 1868 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { |
1870 DCHECK(task_runner_->BelongsToCurrentThread()); | 1869 DCHECK(task_runner_->BelongsToCurrentThread()); |
1871 for (const auto& stream : streams_) { | 1870 for (const auto& stream : streams_) { |
1872 if (stream) | 1871 if (stream) |
1873 stream->SetLiveness(liveness); | 1872 stream->SetLiveness(liveness); |
1874 } | 1873 } |
1875 } | 1874 } |
1876 | 1875 |
1877 } // namespace media | 1876 } // namespace media |
OLD | NEW |