Index: media/gpu/generic_v4l2_device.cc |
diff --git a/content/common/gpu/media/generic_v4l2_device.cc b/media/gpu/generic_v4l2_device.cc |
similarity index 89% |
rename from content/common/gpu/media/generic_v4l2_device.cc |
rename to media/gpu/generic_v4l2_device.cc |
index e2328bc5d0d636427ad2715136ffa83f6261257a..8dd123888a69d99dc53a71be873f70ec06d71982 100644 |
--- a/content/common/gpu/media/generic_v4l2_device.cc |
+++ b/media/gpu/generic_v4l2_device.cc |
@@ -18,24 +18,24 @@ |
#include "base/posix/eintr_wrapper.h" |
#include "base/trace_event/trace_event.h" |
#include "build/build_config.h" |
-#include "content/common/gpu/media/generic_v4l2_device.h" |
+#include "media/gpu/generic_v4l2_device.h" |
#include "ui/gl/egl_util.h" |
#include "ui/gl/gl_bindings.h" |
#if defined(USE_LIBV4L2) |
// Auto-generated for dlopen libv4l2 libraries |
-#include "content/common/gpu/media/v4l2_stubs.h" |
+#include "media/gpu/v4l2_stubs.h" |
#include "third_party/v4l-utils/lib/include/libv4l2.h" |
-using content_common_gpu_media::kModuleV4l2; |
-using content_common_gpu_media::InitializeStubs; |
-using content_common_gpu_media::StubPathMap; |
+using media_gpu::kModuleV4l2; |
+using media_gpu::InitializeStubs; |
+using media_gpu::StubPathMap; |
static const base::FilePath::CharType kV4l2Lib[] = |
FILE_PATH_LITERAL("/usr/lib/libv4l2.so"); |
#endif |
-namespace content { |
+namespace media { |
namespace { |
const char kDecoderDevice[] = "/dev/video-dec"; |
@@ -45,9 +45,7 @@ const char kJpegDecoderDevice[] = "/dev/jpeg-dec"; |
} |
GenericV4L2Device::GenericV4L2Device(Type type) |
- : V4L2Device(type), |
- use_libv4l2_(false) { |
-} |
+ : V4L2Device(type), use_libv4l2_(false) {} |
GenericV4L2Device::~GenericV4L2Device() { |
#if defined(USE_LIBV4L2) |
@@ -90,10 +88,10 @@ bool GenericV4L2Device::Poll(bool poll_device, bool* event_pending) { |
} |
void* GenericV4L2Device::Mmap(void* addr, |
- unsigned int len, |
- int prot, |
- int flags, |
- unsigned int offset) { |
+ unsigned int len, |
+ int prot, |
+ int flags, |
+ unsigned int offset) { |
return mmap(addr, len, prot, flags, device_fd_.get(), offset); |
} |
@@ -211,10 +209,10 @@ bool GenericV4L2Device::CanCreateEGLImageFrom(uint32_t v4l2_pixfmt) { |
}; |
return std::find( |
- kEGLImageDrmFmtsSupported, |
- kEGLImageDrmFmtsSupported + arraysize(kEGLImageDrmFmtsSupported), |
- V4L2PixFmtToDrmFormat(v4l2_pixfmt)) != |
- kEGLImageDrmFmtsSupported + arraysize(kEGLImageDrmFmtsSupported); |
+ kEGLImageDrmFmtsSupported, |
+ kEGLImageDrmFmtsSupported + arraysize(kEGLImageDrmFmtsSupported), |
+ V4L2PixFmtToDrmFormat(v4l2_pixfmt)) != |
+ kEGLImageDrmFmtsSupported + arraysize(kEGLImageDrmFmtsSupported); |
} |
EGLImageKHR GenericV4L2Device::CreateEGLImage(EGLDisplay egl_display, |
@@ -281,13 +279,14 @@ EGLImageKHR GenericV4L2Device::CreateEGLImage(EGLDisplay egl_display, |
attrs.push_back(plane_offset); |
attrs.push_back(EGL_DMA_BUF_PLANE0_PITCH_EXT + plane * 3); |
attrs.push_back(media::VideoFrame::RowBytes(plane, vf_format, |
- frame_buffer_size.width())); |
+ frame_buffer_size.width())); |
if (v4l2_plane + 1 < num_v4l2_planes) { |
++v4l2_plane; |
} else { |
- plane_offset += media::VideoFrame::PlaneSize( |
- vf_format, plane, frame_buffer_size).GetArea(); |
+ plane_offset += |
+ media::VideoFrame::PlaneSize(vf_format, plane, frame_buffer_size) |
+ .GetArea(); |
} |
} |
@@ -306,11 +305,13 @@ EGLImageKHR GenericV4L2Device::CreateEGLImage(EGLDisplay egl_display, |
} |
EGLBoolean GenericV4L2Device::DestroyEGLImage(EGLDisplay egl_display, |
- EGLImageKHR egl_image) { |
+ EGLImageKHR egl_image) { |
return eglDestroyImageKHR(egl_display, egl_image); |
} |
-GLenum GenericV4L2Device::GetTextureTarget() { return GL_TEXTURE_EXTERNAL_OES; } |
+GLenum GenericV4L2Device::GetTextureTarget() { |
+ return GL_TEXTURE_EXTERNAL_OES; |
+} |
uint32_t GenericV4L2Device::PreferredInputFormat() { |
// TODO(posciak): We should support "dontcare" returns here once we |
@@ -331,4 +332,4 @@ bool GenericV4L2Device::PostSandboxInitialization() { |
#endif |
} |
-} // namespace content |
+} // namespace media |