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 18 matching lines...) Expand all Loading... |
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 ~DecryptingVideoDecoder() override; | 32 ~DecryptingVideoDecoder() override; |
33 | 33 |
34 // VideoDecoder implementation. | 34 // VideoDecoder implementation. |
35 std::string GetDisplayName() const override; | 35 std::string GetDisplayName() const override; |
36 void Initialize(const VideoDecoderConfig& config, | 36 void Initialize(const VideoDecoderConfig& config, |
37 bool low_delay, | 37 bool low_delay, |
38 const PipelineStatusCB& status_cb, | 38 const PipelineStatusCB& status_cb, |
39 const OutputCB& output_cb) override; | 39 const OutputCB& output_cb, |
| 40 const base::Closure& waiting_for_encryption_key_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; |
42 void Reset(const base::Closure& closure) override; | 43 void Reset(const base::Closure& closure) override; |
43 | 44 |
44 static const char kDecoderName[]; | 45 static const char kDecoderName[]; |
45 | 46 |
46 private: | 47 private: |
47 // For a detailed state diagram please see this link: http://goo.gl/8jAok | 48 // For a detailed state diagram please see this link: http://goo.gl/8jAok |
48 // TODO(xhwang): Add a ASCII state diagram in this file after this class | 49 // TODO(xhwang): Add a ASCII state diagram in this file after this class |
49 // stabilizes. | 50 // stabilizes. |
(...skipping 31 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_encryption_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 |