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

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

Issue 1538063003: Use data pipe to pass DecoderBuffer contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/mojo/services/mojo_decryptor_service.h
diff --git a/media/mojo/services/mojo_decryptor_service.h b/media/mojo/services/mojo_decryptor_service.h
index fe00699e4ee151c8394f0705b7fde58afea689f6..f09aaa2f721f995f767459bcb5a16abcac623c2a 100644
--- a/media/mojo/services/mojo_decryptor_service.h
+++ b/media/mojo/services/mojo_decryptor_service.h
@@ -12,6 +12,7 @@
#include "media/mojo/interfaces/decryptor.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/callback.h"
+#include "mojo/public/cpp/system/data_pipe.h"
namespace media {
@@ -32,6 +33,8 @@ class MojoDecryptorService : public interfaces::Decryptor {
~MojoDecryptorService() final;
// interfaces::Decryptor implementation.
+ void Initialize(mojo::ScopedDataPipeConsumerHandle receive_pipe,
+ mojo::ScopedDataPipeProducerHandle transmit_pipe) final;
void Decrypt(interfaces::DemuxerStream::Type stream_type,
interfaces::DecoderBufferPtr encrypted,
const DecryptCallback& callback) final;
@@ -71,9 +74,19 @@ class MojoDecryptorService : public interfaces::Decryptor {
media::Decryptor::Status status,
const scoped_refptr<VideoFrame>& frame);
+ // Copy data bytes from |buffer| into the data pipe.
+ void WriteDataIntoDataPipe(const scoped_refptr<DecoderBuffer>& buffer);
+
+ // Copy data bytes from the data pipe into |buffer|.
+ void ReadDataFromDataPipe(const scoped_refptr<DecoderBuffer>& buffer);
+
// A weak binding is used to connect to the MojoDecryptor.
mojo::Binding<interfaces::Decryptor> binding_;
+ // DataPipes for serializing the data section of DecoderBuffer into/from.
+ mojo::ScopedDataPipeProducerHandle write_pipe_;
+ mojo::ScopedDataPipeConsumerHandle read_pipe_;
+
// Keep ownership of |cdm_| while it is being used. |decryptor_| is the actual
// Decryptor referenced by |cdm_|.
scoped_refptr<MediaKeys> cdm_;

Powered by Google App Engine
This is Rietveld 408576698