| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FILTERS_DECRYPTING_DEMUXER_STREAM_H_ | 5 #ifndef MEDIA_FILTERS_DECRYPTING_DEMUXER_STREAM_H_ |
| 6 #define MEDIA_FILTERS_DECRYPTING_DEMUXER_STREAM_H_ | 6 #define MEDIA_FILTERS_DECRYPTING_DEMUXER_STREAM_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // TODO(xhwang): Update this diagram for DecryptingDemuxerStream. | 60 // TODO(xhwang): Update this diagram for DecryptingDemuxerStream. |
| 61 enum State { | 61 enum State { |
| 62 kUninitialized = 0, | 62 kUninitialized = 0, |
| 63 kDecryptorRequested, | 63 kDecryptorRequested, |
| 64 kIdle, | 64 kIdle, |
| 65 kPendingDemuxerRead, | 65 kPendingDemuxerRead, |
| 66 kPendingDecrypt, | 66 kPendingDecrypt, |
| 67 kWaitingForKey | 67 kWaitingForKey |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 // Callback for DecryptorHost::RequestDecryptor(). | 70 // Callback for DecryptorHost::RequestDecryptor(). |insert_done_cb| is called |
| 71 void SetDecryptor(Decryptor* decryptor); | 71 // when the decryptor has been completely inserted into the pipeline. |
| 72 void SetDecryptor(Decryptor* decryptor, |
| 73 const DecryptorInsertedCB& insert_done_cb); |
| 72 | 74 |
| 73 // Callback for DemuxerStream::Read(). | 75 // Callback for DemuxerStream::Read(). |
| 74 void DecryptBuffer(DemuxerStream::Status status, | 76 void DecryptBuffer(DemuxerStream::Status status, |
| 75 const scoped_refptr<DecoderBuffer>& buffer); | 77 const scoped_refptr<DecoderBuffer>& buffer); |
| 76 | 78 |
| 77 void DecryptPendingBuffer(); | 79 void DecryptPendingBuffer(); |
| 78 | 80 |
| 79 // Callback for Decryptor::Decrypt(). | 81 // Callback for Decryptor::Decrypt(). |
| 80 void DeliverBuffer(Decryptor::Status status, | 82 void DeliverBuffer(Decryptor::Status status, |
| 81 const scoped_refptr<DecoderBuffer>& decrypted_buffer); | 83 const scoped_refptr<DecoderBuffer>& decrypted_buffer); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // NOTE: Weak pointers must be invalidated before all other member variables. | 127 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 126 base::WeakPtrFactory<DecryptingDemuxerStream> weak_factory_; | 128 base::WeakPtrFactory<DecryptingDemuxerStream> weak_factory_; |
| 127 base::WeakPtr<DecryptingDemuxerStream> weak_this_; | 129 base::WeakPtr<DecryptingDemuxerStream> weak_this_; |
| 128 | 130 |
| 129 DISALLOW_COPY_AND_ASSIGN(DecryptingDemuxerStream); | 131 DISALLOW_COPY_AND_ASSIGN(DecryptingDemuxerStream); |
| 130 }; | 132 }; |
| 131 | 133 |
| 132 } // namespace media | 134 } // namespace media |
| 133 | 135 |
| 134 #endif // MEDIA_FILTERS_DECRYPTING_DEMUXER_STREAM_H_ | 136 #endif // MEDIA_FILTERS_DECRYPTING_DEMUXER_STREAM_H_ |
| OLD | NEW |