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

Unified Diff: media/base/filters.h

Issue 18380: This is the frozen interface definition for the media pipeline, filters, and ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/filter_host_impl.cc ('k') | media/base/pipeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/filters.h
===================================================================
--- media/base/filters.h (revision 8115)
+++ media/base/filters.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -26,6 +26,8 @@
#include <limits>
#include <string>
+
+#include "base/logging.h"
#include "base/ref_counted.h"
namespace media {
@@ -48,18 +50,43 @@
FILTER_AUDIO_DECODER,
FILTER_VIDEO_DECODER,
FILTER_AUDIO_RENDERER,
- FILTER_VIDEO_RENDERER,
- FILTER_MAX
+ FILTER_VIDEO_RENDERER
};
class MediaFilter : public base::RefCountedThreadSafe<MediaFilter> {
public:
- virtual void SetFilterHost(FilterHost* filter_host) = 0;
+ MediaFilter() : host_(NULL) {}
+ // Sets the protected member |host_|. This is the first method called by
+ // the FilterHost after a filter is created. The host holds a strong
+ // reference to the filter. The refernce held by the host is guaranteed
+ // to be released before the host object is destroyed by the pipeline.
+ virtual void SetFilterHost(FilterHost* host) {
+ DCHECK(NULL == host_);
+ DCHECK(NULL != host);
+ host_ = host;
+ }
+
+ // The pipeline is being stopped either as a result of an error or because
+ // the client called Stop().
+ virtual void Stop() = 0;
+
+ // The pipeline playback rate has been changed. Filters may implement this
+ // method if they need to respond to this call.
+ virtual void SetPlaybackRate(float playback_rate) {}
+
+ // The pipeline is being seeked to the specified time. Filters may implement
+ // this method if they need to respond to this call.
+ virtual void Seek(int64 time) {}
+
protected:
+ FilterHost* host_;
friend class base::RefCountedThreadSafe<MediaFilter>;
virtual ~MediaFilter() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MediaFilter);
};
@@ -95,7 +122,7 @@
public:
static const FilterType kFilterType = FILTER_DEMUXER;
- // Initializes this filter, returns true if successful, false otherwise.
+ // Initializes this filter, returns true if successful, false otherwise.
virtual bool Initialize(DataSource* data_source) = 0;
// Returns the number of streams available
@@ -113,6 +140,8 @@
// Schedules a read and takes ownership of the given buffer.
virtual void Read(Assignable<Buffer>* buffer) = 0;
+
+ virtual ~DemuxerStream() {}
scherkus (not reviewing) 2009/01/21 22:24:45 This should be protected pure virtual.
};
@@ -161,8 +190,11 @@
// Initializes this filter, returns true if successful, false otherwise.
virtual bool Initialize(AudioDecoder* decoder) = 0;
+
+ // Sets the output volume.
+ virtual void SetVolume(float volume) = 0;
};
-} // namespace media
+} // namespace media
-#endif // MEDIA_BASE_FILTERS_H_
+#endif // MEDIA_BASE_FILTERS_H_
« no previous file with comments | « media/base/filter_host_impl.cc ('k') | media/base/pipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698