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_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ |
6 #define MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ | 6 #define MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "media/base/decryptor.h" | 10 #include "media/base/decryptor.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class Decryptor; | 21 class Decryptor; |
22 | 22 |
23 // Decryptor-based VideoDecoder implementation that can decrypt and decode | 23 // Decryptor-based VideoDecoder implementation that can decrypt and decode |
24 // encrypted video buffers and return decrypted and decompressed video frames. | 24 // encrypted video buffers and return decrypted and decompressed video frames. |
25 // All public APIs and callbacks are trampolined to the |task_runner_| so | 25 // All public APIs and callbacks are trampolined to the |task_runner_| so |
26 // that no locks are required for thread safety. | 26 // that no locks are required for thread safety. |
27 class MEDIA_EXPORT DecryptingVideoDecoder : public VideoDecoder { | 27 class MEDIA_EXPORT DecryptingVideoDecoder : public VideoDecoder { |
28 public: | 28 public: |
29 DecryptingVideoDecoder( | 29 DecryptingVideoDecoder( |
30 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 30 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
31 const SetDecryptorReadyCB& set_decryptor_ready_cb); | 31 const SetDecryptorReadyCB& set_decryptor_ready_cb, |
| 32 const base::Closure& waiting_for_decryption_key_cb); |
32 ~DecryptingVideoDecoder() override; | 33 ~DecryptingVideoDecoder() override; |
33 | 34 |
34 // VideoDecoder implementation. | 35 // VideoDecoder implementation. |
35 std::string GetDisplayName() const override; | 36 std::string GetDisplayName() const override; |
36 void Initialize(const VideoDecoderConfig& config, | 37 void Initialize(const VideoDecoderConfig& config, |
37 bool low_delay, | 38 bool low_delay, |
38 const PipelineStatusCB& status_cb, | 39 const PipelineStatusCB& status_cb, |
39 const OutputCB& output_cb) override; | 40 const OutputCB& output_cb) override; |
40 void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 41 void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
41 const DecodeCB& decode_cb) override; | 42 const DecodeCB& decode_cb) override; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void DoReset(); | 82 void DoReset(); |
82 | 83 |
83 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 84 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
84 | 85 |
85 State state_; | 86 State state_; |
86 | 87 |
87 PipelineStatusCB init_cb_; | 88 PipelineStatusCB init_cb_; |
88 OutputCB output_cb_; | 89 OutputCB output_cb_; |
89 DecodeCB decode_cb_; | 90 DecodeCB decode_cb_; |
90 base::Closure reset_cb_; | 91 base::Closure reset_cb_; |
| 92 base::Closure waiting_for_decryption_key_cb_; |
91 | 93 |
92 VideoDecoderConfig config_; | 94 VideoDecoderConfig config_; |
93 | 95 |
94 // Callback to request/cancel decryptor creation notification. | 96 // Callback to request/cancel decryptor creation notification. |
95 SetDecryptorReadyCB set_decryptor_ready_cb_; | 97 SetDecryptorReadyCB set_decryptor_ready_cb_; |
96 | 98 |
97 Decryptor* decryptor_; | 99 Decryptor* decryptor_; |
98 | 100 |
99 // The buffer that needs decrypting/decoding. | 101 // The buffer that needs decrypting/decoding. |
100 scoped_refptr<media::DecoderBuffer> pending_buffer_to_decode_; | 102 scoped_refptr<media::DecoderBuffer> pending_buffer_to_decode_; |
(...skipping 11 matching lines...) Expand all Loading... |
112 | 114 |
113 base::WeakPtr<DecryptingVideoDecoder> weak_this_; | 115 base::WeakPtr<DecryptingVideoDecoder> weak_this_; |
114 base::WeakPtrFactory<DecryptingVideoDecoder> weak_factory_; | 116 base::WeakPtrFactory<DecryptingVideoDecoder> weak_factory_; |
115 | 117 |
116 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); | 118 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); |
117 }; | 119 }; |
118 | 120 |
119 } // namespace media | 121 } // namespace media |
120 | 122 |
121 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ | 123 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ |
OLD | NEW |