| 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 16 matching lines...) Expand all Loading... |
| 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 void Initialize(const VideoDecoderConfig& config, | 35 virtual void Initialize(const VideoDecoderConfig& config, |
| 36 bool live_mode, | 36 bool live_mode, |
| 37 const PipelineStatusCB& status_cb) OVERRIDE; | 37 const PipelineStatusCB& status_cb, |
| 38 const OutputCB& output_cb) OVERRIDE; |
| 38 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 39 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
| 39 const DecodeCB& decode_cb) OVERRIDE; | 40 const DecodeCB& decode_cb) OVERRIDE; |
| 40 virtual void Reset(const base::Closure& closure) OVERRIDE; | 41 virtual void Reset(const base::Closure& closure) OVERRIDE; |
| 41 virtual void Stop() OVERRIDE; | 42 virtual void Stop() OVERRIDE; |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 // 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 |
| 45 // 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 |
| 46 // stabilizes. | 47 // stabilizes. |
| 47 enum State { | 48 enum State { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 77 void DoReset(); | 78 void DoReset(); |
| 78 | 79 |
| 79 // Free decoder resources and call |stop_cb_|. | 80 // Free decoder resources and call |stop_cb_|. |
| 80 void DoStop(); | 81 void DoStop(); |
| 81 | 82 |
| 82 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 83 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 83 | 84 |
| 84 State state_; | 85 State state_; |
| 85 | 86 |
| 86 PipelineStatusCB init_cb_; | 87 PipelineStatusCB init_cb_; |
| 88 OutputCB output_cb_; |
| 87 DecodeCB decode_cb_; | 89 DecodeCB decode_cb_; |
| 88 base::Closure reset_cb_; | 90 base::Closure reset_cb_; |
| 89 | 91 |
| 90 VideoDecoderConfig config_; | 92 VideoDecoderConfig config_; |
| 91 | 93 |
| 92 // Callback to request/cancel decryptor creation notification. | 94 // Callback to request/cancel decryptor creation notification. |
| 93 SetDecryptorReadyCB set_decryptor_ready_cb_; | 95 SetDecryptorReadyCB set_decryptor_ready_cb_; |
| 94 | 96 |
| 95 Decryptor* decryptor_; | 97 Decryptor* decryptor_; |
| 96 | 98 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 111 // NOTE: Weak pointers must be invalidated before all other member variables. | 113 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 112 base::WeakPtrFactory<DecryptingVideoDecoder> weak_factory_; | 114 base::WeakPtrFactory<DecryptingVideoDecoder> weak_factory_; |
| 113 base::WeakPtr<DecryptingVideoDecoder> weak_this_; | 115 base::WeakPtr<DecryptingVideoDecoder> weak_this_; |
| 114 | 116 |
| 115 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); | 117 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); |
| 116 }; | 118 }; |
| 117 | 119 |
| 118 } // namespace media | 120 } // namespace media |
| 119 | 121 |
| 120 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ | 122 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ |
| OLD | NEW |