OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mojo/services/mojo_demuxer_stream_adapter.h" | 5 #include "media/mojo/services/mojo_demuxer_stream_adapter.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/mojo/services/media_type_converters.h" | 10 #include "media/mojo/services/media_type_converters.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 DCHECK(!audio_config_queue_.empty()); | 40 DCHECK(!audio_config_queue_.empty()); |
41 return audio_config_queue_.front(); | 41 return audio_config_queue_.front(); |
42 } | 42 } |
43 | 43 |
44 VideoDecoderConfig MojoDemuxerStreamAdapter::video_decoder_config() { | 44 VideoDecoderConfig MojoDemuxerStreamAdapter::video_decoder_config() { |
45 DCHECK_EQ(type_, DemuxerStream::VIDEO); | 45 DCHECK_EQ(type_, DemuxerStream::VIDEO); |
46 DCHECK(!video_config_queue_.empty()); | 46 DCHECK(!video_config_queue_.empty()); |
47 return video_config_queue_.front(); | 47 return video_config_queue_.front(); |
48 } | 48 } |
49 | 49 |
50 DemuxerStream::Type MojoDemuxerStreamAdapter::type() { | 50 DemuxerStream::Type MojoDemuxerStreamAdapter::type() const { |
51 return type_; | 51 return type_; |
52 } | 52 } |
53 | 53 |
54 void MojoDemuxerStreamAdapter::EnableBitstreamConverter() { | 54 void MojoDemuxerStreamAdapter::EnableBitstreamConverter() { |
55 NOTIMPLEMENTED(); | 55 NOTIMPLEMENTED(); |
56 } | 56 } |
57 | 57 |
58 bool MojoDemuxerStreamAdapter::SupportsConfigChanges() { | 58 bool MojoDemuxerStreamAdapter::SupportsConfigChanges() { |
59 return true; | 59 return true; |
60 } | 60 } |
61 | 61 |
62 VideoRotation MojoDemuxerStreamAdapter::video_rotation() { | 62 VideoRotation MojoDemuxerStreamAdapter::video_rotation() { |
63 NOTIMPLEMENTED(); | 63 NOTIMPLEMENTED(); |
64 return VIDEO_ROTATION_0; | 64 return VIDEO_ROTATION_0; |
65 } | 65 } |
66 | 66 |
| 67 // TODO(xhwang): Pass liveness here. |
67 void MojoDemuxerStreamAdapter::OnStreamReady( | 68 void MojoDemuxerStreamAdapter::OnStreamReady( |
68 mojo::ScopedDataPipeConsumerHandle pipe) { | 69 mojo::ScopedDataPipeConsumerHandle pipe) { |
69 DVLOG(1) << __FUNCTION__; | 70 DVLOG(1) << __FUNCTION__; |
70 // TODO(tim): We don't support pipe streaming yet. | 71 // TODO(tim): We don't support pipe streaming yet. |
71 DCHECK(!pipe.is_valid()); | 72 DCHECK(!pipe.is_valid()); |
72 DCHECK_NE(type_, DemuxerStream::UNKNOWN); | 73 DCHECK_NE(type_, DemuxerStream::UNKNOWN); |
73 stream_ready_cb_.Run(); | 74 stream_ready_cb_.Run(); |
74 } | 75 } |
75 | 76 |
76 void MojoDemuxerStreamAdapter::OnAudioDecoderConfigChanged( | 77 void MojoDemuxerStreamAdapter::OnAudioDecoderConfigChanged( |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 if (video_config_queue_.empty()) | 129 if (video_config_queue_.empty()) |
129 return; | 130 return; |
130 } | 131 } |
131 } | 132 } |
132 | 133 |
133 read_cb_.Run(media_status, media_buffer); | 134 read_cb_.Run(media_status, media_buffer); |
134 read_cb_.Reset(); | 135 read_cb_.Reset(); |
135 } | 136 } |
136 | 137 |
137 } // namespace media | 138 } // namespace media |
OLD | NEW |