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 <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 bool MojoDemuxerStreamAdapter::SupportsConfigChanges() { | 64 bool MojoDemuxerStreamAdapter::SupportsConfigChanges() { |
65 return true; | 65 return true; |
66 } | 66 } |
67 | 67 |
68 VideoRotation MojoDemuxerStreamAdapter::video_rotation() { | 68 VideoRotation MojoDemuxerStreamAdapter::video_rotation() { |
69 NOTIMPLEMENTED(); | 69 NOTIMPLEMENTED(); |
70 return VIDEO_ROTATION_0; | 70 return VIDEO_ROTATION_0; |
71 } | 71 } |
72 | 72 |
| 73 #if DCHECK_IS_ON() |
| 74 void DcheckRemoteEnabledValue(bool local_enabled_value, |
| 75 bool remote_enabled_value) { |
| 76 DCHECK_EQ(local_enabled_value, remote_enabled_value); |
| 77 } |
| 78 #endif |
| 79 |
| 80 bool MojoDemuxerStreamAdapter::enabled() const { |
| 81 #if DCHECK_IS_ON() |
| 82 // TODO(servolk): Is it worth waiting for the IPC call roundtrip, when we can |
| 83 // just maintain the current |enabled_| status in here. Would this cause any |
| 84 // problems? |
| 85 demuxer_stream_->enabled(base::Bind(&DcheckRemoteEnabledValue, enabled_)); |
| 86 #endif |
| 87 return enabled_; |
| 88 } |
| 89 |
| 90 void MojoDemuxerStreamAdapter::set_enabled(bool enabled, |
| 91 base::TimeDelta timestamp) { |
| 92 demuxer_stream_->set_enabled(enabled, timestamp.InMicroseconds()); |
| 93 enabled_ = enabled; |
| 94 } |
| 95 |
73 // TODO(xhwang): Pass liveness here. | 96 // TODO(xhwang): Pass liveness here. |
74 void MojoDemuxerStreamAdapter::OnStreamReady( | 97 void MojoDemuxerStreamAdapter::OnStreamReady( |
75 mojom::DemuxerStream::Type type, | 98 mojom::DemuxerStream::Type type, |
76 mojo::ScopedDataPipeConsumerHandle pipe, | 99 mojo::ScopedDataPipeConsumerHandle pipe, |
77 mojom::AudioDecoderConfigPtr audio_config, | 100 mojom::AudioDecoderConfigPtr audio_config, |
78 mojom::VideoDecoderConfigPtr video_config) { | 101 mojom::VideoDecoderConfigPtr video_config) { |
79 DVLOG(1) << __FUNCTION__; | 102 DVLOG(1) << __FUNCTION__; |
80 DCHECK(pipe.is_valid()); | 103 DCHECK(pipe.is_valid()); |
81 DCHECK_EQ(DemuxerStream::UNKNOWN, type_); | 104 DCHECK_EQ(DemuxerStream::UNKNOWN, type_); |
82 | 105 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 case DemuxerStream::VIDEO: | 171 case DemuxerStream::VIDEO: |
149 DCHECK(video_config && !audio_config); | 172 DCHECK(video_config && !audio_config); |
150 video_config_ = video_config.To<VideoDecoderConfig>(); | 173 video_config_ = video_config.To<VideoDecoderConfig>(); |
151 break; | 174 break; |
152 default: | 175 default: |
153 NOTREACHED(); | 176 NOTREACHED(); |
154 } | 177 } |
155 } | 178 } |
156 | 179 |
157 } // namespace media | 180 } // namespace media |
OLD | NEW |