| 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 13 matching lines...) Expand all Loading... |
| 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 |message_loop_| so | 25 // All public APIs and callbacks are trampolined to the |message_loop_| so |
| 26 // that no locks are required for thread safety. | 26 // that no locks are required for thread safety. |
| 27 // | 27 // |
| 28 // TODO(xhwang): For now, DecryptingVideoDecoder relies on the decryptor to do | 28 // TODO(xhwang): For now, DecryptingVideoDecoder relies on the decryptor to do |
| 29 // both decryption and video decoding. Add the path to use the decryptor for | 29 // both decryption and video decoding. Add the path to use the decryptor for |
| 30 // decryption only and use other VideoDecoder implementations within | 30 // decryption only and use other VideoDecoder implementations within |
| 31 // DecryptingVideoDecoder for video decoding. | 31 // DecryptingVideoDecoder for video decoding. |
| 32 class MEDIA_EXPORT DecryptingVideoDecoder : public VideoDecoder { | 32 class MEDIA_EXPORT DecryptingVideoDecoder : public VideoDecoder { |
| 33 public: | 33 public: |
| 34 // Callback to notify decryptor creation. | |
| 35 typedef base::Callback<void(Decryptor*)> DecryptorNotificationCB; | |
| 36 // Callback to request/cancel decryptor creation notification. | |
| 37 // Calling this callback with a non-null callback registers decryptor creation | |
| 38 // notification. When the decryptor is created, notification will be sent | |
| 39 // through the provided callback. | |
| 40 // Calling this callback with a null callback cancels previously registered | |
| 41 // decryptor creation notification. Any previously provided callback will be | |
| 42 // fired immediately with NULL. | |
| 43 typedef base::Callback<void(const DecryptorNotificationCB&)> | |
| 44 RequestDecryptorNotificationCB; | |
| 45 | |
| 46 DecryptingVideoDecoder( | 34 DecryptingVideoDecoder( |
| 47 const scoped_refptr<base::MessageLoopProxy>& message_loop, | 35 const scoped_refptr<base::MessageLoopProxy>& message_loop, |
| 48 const RequestDecryptorNotificationCB& request_decryptor_notification_cb); | 36 const RequestDecryptorNotificationCB& request_decryptor_notification_cb); |
| 49 | 37 |
| 50 // VideoDecoder implementation. | 38 // VideoDecoder implementation. |
| 51 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 39 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
| 52 const PipelineStatusCB& status_cb, | 40 const PipelineStatusCB& status_cb, |
| 53 const StatisticsCB& statistics_cb) OVERRIDE; | 41 const StatisticsCB& statistics_cb) OVERRIDE; |
| 54 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 42 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
| 55 virtual void Reset(const base::Closure& closure) OVERRIDE; | 43 virtual void Reset(const base::Closure& closure) OVERRIDE; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // A unique ID to trace Decryptor::DecryptAndDecodeVideo() call and the | 134 // A unique ID to trace Decryptor::DecryptAndDecodeVideo() call and the |
| 147 // matching DecryptCB call (in DoDeliverFrame()). | 135 // matching DecryptCB call (in DoDeliverFrame()). |
| 148 uint32 trace_id_; | 136 uint32 trace_id_; |
| 149 | 137 |
| 150 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); | 138 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); |
| 151 }; | 139 }; |
| 152 | 140 |
| 153 } // namespace media | 141 } // namespace media |
| 154 | 142 |
| 155 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ | 143 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ |
| OLD | NEW |