Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: content/common/gpu/media/v4l2_video_device.h

Issue 137023008: Add support for Tegra V4L2 VDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..77d54789f3d2fcfa5bd04044f273fbf35bc30e7f 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 the EglImage since each V4L2Device
+ // may have its own format. 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,
+ unsigned int total_buffers) = 0;
+
+ virtual void DestroyEGLImage(unsigned int buffer_index) = 0;
Pawel Osciak 2014/03/27 05:18:06 Documentation please. This should also state who i
shivdasp 2014/03/27 05:40:37 This method is not required, since we will close t
Pawel Osciak 2014/03/27 05:58:35 I still feel we should have it even if only to cal
sheu 2014/03/27 07:08:49 IMO we could call it CreateEGLImageForBuffer(...,
+
+ // This method returns the supported texture target for the V4L2Device.
+ virtual GLenum GetTextureTarget() = 0;
+
+ // Returns the pixel format supported by this V4L2Device.
+ virtual uint32 GetCapturePixelFormat() = 0;
Pawel Osciak 2014/03/27 05:18:06 Why do we need this? G_FMT tells us this.
shivdasp 2014/03/27 05:40:37 My understanding is that we call S_FMT() in VDA wi
Pawel Osciak 2014/03/27 05:58:35 This is because we prefer that format for performa
shivdasp 2014/03/27 06:51:46 Sorry I didn't get it. I thought this method would
Pawel Osciak 2014/03/27 06:59:56 Yeah sorry please ignore the static part. As I me
sheu 2014/03/27 07:08:49 That's right actually. All we use the plane numbe
shivdasp 2014/03/27 07:40:07 Apart from DCHECK , we use the plane count in Enqu
Pawel Osciak 2014/03/27 07:45:06 The number of planes should come from v4l2_pix_for
shivdasp 2014/03/27 07:54:55 It does come from G_FMT but we have a CHECK_EQ in
+
+ // Returns the number of planes on CAPTURE PLANE for this V4L2Device.
+ virtual uint8 GetNumberOfPlanes() = 0;
sheu 2014/03/27 02:00:23 GetCapturePlaneCount()? (Something with "Capture"
shivdasp 2014/03/27 02:41:04 Alright will "Capture" this in my next patchset. O
Pawel Osciak 2014/03/27 05:18:06 G_FMT can also tell us this.
};
+
} // namespace content
#endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DEVICE_H_

Powered by Google App Engine
This is Rietveld 408576698