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 14 matching lines...) Expand all Loading... |
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 virtual ~DecryptingVideoDecoder(); | 32 virtual ~DecryptingVideoDecoder(); |
33 | 33 |
34 // VideoDecoder implementation. | 34 // VideoDecoder implementation. |
35 virtual std::string GetDisplayName() const OVERRIDE; | 35 virtual std::string GetDisplayName() const override; |
36 virtual void Initialize(const VideoDecoderConfig& config, | 36 virtual 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) override; |
40 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 40 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
41 const DecodeCB& decode_cb) OVERRIDE; | 41 const DecodeCB& decode_cb) override; |
42 virtual void Reset(const base::Closure& closure) OVERRIDE; | 42 virtual void Reset(const base::Closure& closure) override; |
43 | 43 |
44 private: | 44 private: |
45 // For a detailed state diagram please see this link: http://goo.gl/8jAok | 45 // For a detailed state diagram please see this link: http://goo.gl/8jAok |
46 // TODO(xhwang): Add a ASCII state diagram in this file after this class | 46 // TODO(xhwang): Add a ASCII state diagram in this file after this class |
47 // stabilizes. | 47 // stabilizes. |
48 enum State { | 48 enum State { |
49 kUninitialized = 0, | 49 kUninitialized = 0, |
50 kDecryptorRequested, | 50 kDecryptorRequested, |
51 kPendingDecoderInit, | 51 kPendingDecoderInit, |
52 kIdle, | 52 kIdle, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // NOTE: Weak pointers must be invalidated before all other member variables. | 111 // NOTE: Weak pointers must be invalidated before all other member variables. |
112 base::WeakPtrFactory<DecryptingVideoDecoder> weak_factory_; | 112 base::WeakPtrFactory<DecryptingVideoDecoder> weak_factory_; |
113 base::WeakPtr<DecryptingVideoDecoder> weak_this_; | 113 base::WeakPtr<DecryptingVideoDecoder> weak_this_; |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); | 115 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); |
116 }; | 116 }; |
117 | 117 |
118 } // namespace media | 118 } // namespace media |
119 | 119 |
120 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ | 120 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ |
OLD | NEW |