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

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

Issue 1823443002: Use data pipe for encoded buffers in MojoAudioDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@spitzer-audio-service-impl
Patch Set: Addressed comments 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.h
diff --git a/media/mojo/services/mojo_audio_decoder.h b/media/mojo/services/mojo_audio_decoder.h
index 6bfae6e8415d14fba205b4e91d8dc920bf49177b..3f0d58fa4e1167d5bd878615e884b65e8dbfa549 100644
--- a/media/mojo/services/mojo_audio_decoder.h
+++ b/media/mojo/services/mojo_audio_decoder.h
@@ -10,6 +10,7 @@
#include "media/base/audio_decoder.h"
#include "media/mojo/interfaces/audio_decoder.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/public/cpp/system/data_pipe.h"
namespace base {
class SingleThreadTaskRunner;
@@ -52,15 +53,29 @@ class MojoAudioDecoder : public AudioDecoder,
// called when |remote_decoder_| finished Reset() sequence.
void OnResetDone();
+ // A helper method that creates data pipe and sets the data connection to
+ // the service.
+ void CreateDataPipe();
+
+ // A helper method to serialize the data section of DecoderBuffer into pipe.
+ interfaces::DecoderBufferPtr TransferDecoderBuffer(
+ const scoped_refptr<DecoderBuffer>& media_buffer);
+
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
interfaces::AudioDecoderPtr remote_decoder_;
+ // DataPipe for serializing the data section of DecoderBuffer.
+ mojo::ScopedDataPipeProducerHandle producer_handle_;
+
// Binding for AudioDecoderClient, bound to the |task_runner_|.
mojo::Binding<AudioDecoderClient> binding_;
- // We call these callbacks to pass the information to the pipeline.
+ // We call the following callbacks to pass the information to the pipeline.
+ // |output_cb_| is permanent while other three are called only once,
+ // |decode_cb_| and |reset_cb_| are replaced by every by Decode() and Reset().
InitCB init_cb_;
+ OutputCB output_cb_;
DecodeCB decode_cb_;
base::Closure reset_cb_;

Powered by Google App Engine
This is Rietveld 408576698