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 CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_ENCODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_ENCODE_ACCELERATOR_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_ENCODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_ENCODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <linux/videodev2.h> | 8 #include <linux/videodev2.h> |
9 #include <list> | 9 #include <list> |
10 #include <vector> | 10 #include <vector> |
(...skipping 25 matching lines...) Expand all Loading... | |
36 // device exposed by the codec hardware driver. The threading model of this | 36 // device exposed by the codec hardware driver. The threading model of this |
37 // class is the same as in the V4L2VideoDecodeAccelerator (from which class this | 37 // class is the same as in the V4L2VideoDecodeAccelerator (from which class this |
38 // was designed). | 38 // was designed). |
39 // This class may try to instantiate and use a V4L2ImageProcessor for input | 39 // This class may try to instantiate and use a V4L2ImageProcessor for input |
40 // format conversion, if the input format requested via Initialize() is not | 40 // format conversion, if the input format requested via Initialize() is not |
41 // accepted by the hardware codec. | 41 // accepted by the hardware codec. |
42 class CONTENT_EXPORT V4L2VideoEncodeAccelerator | 42 class CONTENT_EXPORT V4L2VideoEncodeAccelerator |
43 : public media::VideoEncodeAccelerator { | 43 : public media::VideoEncodeAccelerator { |
44 public: | 44 public: |
45 explicit V4L2VideoEncodeAccelerator(const scoped_refptr<V4L2Device>& device); | 45 explicit V4L2VideoEncodeAccelerator(const scoped_refptr<V4L2Device>& device); |
46 virtual ~V4L2VideoEncodeAccelerator(); | 46 ~V4L2VideoEncodeAccelerator() override; |
47 | 47 |
48 // media::VideoEncodeAccelerator implementation. | 48 // media::VideoEncodeAccelerator implementation. |
49 virtual std::vector<media::VideoEncodeAccelerator::SupportedProfile> | 49 std::vector<media::VideoEncodeAccelerator::SupportedProfile> |
50 GetSupportedProfiles() override; | 50 GetSupportedProfiles() override; |
51 virtual bool Initialize(media::VideoFrame::Format format, | 51 bool Initialize(media::VideoFrame::Format format, |
52 const gfx::Size& input_visible_size, | 52 const gfx::Size& input_visible_size, |
Pawel Osciak
2015/02/12 04:55:12
Incorrect indent.
| |
53 media::VideoCodecProfile output_profile, | 53 media::VideoCodecProfile output_profile, |
54 uint32 initial_bitrate, | 54 uint32 initial_bitrate, |
55 Client* client) override; | 55 Client* client) override; |
56 virtual void Encode(const scoped_refptr<media::VideoFrame>& frame, | 56 void Encode(const scoped_refptr<media::VideoFrame>& frame, |
57 bool force_keyframe) override; | 57 bool force_keyframe) override; |
Pawel Osciak
2015/02/12 04:55:12
Ditto.
| |
58 virtual void UseOutputBitstreamBuffer(const media::BitstreamBuffer& buffer) | 58 void UseOutputBitstreamBuffer(const media::BitstreamBuffer& buffer) |
59 override; | 59 override; |
60 virtual void RequestEncodingParametersChange(uint32 bitrate, | 60 void RequestEncodingParametersChange(uint32 bitrate, |
61 uint32 framerate) override; | 61 uint32 framerate) override; |
Pawel Osciak
2015/02/12 04:55:12
Ditto.
| |
62 virtual void Destroy() override; | 62 void Destroy() override; |
63 | 63 |
64 private: | 64 private: |
65 // Auto-destroy reference for BitstreamBuffer, for tracking buffers passed to | 65 // Auto-destroy reference for BitstreamBuffer, for tracking buffers passed to |
66 // this instance. | 66 // this instance. |
67 struct BitstreamBufferRef; | 67 struct BitstreamBufferRef; |
68 | 68 |
69 // Record for codec input buffers. | 69 // Record for codec input buffers. |
70 struct InputRecord { | 70 struct InputRecord { |
71 InputRecord(); | 71 InputRecord(); |
72 ~InputRecord(); | 72 ~InputRecord(); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 // as both threads will not outlive this object. | 272 // as both threads will not outlive this object. |
273 base::WeakPtr<V4L2VideoEncodeAccelerator> weak_this_; | 273 base::WeakPtr<V4L2VideoEncodeAccelerator> weak_this_; |
274 base::WeakPtrFactory<V4L2VideoEncodeAccelerator> weak_this_ptr_factory_; | 274 base::WeakPtrFactory<V4L2VideoEncodeAccelerator> weak_this_ptr_factory_; |
275 | 275 |
276 DISALLOW_COPY_AND_ASSIGN(V4L2VideoEncodeAccelerator); | 276 DISALLOW_COPY_AND_ASSIGN(V4L2VideoEncodeAccelerator); |
277 }; | 277 }; |
278 | 278 |
279 } // namespace content | 279 } // namespace content |
280 | 280 |
281 #endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_ENCODE_ACCELERATOR_H_ | 281 #endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_ENCODE_ACCELERATOR_H_ |
OLD | NEW |