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/services/mojo_video_decoder_service.h" | 5 #include "media/mojo/services/mojo_video_decoder_service.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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 MojoVideoDecoderService::MojoVideoDecoderService( | 24 MojoVideoDecoderService::MojoVideoDecoderService( |
25 MojoMediaClient* mojo_media_client) | 25 MojoMediaClient* mojo_media_client) |
26 : mojo_media_client_(mojo_media_client), weak_factory_(this) { | 26 : mojo_media_client_(mojo_media_client), weak_factory_(this) { |
27 weak_this_ = weak_factory_.GetWeakPtr(); | 27 weak_this_ = weak_factory_.GetWeakPtr(); |
28 } | 28 } |
29 | 29 |
30 MojoVideoDecoderService::~MojoVideoDecoderService() {} | 30 MojoVideoDecoderService::~MojoVideoDecoderService() {} |
31 | 31 |
32 void MojoVideoDecoderService::Construct( | 32 void MojoVideoDecoderService::Construct( |
33 mojom::VideoDecoderClientAssociatedPtrInfo client, | 33 mojom::VideoDecoderClientAssociatedPtrInfo client, |
34 mojo::ScopedDataPipeConsumerHandle decoder_buffer_pipe) { | 34 mojo::ScopedDataPipeConsumerHandle decoder_buffer_pipe, |
35 mojom::CommandBufferIdPtr command_buffer_id) { | |
35 DVLOG(1) << __func__; | 36 DVLOG(1) << __func__; |
36 | 37 |
38 if (command_buffer_id) { | |
39 DVLOG(1) << command_buffer_id->channel_token << " : " | |
40 << command_buffer_id->route_id; | |
dcheng
2017/01/10 06:03:42
Is it possible to upstream the implementation of t
sandersd (OOO until July 31)
2017/01/10 23:54:14
Done. (It's now plumbed to the factory which does
| |
41 } else { | |
42 DVLOG(1) << "No command_buffer_id"; | |
43 } | |
44 | |
45 // TODO(sandersd): Enter an error state. | |
37 if (decoder_) | 46 if (decoder_) |
38 return; | 47 return; |
39 | 48 |
40 // TODO(sandersd): Provide callback for requesting a GpuCommandBufferStub. | 49 // TODO(sandersd): Provide callback for requesting a GpuCommandBufferStub. |
41 decoder_ = mojo_media_client_->CreateVideoDecoder( | 50 decoder_ = mojo_media_client_->CreateVideoDecoder( |
42 base::ThreadTaskRunnerHandle::Get()); | 51 base::ThreadTaskRunnerHandle::Get()); |
43 | 52 |
44 client_.Bind(std::move(client)); | 53 client_.Bind(std::move(client)); |
45 | 54 |
46 mojo_decoder_buffer_reader_.reset( | 55 mojo_decoder_buffer_reader_.reset( |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 } | 137 } |
129 | 138 |
130 void MojoVideoDecoderService::OnDecoderOutput( | 139 void MojoVideoDecoderService::OnDecoderOutput( |
131 const scoped_refptr<VideoFrame>& frame) { | 140 const scoped_refptr<VideoFrame>& frame) { |
132 DVLOG(2) << __func__; | 141 DVLOG(2) << __func__; |
133 DCHECK(client_); | 142 DCHECK(client_); |
134 client_->OnVideoFrameDecoded(mojom::VideoFrame::From(frame)); | 143 client_->OnVideoFrameDecoded(mojom::VideoFrame::From(frame)); |
135 } | 144 } |
136 | 145 |
137 } // namespace media | 146 } // namespace media |
OLD | NEW |