Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Side by Side Diff: media/mojo/services/mojo_video_decoder_service.cc

Issue 2526953003: Add MediaGpuChannelManager::LookupChannel(). (Closed)
Patch Set: Implement MockGpuVideoAcceleratorFactories::GetCommandBufferRouteId(). Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // TODO(sandersd): Enter an error state.
37 if (decoder_) 39 if (decoder_)
38 return; 40 return;
39 41
40 // TODO(sandersd): Provide callback for requesting a GpuCommandBufferStub. 42 // TODO(sandersd): Provide callback for requesting a GpuCommandBufferStub.
41 decoder_ = mojo_media_client_->CreateVideoDecoder( 43 decoder_ = mojo_media_client_->CreateVideoDecoder(
42 base::ThreadTaskRunnerHandle::Get()); 44 base::ThreadTaskRunnerHandle::Get(), std::move(command_buffer_id));
43 45
44 client_.Bind(std::move(client)); 46 client_.Bind(std::move(client));
45 47
46 mojo_decoder_buffer_reader_.reset( 48 mojo_decoder_buffer_reader_.reset(
47 new MojoDecoderBufferReader(std::move(decoder_buffer_pipe))); 49 new MojoDecoderBufferReader(std::move(decoder_buffer_pipe)));
48 } 50 }
49 51
50 void MojoVideoDecoderService::Initialize(mojom::VideoDecoderConfigPtr config, 52 void MojoVideoDecoderService::Initialize(mojom::VideoDecoderConfigPtr config,
51 bool low_delay, 53 bool low_delay,
52 const InitializeCallback& callback) { 54 const InitializeCallback& callback) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 130 }
129 131
130 void MojoVideoDecoderService::OnDecoderOutput( 132 void MojoVideoDecoderService::OnDecoderOutput(
131 const scoped_refptr<VideoFrame>& frame) { 133 const scoped_refptr<VideoFrame>& frame) {
132 DVLOG(2) << __func__; 134 DVLOG(2) << __func__;
133 DCHECK(client_); 135 DCHECK(client_);
134 client_->OnVideoFrameDecoded(mojom::VideoFrame::From(frame)); 136 client_->OnVideoFrameDecoded(mojom::VideoFrame::From(frame));
135 } 137 }
136 138
137 } // namespace media 139 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_video_decoder_service.h ('k') | media/renderers/gpu_video_accelerator_factories.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698