Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: media/filters/ffmpeg_demuxer.cc

Issue 2825863002: Fix status notifications for FFmpegDemuxerStream with a pending read (Closed)
Patch Set: Add a comment explaining FlushBuffers Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698