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..4c82d56bd0c46fd78089f12757b7e34390186fc7 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,32 @@ 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 |
Ami GONE FROM CHROMIUM
2014/03/28 17:10:01
"This method is used to " is not adding value (dit
shivdasp
2014/03/28 18:54:11
Done. I kept a few of "These methods" since the se
|
+ // 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 |
Ami GONE FROM CHROMIUM
2014/03/28 17:10:01
s/created/returned/
shivdasp
2014/03/28 18:54:11
Done.
|
+ // eglImage. buffer_index can be used to associate the created EglImage by |
Ami GONE FROM CHROMIUM
2014/03/28 17:10:01
s/eglImage/EGLImageKHR/
Ami GONE FROM CHROMIUM
2014/03/28 17:10:01
s/created/returned/
Ami GONE FROM CHROMIUM
2014/03/28 17:10:01
s/EglImage/EGLImageKHR/
shivdasp
2014/03/28 18:54:11
Done.
|
+ // the underlying V4L2Device implementation. |
+ virtual EGLImageKHR CreateEGLImage(EGLDisplay egl_display, |
+ GLuint texture_id, |
+ gfx::Size frame_buffer_size, |
+ unsigned int buffer_index, |
+ size_t planes_count) = 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; |
Ami GONE FROM CHROMIUM
2014/03/28 17:10:01
Both impls return the same (V4L2_PIX_FMT_NV12M).
shivdasp
2014/03/28 18:54:11
This is future-proofing as the formats are now sam
|
}; |
+ |
} // namespace content |
#endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DEVICE_H_ |