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

Unified Diff: media/filters/audio_decoder_factory.h

Issue 11492003: Encrypted Media: Support Audio Decrypt-Only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/audio_decoder_factory.h
diff --git a/media/filters/audio_decoder_factory.h b/media/filters/audio_decoder_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..f1187e603d4e4e38325212a62ed17cad089206f7
--- /dev/null
+++ b/media/filters/audio_decoder_factory.h
@@ -0,0 +1,73 @@
+// 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_AUDIO_DECODER_FACTORY_H_
+#define MEDIA_FILTERS_AUDIO_DECODER_FACTORY_H_
+
+#include <list>
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "media/base/audio_decoder.h"
+#include "media/base/decryptor.h"
+#include "media/base/demuxer_stream.h"
+
+namespace base {
+class MessageLoopProxy;
+}
+
+namespace media {
+
+class DecoderBuffer;
+class DecryptingDemuxerStream;
+class Decryptor;
+
+// AudioDecoderFactory (creates if necessary and) initializes the proper
+// AudioDecoder for a given DemuxerStream. If the given DemuxerStream is
+// encrypted, a DecryptingDemuxerStream may also be created.
+class MEDIA_EXPORT AudioDecoderFactory {
+ public:
+ typedef std::list<scoped_refptr<AudioDecoder> > AudioDecoderList;
+
+ typedef base::Callback<
+ void(const scoped_refptr<AudioDecoder>&,
+ const scoped_refptr<DecryptingDemuxerStream>&)> InitDoneCB;
+
+ AudioDecoderFactory(
+ const scoped_refptr<base::MessageLoopProxy>& message_loop,
+ const AudioDecoderList& precreated_decoders,
+ const RequestDecryptorNotificationCB& request_decryptor_notification_cb);
+ ~AudioDecoderFactory();
+
+ void InitAudioDecoder(const scoped_refptr<DemuxerStream>& stream,
+ const StatisticsCB& statistics_cb,
+ InitDoneCB init_done_cb);
+
+ private:
+ void OnDecryptingAudioDecoderInitDone(PipelineStatus status);
+ void OnDecryptingDemuxerStreamInitDone(PipelineStatus status);
+ void InitializeNextDecoder();
+ void OnDecoderInitDone(PipelineStatus status);
+
+ scoped_refptr<base::MessageLoopProxy> message_loop_;
+ AudioDecoderList precreated_decoders_;
+ RequestDecryptorNotificationCB request_decryptor_notification_cb_;
+
+ scoped_refptr<DemuxerStream> input_stream_;
+ StatisticsCB statistics_cb_;
+ InitDoneCB init_done_cb_;
+
+ scoped_refptr<AudioDecoder> audio_decoder_;
+ scoped_refptr<DecryptingDemuxerStream> decrypted_stream_;
+
+ base::WeakPtrFactory<AudioDecoderFactory> weak_ptr_factory_;
+ base::WeakPtr<AudioDecoderFactory> weak_this_;
+
+ DISALLOW_COPY_AND_ASSIGN(AudioDecoderFactory);
+};
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_AUDIO_DECODER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698