Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 // PipelineImpl::Stop() goes through a Pause/Flush/Stop dance to all its | 157 // PipelineImpl::Stop() goes through a Pause/Flush/Stop dance to all its |
| 158 // filters, waiting for each state transition to complete before starting the | 158 // filters, waiting for each state transition to complete before starting the |
| 159 // next, but WebMediaPlayerImpl::Destroy() holds the renderer loop hostage for | 159 // next, but WebMediaPlayerImpl::Destroy() holds the renderer loop hostage for |
| 160 // the duration. Default implementation does nothing; derived decoders may | 160 // the duration. Default implementation does nothing; derived decoders may |
| 161 // override as needed. http://crbug.com/110228 tracks removing this. | 161 // override as needed. http://crbug.com/110228 tracks removing this. |
| 162 virtual void PrepareForShutdownHack(); | 162 virtual void PrepareForShutdownHack(); |
| 163 | 163 |
| 164 protected: | 164 protected: |
| 165 VideoDecoder(); | 165 VideoDecoder(); |
| 166 virtual ~VideoDecoder(); | 166 virtual ~VideoDecoder(); |
| 167 }; | 167 }; |
|
Ami GONE FROM CHROMIUM
2012/03/14 20:05:01
Can you confirm that Pause/Seek/Play are never cal
xhwang
2012/03/14 22:28:41
I like this! Done.
| |
| 168 | 168 |
| 169 | 169 |
| 170 class MEDIA_EXPORT VideoRenderer : public Filter { | 170 class MEDIA_EXPORT VideoRenderer : public Filter { |
| 171 public: | 171 public: |
| 172 // Used to update the pipeline's clock time. The parameter is the time that | 172 // Used to update the pipeline's clock time. The parameter is the time that |
| 173 // the clock should not exceed. | 173 // the clock should not exceed. |
| 174 typedef base::Callback<void(base::TimeDelta)> VideoTimeCB; | 174 typedef base::Callback<void(base::TimeDelta)> VideoTimeCB; |
| 175 | 175 |
| 176 // Initialize a VideoRenderer with the given VideoDecoder, executing the | 176 // Initialize a VideoRenderer with the given VideoDecoder, executing the |
| 177 // callback upon completion. | 177 // callback upon completion. |
| 178 virtual void Initialize(VideoDecoder* decoder, | 178 virtual void Initialize(const scoped_refptr<VideoDecoder>& decoder, |
| 179 const PipelineStatusCB& callback, | 179 const PipelineStatusCB& pipeline_status_cb, |
|
Ami GONE FROM CHROMIUM
2012/03/14 20:05:01
s/pipeline_// ?
xhwang
2012/03/14 22:28:41
I chose this verbose name because status_cb and st
Ami GONE FROM CHROMIUM
2012/03/14 22:42:50
My only objection is the length.
xhwang
2012/03/14 22:59:42
Okay, will change this in the next CL too.
| |
| 180 const StatisticsCB& statistics_cb, | 180 const StatisticsCB& statistics_cb, |
| 181 const VideoTimeCB& time_cb) = 0; | 181 const VideoTimeCB& video_time_cb) = 0; |
|
Ami GONE FROM CHROMIUM
2012/03/14 20:05:01
IMO "Video" belongs in neither the param name nor
xhwang
2012/03/14 22:28:41
Will do in another CL.
| |
| 182 | 182 |
| 183 // Returns true if this filter has received and processed an end-of-stream | 183 // Returns true if this filter has received and processed an end-of-stream |
| 184 // buffer. | 184 // buffer. |
| 185 virtual bool HasEnded() = 0; | 185 virtual bool HasEnded() = 0; |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 | 188 |
| 189 class MEDIA_EXPORT AudioRenderer : public Filter { | 189 class MEDIA_EXPORT AudioRenderer : public Filter { |
| 190 public: | 190 public: |
| 191 // Used to update the pipeline's clock time. The first parameter is the | 191 // Used to update the pipeline's clock time. The first parameter is the |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 213 | 213 |
| 214 // Resumes playback after underflow occurs. | 214 // Resumes playback after underflow occurs. |
| 215 // |buffer_more_audio| is set to true if you want to increase the size of the | 215 // |buffer_more_audio| is set to true if you want to increase the size of the |
| 216 // decoded audio buffer. | 216 // decoded audio buffer. |
| 217 virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0; | 217 virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0; |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 } // namespace media | 220 } // namespace media |
| 221 | 221 |
| 222 #endif // MEDIA_BASE_FILTERS_H_ | 222 #endif // MEDIA_BASE_FILTERS_H_ |
| OLD | NEW |