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

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

Issue 426873004: Pass decoded picture size from VDA to client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use gfx::Size Created 6 years, 4 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
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 virtual void NotifyFlushDone() OVERRIDE; 84 virtual void NotifyFlushDone() OVERRIDE;
85 virtual void NotifyResetDone() OVERRIDE; 85 virtual void NotifyResetDone() OVERRIDE;
86 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; 86 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE;
87 87
88 private: 88 private:
89 class SHMBuffer; 89 class SHMBuffer;
90 // Metadata of a bitstream buffer. 90 // Metadata of a bitstream buffer.
91 struct BufferData { 91 struct BufferData {
92 BufferData(int32 bitstream_buffer_id, 92 BufferData(int32 bitstream_buffer_id,
93 uint32_t timestamp, 93 uint32_t timestamp,
94 int width,
95 int height,
96 size_t size); 94 size_t size);
97 BufferData(); 95 BufferData();
98 ~BufferData(); 96 ~BufferData();
99 int32 bitstream_buffer_id; 97 int32 bitstream_buffer_id;
100 uint32_t timestamp; // in 90KHz 98 uint32_t timestamp; // in 90KHz
101 uint32_t width;
102 uint32_t height;
103 size_t size; // buffer size 99 size_t size; // buffer size
104 }; 100 };
105 101
106 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsBufferAfterReset); 102 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsBufferAfterReset);
107 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsFirstBufferAfterReset); 103 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsFirstBufferAfterReset);
108 104
109 RTCVideoDecoder( 105 RTCVideoDecoder(
110 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories); 106 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories);
111 107
112 // Requests a buffer to be decoded by VDA. 108 // Requests a buffer to be decoded by VDA.
(...skipping 19 matching lines...) Expand all
132 bool SaveToPendingBuffers_Locked(const webrtc::EncodedImage& input_image, 128 bool SaveToPendingBuffers_Locked(const webrtc::EncodedImage& input_image,
133 const BufferData& buffer_data); 129 const BufferData& buffer_data);
134 130
135 // Gets SHM and moves pending buffers to decode buffers. 131 // Gets SHM and moves pending buffers to decode buffers.
136 void MovePendingBuffersToDecodeBuffers(); 132 void MovePendingBuffersToDecodeBuffers();
137 133
138 scoped_refptr<media::VideoFrame> CreateVideoFrame( 134 scoped_refptr<media::VideoFrame> CreateVideoFrame(
139 const media::Picture& picture, 135 const media::Picture& picture,
140 const media::PictureBuffer& pb, 136 const media::PictureBuffer& pb,
141 uint32_t timestamp, 137 uint32_t timestamp,
142 uint32_t width,
143 uint32_t height,
144 size_t size); 138 size_t size);
145 139
146 // Resets VDA. 140 // Resets VDA.
147 void ResetInternal(); 141 void ResetInternal();
148 142
149 // Static method is to allow it to run even after RVD is deleted. 143 // Static method is to allow it to run even after RVD is deleted.
150 static void ReleaseMailbox( 144 static void ReleaseMailbox(
151 base::WeakPtr<RTCVideoDecoder> decoder, 145 base::WeakPtr<RTCVideoDecoder> decoder,
152 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, 146 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories,
153 int64 picture_buffer_id, 147 int64 picture_buffer_id,
(...skipping 16 matching lines...) Expand all
170 // Returns a shared-memory segment to the available pool. 164 // Returns a shared-memory segment to the available pool.
171 void PutSHM_Locked(scoped_ptr<SHMBuffer> shm_buffer); 165 void PutSHM_Locked(scoped_ptr<SHMBuffer> shm_buffer);
172 166
173 // Allocates |number| shared memory of at least |min_size| bytes. 167 // Allocates |number| shared memory of at least |min_size| bytes.
174 void CreateSHM(int number, size_t min_size); 168 void CreateSHM(int number, size_t min_size);
175 169
176 // Stores the buffer metadata to |input_buffer_data_|. 170 // Stores the buffer metadata to |input_buffer_data_|.
177 void RecordBufferData(const BufferData& buffer_data); 171 void RecordBufferData(const BufferData& buffer_data);
178 // Gets the buffer metadata from |input_buffer_data_|. 172 // Gets the buffer metadata from |input_buffer_data_|.
179 void GetBufferData(int32 bitstream_buffer_id, 173 void GetBufferData(int32 bitstream_buffer_id,
180 uint32_t* timestamp, 174 uint32_t* timestamp);
181 uint32_t* width,
182 uint32_t* height,
183 size_t* size);
184 175
185 // Records the result of InitDecode to UMA and returns |status|. 176 // Records the result of InitDecode to UMA and returns |status|.
186 int32_t RecordInitDecodeUMA(int32_t status); 177 int32_t RecordInitDecodeUMA(int32_t status);
187 178
188 // Assert the contract that this class is operated on the right thread. 179 // Assert the contract that this class is operated on the right thread.
189 void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const; 180 void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const;
190 181
191 enum State { 182 enum State {
192 UNINITIALIZED, // The decoder has not initialized. 183 UNINITIALIZED, // The decoder has not initialized.
193 INITIALIZED, // The decoder has initialized. 184 INITIALIZED, // The decoder has initialized.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // Must be destroyed, or invalidated, on |vda_loop_proxy_| 259 // Must be destroyed, or invalidated, on |vda_loop_proxy_|
269 // NOTE: Weak pointers must be invalidated before all other member variables. 260 // NOTE: Weak pointers must be invalidated before all other member variables.
270 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_; 261 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_;
271 262
272 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); 263 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder);
273 }; 264 };
274 265
275 } // namespace content 266 } // namespace content
276 267
277 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ 268 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698