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

Unified Diff: ppapi/cpp/private/flash.cc

Issue 11016007: Implement host side of sync EnumerateVideoCaptureDevices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/private/flash.h ('k') | ppapi/examples/enumerate_devices/enumerate_devices.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/private/flash.cc
diff --git a/ppapi/cpp/private/flash.cc b/ppapi/cpp/private/flash.cc
index 3a3da4e2bd8e1a098904b347ab5596cf68ba14a9..5707b7036b25059354390edaac3506552c2eeb40 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;
}
@@ -53,7 +59,10 @@ PPB_Flash flash_12_combined_interface;
void InitializeCombinedInterface() {
if (initialized_combined_interface)
return;
- if (has_interface<PPB_Flash_12_5>()) {
+ if (has_interface<PPB_Flash_12_6>()) {
+ 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::EnumerateVideoCaptureDevices(
+ const InstanceHandle& instance,
+ const VideoCapture_Dev& video_capture,
+ std::vector<DeviceRef_Dev>* devices_out) {
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.EnumerateVideoCaptureDevices) {
+ ResourceArrayOutputAdapter<DeviceRef_Dev> adapter(devices_out);
+ return flash_12_combined_interface.EnumerateVideoCaptureDevices(
+ 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(
« no previous file with comments | « ppapi/cpp/private/flash.h ('k') | ppapi/examples/enumerate_devices/enumerate_devices.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698