| 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 MEDIA_GPU_V4L2_DEVICE_H_ | 9 #ifndef MEDIA_GPU_V4L2_DEVICE_H_ |
| 10 #define MEDIA_GPU_V4L2_DEVICE_H_ | 10 #define MEDIA_GPU_V4L2_DEVICE_H_ |
| 11 | 11 |
| 12 #include <stddef.h> | 12 #include <stddef.h> |
| 13 #include <stdint.h> | 13 #include <stdint.h> |
| 14 | 14 |
| 15 #include <linux/videodev2.h> | 15 #include <linux/videodev2.h> |
| 16 | 16 |
| 17 #include "base/files/scoped_file.h" | 17 #include "base/files/scoped_file.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "media/base/video_decoder_config.h" | 19 #include "media/base/video_decoder_config.h" |
| 20 #include "media/base/video_frame.h" | 20 #include "media/base/video_frame.h" |
| 21 #include "media/gpu/media_gpu_export.h" | 21 #include "media/gpu/media_gpu_export.h" |
| 22 #include "media/video/video_decode_accelerator.h" | 22 #include "media/video/video_decode_accelerator.h" |
| 23 #include "ui/gfx/geometry/size.h" | 23 #include "ui/gfx/geometry/size.h" |
| 24 #include "ui/gl/gl_bindings.h" | 24 #include "ui/gl/gl_bindings.h" |
| 25 | 25 |
| 26 // TODO(posciak): remove this once V4L2 headers are updated. | 26 // TODO(posciak): remove this once V4L2 headers are updated. |
| 27 #define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') | |
| 28 #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') | 27 #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') |
| 29 #define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') | |
| 30 #define V4L2_PIX_FMT_MT21 v4l2_fourcc('M', 'T', '2', '1') | 28 #define V4L2_PIX_FMT_MT21 v4l2_fourcc('M', 'T', '2', '1') |
| 29 #ifndef V4L2_BUF_FLAG_LAST |
| 30 #define V4L2_BUF_FLAG_LAST 0x00100000 |
| 31 #endif |
| 31 | 32 |
| 32 namespace media { | 33 namespace media { |
| 33 | 34 |
| 34 class MEDIA_GPU_EXPORT V4L2Device | 35 class MEDIA_GPU_EXPORT V4L2Device |
| 35 : public base::RefCountedThreadSafe<V4L2Device> { | 36 : public base::RefCountedThreadSafe<V4L2Device> { |
| 36 public: | 37 public: |
| 37 // Utility format conversion functions | 38 // Utility format conversion functions |
| 38 static VideoPixelFormat V4L2PixFmtToVideoPixelFormat(uint32_t format); | 39 static VideoPixelFormat V4L2PixFmtToVideoPixelFormat(uint32_t format); |
| 39 static uint32_t VideoPixelFormatToV4L2PixFmt(VideoPixelFormat format); | 40 static uint32_t VideoPixelFormatToV4L2PixFmt(VideoPixelFormat format); |
| 40 static uint32_t VideoCodecProfileToV4L2PixFmt(VideoCodecProfile profile, | 41 static uint32_t VideoCodecProfileToV4L2PixFmt(VideoCodecProfile profile, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 friend class base::RefCountedThreadSafe<V4L2Device>; | 151 friend class base::RefCountedThreadSafe<V4L2Device>; |
| 151 explicit V4L2Device(Type type); | 152 explicit V4L2Device(Type type); |
| 152 virtual ~V4L2Device(); | 153 virtual ~V4L2Device(); |
| 153 | 154 |
| 154 const Type type_; | 155 const Type type_; |
| 155 }; | 156 }; |
| 156 | 157 |
| 157 } // namespace media | 158 } // namespace media |
| 158 | 159 |
| 159 #endif // MEDIA_GPU_V4L2_DEVICE_H_ | 160 #endif // MEDIA_GPU_V4L2_DEVICE_H_ |
| OLD | NEW |