Pepper: Add IsAvailable() static methods to C++ wrappers to AudioInput_Dev and VideoCapture_Dev.

Review URL: http://codereview.chromium.org/8566044

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110758 0039d316-1c4b-4281-b951-d872f2087c98
parent 3f031829
......@@ -31,6 +31,11 @@ AudioInput_Dev::AudioInput_Dev(Instance* instance,
}
}
// static
bool AudioInput_Dev::IsAvailable() {
return has_interface<PPB_AudioInput_Dev>();
}
bool AudioInput_Dev::StartCapture() {
return has_interface<PPB_AudioInput_Dev>() &&
get_interface<PPB_AudioInput_Dev>()->StartCapture(pp_resource());
......
......@@ -23,6 +23,12 @@ class AudioInput_Dev : public Resource {
PPB_AudioInput_Callback callback,
void* user_data);
/// Static function for determining whether the browser supports the required
/// AudioInput interface.
///
/// @return true if the interface is available, false otherwise.
static bool IsAvailable();
/// Getter function for returning the internal <code>PPB_AudioConfig</code>
/// struct.
///
......
......@@ -34,6 +34,11 @@ VideoCapture_Dev::VideoCapture_Dev(const VideoCapture_Dev& other)
: Resource(other) {
}
// static
bool VideoCapture_Dev::IsAvailable() {
return has_interface<PPB_VideoCapture_Dev>();
}
int32_t VideoCapture_Dev::StartCapture(
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count) {
......
......@@ -18,6 +18,9 @@ class VideoCapture_Dev : public Resource {
VideoCapture_Dev(PP_Resource resource);
VideoCapture_Dev(const VideoCapture_Dev& other);
// Returns true if the required interface is available.
static bool IsAvailable();
int32_t StartCapture(const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count);
int32_t ReuseBuffer(uint32_t buffer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment