| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 kDecryptorRequested, | 67 kDecryptorRequested, |
| 68 kPendingDecoderInit, | 68 kPendingDecoderInit, |
| 69 kIdle, | 69 kIdle, |
| 70 kPendingDemuxerRead, | 70 kPendingDemuxerRead, |
| 71 kPendingDecode, | 71 kPendingDecode, |
| 72 kWaitingForKey, | 72 kWaitingForKey, |
| 73 kDecodeFinished, | 73 kDecodeFinished, |
| 74 kStopped | 74 kStopped |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 // Carries out the initialization operation scheduled by Initialize(). | |
| 78 void DoInitialize(const scoped_refptr<DemuxerStream>& stream, | |
| 79 const PipelineStatusCB& status_cb, | |
| 80 const StatisticsCB& statistics_cb); | |
| 81 | |
| 82 // Callback for DecryptorHost::RequestDecryptor(). | 77 // Callback for DecryptorHost::RequestDecryptor(). |
| 83 void SetDecryptor(Decryptor* decryptor); | 78 void SetDecryptor(Decryptor* decryptor); |
| 84 | 79 |
| 85 // Callback for Decryptor::InitializeVideoDecoder(). | 80 // Callback for Decryptor::InitializeVideoDecoder(). |
| 86 void FinishInitialization(bool success); | 81 void FinishInitialization(bool success); |
| 87 | 82 |
| 88 // Carries out the buffer reading operation scheduled by Read(). | |
| 89 void DoRead(const ReadCB& read_cb); | |
| 90 | |
| 91 void ReadFromDemuxerStream(); | 83 void ReadFromDemuxerStream(); |
| 92 | 84 |
| 93 // Callback for DemuxerStream::Read(). | 85 // Callback for DemuxerStream::Read(). |
| 94 void DoDecryptAndDecodeBuffer(DemuxerStream::Status status, | 86 void DecryptAndDecodeBuffer(DemuxerStream::Status status, |
| 95 const scoped_refptr<DecoderBuffer>& buffer); | 87 const scoped_refptr<DecoderBuffer>& buffer); |
| 96 | 88 |
| 97 void DecodePendingBuffer(); | 89 void DecodePendingBuffer(); |
| 98 | 90 |
| 99 // Callback for Decryptor::DecryptAndDecodeVideo(). | 91 // Callback for Decryptor::DecryptAndDecodeVideo(). |
| 100 void DeliverFrame(int buffer_size, | 92 void DeliverFrame(int buffer_size, |
| 101 Decryptor::Status status, | 93 Decryptor::Status status, |
| 102 const scoped_refptr<VideoFrame>& frame); | 94 const scoped_refptr<VideoFrame>& frame); |
| 103 | 95 |
| 104 // Carries out the frame delivery operation scheduled by DeliverFrame(). | |
| 105 void DoDeliverFrame(int buffer_size, | |
| 106 Decryptor::Status status, | |
| 107 const scoped_refptr<VideoFrame>& frame); | |
| 108 | |
| 109 // Callback for the |decryptor_| to notify this object that a new key has been | 96 // Callback for the |decryptor_| to notify this object that a new key has been |
| 110 // added. | 97 // added. |
| 111 void OnKeyAdded(); | 98 void OnKeyAdded(); |
| 112 | 99 |
| 113 // Reset decoder and call |reset_cb_|. | 100 // Reset decoder and call |reset_cb_|. |
| 114 void DoReset(); | 101 void DoReset(); |
| 115 | 102 |
| 116 // Free decoder resources and call |stop_cb_|. | 103 // Free decoder resources and call |stop_cb_|. |
| 117 void DoStop(); | 104 void DoStop(); |
| 118 | 105 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 146 // A unique ID to trace Decryptor::DecryptAndDecodeVideo() call and the | 133 // A unique ID to trace Decryptor::DecryptAndDecodeVideo() call and the |
| 147 // matching DecryptCB call (in DoDeliverFrame()). | 134 // matching DecryptCB call (in DoDeliverFrame()). |
| 148 uint32 trace_id_; | 135 uint32 trace_id_; |
| 149 | 136 |
| 150 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); | 137 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); |
| 151 }; | 138 }; |
| 152 | 139 |
| 153 } // namespace media | 140 } // namespace media |
| 154 | 141 |
| 155 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ | 142 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ |
| OLD | NEW |