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

Side by Side Diff: chromecast/media/cma/base/demuxer_stream_for_test.cc

Issue 2199913002: Notify demux stream clients when a stream is disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't pass DemuxerStream into the status callback Created 4 years, 4 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 | « chromecast/media/cma/base/demuxer_stream_for_test.h ('k') | media/base/demuxer_stream.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chromecast/media/cma/base/demuxer_stream_for_test.h" 5 #include "chromecast/media/cma/base/demuxer_stream_for_test.h"
6 6
7 #include "base/threading/thread.h" 7 #include "base/threading/thread.h"
8 #include "media/base/media_util.h" 8 #include "media/base/media_util.h"
9 9
10 namespace chromecast { 10 namespace chromecast {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 bool DemuxerStreamForTest::enabled() const { 81 bool DemuxerStreamForTest::enabled() const {
82 return true; 82 return true;
83 } 83 }
84 84
85 void DemuxerStreamForTest::set_enabled(bool enabled, base::TimeDelta time) { 85 void DemuxerStreamForTest::set_enabled(bool enabled, base::TimeDelta time) {
86 NOTIMPLEMENTED(); 86 NOTIMPLEMENTED();
87 } 87 }
88 88
89 void DemuxerStreamForTest::SetStreamRestartedCB(const StreamRestartedCB& cb) { 89 void DemuxerStreamForTest::SetStreamStatusChangeCB(
90 const StreamStatusChangeCB& cb) {
90 NOTIMPLEMENTED(); 91 NOTIMPLEMENTED();
91 } 92 }
92 93
93 void DemuxerStreamForTest::DoRead(const ReadCB& read_cb) { 94 void DemuxerStreamForTest::DoRead(const ReadCB& read_cb) {
94 has_pending_read_ = false; 95 has_pending_read_ = false;
95 96
96 if (total_frame_count_ != -1 && frame_count_ >= total_frame_count_) { 97 if (total_frame_count_ != -1 && frame_count_ >= total_frame_count_) {
97 // End of stream 98 // End of stream
98 read_cb.Run(kOk, ::media::DecoderBuffer::CreateEOSBuffer()); 99 read_cb.Run(kOk, ::media::DecoderBuffer::CreateEOSBuffer());
99 return; 100 return;
100 } 101 }
101 102
102 scoped_refptr<::media::DecoderBuffer> buffer(new ::media::DecoderBuffer(16)); 103 scoped_refptr<::media::DecoderBuffer> buffer(new ::media::DecoderBuffer(16));
103 buffer->set_timestamp(frame_count_ * base::TimeDelta::FromMilliseconds( 104 buffer->set_timestamp(frame_count_ * base::TimeDelta::FromMilliseconds(
104 kDemuxerStreamForTestFrameDuration)); 105 kDemuxerStreamForTestFrameDuration));
105 frame_count_++; 106 frame_count_++;
106 read_cb.Run(kOk, buffer); 107 read_cb.Run(kOk, buffer);
107 } 108 }
108 109
109 } // namespace media 110 } // namespace media
110 } // namespace chromecast 111 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/cma/base/demuxer_stream_for_test.h ('k') | media/base/demuxer_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698