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

Side by Side Diff: media/base/filters.h

Issue 7932005: Reland r101418: Fix aspect ratio and clarify video frame dimensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « media/base/filter_host.h ('k') | media/base/mock_filter_host.h » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Filters are connected in a strongly typed manner, with downstream filters 5 // Filters are connected in a strongly typed manner, with downstream filters
6 // always reading data from upstream filters. Upstream filters have no clue 6 // always reading data from upstream filters. Upstream filters have no clue
7 // who is actually reading from them, and return the results via callbacks. 7 // who is actually reading from them, and return the results via callbacks.
8 // 8 //
9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer 9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer
10 // DataSource <- Demuxer < 10 // DataSource <- Demuxer <
(...skipping 17 matching lines...) Expand all
28 28
29 #include "base/callback.h" 29 #include "base/callback.h"
30 #include "base/callback_old.h" 30 #include "base/callback_old.h"
31 #include "base/memory/ref_counted.h" 31 #include "base/memory/ref_counted.h"
32 #include "base/memory/scoped_ptr.h" 32 #include "base/memory/scoped_ptr.h"
33 #include "base/time.h" 33 #include "base/time.h"
34 #include "media/base/audio_decoder_config.h" 34 #include "media/base/audio_decoder_config.h"
35 #include "media/base/media_export.h" 35 #include "media/base/media_export.h"
36 #include "media/base/pipeline_status.h" 36 #include "media/base/pipeline_status.h"
37 #include "media/base/video_frame.h" 37 #include "media/base/video_frame.h"
38 #include "ui/gfx/size.h"
38 39
39 namespace media { 40 namespace media {
40 41
41 class Buffer; 42 class Buffer;
42 class Decoder; 43 class Decoder;
43 class DemuxerStream; 44 class DemuxerStream;
44 class Filter; 45 class Filter;
45 class FilterHost; 46 class FilterHost;
46 47
47 struct PipelineStatistics; 48 struct PipelineStatistics;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame) = 0; 174 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame) = 0;
174 175
175 // Installs a permanent callback for passing decoded video output. 176 // Installs a permanent callback for passing decoded video output.
176 // 177 //
177 // A NULL frame represents a decoding error. 178 // A NULL frame represents a decoding error.
178 typedef base::Callback<void(scoped_refptr<VideoFrame>)> ConsumeVideoFrameCB; 179 typedef base::Callback<void(scoped_refptr<VideoFrame>)> ConsumeVideoFrameCB;
179 void set_consume_video_frame_callback(const ConsumeVideoFrameCB& callback) { 180 void set_consume_video_frame_callback(const ConsumeVideoFrameCB& callback) {
180 consume_video_frame_callback_ = callback; 181 consume_video_frame_callback_ = callback;
181 } 182 }
182 183
183 // Returns the width and height of decoded video in pixels. 184 // Returns the natural width and height of decoded video in pixels.
184 // 185 //
185 // Clients should NOT rely on these values to remain constant. Instead, use 186 // Clients should NOT rely on these values to remain constant. Instead, use
186 // the width/height from decoded video frames themselves. 187 // the width/height from decoded video frames themselves.
187 // 188 //
188 // TODO(scherkus): why not rely on prerolling and decoding a single frame to 189 // TODO(scherkus): why not rely on prerolling and decoding a single frame to
189 // get dimensions? 190 // get dimensions?
190 virtual int width() = 0; 191 virtual gfx::Size natural_size() = 0;
191 virtual int height() = 0;
192 192
193 protected: 193 protected:
194 // Executes the permanent callback to pass off decoded video. 194 // Executes the permanent callback to pass off decoded video.
195 // 195 //
196 // TODO(scherkus): name this ConsumeVideoFrame() once we fix the TODO in 196 // TODO(scherkus): name this ConsumeVideoFrame() once we fix the TODO in
197 // VideoDecodeEngine::EventHandler to remove ConsumeVideoFrame() from there. 197 // VideoDecodeEngine::EventHandler to remove ConsumeVideoFrame() from there.
198 void VideoFrameReady(scoped_refptr<VideoFrame> frame) { 198 void VideoFrameReady(scoped_refptr<VideoFrame> frame) {
199 consume_video_frame_callback_.Run(frame); 199 consume_video_frame_callback_.Run(frame);
200 } 200 }
201 201
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // buffer. 265 // buffer.
266 virtual bool HasEnded() = 0; 266 virtual bool HasEnded() = 0;
267 267
268 // Sets the output volume. 268 // Sets the output volume.
269 virtual void SetVolume(float volume) = 0; 269 virtual void SetVolume(float volume) = 0;
270 }; 270 };
271 271
272 } // namespace media 272 } // namespace media
273 273
274 #endif // MEDIA_BASE_FILTERS_H_ 274 #endif // MEDIA_BASE_FILTERS_H_
OLDNEW
« no previous file with comments | « media/base/filter_host.h ('k') | media/base/mock_filter_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698