OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/clients/mojo_video_decoder.h" | 5 #include "media/mojo/clients/mojo_video_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 DCHECK(!remote_decoder_bound_); | 168 DCHECK(!remote_decoder_bound_); |
169 | 169 |
170 remote_decoder_.Bind(std::move(remote_decoder_info_)); | 170 remote_decoder_.Bind(std::move(remote_decoder_info_)); |
171 remote_decoder_bound_ = true; | 171 remote_decoder_bound_ = true; |
172 | 172 |
173 remote_decoder_.set_connection_error_handler( | 173 remote_decoder_.set_connection_error_handler( |
174 base::Bind(&MojoVideoDecoder::Stop, base::Unretained(this))); | 174 base::Bind(&MojoVideoDecoder::Stop, base::Unretained(this))); |
175 | 175 |
176 // TODO(sandersd): Does this need its own error handler? | 176 // TODO(sandersd): Does this need its own error handler? |
177 mojom::VideoDecoderClientAssociatedPtrInfo client_ptr_info; | 177 mojom::VideoDecoderClientAssociatedPtrInfo client_ptr_info; |
178 client_binding_.Bind(&client_ptr_info, remote_decoder_.associated_group()); | 178 client_binding_.Bind(&client_ptr_info); |
179 | 179 |
180 // TODO(sandersd): Better buffer sizing. | 180 // TODO(sandersd): Better buffer sizing. |
181 mojo::ScopedDataPipeConsumerHandle remote_consumer_handle; | 181 mojo::ScopedDataPipeConsumerHandle remote_consumer_handle; |
182 mojo_decoder_buffer_writer_ = MojoDecoderBufferWriter::Create( | 182 mojo_decoder_buffer_writer_ = MojoDecoderBufferWriter::Create( |
183 DemuxerStream::VIDEO, &remote_consumer_handle); | 183 DemuxerStream::VIDEO, &remote_consumer_handle); |
184 | 184 |
185 media::mojom::CommandBufferIdPtr command_buffer_id; | 185 media::mojom::CommandBufferIdPtr command_buffer_id; |
186 if (gpu_factories_) { | 186 if (gpu_factories_) { |
187 base::UnguessableToken channel_token = gpu_factories_->GetChannelToken(); | 187 base::UnguessableToken channel_token = gpu_factories_->GetChannelToken(); |
188 if (channel_token) { | 188 if (channel_token) { |
(...skipping 19 matching lines...) Expand all Loading... |
208 | 208 |
209 for (const auto& pending_decode : pending_decodes_) | 209 for (const auto& pending_decode : pending_decodes_) |
210 pending_decode.second.Run(DecodeStatus::DECODE_ERROR); | 210 pending_decode.second.Run(DecodeStatus::DECODE_ERROR); |
211 pending_decodes_.clear(); | 211 pending_decodes_.clear(); |
212 | 212 |
213 if (!reset_cb_.is_null()) | 213 if (!reset_cb_.is_null()) |
214 base::ResetAndReturn(&reset_cb_).Run(); | 214 base::ResetAndReturn(&reset_cb_).Run(); |
215 } | 215 } |
216 | 216 |
217 } // namespace media | 217 } // namespace media |
OLD | NEW |