Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: content/renderer/media/rtc_video_decoder.h

Issue 457733002: Support for H264 HW offload for webRTC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased at 291440. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/media/rtc_video_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_
6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ 6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 ~BufferData(); 96 ~BufferData();
97 int32 bitstream_buffer_id; 97 int32 bitstream_buffer_id;
98 uint32_t timestamp; // in 90KHz 98 uint32_t timestamp; // in 90KHz
99 size_t size; // buffer size 99 size_t size; // buffer size
100 }; 100 };
101 101
102 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsBufferAfterReset); 102 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsBufferAfterReset);
103 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsFirstBufferAfterReset); 103 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsFirstBufferAfterReset);
104 104
105 RTCVideoDecoder( 105 RTCVideoDecoder(
106 webrtc::VideoCodecType type,
106 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories); 107 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories);
107 108
108 // Requests a buffer to be decoded by VDA. 109 // Requests a buffer to be decoded by VDA.
109 void RequestBufferDecode(); 110 void RequestBufferDecode();
110 111
111 bool CanMoreDecodeWorkBeDone(); 112 bool CanMoreDecodeWorkBeDone();
112 113
113 // Returns true if bitstream buffer id |id_buffer| comes after |id_reset|. 114 // Returns true if bitstream buffer id |id_buffer| comes after |id_reset|.
114 // This handles the wraparound. 115 // This handles the wraparound.
115 bool IsBufferAfterReset(int32 id_buffer, int32 id_reset); 116 bool IsBufferAfterReset(int32 id_buffer, int32 id_reset);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 DECODE_ERROR, // Decoding error happened. 185 DECODE_ERROR, // Decoding error happened.
185 }; 186 };
186 187
187 static const int32 ID_LAST; // maximum bitstream buffer id 188 static const int32 ID_LAST; // maximum bitstream buffer id
188 static const int32 ID_HALF; // half of the maximum bitstream buffer id 189 static const int32 ID_HALF; // half of the maximum bitstream buffer id
189 static const int32 ID_INVALID; // indicates Reset or Release never occurred 190 static const int32 ID_INVALID; // indicates Reset or Release never occurred
190 191
191 // The hardware video decoder. 192 // The hardware video decoder.
192 scoped_ptr<media::VideoDecodeAccelerator> vda_; 193 scoped_ptr<media::VideoDecodeAccelerator> vda_;
193 194
195 // The video codec type, as reported by WebRTC.
196 const webrtc::VideoCodecType video_codec_type_;
197
194 // The size of the incoming video frames. 198 // The size of the incoming video frames.
195 gfx::Size frame_size_; 199 gfx::Size frame_size_;
196 200
197 scoped_refptr<media::GpuVideoAcceleratorFactories> factories_; 201 scoped_refptr<media::GpuVideoAcceleratorFactories> factories_;
198 202
199 // The texture target used for decoded pictures. 203 // The texture target used for decoded pictures.
200 uint32 decoder_texture_target_; 204 uint32 decoder_texture_target_;
201 205
202 // Metadata of the buffers that have been sent for decode. 206 // Metadata of the buffers that have been sent for decode.
203 std::list<BufferData> input_buffer_data_; 207 std::list<BufferData> input_buffer_data_;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // Must be destroyed, or invalidated, on |vda_loop_proxy_| 261 // Must be destroyed, or invalidated, on |vda_loop_proxy_|
258 // NOTE: Weak pointers must be invalidated before all other member variables. 262 // NOTE: Weak pointers must be invalidated before all other member variables.
259 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_; 263 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_;
260 264
261 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); 265 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder);
262 }; 266 };
263 267
264 } // namespace content 268 } // namespace content
265 269
266 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ 270 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/rtc_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698