Index: content/common/gpu/media/tegra_v4l2_video_device.h |
diff --git a/content/common/gpu/media/tegra_v4l2_video_device.h b/content/common/gpu/media/tegra_v4l2_video_device.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..deae44ce26ce7615efa2c741199670ca5b2c1368 |
--- /dev/null |
+++ b/content/common/gpu/media/tegra_v4l2_video_device.h |
@@ -0,0 +1,63 @@ |
+#ifndef CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ |
+#define CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ |
+ |
+#include "content/common/gpu/media/v4l2_video_device.h" |
+#include "ui/gl/gl_bindings.h" |
+ |
+namespace content { |
+ |
+class TegraV4L2Device : public V4L2Device { |
Ami GONE FROM CHROMIUM
2014/02/07 09:09:30
Class commentary please.
|
+ public: |
+ TegraV4L2Device(EGLContext egl_context); |
Ami GONE FROM CHROMIUM
2014/02/07 09:09:30
explicit
|
+ virtual ~TegraV4L2Device(); |
+ |
+ // Tries to create and initialize an TegraV4L2Device, returns |
Ami GONE FROM CHROMIUM
2014/02/07 09:09:30
s/an/a/
but this comment seems like leftover copy/
|
+ // a scoped_ptr on success else returns NULL. |
+ int Ioctl(int flags, void* arg); |
+ bool Poll(bool poll_device, bool* event_pending); |
+ bool SetDevicePollInterrupt(void); |
+ bool ClearDevicePollInterrupt(void); |
+ void* Mmap(void* addr, |
+ unsigned int len, |
+ int prot, |
+ int flags, |
+ unsigned int offset); |
+ void Munmap(void* addr, unsigned int len); |
+ // Does all the initialization of device fds , returns true on success. |
Ami GONE FROM CHROMIUM
2014/02/07 09:09:30
precede by newline
|
+ bool Initialize(void); |
+ |
+ EGLImageKHR CreateEGLImage(EGLDisplay egl_display, |
Ami GONE FROM CHROMIUM
2014/02/07 09:09:30
this and the next method belong above Initialize a
|
+ EGLint attrib[], |
+ unsigned int texture_id, |
+ unsigned int buffer_index); |
+ |
+ unsigned int GetTextureTarget(); |
+ |
+ private: |
+ // The actual device fd. |
+ int device_fd_; |
+ |
+ // The EGLContext associated with this device. |
+ EGLContext egl_context_; |
Pawel Osciak
2014/02/10 06:36:17
To be honest I'm not especially excited with EGLCo
|
+ |
+ typedef int32 (*TegraV4L2OpenFunc)(const char* name, int32 flags); |
+ typedef int32 (*TegraV4L2IoctlFunc)(int32 fd, unsigned long cmd, ...); |
+ typedef int32 (*TegraV4L2CloseFunc)(int32 fd); |
+ typedef int32 (*TegraV4L2PollFunc)(int32 fd, |
+ bool poll_device, |
+ bool* event_pending); |
+ typedef int32 (*TegraV4L2SetDevicePollInterruptFunc)(int32 fd); |
+ typedef int32 (*TegraV4L2ClearDevicePollInterruptFunc)(int32 fd); |
+ |
+ TegraV4L2OpenFunc TegraV4L2Open; |
+ TegraV4L2IoctlFunc TegraV4L2Ioctl; |
+ TegraV4L2CloseFunc TegraV4L2Close; |
+ TegraV4L2PollFunc TegraV4L2Poll; |
+ TegraV4L2SetDevicePollInterruptFunc TegraV4L2SetDevicePollInterrupt; |
+ TegraV4L2ClearDevicePollInterruptFunc TegraV4L2ClearDevicePollInterrupt; |
Ami GONE FROM CHROMIUM
2014/02/07 09:09:30
l.43-57 could be file-static in the .cc file, righ
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(TegraV4L2Device); |
+}; |
+} |
Pawel Osciak
2014/02/10 06:36:17
Empty line above and // namespace content please.
|
+ |
+#endif // CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_VIDEO_DEVICE_H_ |