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

Side by Side Diff: content/common/gpu/media/generic_v4l2_device.h

Issue 1093173002: Do not use libv4l if no plugin is registered. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file contains the implementation of GenericV4L2Device used on 5 // This file contains the implementation of GenericV4L2Device used on
6 // platforms, which provide generic V4L2 video codec devices. 6 // platforms, which provide generic V4L2 video codec devices.
7 7
8 #ifndef CONTENT_COMMON_GPU_MEDIA_GENERIC_V4L2_DEVICE_H_ 8 #ifndef CONTENT_COMMON_GPU_MEDIA_GENERIC_V4L2_DEVICE_H_
9 #define CONTENT_COMMON_GPU_MEDIA_GENERIC_V4L2_DEVICE_H_ 9 #define CONTENT_COMMON_GPU_MEDIA_GENERIC_V4L2_DEVICE_H_
10 10
11 #include "base/files/scoped_file.h"
11 #include "content/common/gpu/media/v4l2_device.h" 12 #include "content/common/gpu/media/v4l2_device.h"
12 13
13 namespace content { 14 namespace content {
14 15
15 class GenericV4L2Device : public V4L2Device { 16 class GenericV4L2Device : public V4L2Device {
16 public: 17 public:
17 explicit GenericV4L2Device(Type type); 18 explicit GenericV4L2Device(Type type);
18 19
19 // V4L2Device implementation. 20 // V4L2Device implementation.
20 int Ioctl(int request, void* arg) override; 21 int Ioctl(int request, void* arg) override;
(...skipping 18 matching lines...) Expand all
39 EGLBoolean DestroyEGLImage(EGLDisplay egl_display, 40 EGLBoolean DestroyEGLImage(EGLDisplay egl_display,
40 EGLImageKHR egl_image) override; 41 EGLImageKHR egl_image) override;
41 GLenum GetTextureTarget() override; 42 GLenum GetTextureTarget() override;
42 uint32 PreferredInputFormat() override; 43 uint32 PreferredInputFormat() override;
43 44
44 private: 45 private:
45 ~GenericV4L2Device() override; 46 ~GenericV4L2Device() override;
46 const Type type_; 47 const Type type_;
47 48
48 // The actual device fd. 49 // The actual device fd.
49 int device_fd_; 50 base::ScopedFD device_fd_;
50 51
51 // eventfd fd to signal device poll thread when its poll() should be 52 // eventfd fd to signal device poll thread when its poll() should be
52 // interrupted. 53 // interrupted.
53 int device_poll_interrupt_fd_; 54 base::ScopedFD device_poll_interrupt_fd_;
55
56 // Use libv4l2 when operating |device_fd_|.
57 bool use_libv4l2_;
Pawel Osciak 2015/04/21 09:19:46 Ah I realized, this should be under #ifdef USE_LIB
wuchengli 2015/04/21 09:25:24 v4l2_close and v4l2_ioctl won't compile if USE_LIB
54 58
55 DISALLOW_COPY_AND_ASSIGN(GenericV4L2Device); 59 DISALLOW_COPY_AND_ASSIGN(GenericV4L2Device);
56 60
57 // Lazily initialize static data after sandbox is enabled. Return false on 61 // Lazily initialize static data after sandbox is enabled. Return false on
58 // init failure. 62 // init failure.
59 static bool PostSandboxInitialization(); 63 static bool PostSandboxInitialization();
60 }; 64 };
61 } // namespace content 65 } // namespace content
62 66
63 #endif // CONTENT_COMMON_GPU_MEDIA_GENERIC_V4L2_DEVICE_H_ 67 #endif // CONTENT_COMMON_GPU_MEDIA_GENERIC_V4L2_DEVICE_H_
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/generic_v4l2_device.cc » ('j') | content/common/gpu/media/generic_v4l2_device.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698