OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/base/fake_text_track_stream.h" | 5 #include "media/base/fake_text_track_stream.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "media/base/decoder_buffer.h" | 9 #include "media/base/decoder_buffer.h" |
10 #include "media/filters/webvtt_util.h" | 10 #include "media/filters/webvtt_util.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 DCHECK(read_cb_.is_null()); | 25 DCHECK(read_cb_.is_null()); |
26 OnRead(); | 26 OnRead(); |
27 read_cb_ = read_cb; | 27 read_cb_ = read_cb; |
28 | 28 |
29 if (stopping_) { | 29 if (stopping_) { |
30 task_runner_->PostTask(FROM_HERE, base::Bind( | 30 task_runner_->PostTask(FROM_HERE, base::Bind( |
31 &FakeTextTrackStream::AbortPendingRead, base::Unretained(this))); | 31 &FakeTextTrackStream::AbortPendingRead, base::Unretained(this))); |
32 } | 32 } |
33 } | 33 } |
34 | 34 |
35 DemuxerStream::Type FakeTextTrackStream::type() { | 35 DemuxerStream::Type FakeTextTrackStream::type() const { |
36 return DemuxerStream::TEXT; | 36 return DemuxerStream::TEXT; |
37 } | 37 } |
38 | 38 |
39 bool FakeTextTrackStream::SupportsConfigChanges() { return false; } | 39 bool FakeTextTrackStream::SupportsConfigChanges() { return false; } |
40 | 40 |
41 VideoRotation FakeTextTrackStream::video_rotation() { | 41 VideoRotation FakeTextTrackStream::video_rotation() { |
42 return VIDEO_ROTATION_0; | 42 return VIDEO_ROTATION_0; |
43 } | 43 } |
44 | 44 |
45 void FakeTextTrackStream::SatisfyPendingRead( | 45 void FakeTextTrackStream::SatisfyPendingRead( |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 base::ResetAndReturn(&read_cb_).Run(kOk, DecoderBuffer::CreateEOSBuffer()); | 83 base::ResetAndReturn(&read_cb_).Run(kOk, DecoderBuffer::CreateEOSBuffer()); |
84 } | 84 } |
85 | 85 |
86 void FakeTextTrackStream::Stop() { | 86 void FakeTextTrackStream::Stop() { |
87 stopping_ = true; | 87 stopping_ = true; |
88 if (!read_cb_.is_null()) | 88 if (!read_cb_.is_null()) |
89 AbortPendingRead(); | 89 AbortPendingRead(); |
90 } | 90 } |
91 | 91 |
92 } // namespace media | 92 } // namespace media |
OLD | NEW |