summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-23 23:02:00 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-23 23:02:00 +0000
commitbb149f89c5d24d3cdc420e7de2635a72a403c3a5 (patch)
tree9ab31b1ababb1491e53a2f5635e3961d8f7209db /media
parent0a7347ffaf22c5edadac59c694305328847526e3 (diff)
downloadchromium_src-bb149f89c5d24d3cdc420e7de2635a72a403c3a5.zip
chromium_src-bb149f89c5d24d3cdc420e7de2635a72a403c3a5.tar.gz
chromium_src-bb149f89c5d24d3cdc420e7de2635a72a403c3a5.tar.bz2
Check in missing files from r138642.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138644 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/base/audio_renderer.h55
-rw-r--r--media/base/video_renderer.h42
2 files changed, 97 insertions, 0 deletions
diff --git a/media/base/audio_renderer.h b/media/base/audio_renderer.h
new file mode 100644
index 0000000..0c9c582
--- /dev/null
+++ b/media/base/audio_renderer.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2012 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.
+
+#ifndef MEDIA_BASE_AUDIO_RENDERER_H_
+#define MEDIA_BASE_AUDIO_RENDERER_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "base/time.h"
+#include "media/base/filters.h"
+#include "media/base/media_export.h"
+#include "media/base/pipeline_status.h"
+
+namespace media {
+
+class AudioDecoder;
+
+class MEDIA_EXPORT AudioRenderer : public Filter {
+ public:
+ // Used to update the pipeline's clock time. The first parameter is the
+ // current time, and the second parameter is the time that the clock must not
+ // exceed.
+ typedef base::Callback<void(base::TimeDelta, base::TimeDelta)> TimeCB;
+
+ // Initialize a AudioRenderer with the given AudioDecoder, executing the
+ // |init_cb| upon completion. |underflow_cb| is called when the
+ // renderer runs out of data to pass to the audio card during playback.
+ // If the |underflow_cb| is called ResumeAfterUnderflow() must be called
+ // to resume playback. Pause(), Seek(), or Stop() cancels the underflow
+ // condition.
+ virtual void Initialize(const scoped_refptr<AudioDecoder>& decoder,
+ const PipelineStatusCB& init_cb,
+ const base::Closure& underflow_cb,
+ const TimeCB& time_cb) = 0;
+
+ // Returns true if this filter has received and processed an end-of-stream
+ // buffer.
+ virtual bool HasEnded() = 0;
+
+ // Sets the output volume.
+ virtual void SetVolume(float volume) = 0;
+
+ // Resumes playback after underflow occurs.
+ // |buffer_more_audio| is set to true if you want to increase the size of the
+ // decoded audio buffer.
+ virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0;
+
+ protected:
+ virtual ~AudioRenderer() {}
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_AUDIO_RENDERER_H_
diff --git a/media/base/video_renderer.h b/media/base/video_renderer.h
new file mode 100644
index 0000000..8907610
--- /dev/null
+++ b/media/base/video_renderer.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 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.
+
+#ifndef MEDIA_BASE_VIDEO_RENDERER_H_
+#define MEDIA_BASE_VIDEO_RENDERER_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "base/time.h"
+#include "media/base/filters.h"
+#include "media/base/media_export.h"
+#include "media/base/pipeline_status.h"
+
+namespace media {
+
+class VideoDecoder;
+
+class MEDIA_EXPORT VideoRenderer : public Filter {
+ public:
+ // Used to update the pipeline's clock time. The parameter is the time that
+ // the clock should not exceed.
+ typedef base::Callback<void(base::TimeDelta)> TimeCB;
+
+ // Initialize a VideoRenderer with the given VideoDecoder, executing the
+ // callback upon completion.
+ virtual void Initialize(const scoped_refptr<VideoDecoder>& decoder,
+ const PipelineStatusCB& status_cb,
+ const StatisticsCB& statistics_cb,
+ const TimeCB& time_cb) = 0;
+
+ // Returns true if this filter has received and processed an end-of-stream
+ // buffer.
+ virtual bool HasEnded() = 0;
+
+ protected:
+ virtual ~VideoRenderer() {}
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_VIDEO_RENDERER_H_