Index: content/common/gpu/media/v4l2_video_device.h |
diff --git a/content/common/gpu/media/v4l2_video_device.h b/content/common/gpu/media/v4l2_video_device.h |
index 92bc02fac25175b13582ea64d366c2c3b2406df4..eae3d23fddde599fde56b516bac8fa324c77ce9e 100644 |
--- a/content/common/gpu/media/v4l2_video_device.h |
+++ b/content/common/gpu/media/v4l2_video_device.h |
@@ -9,6 +9,9 @@ |
#ifndef CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DEVICE_H_ |
#define CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DEVICE_H_ |
+#include "ui/gfx/size.h" |
+#include "ui/gl/gl_bindings.h" |
+ |
namespace content { |
class V4L2Device { |
@@ -19,7 +22,7 @@ class V4L2Device { |
// Tries to create and initialize an appropriate V4L2Device object for the |
// current platform and returns a scoped_ptr<V4L2Device> on success else |
// returns NULL. |
- static scoped_ptr<V4L2Device> Create(); |
+ static scoped_ptr<V4L2Device> Create(EGLContext egl_context); |
// Parameters and return value are the same as for the standard ioctl() system |
// call. |
@@ -50,7 +53,31 @@ class V4L2Device { |
int flags, |
unsigned int offset) = 0; |
virtual void Munmap(void* addr, unsigned int len) = 0; |
+ |
+ // Does all the initialization of V4L2Device, returns true on success. |
+ virtual bool Initialize() = 0; |
+ |
+ // This method is used to create an EglImage since each V4L2Device |
+ // may use a different method of acquiring one and associating it to the |
+ // given texture. The texture_id is used to bind the texture to the created |
+ // eglImage. buffer_index can be used to associate the created EglImage by |
+ // the underlying V4L2Device implementation. |
+ virtual EGLImageKHR CreateEGLImage(EGLDisplay egl_display, |
+ GLuint texture_id, |
+ gfx::Size frame_buffer_size, |
+ unsigned int buffer_index) = 0; |
+ |
+ // This method destroys the EGLImage. |
+ virtual EGLBoolean DestroyEGLImage(EGLDisplay egl_display, |
+ EGLImageKHR egl_image) = 0; |
+ |
+ // This method returns the supported texture target for the V4L2Device. |
+ virtual GLenum GetTextureTarget() = 0; |
+ |
+ // Returns the preferred pixel format supported by this V4L2Device. |
+ virtual uint32 PreferredOutputFormat() = 0; |
}; |
+ |
} // namespace content |
#endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DEVICE_H_ |