OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_MOJO_SERVICES_MOJO_DECRYPTOR_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_DECRYPTOR_H_ |
6 #define MEDIA_MOJO_SERVICES_MOJO_DECRYPTOR_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_DECRYPTOR_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void OnBufferDecrypted(const DecryptCB& decrypt_cb, | 50 void OnBufferDecrypted(const DecryptCB& decrypt_cb, |
51 interfaces::Decryptor::Status status, | 51 interfaces::Decryptor::Status status, |
52 interfaces::DecoderBufferPtr buffer); | 52 interfaces::DecoderBufferPtr buffer); |
53 void OnAudioDecoded(const AudioDecodeCB& audio_decode_cb, | 53 void OnAudioDecoded(const AudioDecodeCB& audio_decode_cb, |
54 interfaces::Decryptor::Status status, | 54 interfaces::Decryptor::Status status, |
55 mojo::Array<interfaces::AudioBufferPtr> audio_buffers); | 55 mojo::Array<interfaces::AudioBufferPtr> audio_buffers); |
56 void OnVideoDecoded(const VideoDecodeCB& video_decode_cb, | 56 void OnVideoDecoded(const VideoDecodeCB& video_decode_cb, |
57 interfaces::Decryptor::Status status, | 57 interfaces::Decryptor::Status status, |
58 interfaces::VideoFramePtr video_frame); | 58 interfaces::VideoFramePtr video_frame); |
59 | 59 |
| 60 // Called when done with a VideoFrame in order to reuse the shared memory. |
| 61 void ReleaseSharedBuffer(mojo::ScopedSharedBufferHandle buffer, |
| 62 size_t buffer_size); |
| 63 |
60 // To pass DecoderBuffers to and from the MojoDecryptorService, 2 data pipes | 64 // To pass DecoderBuffers to and from the MojoDecryptorService, 2 data pipes |
61 // are required (one each way). At initialization both pipes are created, | 65 // are required (one each way). At initialization both pipes are created, |
62 // and then the handles are passed to the MojoDecryptorService. | 66 // and then the handles are passed to the MojoDecryptorService. |
63 void CreateDataPipes(); | 67 void CreateDataPipes(); |
64 | 68 |
65 // Helper functions to write and read a DecoderBuffer. | 69 // Helper functions to write and read a DecoderBuffer. |
66 interfaces::DecoderBufferPtr TransferDecoderBuffer( | 70 interfaces::DecoderBufferPtr TransferDecoderBuffer( |
67 const scoped_refptr<DecoderBuffer>& buffer); | 71 const scoped_refptr<DecoderBuffer>& buffer); |
68 scoped_refptr<DecoderBuffer> ReadDecoderBuffer( | 72 scoped_refptr<DecoderBuffer> ReadDecoderBuffer( |
69 interfaces::DecoderBufferPtr buffer); | 73 interfaces::DecoderBufferPtr buffer); |
(...skipping 10 matching lines...) Expand all Loading... |
80 NewKeyCB new_video_key_cb_; | 84 NewKeyCB new_video_key_cb_; |
81 | 85 |
82 base::WeakPtrFactory<MojoDecryptor> weak_factory_; | 86 base::WeakPtrFactory<MojoDecryptor> weak_factory_; |
83 | 87 |
84 DISALLOW_COPY_AND_ASSIGN(MojoDecryptor); | 88 DISALLOW_COPY_AND_ASSIGN(MojoDecryptor); |
85 }; | 89 }; |
86 | 90 |
87 } // namespace media | 91 } // namespace media |
88 | 92 |
89 #endif // MEDIA_MOJO_SERVICES_MOJO_DECRYPTOR_H_ | 93 #endif // MEDIA_MOJO_SERVICES_MOJO_DECRYPTOR_H_ |
OLD | NEW |