OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file defines the V4L2Device interface which is used by the | 5 // This file defines the V4L2Device interface which is used by the |
6 // V4L2DecodeAccelerator class to delegate/pass the device specific | 6 // V4L2DecodeAccelerator class to delegate/pass the device specific |
7 // handling of any of the functionalities. | 7 // handling of any of the functionalities. |
8 | 8 |
9 #ifndef CONTENT_COMMON_GPU_MEDIA_V4L2_DEVICE_H_ | 9 #ifndef CONTENT_COMMON_GPU_MEDIA_V4L2_DEVICE_H_ |
10 #define CONTENT_COMMON_GPU_MEDIA_V4L2_DEVICE_H_ | 10 #define CONTENT_COMMON_GPU_MEDIA_V4L2_DEVICE_H_ |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "media/base/video_decoder_config.h" | 14 #include "media/base/video_decoder_config.h" |
15 #include "media/base/video_frame.h" | 15 #include "media/base/video_frame.h" |
| 16 #include "media/video/video_decode_accelerator.h" |
16 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
17 #include "ui/gl/gl_bindings.h" | 18 #include "ui/gl/gl_bindings.h" |
18 | 19 |
19 // TODO(posciak): remove this once V4L2 headers are updated. | 20 // TODO(posciak): remove this once V4L2 headers are updated. |
20 #define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') | 21 #define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') |
21 #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') | 22 #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') |
22 #define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') | 23 #define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') |
23 | 24 |
24 namespace content { | 25 namespace content { |
25 | 26 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // Destroys the EGLImageKHR. | 100 // Destroys the EGLImageKHR. |
100 virtual EGLBoolean DestroyEGLImage(EGLDisplay egl_display, | 101 virtual EGLBoolean DestroyEGLImage(EGLDisplay egl_display, |
101 EGLImageKHR egl_image) = 0; | 102 EGLImageKHR egl_image) = 0; |
102 | 103 |
103 // Returns the supported texture target for the V4L2Device. | 104 // Returns the supported texture target for the V4L2Device. |
104 virtual GLenum GetTextureTarget() = 0; | 105 virtual GLenum GetTextureTarget() = 0; |
105 | 106 |
106 // Returns the preferred V4L2 input format or 0 if don't care. | 107 // Returns the preferred V4L2 input format or 0 if don't care. |
107 virtual uint32 PreferredInputFormat() = 0; | 108 virtual uint32 PreferredInputFormat() = 0; |
108 | 109 |
| 110 // Get minimum and maximum resolution for fourcc |pixelformat| and store to |
| 111 // |min_resolution| and |max_resolution|. |
| 112 void GetSupportedResolution(uint32_t pixelformat, gfx::Size* min_resolution, |
| 113 gfx::Size* max_resolution); |
| 114 |
| 115 // Return supported profiles for decoder, including only profiles for given |
| 116 // fourcc |pixelformats|. |
| 117 media::VideoDecodeAccelerator::SupportedProfiles GetSupportedDecodeProfiles( |
| 118 const size_t num_formats, const uint32_t pixelformats[]); |
| 119 |
109 protected: | 120 protected: |
110 friend class base::RefCountedThreadSafe<V4L2Device>; | 121 friend class base::RefCountedThreadSafe<V4L2Device>; |
| 122 explicit V4L2Device(Type type); |
111 virtual ~V4L2Device(); | 123 virtual ~V4L2Device(); |
| 124 |
| 125 const Type type_; |
112 }; | 126 }; |
113 | 127 |
114 } // namespace content | 128 } // namespace content |
115 | 129 |
116 #endif // CONTENT_COMMON_GPU_MEDIA_V4L2_DEVICE_H_ | 130 #endif // CONTENT_COMMON_GPU_MEDIA_V4L2_DEVICE_H_ |
OLD | NEW |