OLD | NEW |
---|---|
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 TegraV4L2Device used on | 5 // This file contains the implementation of TegraV4L2Device used on |
6 // Tegra platform. | 6 // Tegra platform. |
7 | 7 |
8 #ifndef CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ | 8 #ifndef CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ |
9 #define CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ | 9 #define CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ |
10 | 10 |
11 #include "content/common/gpu/media/v4l2_video_device.h" | 11 #include "content/common/gpu/media/v4l2_video_device.h" |
12 #include "ui/gl/gl_bindings.h" | 12 #include "ui/gl/gl_bindings.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 // This class implements the V4L2Device interface for Tegra platform. | 16 // This class implements the V4L2Device interface for Tegra platform. |
17 // It interfaces with libtegrav4l2 library which provides API that exhibit the | 17 // It interfaces with libtegrav4l2 library which provides API that exhibit the |
18 // V4L2 specification via the library API instead of system calls. | 18 // V4L2 specification via the library API instead of system calls. |
19 class TegraV4L2Device : public V4L2Device { | 19 class TegraV4L2Device : public V4L2Device { |
20 public: | 20 public: |
21 explicit TegraV4L2Device(Type type); | 21 explicit TegraV4L2Device(Type type); |
22 virtual ~TegraV4L2Device(); | |
23 | 22 |
24 int Ioctl(int flags, void* arg) override; | 23 int Ioctl(int flags, void* arg) override; |
25 bool Poll(bool poll_device, bool* event_pending) override; | 24 bool Poll(bool poll_device, bool* event_pending) override; |
26 bool SetDevicePollInterrupt() override; | 25 bool SetDevicePollInterrupt() override; |
27 bool ClearDevicePollInterrupt() override; | 26 bool ClearDevicePollInterrupt() override; |
28 void* Mmap(void* addr, | 27 void* Mmap(void* addr, |
29 unsigned int len, | 28 unsigned int len, |
30 int prot, | 29 int prot, |
31 int flags, | 30 int flags, |
32 unsigned int offset) override; | 31 unsigned int offset) override; |
33 void Munmap(void* addr, unsigned int len) override; | 32 void Munmap(void* addr, unsigned int len) override; |
34 bool Initialize() override; | 33 bool Initialize() override; |
35 bool CanCreateEGLImageFrom(uint32_t v4l2_pixfmt) override; | 34 bool CanCreateEGLImageFrom(uint32_t v4l2_pixfmt) override; |
36 EGLImageKHR CreateEGLImage(EGLDisplay egl_display, | 35 EGLImageKHR CreateEGLImage(EGLDisplay egl_display, |
37 EGLContext egl_context, | 36 EGLContext egl_context, |
38 GLuint texture_id, | 37 GLuint texture_id, |
39 gfx::Size frame_buffer_size, | 38 gfx::Size frame_buffer_size, |
40 unsigned int buffer_index, | 39 unsigned int buffer_index, |
41 uint32_t v4l2_pixfmt, | 40 uint32_t v4l2_pixfmt, |
42 size_t num_v4l2_planes); | 41 size_t num_v4l2_planes); |
43 EGLBoolean DestroyEGLImage(EGLDisplay egl_display, | 42 EGLBoolean DestroyEGLImage(EGLDisplay egl_display, |
44 EGLImageKHR egl_image) override; | 43 EGLImageKHR egl_image) override; |
45 GLenum GetTextureTarget() override; | 44 GLenum GetTextureTarget() override; |
46 uint32 PreferredInputFormat() override; | 45 uint32 PreferredInputFormat() override; |
47 | 46 |
48 private: | 47 private: |
48 virtual ~TegraV4L2Device(); | |
scherkus (not reviewing)
2015/01/13 01:24:59
override
Pawel Osciak
2015/01/13 11:33:34
Done.
| |
49 | |
49 const Type type_; | 50 const Type type_; |
50 | 51 |
51 // The actual device fd. | 52 // The actual device fd. |
52 int device_fd_; | 53 int device_fd_; |
53 | 54 |
54 DISALLOW_COPY_AND_ASSIGN(TegraV4L2Device); | 55 DISALLOW_COPY_AND_ASSIGN(TegraV4L2Device); |
55 }; | 56 }; |
56 | 57 |
57 } // namespace content | 58 } // namespace content |
58 | 59 |
59 #endif // CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ | 60 #endif // CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ |
OLD | NEW |