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

Unified Diff: media/filters/null_audio_renderer.h

Issue 9826023: Merge AudioRendererImpl and AudioRendererBase; add NullAudioSink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase ToT + address CR comments Created 8 years, 9 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
Index: media/filters/null_audio_renderer.h
diff --git a/media/filters/null_audio_renderer.h b/media/filters/null_audio_renderer.h
deleted file mode 100644
index 03500cab7d935195f18eacb51253221a5b9d9a75..0000000000000000000000000000000000000000
--- a/media/filters/null_audio_renderer.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// 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_FILTERS_NULL_AUDIO_RENDERER_H_
-#define MEDIA_FILTERS_NULL_AUDIO_RENDERER_H_
-
-// NullAudioRenderer effectively uses an extra thread to "throw away" the
-// audio data at a rate resembling normal playback speed. It's just like
-// decoding to /dev/null!
-//
-// NullAudioRenderer can also be used in situations where the client has no
-// audio device or we haven't written an audio implementation for a particular
-// platform yet.
-
-#include <deque>
-
-#include "base/memory/scoped_ptr.h"
-#include "base/threading/thread.h"
-#include "media/base/buffers.h"
-#include "media/base/filters.h"
-#include "media/filters/audio_renderer_base.h"
-
-namespace media {
-
-class MEDIA_EXPORT NullAudioRenderer : public AudioRendererBase {
- public:
- NullAudioRenderer();
- virtual ~NullAudioRenderer();
-
- // AudioRenderer implementation.
- virtual void SetVolume(float volume) OVERRIDE;
-
- protected:
- // AudioRendererBase implementation.
- virtual bool OnInitialize(int bits_per_channel,
- ChannelLayout channel_layout,
- int sample_rate) OVERRIDE;
- virtual void OnStop() OVERRIDE;
- virtual void OnRenderEndOfStream() OVERRIDE;
-
- private:
- // Audio thread task that periodically calls FillBuffer() to consume
- // audio data.
- void FillBufferTask();
-
- // A number to convert bytes written in FillBuffer to milliseconds based on
- // the audio format.
- size_t bytes_per_millisecond_;
-
- // A buffer passed to FillBuffer to advance playback.
- scoped_array<uint8> buffer_;
- size_t buffer_size_;
-
- size_t bytes_per_frame_;
-
- // Separate thread used to throw away data.
- base::Thread thread_;
-
- DISALLOW_COPY_AND_ASSIGN(NullAudioRenderer);
-};
-
-} // namespace media
-
-#endif // MEDIA_FILTERS_NULL_AUDIO_RENDERER_H_

Powered by Google App Engine
This is Rietveld 408576698