OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <queue> | 9 #include <queue> |
10 #include <vector> | 10 #include <vector> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 scoped_ptr<base::WeakPtrFactory<Client> > client_ptr_factory_; | 78 scoped_ptr<base::WeakPtrFactory<Client> > client_ptr_factory_; |
79 | 79 |
80 scoped_ptr<media::VideoCodecBridge> media_codec_; | 80 scoped_ptr<media::VideoCodecBridge> media_codec_; |
81 | 81 |
82 // Bitstream buffers waiting to be populated & returned to the client. | 82 // Bitstream buffers waiting to be populated & returned to the client. |
83 std::vector<media::BitstreamBuffer> available_bitstream_buffers_; | 83 std::vector<media::BitstreamBuffer> available_bitstream_buffers_; |
84 | 84 |
85 // Frames waiting to be passed to the codec, queued until an input buffer is | 85 // Frames waiting to be passed to the codec, queued until an input buffer is |
86 // available. Each element is a tuple of <Frame, key_frame, enqueue_time>. | 86 // available. Each element is a tuple of <Frame, key_frame, enqueue_time>. |
87 typedef std::queue< | 87 typedef std::queue< |
88 Tuple<scoped_refptr<media::VideoFrame>, bool, base::Time>> | 88 base::Tuple<scoped_refptr<media::VideoFrame>, bool, base::Time>> |
89 PendingFrames; | 89 PendingFrames; |
90 PendingFrames pending_frames_; | 90 PendingFrames pending_frames_; |
91 | 91 |
92 // Repeating timer responsible for draining pending IO to the codec. | 92 // Repeating timer responsible for draining pending IO to the codec. |
93 base::RepeatingTimer<AndroidVideoEncodeAccelerator> io_timer_; | 93 base::RepeatingTimer<AndroidVideoEncodeAccelerator> io_timer_; |
94 | 94 |
95 // The difference between number of buffers queued & dequeued at the codec. | 95 // The difference between number of buffers queued & dequeued at the codec. |
96 int32 num_buffers_at_codec_; | 96 int32 num_buffers_at_codec_; |
97 | 97 |
98 // A monotonically-growing value, used as a fake timestamp just to keep things | 98 // A monotonically-growing value, used as a fake timestamp just to keep things |
99 // appearing to move forward. | 99 // appearing to move forward. |
100 base::TimeDelta fake_input_timestamp_; | 100 base::TimeDelta fake_input_timestamp_; |
101 | 101 |
102 // Number of requested output buffers and their capacity. | 102 // Number of requested output buffers and their capacity. |
103 int num_output_buffers_; // -1 until RequireBitstreamBuffers. | 103 int num_output_buffers_; // -1 until RequireBitstreamBuffers. |
104 size_t output_buffers_capacity_; // 0 until RequireBitstreamBuffers. | 104 size_t output_buffers_capacity_; // 0 until RequireBitstreamBuffers. |
105 | 105 |
106 uint32 last_set_bitrate_; // In bps. | 106 uint32 last_set_bitrate_; // In bps. |
107 | 107 |
108 DISALLOW_COPY_AND_ASSIGN(AndroidVideoEncodeAccelerator); | 108 DISALLOW_COPY_AND_ASSIGN(AndroidVideoEncodeAccelerator); |
109 }; | 109 }; |
110 | 110 |
111 } // namespace content | 111 } // namespace content |
112 | 112 |
113 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ | 113 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_ |
OLD | NEW |