chromium/third_party/webrtc/modules/video_capture/linux/video_capture_v4l2.cc

/*
 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "modules/video_capture/linux/video_capture_v4l2.h"

#include <errno.h>
#include <fcntl.h>
#include <linux/videodev2.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/select.h>
#include <time.h>
#include <unistd.h>

#include <new>
#include <string>

#include "api/scoped_refptr.h"
#include "media/base/video_common.h"
#include "modules/video_capture/video_capture.h"
#include "rtc_base/logging.h"

// These defines are here to support building on kernel 3.16 which some
// downstream projects, e.g. Firefox, use.
// TODO(apehrson): Remove them and their undefs when no longer needed.
#ifndef V4L2_PIX_FMT_ABGR32
#define ABGR32_OVERRIDE
#define V4L2_PIX_FMT_ABGR32
#endif

#ifndef V4L2_PIX_FMT_ARGB32
#define ARGB32_OVERRIDE
#define V4L2_PIX_FMT_ARGB32
#endif

#ifndef V4L2_PIX_FMT_RGBA32
#define RGBA32_OVERRIDE
#define V4L2_PIX_FMT_RGBA32
#endif

namespace webrtc {
namespace videocapturemodule {
VideoCaptureModuleV4L2::VideoCaptureModuleV4L2()
    :{}

int32_t VideoCaptureModuleV4L2::Init(const char* deviceUniqueIdUTF8) {}

VideoCaptureModuleV4L2::~VideoCaptureModuleV4L2() {}

int32_t VideoCaptureModuleV4L2::StartCapture(
    const VideoCaptureCapability& capability) {}

int32_t VideoCaptureModuleV4L2::StopCapture() {}

// critical section protected by the caller

bool VideoCaptureModuleV4L2::AllocateVideoBuffers() {}

bool VideoCaptureModuleV4L2::DeAllocateVideoBuffers() {}

bool VideoCaptureModuleV4L2::CaptureStarted() {}

bool VideoCaptureModuleV4L2::CaptureProcess() {}

int32_t VideoCaptureModuleV4L2::CaptureSettings(
    VideoCaptureCapability& settings) {}
}  // namespace videocapturemodule
}  // namespace webrtc

#ifdef ABGR32_OVERRIDE
#undef ABGR32_OVERRIDE
#undef V4L2_PIX_FMT_ABGR32
#endif

#ifdef ARGB32_OVERRIDE
#undef ARGB32_OVERRIDE
#undef V4L2_PIX_FMT_ARGB32
#endif

#ifdef RGBA32_OVERRIDE
#undef RGBA32_OVERRIDE
#undef V4L2_PIX_FMT_RGBA32
#endif