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 #ifndef MEDIA_GPU_V4L2_IMAGE_PROCESSOR_H_ | 5 #ifndef MEDIA_GPU_V4L2_IMAGE_PROCESSOR_H_ |
6 #define MEDIA_GPU_V4L2_IMAGE_PROCESSOR_H_ | 6 #define MEDIA_GPU_V4L2_IMAGE_PROCESSOR_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 gfx::Size output_allocated_size, | 48 gfx::Size output_allocated_size, |
49 int num_buffers, | 49 int num_buffers, |
50 const base::Closure& error_cb); | 50 const base::Closure& error_cb); |
51 | 51 |
52 // Returns a vector of dmabuf file descriptors, exported for V4L2 output | 52 // Returns a vector of dmabuf file descriptors, exported for V4L2 output |
53 // buffer with |index|. The size of vector will be the number of planes of the | 53 // buffer with |index|. The size of vector will be the number of planes of the |
54 // buffer. Return an empty vector on failure. | 54 // buffer. Return an empty vector on failure. |
55 std::vector<base::ScopedFD> GetDmabufsForOutputBuffer( | 55 std::vector<base::ScopedFD> GetDmabufsForOutputBuffer( |
56 int output_buffer_index); | 56 int output_buffer_index); |
57 | 57 |
58 // Returns a vector of supported input formats in fourcc. This can be called | 58 // Returns true if image processing is supported on this platform. |
59 // before Initialize. | 59 static bool IsSupported(); |
60 std::vector<uint32_t> GetSupportedInputFormats(); | |
61 | 60 |
62 // Returns a vector of supported output formats in fourcc. This can be called | 61 // Returns a vector of supported input formats in fourcc. |
63 // before Initialize. | 62 static std::vector<uint32_t> GetSupportedInputFormats(); |
64 std::vector<uint32_t> GetSupportedOutputFormats(); | |
65 | 63 |
66 // Gets the output allocated size and number of planes given |pixelformat| | 64 // Returns a vector of supported output formats in fourcc. |
67 // fourcc and visible size |size|. Return true if success. The adjusted coded | 65 static std::vector<uint32_t> GetSupportedOutputFormats(); |
68 // size will be stored in |size| and the number of planes will be stored in | 66 |
69 // |num_planes|. This can be called before Initialize. | 67 // Gets output allocated size and number of planes required by the device |
70 bool TryOutputFormat(uint32_t pixelformat, | 68 // for conversion from |input_pixelformat| to |output_pixelformat|, for |
71 gfx::Size* size, | 69 // visible size |size|. Returns true on success. Adjusted coded size will be |
72 size_t* num_planes); | 70 // stored in |size| and the number of planes will be stored in |num_planes|. |
| 71 static bool TryOutputFormat(uint32_t input_pixelformat, |
| 72 uint32_t output_pixelformat, |
| 73 gfx::Size* size, |
| 74 size_t* num_planes); |
73 | 75 |
74 // Returns input allocated size required by the processor to be fed with. | 76 // Returns input allocated size required by the processor to be fed with. |
75 gfx::Size input_allocated_size() const { return input_allocated_size_; } | 77 gfx::Size input_allocated_size() const { return input_allocated_size_; } |
76 | 78 |
77 // Returns output allocated size required by the processor. | 79 // Returns output allocated size required by the processor. |
78 gfx::Size output_allocated_size() const { return output_allocated_size_; } | 80 gfx::Size output_allocated_size() const { return output_allocated_size_; } |
79 | 81 |
80 // Callback to be used to return the index of a processed image to the | 82 // Callback to be used to return the index of a processed image to the |
81 // client. After the client is done with the frame, call Process with the | 83 // client. After the client is done with the frame, call Process with the |
82 // index to return the output buffer to the image processor. | 84 // index to return the output buffer to the image processor. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 232 |
231 // Weak factory for producing weak pointers on the child thread. | 233 // Weak factory for producing weak pointers on the child thread. |
232 base::WeakPtrFactory<V4L2ImageProcessor> weak_this_factory_; | 234 base::WeakPtrFactory<V4L2ImageProcessor> weak_this_factory_; |
233 | 235 |
234 DISALLOW_COPY_AND_ASSIGN(V4L2ImageProcessor); | 236 DISALLOW_COPY_AND_ASSIGN(V4L2ImageProcessor); |
235 }; | 237 }; |
236 | 238 |
237 } // namespace media | 239 } // namespace media |
238 | 240 |
239 #endif // MEDIA_GPU_V4L2_IMAGE_PROCESSOR_H_ | 241 #endif // MEDIA_GPU_V4L2_IMAGE_PROCESSOR_H_ |
OLD | NEW |