~abreu-alexandre/oxide/vibrate

« back to all changes in this revision

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

  • Committer: Chris Coulson
  • Date: 2015-12-01 19:47:54 UTC
  • mto: This revision was merged to the branch mainline in revision 1287.
  • Revision ID: chris.coulson@canonical.com-20151201194754-166w6vabdbwh855h
Hide the camera support behind a new build option - ENABLE_HYBRIS_CAMERA (currently off by default). We're using API's that only exist in Ubuntu's libhybris, so we should probably auto-detect these in future

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "base/logging.h"
22
22
#include "media/capture/video/video_capture_device.h"
23
23
 
24
 
#if defined(ENABLE_HYBRIS)
 
24
#if defined(ENABLE_HYBRIS_CAMERA)
25
25
#include <algorithm>
26
26
#include <hybris/camera/camera_compatibility_layer.h>
27
27
#include <hybris/camera/camera_compatibility_layer_capabilities.h>
39
39
 
40
40
namespace {
41
41
 
42
 
#if defined(ENABLE_HYBRIS)
 
42
#if defined(ENABLE_HYBRIS_CAMERA)
43
43
 
44
44
const char* GetDeviceNameFromCameraType(CameraType type) {
45
45
  switch (type) {
99
99
 
100
100
scoped_ptr<media::VideoCaptureDevice> VideoCaptureDeviceFactoryLinux::Create(
101
101
    const media::VideoCaptureDevice::Name& device_name) {
102
 
#if defined(ENABLE_HYBRIS)
 
102
#if defined(ENABLE_HYBRIS_CAMERA)
103
103
  if (!AndroidProperties::GetInstance()->Available()) {
104
104
    return delegate_->Create(device_name);
105
105
  }
122
122
 
123
123
void VideoCaptureDeviceFactoryLinux::EnumerateDeviceNames(
124
124
    const EnumerateDevicesCallback& callback) {
125
 
#if defined(ENABLE_HYBRIS)
 
125
#if defined(ENABLE_HYBRIS_CAMERA)
126
126
  if (AndroidProperties::GetInstance()->Available()) {
127
127
    scoped_ptr<media::VideoCaptureDevice::Names> names =
128
128
        GetDeviceNamesFromHybris();
137
137
void VideoCaptureDeviceFactoryLinux::GetDeviceSupportedFormats(
138
138
    const media::VideoCaptureDevice::Name& device,
139
139
    media::VideoCaptureFormats* supported_formats) {
140
 
#if defined(ENABLE_HYBRIS)
 
140
#if defined(ENABLE_HYBRIS_CAMERA)
141
141
  if (AndroidProperties::GetInstance()->Available()) {
142
142
    return;
143
143
  }