| 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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class MediaLog; | 26 class MediaLog; |
| 27 | 27 |
| 28 // Decryptor-based DemuxerStream implementation that converts a potentially | 28 // Decryptor-based DemuxerStream implementation that converts a potentially |
| 29 // encrypted demuxer stream to a clear demuxer stream. | 29 // encrypted demuxer stream to a clear demuxer stream. |
| 30 // All public APIs and callbacks are trampolined to the |task_runner_| so | 30 // All public APIs and callbacks are trampolined to the |task_runner_| so |
| 31 // that no locks are required for thread safety. | 31 // that no locks are required for thread safety. |
| 32 class MEDIA_EXPORT DecryptingDemuxerStream : public DemuxerStream { | 32 class MEDIA_EXPORT DecryptingDemuxerStream : public DemuxerStream { |
| 33 public: | 33 public: |
| 34 DecryptingDemuxerStream( | 34 DecryptingDemuxerStream( |
| 35 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 35 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 36 const scoped_refptr<MediaLog>& media_log, | 36 MediaLog* media_log, |
| 37 const base::Closure& waiting_for_decryption_key_cb); | 37 const base::Closure& waiting_for_decryption_key_cb); |
| 38 | 38 |
| 39 // Cancels all pending operations immediately and fires all pending callbacks. | 39 // Cancels all pending operations immediately and fires all pending callbacks. |
| 40 ~DecryptingDemuxerStream() override; | 40 ~DecryptingDemuxerStream() override; |
| 41 | 41 |
| 42 // |steram| must be encrypted and |cdm_context| must be non-null. | 42 // |steram| must be encrypted and |cdm_context| must be non-null. |
| 43 void Initialize(DemuxerStream* stream, | 43 void Initialize(DemuxerStream* stream, |
| 44 CdmContext* cdm_context, | 44 CdmContext* cdm_context, |
| 45 const PipelineStatusCB& status_cb); | 45 const PipelineStatusCB& status_cb); |
| 46 | 46 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 // Returns Decryptor::StreamType converted from |stream_type_|. | 96 // Returns Decryptor::StreamType converted from |stream_type_|. |
| 97 Decryptor::StreamType GetDecryptorStreamType() const; | 97 Decryptor::StreamType GetDecryptorStreamType() const; |
| 98 | 98 |
| 99 // Creates and initializes either |audio_config_| or |video_config_| based on | 99 // Creates and initializes either |audio_config_| or |video_config_| based on |
| 100 // |demuxer_stream_|. | 100 // |demuxer_stream_|. |
| 101 void InitializeDecoderConfig(); | 101 void InitializeDecoderConfig(); |
| 102 | 102 |
| 103 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 103 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 104 | 104 |
| 105 scoped_refptr<MediaLog> media_log_; | 105 MediaLog* media_log_; |
| 106 | 106 |
| 107 State state_; | 107 State state_; |
| 108 | 108 |
| 109 PipelineStatusCB init_cb_; | 109 PipelineStatusCB init_cb_; |
| 110 ReadCB read_cb_; | 110 ReadCB read_cb_; |
| 111 base::Closure reset_cb_; | 111 base::Closure reset_cb_; |
| 112 base::Closure waiting_for_decryption_key_cb_; | 112 base::Closure waiting_for_decryption_key_cb_; |
| 113 | 113 |
| 114 // Pointer to the input demuxer stream that will feed us encrypted buffers. | 114 // Pointer to the input demuxer stream that will feed us encrypted buffers. |
| 115 DemuxerStream* demuxer_stream_; | 115 DemuxerStream* demuxer_stream_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 130 | 130 |
| 131 base::WeakPtr<DecryptingDemuxerStream> weak_this_; | 131 base::WeakPtr<DecryptingDemuxerStream> weak_this_; |
| 132 base::WeakPtrFactory<DecryptingDemuxerStream> weak_factory_; | 132 base::WeakPtrFactory<DecryptingDemuxerStream> weak_factory_; |
| 133 | 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(DecryptingDemuxerStream); | 134 DISALLOW_COPY_AND_ASSIGN(DecryptingDemuxerStream); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 } // namespace media | 137 } // namespace media |
| 138 | 138 |
| 139 #endif // MEDIA_FILTERS_DECRYPTING_DEMUXER_STREAM_H_ | 139 #endif // MEDIA_FILTERS_DECRYPTING_DEMUXER_STREAM_H_ |
| OLD | NEW |