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

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

Issue 8399023: Fire canplaythrough event at the proper time for audio/video (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and minor fix Created 9 years, 1 month 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 (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 // The pipeline is the public API clients use for playing back media. Clients 5 // The pipeline is the public API clients use for playing back media. Clients
6 // provide a filter collection containing the filters they want the pipeline to 6 // provide a filter collection containing the filters they want the pipeline to
7 // use to render media. 7 // use to render media.
8 8
9 #ifndef MEDIA_BASE_PIPELINE_H_ 9 #ifndef MEDIA_BASE_PIPELINE_H_
10 #define MEDIA_BASE_PIPELINE_H_ 10 #define MEDIA_BASE_PIPELINE_H_
(...skipping 16 matching lines...) Expand all
27 video_frames_decoded(0), 27 video_frames_decoded(0),
28 video_frames_dropped(0) { 28 video_frames_dropped(0) {
29 } 29 }
30 30
31 uint32 audio_bytes_decoded; // Should be uint64? 31 uint32 audio_bytes_decoded; // Should be uint64?
32 uint32 video_bytes_decoded; // Should be uint64? 32 uint32 video_bytes_decoded; // Should be uint64?
33 uint32 video_frames_decoded; 33 uint32 video_frames_decoded;
34 uint32 video_frames_dropped; 34 uint32 video_frames_dropped;
35 }; 35 };
36 36
37 enum NetworkEvent {
38 DOWNLOAD_CONTINUED,
39 DOWNLOAD_PAUSED,
40 CAN_PLAY_THROUGH
41 };
42
37 class FilterCollection; 43 class FilterCollection;
38 44
39 class MEDIA_EXPORT Pipeline : public base::RefCountedThreadSafe<Pipeline> { 45 class MEDIA_EXPORT Pipeline : public base::RefCountedThreadSafe<Pipeline> {
40 public: 46 public:
41 // Callback that executes when a network event occurrs. 47 // Callback that executes when a network event occurrs.
42 // The parameter represents the state of network activity: true if the network 48 // The parameter specifies the type of event that is being signaled.
43 // is downloading data, false if it is not. If the callback never runs, it is 49 typedef base::Callback<void(NetworkEvent)> NetworkEventCB;
acolwell GONE FROM CHROMIUM 2011/11/09 00:50:22 I figured this bool wouldn't last long. ;)
vrk (LEFT CHROMIUM) 2011/11/11 02:51:06 :)
44 // assumed the network is not downloading data.
45 typedef base::Callback<void(bool)> NetworkEventCB;
46 50
47 // Initializes pipeline. Pipeline takes ownership of all callbacks passed 51 // Initializes pipeline. Pipeline takes ownership of all callbacks passed
48 // into this method. 52 // into this method.
49 // |ended_callback| will be executed when the media reaches the end. 53 // |ended_callback| will be executed when the media reaches the end.
50 // |error_callback_| will be executed upon an error in the pipeline. 54 // |error_callback_| will be executed upon an error in the pipeline.
51 // |network_callback_| will be executed when there's a network event. 55 // |network_callback_| will be executed when there's a network event.
52 virtual void Init(const PipelineStatusCB& ended_callback, 56 virtual void Init(const PipelineStatusCB& ended_callback,
53 const PipelineStatusCB& error_callback, 57 const PipelineStatusCB& error_callback,
54 const NetworkEventCB& network_callback) = 0; 58 const NetworkEventCB& network_callback) = 0;
55 59
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 172
169 protected: 173 protected:
170 // Only allow ourselves to be deleted by reference counting. 174 // Only allow ourselves to be deleted by reference counting.
171 friend class base::RefCountedThreadSafe<Pipeline>; 175 friend class base::RefCountedThreadSafe<Pipeline>;
172 virtual ~Pipeline() {} 176 virtual ~Pipeline() {}
173 }; 177 };
174 178
175 } // namespace media 179 } // namespace media
176 180
177 #endif // MEDIA_BASE_PIPELINE_H_ 181 #endif // MEDIA_BASE_PIPELINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698