~osomon/oxide/override-touchUngrabEvent

« back to all changes in this revision

Viewing changes to shared/browser/media/oxide_video_capture_device_factory_linux.cc

  • Committer: Chris Coulson
  • Date: 2016-01-08 21:31:20 UTC
  • Revision ID: chris.coulson@canonical.com-20160108213120-9v54434yvfmsd7lz
Be a bit more intelligent when detecting whether the hybris camera compatibility layer is available, or whether we're running on the Android EGL stack

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "base/callback.h"
33
33
#include "base/strings/stringprintf.h"
34
34
 
35
 
#include "shared/browser/oxide_android_properties.h"
 
35
#include "shared/browser/oxide_hybris_utils.h"
36
36
 
37
37
#include "oxide_video_capture_device_hybris.h"
38
38
#endif
56
56
}
57
57
 
58
58
scoped_ptr<media::VideoCaptureDevice::Names> GetDeviceNamesFromHybris() {
59
 
  DCHECK(AndroidProperties::GetInstance()->Available());
 
59
  DCHECK(HybrisUtils::IsCameraCompatAvailable());
60
60
 
61
61
  int32_t number_of_devices = android_camera_get_number_of_devices();
62
62
 
108
108
scoped_ptr<media::VideoCaptureDevice> VideoCaptureDeviceFactoryLinux::Create(
109
109
    const media::VideoCaptureDevice::Name& device_name) {
110
110
#if defined(ENABLE_HYBRIS_CAMERA)
111
 
  if (!AndroidProperties::GetInstance()->Available()) {
 
111
  if (!HybrisUtils::IsCameraCompatAvailable()) {
112
112
    return delegate_->Create(device_name);
113
113
  }
114
114
 
131
131
void VideoCaptureDeviceFactoryLinux::EnumerateDeviceNames(
132
132
    const EnumerateDevicesCallback& callback) {
133
133
#if defined(ENABLE_HYBRIS_CAMERA)
134
 
  if (AndroidProperties::GetInstance()->Available()) {
 
134
  if (HybrisUtils::IsCameraCompatAvailable()) {
135
135
    scoped_ptr<media::VideoCaptureDevice::Names> names =
136
136
        GetDeviceNamesFromHybris();
137
137
    callback.Run(std::move(names));
146
146
    const media::VideoCaptureDevice::Name& device,
147
147
    media::VideoCaptureFormats* supported_formats) {
148
148
#if defined(ENABLE_HYBRIS_CAMERA)
149
 
  if (AndroidProperties::GetInstance()->Available()) {
 
149
  if (HybrisUtils::IsCameraCompatAvailable()) {
150
150
    return;
151
151
  }
152
152
#endif