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

Side by Side Diff: content/common/gpu/client/gpu_video_decode_accelerator_host.cc

Issue 1485043002: Passed is_encrypted parameter to the VDA initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/common/gpu/client/gpu_video_decode_accelerator_host.h" 5 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "content/common/gpu/client/gpu_channel_host.h" 10 #include "content/common/gpu/client/gpu_channel_host.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 DCHECK(CalledOnValidThread()); 74 DCHECK(CalledOnValidThread());
75 if (channel_) { 75 if (channel_) {
76 if (decoder_route_id_ != MSG_ROUTING_NONE) 76 if (decoder_route_id_ != MSG_ROUTING_NONE)
77 channel_->RemoveRoute(decoder_route_id_); 77 channel_->RemoveRoute(decoder_route_id_);
78 channel_ = NULL; 78 channel_ = NULL;
79 } 79 }
80 DLOG(ERROR) << "OnChannelError()"; 80 DLOG(ERROR) << "OnChannelError()";
81 PostNotifyError(PLATFORM_FAILURE); 81 PostNotifyError(PLATFORM_FAILURE);
82 } 82 }
83 83
84 bool GpuVideoDecodeAcceleratorHost::Initialize(media::VideoCodecProfile profile, 84 bool GpuVideoDecodeAcceleratorHost::Initialize(
85 Client* client) { 85 const media::VideoDecodeAccelerator::InitParams& params,
86 Client* client) {
86 DCHECK(CalledOnValidThread()); 87 DCHECK(CalledOnValidThread());
87 client_ = client; 88 client_ = client;
88 89
89 if (!impl_) 90 if (!impl_)
90 return false; 91 return false;
91 92
92 int32 route_id = channel_->GenerateRouteID(); 93 int32 route_id = channel_->GenerateRouteID();
93 channel_->AddRoute(route_id, weak_this_factory_.GetWeakPtr()); 94 channel_->AddRoute(route_id, weak_this_factory_.GetWeakPtr());
94 95
95 bool succeeded = false; 96 bool succeeded = false;
96 Send(new GpuCommandBufferMsg_CreateVideoDecoder(impl_->route_id(), profile, 97 Send(new GpuCommandBufferMsg_CreateVideoDecoder(impl_->route_id(), params,
97 route_id, &succeeded)); 98 route_id, &succeeded));
98 99
99 if (!succeeded) { 100 if (!succeeded) {
100 DLOG(ERROR) << "Send(GpuCommandBufferMsg_CreateVideoDecoder()) failed"; 101 DLOG(ERROR) << "Send(GpuCommandBufferMsg_CreateVideoDecoder()) failed";
101 PostNotifyError(PLATFORM_FAILURE); 102 PostNotifyError(PLATFORM_FAILURE);
102 channel_->RemoveRoute(route_id); 103 channel_->RemoveRoute(route_id);
103 return false; 104 return false;
104 } 105 }
105 decoder_route_id_ = route_id; 106 decoder_route_id_ = route_id;
106 return true; 107 return true;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 weak_this_factory_.InvalidateWeakPtrs(); 283 weak_this_factory_.InvalidateWeakPtrs();
283 284
284 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the 285 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the
285 // last thing done on this stack! 286 // last thing done on this stack!
286 media::VideoDecodeAccelerator::Client* client = NULL; 287 media::VideoDecodeAccelerator::Client* client = NULL;
287 std::swap(client, client_); 288 std::swap(client, client_);
288 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); 289 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error));
289 } 290 }
290 291
291 } // namespace content 292 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698