Chromium Code Reviews| Index: ppapi/cpp/private/flash.cc |
| diff --git a/ppapi/cpp/private/flash.cc b/ppapi/cpp/private/flash.cc |
| index 3a3da4e2bd8e1a098904b347ab5596cf68ba14a9..9c97f12ab85e79078e76130177384e1fc9fd632c 100644 |
| --- a/ppapi/cpp/private/flash.cc |
| +++ b/ppapi/cpp/private/flash.cc |
| @@ -8,7 +8,9 @@ |
| #include "ppapi/c/pp_bool.h" |
| #include "ppapi/c/pp_errors.h" |
| +#include "ppapi/cpp/dev/device_ref_dev.h" |
| #include "ppapi/cpp/dev/font_dev.h" |
| +#include "ppapi/cpp/dev/video_capture_dev.h" |
| #include "ppapi/cpp/image_data.h" |
| #include "ppapi/cpp/instance_handle.h" |
| #include "ppapi/cpp/module.h" |
| @@ -24,6 +26,10 @@ namespace pp { |
| namespace { |
| +template <> const char* interface_name<PPB_Flash_12_6>() { |
| + return PPB_FLASH_INTERFACE_12_6; |
| +} |
| + |
| template <> const char* interface_name<PPB_Flash_12_5>() { |
| return PPB_FLASH_INTERFACE_12_5; |
| } |
| @@ -54,6 +60,9 @@ void InitializeCombinedInterface() { |
| if (initialized_combined_interface) |
| return; |
| if (has_interface<PPB_Flash_12_5>()) { |
|
yzshen1
2012/10/10 18:17:39
Haha! Please use 12_6. :)
raymes
2012/10/11 18:39:26
Good catch, thanks.
|
| + memcpy(&flash_12_combined_interface, get_interface<PPB_Flash_12_6>(), |
| + sizeof(PPB_Flash_12_6)); |
| + } else if (has_interface<PPB_Flash_12_5>()) { |
| memcpy(&flash_12_combined_interface, get_interface<PPB_Flash_12_5>(), |
| sizeof(PPB_Flash_12_5)); |
| } else if (has_interface<PPB_Flash_12_4>()) { |
| @@ -72,7 +81,8 @@ namespace flash { |
| // static |
| bool Flash::IsAvailable() { |
| - return has_interface<PPB_Flash_12_5>() || |
| + return has_interface<PPB_Flash_12_6>() || |
| + has_interface<PPB_Flash_12_5>() || |
| has_interface<PPB_Flash_12_4>() || |
| has_interface<PPB_Flash_12_3>(); |
| } |
| @@ -246,6 +256,22 @@ bool Flash::SetCrashData(const InstanceHandle& instance, |
| } |
| // static |
| +int32_t Flash::EnumerateVideoDevicesSync( |
| + const InstanceHandle& instance, |
| + const VideoCapture_Dev& video_capture, |
| + std::vector<DeviceRef_Dev>* devices_out) { |
| + InitializeCombinedInterface(); |
| + if (flash_12_combined_interface.EnumerateVideoDevicesSync) { |
| + ResourceArrayOutputAdapter<DeviceRef_Dev> adapter(devices_out); |
| + return flash_12_combined_interface.EnumerateVideoDevicesSync( |
|
yzshen1
2012/10/10 18:17:39
Please update the function name.
raymes
2012/10/11 18:39:26
Done.
|
| + instance.pp_instance(), |
| + video_capture.pp_resource(), |
| + adapter.pp_array_output()); |
| + } |
| + return PP_ERROR_FAILED; |
| +} |
| + |
| +// static |
| bool Flash::InvokePrinting(const InstanceHandle& instance) { |
| if (has_interface<PPB_Flash_Print_1_0>()) { |
| get_interface<PPB_Flash_Print_1_0>()->InvokePrinting( |