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

Unified Diff: device/capture/video/linux/v4l2_capture_delegate.cc

Issue 2214533002: move //media/capture to //device/capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: device/capture/video/linux/v4l2_capture_delegate.cc
diff --git a/media/capture/video/linux/v4l2_capture_delegate.cc b/device/capture/video/linux/v4l2_capture_delegate.cc
similarity index 95%
rename from media/capture/video/linux/v4l2_capture_delegate.cc
rename to device/capture/video/linux/v4l2_capture_delegate.cc
index a6f47b551ed410f3fa28c5f45b888eee6f97c0b7..1ecae47deb2b8f5aa07dbb202613ea7fbf755aac 100644
--- a/media/capture/video/linux/v4l2_capture_delegate.cc
+++ b/device/capture/video/linux/v4l2_capture_delegate.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "media/capture/video/linux/v4l2_capture_delegate.h"
+#include "device/capture/video/linux/v4l2_capture_delegate.h"
#include <poll.h>
#include <sys/fcntl.h>
@@ -15,10 +15,10 @@
#include "base/posix/eintr_wrapper.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
+#include "device/capture/video/linux/video_capture_device_linux.h"
#include "media/base/bind_to_current_loop.h"
-#include "media/capture/video/linux/video_capture_device_linux.h"
-namespace media {
+namespace device {
// Desired number of video buffers to allocate. The actual number of allocated
// buffers by v4l2 driver can be higher or lower than this number.
@@ -44,19 +44,19 @@ static struct {
VideoPixelFormat pixel_format;
size_t num_planes;
} const kSupportedFormatsAndPlanarity[] = {
- {V4L2_PIX_FMT_YUV420, PIXEL_FORMAT_I420, 1},
- {V4L2_PIX_FMT_YUYV, PIXEL_FORMAT_YUY2, 1},
- {V4L2_PIX_FMT_UYVY, PIXEL_FORMAT_UYVY, 1},
- {V4L2_PIX_FMT_RGB24, PIXEL_FORMAT_RGB24, 1},
+ {V4L2_PIX_FMT_YUV420, media::PIXEL_FORMAT_I420, 1},
+ {V4L2_PIX_FMT_YUYV, media::PIXEL_FORMAT_YUY2, 1},
+ {V4L2_PIX_FMT_UYVY, media::PIXEL_FORMAT_UYVY, 1},
+ {V4L2_PIX_FMT_RGB24, media::PIXEL_FORMAT_RGB24, 1},
// MJPEG is usually sitting fairly low since we don't want to have to
// decode. However, it is needed for large resolutions due to USB bandwidth
// limitations, so GetListOfUsableFourCcs() can duplicate it on top, see
// that method.
- {V4L2_PIX_FMT_MJPEG, PIXEL_FORMAT_MJPEG, 1},
+ {V4L2_PIX_FMT_MJPEG, media::PIXEL_FORMAT_MJPEG, 1},
// JPEG works as MJPEG on some gspca webcams from field reports, see
// https://code.google.com/p/webrtc/issues/detail?id=529, put it as the
// least preferred format.
- {V4L2_PIX_FMT_JPEG, PIXEL_FORMAT_MJPEG, 1},
+ {V4L2_PIX_FMT_JPEG, media::PIXEL_FORMAT_MJPEG, 1},
};
// Fill in |format| with the given parameters.
@@ -136,10 +136,10 @@ VideoPixelFormat V4L2CaptureDelegate::V4l2FourCcToChromiumPixelFormat(
return fourcc_and_pixel_format.pixel_format;
}
// Not finding a pixel format is OK during device capabilities enumeration.
- // Let the caller decide if PIXEL_FORMAT_UNKNOWN is an error or
+ // Let the caller decide if media::PIXEL_FORMAT_UNKNOWN is an error or
// not.
DVLOG(1) << "Unsupported pixel format: " << FourccToString(v4l2_fourcc);
- return PIXEL_FORMAT_UNKNOWN;
+ return media::PIXEL_FORMAT_UNKNOWN;
}
// static
@@ -219,7 +219,7 @@ void V4L2CaptureDelegate::AllocateAndStart(
}
const VideoPixelFormat pixel_format =
V4l2FourCcToChromiumPixelFormat(video_fmt_.fmt.pix.pixelformat);
- if (pixel_format == PIXEL_FORMAT_UNKNOWN) {
+ if (pixel_format == media::PIXEL_FORMAT_UNKNOWN) {
SetErrorState(FROM_HERE, "Unsupported pixel format");
return;
}
@@ -444,4 +444,4 @@ bool V4L2CaptureDelegate::BufferTracker::Init(int fd,
return true;
}
-} // namespace media
+} // namespace device
« no previous file with comments | « device/capture/video/linux/v4l2_capture_delegate.h ('k') | device/capture/video/linux/video_capture_device_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698