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.
5 // This file contains the implementation of TegraV4L2Device used on
8 #ifndef CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_DEVICE_H_
9 #define CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_DEVICE_H_
11 #include "content/common/gpu/media/v4l2_device.h"
12 #include "ui/gl/gl_bindings.h"
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
{
21 explicit TegraV4L2Device(Type type
);
23 int Ioctl(int flags
, void* arg
) override
;
24 bool Poll(bool poll_device
, bool* event_pending
) override
;
25 bool SetDevicePollInterrupt() override
;
26 bool ClearDevicePollInterrupt() override
;
27 void* Mmap(void* addr
,
31 unsigned int offset
) override
;
32 void Munmap(void* addr
, unsigned int len
) override
;
33 bool Initialize() override
;
34 bool CanCreateEGLImageFrom(uint32_t v4l2_pixfmt
) override
;
35 EGLImageKHR
CreateEGLImage(EGLDisplay egl_display
,
36 EGLContext egl_context
,
38 gfx::Size frame_buffer_size
,
39 unsigned int buffer_index
,
41 size_t num_v4l2_planes
);
42 EGLBoolean
DestroyEGLImage(EGLDisplay egl_display
,
43 EGLImageKHR egl_image
) override
;
44 GLenum
GetTextureTarget() override
;
45 uint32
PreferredInputFormat() override
;
48 ~TegraV4L2Device() override
;
50 // The actual device fd.
53 DISALLOW_COPY_AND_ASSIGN(TegraV4L2Device
);
56 } // namespace content
58 #endif // CONTENT_COMMON_GPU_MEDIA_TEGRA_V4L2_DEVICE_H_