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

Side by Side Diff: ppapi/examples/video_encode/video_encode.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 <math.h> 5 #include <math.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <iostream> 9 #include <iostream>
10 #include <map> 10 #include <map>
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 281 }
282 282
283 void VideoEncoderInstance::OnEncoderProbed( 283 void VideoEncoderInstance::OnEncoderProbed(
284 int32_t result, 284 int32_t result,
285 const std::vector<PP_VideoProfileDescription> profiles) { 285 const std::vector<PP_VideoProfileDescription> profiles) {
286 pp::VarDictionary dict; 286 pp::VarDictionary dict;
287 dict.Set(pp::Var("name"), pp::Var("supportedProfiles")); 287 dict.Set(pp::Var("name"), pp::Var("supportedProfiles"));
288 pp::VarArray js_profiles; 288 pp::VarArray js_profiles;
289 dict.Set(pp::Var("profiles"), js_profiles); 289 dict.Set(pp::Var("profiles"), js_profiles);
290 290
291 if (result != PP_OK) { 291 if (result < 0) {
292 LogError(result, "Cannot get supported profiles"); 292 LogError(result, "Cannot get supported profiles");
293 PostMessage(dict); 293 PostMessage(dict);
294 } 294 }
295 295
296 int32_t idx = 0; 296 int32_t idx = 0;
297 for (const PP_VideoProfileDescription& profile : profiles) 297 for (const PP_VideoProfileDescription& profile : profiles)
298 js_profiles.Set(idx++, pp::Var(VideoProfileToString(profile.profile))); 298 js_profiles.Set(idx++, pp::Var(VideoProfileToString(profile.profile)));
299 PostMessage(dict); 299 PostMessage(dict);
300 } 300 }
301 301
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 } 570 }
571 571
572 } // anonymous namespace 572 } // anonymous namespace
573 573
574 namespace pp { 574 namespace pp {
575 // Factory function for your specialization of the Module object. 575 // Factory function for your specialization of the Module object.
576 Module* CreateModule() { 576 Module* CreateModule() {
577 return new VideoEncoderModule(); 577 return new VideoEncoderModule();
578 } 578 }
579 } // namespace pp 579 } // namespace pp
OLDNEW
« no previous file with comments | « native_client_sdk/src/examples/api/video_encode/video_encode.cc ('k') | ppapi/proxy/video_encoder_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698