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

Unified Diff: media/mojo/services/mojo_audio_decoder_service.h

Issue 1808593002: Add a stub implementation for Mojo AudioDecoder interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@spitzer-audio-mojom
Patch Set: Rebased Created 4 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/mojo/services/mojo_audio_decoder_service.h
diff --git a/media/mojo/services/mojo_audio_decoder_service.h b/media/mojo/services/mojo_audio_decoder_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..b91da7157a074318ff7dd3f036e54c81aa6ae086
--- /dev/null
+++ b/media/mojo/services/mojo_audio_decoder_service.h
@@ -0,0 +1,52 @@
+// Copyright 2016 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_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_
+#define MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_
+
+#include "base/macros.h"
+//#include "base/memory/ref_counted.h"
xhwang 2016/03/16 04:12:18 fix the "//" here.
Tima Vaisburd 2016/03/16 19:23:20 Done.
+#include "base/memory/scoped_ptr.h"
+//#include "base/memory/weak_ptr.h"
xhwang 2016/03/16 04:12:18 fix the "//" here.
Tima Vaisburd 2016/03/16 19:23:20 Done.
+#include "media/mojo/interfaces/audio_decoder.mojom.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+
+namespace media {
+
+class MojoAudioDecoderService : public interfaces::AudioDecoder {
+ public:
+ MojoAudioDecoderService(
+ scoped_ptr<AudioDecoder> decoder,
xhwang 2016/03/16 04:21:58 BTW, I assume you'll create the AudioDecoder in An
Tima Vaisburd 2016/03/16 19:23:20 In the doc you mentioned ServiceFactoryImpl. Shoul
xhwang 2016/03/16 19:51:41 Sorry for the confusion. Yes, platform specific im
+ mojo::InterfaceRequest<interfaces::AudioDecoder> request);
+
+ ~MojoAudioDecoderService() final;
+
+ // interfaces::AudioDecoder implementation
+ void Initialize(interfaces::AudioDecoderClientPtr client,
+ interfaces::AudioDecoderConfigPtr config,
+ int32_t cdm_id,
+ const InitializeCallback& callback) final;
+
+ void Decode(interfaces::DecoderBufferPtr buffer,
+ const DecodeCallback& callback) final;
+
+ void Reset(const ResetCallback& callback) final;
+
+ private:
+ // A binding represents the association between the service and the
+ // communication channel, i.e. the pipe.
+ mojo::StrongBinding<interfaces::AudioDecoder> binding_;
+
+ // The AudioDecoder that does actual decoding work.
+ scoped_ptr<AudioDecoder> decoder_;
+
+ // The destination for the decoded buffers.
+ interfaces::AudioDecoderClientPtr client_;
+
+ DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoderService);
+};
+
+} // namespace media
+
+#endif // MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698