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

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

Issue 1809903002: Reland "Update mojo Decryptor interface to support reusing shared memory" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add includes 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
« no previous file with comments | « media/mojo/services/mojo_decryptor.cc ('k') | media/mojo/services/mojo_decryptor_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b5bf2ff2a1284cf75b527f89100491fdbc56e56e..23ddc543775f51f36a4375771ade663b5c57cfc5 100644
--- a/media/mojo/services/mojo_decryptor_service.h
+++ b/media/mojo/services/mojo_decryptor_service.h
@@ -5,6 +5,11 @@
#ifndef MEDIA_MOJO_SERVICES_MOJO_DECRYPTOR_SERVICE_H_
#define MEDIA_MOJO_SERVICES_MOJO_DECRYPTOR_SERVICE_H_
+#include <stddef.h>
+#include <stdint.h>
+
+#include <unordered_map>
+
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
@@ -53,6 +58,8 @@ class MojoDecryptorService : public interfaces::Decryptor {
const DecryptAndDecodeVideoCallback& callback) final;
void ResetDecoder(interfaces::DemuxerStream::Type stream_type) final;
void DeinitializeDecoder(interfaces::DemuxerStream::Type stream_type) final;
+ void ReleaseSharedBuffer(mojo::ScopedSharedBufferHandle buffer,
+ uint64_t buffer_size) final;
private:
// Callback executed once Decrypt() is done.
@@ -92,6 +99,11 @@ class MojoDecryptorService : public interfaces::Decryptor {
scoped_refptr<MediaKeys> cdm_;
media::Decryptor* decryptor_;
+ // Keep a reference to VideoFrames until ReleaseSharedBuffer() is called
+ // to release it.
+ std::unordered_map<MojoHandle, scoped_refptr<VideoFrame>>
+ in_use_video_frames_;
+
base::WeakPtr<MojoDecryptorService> weak_this_;
base::WeakPtrFactory<MojoDecryptorService> weak_factory_;
« no previous file with comments | « media/mojo/services/mojo_decryptor.cc ('k') | media/mojo/services/mojo_decryptor_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698