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

Side by Side Diff: ppapi/proxy/video_encoder_resource.cc

Issue 1069653002: ppapi: VideoEncoder: fix reported value for GetSupportedProfiles() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bbudge's nit Created 5 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/memory/shared_memory.h" 5 #include "base/memory/shared_memory.h"
6 #include "base/numerics/safe_conversions.h" 6 #include "base/numerics/safe_conversions.h"
7 #include "ppapi/c/pp_array_output.h" 7 #include "ppapi/c/pp_array_output.h"
8 #include "ppapi/proxy/ppapi_messages.h" 8 #include "ppapi/proxy/ppapi_messages.h"
9 #include "ppapi/proxy/video_encoder_resource.h" 9 #include "ppapi/proxy/video_encoder_resource.h"
10 #include "ppapi/proxy/video_frame_resource.h" 10 #include "ppapi/proxy/video_frame_resource.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (!writer.is_valid()) { 260 if (!writer.is_valid()) {
261 RunCallback(&get_supported_profiles_callback_, PP_ERROR_BADARGUMENT); 261 RunCallback(&get_supported_profiles_callback_, PP_ERROR_BADARGUMENT);
262 return; 262 return;
263 } 263 }
264 264
265 if (!writer.StoreVector(profiles)) { 265 if (!writer.StoreVector(profiles)) {
266 RunCallback(&get_supported_profiles_callback_, PP_ERROR_FAILED); 266 RunCallback(&get_supported_profiles_callback_, PP_ERROR_FAILED);
267 return; 267 return;
268 } 268 }
269 269
270 RunCallback(&get_supported_profiles_callback_, PP_OK); 270 RunCallback(&get_supported_profiles_callback_,
271 base::checked_cast<int32_t>(profiles.size()));
271 } 272 }
272 273
273 void VideoEncoderResource::OnPluginMsgInitializeReply( 274 void VideoEncoderResource::OnPluginMsgInitializeReply(
274 const ResourceMessageReplyParams& params, 275 const ResourceMessageReplyParams& params,
275 uint32_t input_frame_count, 276 uint32_t input_frame_count,
276 const PP_Size& input_coded_size) { 277 const PP_Size& input_coded_size) {
277 DCHECK(!initialized_); 278 DCHECK(!initialized_);
278 279
279 encoder_last_error_ = params.result(); 280 encoder_last_error_ = params.result();
280 if (!encoder_last_error_) 281 if (!encoder_last_error_)
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 for (VideoFrameMap::iterator it = video_frames_.begin(); 424 for (VideoFrameMap::iterator it = video_frames_.begin();
424 it != video_frames_.end(); ++it) { 425 it != video_frames_.end(); ++it) {
425 it->second->Invalidate(); 426 it->second->Invalidate();
426 it->second = nullptr; 427 it->second = nullptr;
427 } 428 }
428 video_frames_.clear(); 429 video_frames_.clear();
429 } 430 }
430 431
431 } // namespace proxy 432 } // namespace proxy
432 } // namespace ppapi 433 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/examples/video_encode/video_encode.cc ('k') | ppapi/proxy/video_encoder_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698