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

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

Issue 1882373004: Migrate content/common/gpu/media code to media/gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix several more bot-identified build issues Created 4 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
(Empty)
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
3 // found in the LICENSE file.
4 //
5 // This file contains the implementation of GenericV4L2Device used on
6 // platforms, which provide generic V4L2 video codec devices.
7
8 #ifndef CONTENT_COMMON_GPU_MEDIA_GENERIC_V4L2_DEVICE_H_
9 #define CONTENT_COMMON_GPU_MEDIA_GENERIC_V4L2_DEVICE_H_
10
11 #include <stddef.h>
12 #include <stdint.h>
13
14 #include "base/files/scoped_file.h"
15 #include "base/macros.h"
16 #include "content/common/gpu/media/v4l2_device.h"
17
18 namespace content {
19
20 class GenericV4L2Device : public V4L2Device {
21 public:
22 explicit GenericV4L2Device(Type type);
23
24 // V4L2Device implementation.
25 int Ioctl(int request, void* arg) override;
26 bool Poll(bool poll_device, bool* event_pending) override;
27 bool SetDevicePollInterrupt() override;
28 bool ClearDevicePollInterrupt() override;
29 void* Mmap(void* addr,
30 unsigned int len,
31 int prot,
32 int flags,
33 unsigned int offset) override;
34 void Munmap(void* addr, unsigned int len) override;
35 bool Initialize() override;
36
37 std::vector<base::ScopedFD> GetDmabufsForV4L2Buffer(
38 int index,
39 size_t num_planes,
40 enum v4l2_buf_type type) override;
41
42 bool CanCreateEGLImageFrom(uint32_t v4l2_pixfmt) override;
43 EGLImageKHR CreateEGLImage(EGLDisplay egl_display,
44 EGLContext egl_context,
45 GLuint texture_id,
46 gfx::Size frame_buffer_size,
47 unsigned int buffer_index,
48 uint32_t v4l2_pixfmt,
49 size_t num_v4l2_planes) override;
50 EGLBoolean DestroyEGLImage(EGLDisplay egl_display,
51 EGLImageKHR egl_image) override;
52 GLenum GetTextureTarget() override;
53 uint32_t PreferredInputFormat() override;
54
55 private:
56 ~GenericV4L2Device() override;
57
58 // The actual device fd.
59 base::ScopedFD device_fd_;
60
61 // eventfd fd to signal device poll thread when its poll() should be
62 // interrupted.
63 base::ScopedFD device_poll_interrupt_fd_;
64
65 // Use libv4l2 when operating |device_fd_|.
66 bool use_libv4l2_;
67
68 DISALLOW_COPY_AND_ASSIGN(GenericV4L2Device);
69
70 // Lazily initialize static data after sandbox is enabled. Return false on
71 // init failure.
72 static bool PostSandboxInitialization();
73 };
74 } // namespace content
75
76 #endif // CONTENT_COMMON_GPU_MEDIA_GENERIC_V4L2_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698