| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 // Decryptor-based DemuxerStream implementation that converts a potentially | 27 // Decryptor-based DemuxerStream implementation that converts a potentially |
| 28 // encrypted demuxer stream to a clear demuxer stream. | 28 // encrypted demuxer stream to a clear demuxer stream. |
| 29 // All public APIs and callbacks are trampolined to the |task_runner_| so | 29 // All public APIs and callbacks are trampolined to the |task_runner_| so |
| 30 // that no locks are required for thread safety. | 30 // that no locks are required for thread safety. |
| 31 class MEDIA_EXPORT DecryptingDemuxerStream : public DemuxerStream { | 31 class MEDIA_EXPORT DecryptingDemuxerStream : public DemuxerStream { |
| 32 public: | 32 public: |
| 33 DecryptingDemuxerStream( | 33 DecryptingDemuxerStream( |
| 34 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 34 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 35 const scoped_refptr<MediaLog>& media_log, | 35 const scoped_refptr<MediaLog>& media_log, |
| 36 const SetCdmReadyCB& set_cdm_ready_cb, |
| 36 const base::Closure& waiting_for_decryption_key_cb); | 37 const base::Closure& waiting_for_decryption_key_cb); |
| 37 | 38 |
| 38 // Cancels all pending operations immediately and fires all pending callbacks. | 39 // Cancels all pending operations immediately and fires all pending callbacks. |
| 39 ~DecryptingDemuxerStream() override; | 40 ~DecryptingDemuxerStream() override; |
| 40 | 41 |
| 41 void Initialize(DemuxerStream* stream, | 42 void Initialize(DemuxerStream* stream, const PipelineStatusCB& status_cb); |
| 42 const SetCdmReadyCB& set_cdm_ready_cb, | |
| 43 const PipelineStatusCB& status_cb); | |
| 44 | 43 |
| 45 // Cancels all pending operations and fires all pending callbacks. If in | 44 // Cancels all pending operations and fires all pending callbacks. If in |
| 46 // kPendingDemuxerRead or kPendingDecrypt state, waits for the pending | 45 // kPendingDemuxerRead or kPendingDecrypt state, waits for the pending |
| 47 // operation to finish before satisfying |closure|. Sets the state to | 46 // operation to finish before satisfying |closure|. Sets the state to |
| 48 // kUninitialized if |this| hasn't been initialized, or to kIdle otherwise. | 47 // kUninitialized if |this| hasn't been initialized, or to kIdle otherwise. |
| 49 void Reset(const base::Closure& closure); | 48 void Reset(const base::Closure& closure); |
| 50 | 49 |
| 51 // Returns the name of this class for logging purpose. | 50 // Returns the name of this class for logging purpose. |
| 52 std::string GetDisplayName() const; | 51 std::string GetDisplayName() const; |
| 53 | 52 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 135 |
| 137 base::WeakPtr<DecryptingDemuxerStream> weak_this_; | 136 base::WeakPtr<DecryptingDemuxerStream> weak_this_; |
| 138 base::WeakPtrFactory<DecryptingDemuxerStream> weak_factory_; | 137 base::WeakPtrFactory<DecryptingDemuxerStream> weak_factory_; |
| 139 | 138 |
| 140 DISALLOW_COPY_AND_ASSIGN(DecryptingDemuxerStream); | 139 DISALLOW_COPY_AND_ASSIGN(DecryptingDemuxerStream); |
| 141 }; | 140 }; |
| 142 | 141 |
| 143 } // namespace media | 142 } // namespace media |
| 144 | 143 |
| 145 #endif // MEDIA_FILTERS_DECRYPTING_DEMUXER_STREAM_H_ | 144 #endif // MEDIA_FILTERS_DECRYPTING_DEMUXER_STREAM_H_ |
| OLD | NEW |