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

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

Issue 9860027: Remove DemuxerFactory and URL parameter from Pipeline. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: added some todos Created 8 years, 8 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 | « no previous file | media/base/demuxer_factory.h » ('j') | media/base/filter_collection.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef MEDIA_BASE_DEMUXER_H_ 5 #ifndef MEDIA_BASE_DEMUXER_H_
6 #define MEDIA_BASE_DEMUXER_H_ 6 #define MEDIA_BASE_DEMUXER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "media/base/data_source.h" 10 #include "media/base/data_source.h"
(...skipping 21 matching lines...) Expand all
32 // Stops execution of the pipeline due to a fatal error. Do not call this 32 // Stops execution of the pipeline due to a fatal error. Do not call this
33 // method with PIPELINE_OK. 33 // method with PIPELINE_OK.
34 virtual void OnDemuxerError(PipelineStatus error) = 0; 34 virtual void OnDemuxerError(PipelineStatus error) = 0;
35 }; 35 };
36 36
37 class MEDIA_EXPORT Demuxer 37 class MEDIA_EXPORT Demuxer
38 : public base::RefCountedThreadSafe<Demuxer> { 38 : public base::RefCountedThreadSafe<Demuxer> {
39 public: 39 public:
40 Demuxer(); 40 Demuxer();
41 41
42 // Completes initialization of the demuxer.
43 virtual void Initialize(const PipelineStatusCB& status_cb) = 0;
acolwell GONE FROM CHROMIUM 2012/03/27 20:11:35 How about removing set_host() and adding DemuxerHo
scherkus (not reviewing) 2012/03/27 20:44:09 added a TODO w/ bug as I was planning on doing tha
44
42 // Sets the private member |host_|. This is the first method called by 45 // Sets the private member |host_|. This is the first method called by
43 // the DemuxerHost after a demuxer is created. The host holds a strong 46 // the DemuxerHost after a demuxer is created. The host holds a strong
44 // reference to the demuxer. The reference held by the host is guaranteed 47 // reference to the demuxer. The reference held by the host is guaranteed
45 // to be released before the host object is destroyed by the pipeline. 48 // to be released before the host object is destroyed by the pipeline.
46 virtual void set_host(DemuxerHost* host); 49 virtual void set_host(DemuxerHost* host);
47 50
48 // The pipeline playback rate has been changed. Demuxers may implement this 51 // The pipeline playback rate has been changed. Demuxers may implement this
49 // method if they need to respond to this call. 52 // method if they need to respond to this call.
50 virtual void SetPlaybackRate(float playback_rate); 53 virtual void SetPlaybackRate(float playback_rate);
51 54
(...skipping 17 matching lines...) Expand all
69 72
70 // Returns the starting time for the media file. 73 // Returns the starting time for the media file.
71 virtual base::TimeDelta GetStartTime() const = 0; 74 virtual base::TimeDelta GetStartTime() const = 0;
72 75
73 // Returns the content bitrate. May be obtained from container or 76 // Returns the content bitrate. May be obtained from container or
74 // approximated. Returns 0 if it is unknown. 77 // approximated. Returns 0 if it is unknown.
75 virtual int GetBitrate() = 0; 78 virtual int GetBitrate() = 0;
76 79
77 // Returns true if the source is from a local file or stream (such as a 80 // Returns true if the source is from a local file or stream (such as a
78 // webcam stream), false otherwise. 81 // webcam stream), false otherwise.
82 //
83 // TODO(scherkus): See http://crbug.com/120426 on why we should remove this.
79 virtual bool IsLocalSource() = 0; 84 virtual bool IsLocalSource() = 0;
80 85
81 // Returns true if seeking is possible; false otherwise. 86 // Returns true if seeking is possible; false otherwise.
82 virtual bool IsSeekable() = 0; 87 virtual bool IsSeekable() = 0;
83 88
84 protected: 89 protected:
85 // Only allow derived objects access to the DemuxerHost. This is 90 // Only allow derived objects access to the DemuxerHost. This is
86 // kept out of the public interface because demuxers need to be 91 // kept out of the public interface because demuxers need to be
87 // aware of all calls made to the host object so they can insure 92 // aware of all calls made to the host object so they can insure
88 // the state presented to the host is always consistent with its own 93 // the state presented to the host is always consistent with its own
89 // state. 94 // state.
90 DemuxerHost* host() { return host_; } 95 DemuxerHost* host() { return host_; }
91 96
92 friend class base::RefCountedThreadSafe<Demuxer>; 97 friend class base::RefCountedThreadSafe<Demuxer>;
93 virtual ~Demuxer(); 98 virtual ~Demuxer();
94 99
95 private: 100 private:
96 DemuxerHost* host_; 101 DemuxerHost* host_;
97 102
98 DISALLOW_COPY_AND_ASSIGN(Demuxer); 103 DISALLOW_COPY_AND_ASSIGN(Demuxer);
99 }; 104 };
100 105
101 } // namespace media 106 } // namespace media
102 107
103 #endif // MEDIA_BASE_DEMUXER_H_ 108 #endif // MEDIA_BASE_DEMUXER_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/demuxer_factory.h » ('j') | media/base/filter_collection.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698