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

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

Issue 155713: Added reference counting to the Pipeline interface. (Closed)
Patch Set: Uploaded too much Created 11 years, 5 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
« no previous file with comments | « media/base/pipeline.h ('k') | media/base/pipeline_impl_unittest.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 (c) 2008-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008-2009 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 // Implementation of Pipeline. 5 // Implementation of Pipeline.
6 6
7 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_ 7 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_
8 #define MEDIA_BASE_PIPELINE_IMPL_H_ 8 #define MEDIA_BASE_PIPELINE_IMPL_H_
9 9
10 #include <string> 10 #include <string>
(...skipping 12 matching lines...) Expand all
23 class PipelineInternal; 23 class PipelineInternal;
24 24
25 // Class which implements the Media::Pipeline contract. The majority of the 25 // Class which implements the Media::Pipeline contract. The majority of the
26 // actual code for this object lives in the PipelineInternal class, which is 26 // actual code for this object lives in the PipelineInternal class, which is
27 // responsible for actually building and running the pipeline. This object 27 // responsible for actually building and running the pipeline. This object
28 // is basically a simple container for state information, and is responsible 28 // is basically a simple container for state information, and is responsible
29 // for creating and communicating with the PipelineInternal object. 29 // for creating and communicating with the PipelineInternal object.
30 class PipelineImpl : public Pipeline { 30 class PipelineImpl : public Pipeline {
31 public: 31 public:
32 PipelineImpl(MessageLoop* message_loop); 32 PipelineImpl(MessageLoop* message_loop);
33 virtual ~PipelineImpl();
34 33
35 // Pipeline implementation. 34 // Pipeline implementation.
36 virtual bool Start(FilterFactory* filter_factory, 35 virtual bool Start(FilterFactory* filter_factory,
37 const std::string& uri, 36 const std::string& uri,
38 PipelineCallback* start_callback); 37 PipelineCallback* start_callback);
39 virtual void Stop(PipelineCallback* stop_callback); 38 virtual void Stop(PipelineCallback* stop_callback);
40 virtual void Seek(base::TimeDelta time, PipelineCallback* seek_callback); 39 virtual void Seek(base::TimeDelta time, PipelineCallback* seek_callback);
41 virtual bool IsRunning() const; 40 virtual bool IsRunning() const;
42 virtual bool IsInitialized() const; 41 virtual bool IsInitialized() const;
43 virtual bool IsRendered(const std::string& major_mime_type) const; 42 virtual bool IsRendered(const std::string& major_mime_type) const;
44 virtual float GetPlaybackRate() const; 43 virtual float GetPlaybackRate() const;
45 virtual void SetPlaybackRate(float playback_rate); 44 virtual void SetPlaybackRate(float playback_rate);
46 virtual float GetVolume() const; 45 virtual float GetVolume() const;
47 virtual void SetVolume(float volume); 46 virtual void SetVolume(float volume);
48 virtual base::TimeDelta GetCurrentTime() const; 47 virtual base::TimeDelta GetCurrentTime() const;
49 virtual base::TimeDelta GetBufferedTime() const; 48 virtual base::TimeDelta GetBufferedTime() const;
50 virtual base::TimeDelta GetDuration() const; 49 virtual base::TimeDelta GetDuration() const;
51 virtual int64 GetBufferedBytes() const; 50 virtual int64 GetBufferedBytes() const;
52 virtual int64 GetTotalBytes() const; 51 virtual int64 GetTotalBytes() const;
53 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const; 52 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const;
54 virtual PipelineError GetError() const; 53 virtual PipelineError GetError() const;
55 54
56 private: 55 private:
57 friend class FilterHostImpl; 56 friend class FilterHostImpl;
58 friend class PipelineInternal; 57 friend class PipelineInternal;
58 virtual ~PipelineImpl();
59 59
60 // Reset the state of the pipeline object to the initial state. This method 60 // Reset the state of the pipeline object to the initial state. This method
61 // is used by the constructor, and the Stop method. 61 // is used by the constructor, and the Stop method.
62 void ResetState(); 62 void ResetState();
63 63
64 // Used internally to make sure that the thread is in a state that is 64 // Used internally to make sure that the thread is in a state that is
65 // acceptable to post a task to. It must exist, be initialized, and there 65 // acceptable to post a task to. It must exist, be initialized, and there
66 // must not be an error. 66 // must not be an error.
67 bool IsPipelineOk() const; 67 bool IsPipelineOk() const;
68 68
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 typedef std::vector<base::Thread*> FilterThreadVector; 375 typedef std::vector<base::Thread*> FilterThreadVector;
376 FilterThreadVector filter_threads_; 376 FilterThreadVector filter_threads_;
377 377
378 DISALLOW_COPY_AND_ASSIGN(PipelineInternal); 378 DISALLOW_COPY_AND_ASSIGN(PipelineInternal);
379 }; 379 };
380 380
381 } // namespace media 381 } // namespace media
382 382
383 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ 383 #endif // MEDIA_BASE_PIPELINE_IMPL_H_
OLDNEW
« no previous file with comments | « media/base/pipeline.h ('k') | media/base/pipeline_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698