Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 TegraV4L2Device used on | |
| 6 // Tegra platform. | |
| 7 | |
| 8 #ifndef CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ | |
| 9 #define CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ | |
| 10 | |
| 11 #include "content/common/gpu/media/v4l2_video_device.h" | |
| 12 #include "ui/gl/gl_bindings.h" | |
| 13 | |
| 14 namespace content { | |
| 15 | |
| 16 // This class implements the V4L2Device interface for Tegra platform. | |
| 17 // It interfaces with libtegrav4l2 library which provides API that exhibit the | |
| 18 // V4L2 specification via the library API instead of system calls. | |
| 19 class TegraV4L2Device : public V4L2Device { | |
| 20 public: | |
| 21 explicit TegraV4L2Device(EGLContext egl_context); | |
| 22 virtual ~TegraV4L2Device(); | |
| 23 | |
| 24 virtual int Ioctl(int flags, void* arg) OVERRIDE; | |
| 25 virtual bool Poll(bool poll_device, bool* event_pending) OVERRIDE; | |
| 26 virtual bool SetDevicePollInterrupt() OVERRIDE; | |
| 27 virtual bool ClearDevicePollInterrupt() OVERRIDE; | |
| 28 virtual void* Mmap(void* addr, | |
| 29 unsigned int len, | |
| 30 int prot, | |
| 31 int flags, | |
| 32 unsigned int offset) OVERRIDE; | |
| 33 virtual void Munmap(void* addr, unsigned int len) OVERRIDE; | |
| 34 virtual bool Initialize() OVERRIDE; | |
| 35 virtual EGLImageKHR CreateEGLImage(EGLDisplay egl_display, | |
| 36 const EGLint* attrib, | |
| 37 GLuint texture_id, | |
| 38 unsigned int buffer_index) OVERRIDE; | |
| 39 virtual GLenum GetTextureTarget() OVERRIDE; | |
| 40 | |
| 41 private: | |
| 42 // The actual device fd. | |
| 43 int device_fd_; | |
| 44 | |
| 45 // The EGLContext associated with this device. | |
| 46 EGLContext egl_context_; | |
| 47 | |
| 48 // Tries to initialize the library symbols on this platform. | |
| 49 bool InitializeLibrarySymbols(); | |
|
Pawel Osciak
2014/03/25 08:21:08
Methods should come before members.
shivdasp
2014/03/25 10:36:40
Done.
| |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(TegraV4L2Device); | |
| 52 }; | |
| 53 | |
| 54 } // namespace content | |
| 55 | |
| 56 #endif // CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ | |
| OLD | NEW |