| 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/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "media/base/decryptor.h" | 10 #include "media/base/decryptor.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 virtual void Reset(const base::Closure& closure) OVERRIDE; | 58 virtual void Reset(const base::Closure& closure) OVERRIDE; |
| 59 virtual void Stop(const base::Closure& closure) OVERRIDE; | 59 virtual void Stop(const base::Closure& closure) OVERRIDE; |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 virtual ~DecryptingVideoDecoder(); | 62 virtual ~DecryptingVideoDecoder(); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 // For a detailed state diagram please see this link: http://goo.gl/8jAok | 65 // For a detailed state diagram please see this link: http://goo.gl/8jAok |
| 66 // TODO(xhwang): Add a ASCII state diagram in this file after this class | 66 // TODO(xhwang): Add a ASCII state diagram in this file after this class |
| 67 // stabilizes. | 67 // stabilizes. |
| 68 enum DecoderState { | 68 enum State { |
| 69 kUninitialized = 0, | 69 kUninitialized = 0, |
| 70 kDecryptorRequested, | 70 kDecryptorRequested, |
| 71 kPendingDecoderInit, | 71 kPendingDecoderInit, |
| 72 kIdle, | 72 kIdle, |
| 73 kPendingDemuxerRead, | 73 kPendingDemuxerRead, |
| 74 kPendingDecode, | 74 kPendingDecode, |
| 75 kWaitingForKey, | 75 kWaitingForKey, |
| 76 kDecodeFinished, | 76 kDecodeFinished, |
| 77 kStopped | 77 kStopped |
| 78 }; | 78 }; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 // Free decoder resources and call |stop_cb_|. | 124 // Free decoder resources and call |stop_cb_|. |
| 125 void DoStop(); | 125 void DoStop(); |
| 126 | 126 |
| 127 // This is !is_null() iff Initialize() hasn't been called. | 127 // This is !is_null() iff Initialize() hasn't been called. |
| 128 MessageLoopFactoryCB message_loop_factory_cb_; | 128 MessageLoopFactoryCB message_loop_factory_cb_; |
| 129 | 129 |
| 130 scoped_refptr<base::MessageLoopProxy> message_loop_; | 130 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 131 | 131 |
| 132 // Current state of the DecryptingVideoDecoder. | 132 // Current state of the DecryptingVideoDecoder. |
| 133 DecoderState state_; | 133 State state_; |
| 134 | 134 |
| 135 PipelineStatusCB init_cb_; | 135 PipelineStatusCB init_cb_; |
| 136 StatisticsCB statistics_cb_; | 136 StatisticsCB statistics_cb_; |
| 137 ReadCB read_cb_; | 137 ReadCB read_cb_; |
| 138 base::Closure reset_cb_; | 138 base::Closure reset_cb_; |
| 139 | 139 |
| 140 // Pointer to the demuxer stream that will feed us compressed buffers. | 140 // Pointer to the demuxer stream that will feed us compressed buffers. |
| 141 scoped_refptr<DemuxerStream> demuxer_stream_; | 141 scoped_refptr<DemuxerStream> demuxer_stream_; |
| 142 | 142 |
| 143 // Callback to request/cancel decryptor creation notification. | 143 // Callback to request/cancel decryptor creation notification. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 154 // decrypting/decoding again in case the newly added key is the correct | 154 // decrypting/decoding again in case the newly added key is the correct |
| 155 // decryption key. | 155 // decryption key. |
| 156 bool key_added_while_pending_decode_; | 156 bool key_added_while_pending_decode_; |
| 157 | 157 |
| 158 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); | 158 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 } // namespace media | 161 } // namespace media |
| 162 | 162 |
| 163 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ | 163 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ |
| OLD | NEW |