| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BASE_ANDROID_MEDIA_DECODER_JOB_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_DECODER_JOB_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_DECODER_JOB_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_DECODER_JOB_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 "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // Callback when a decoder job finishes its work. Args: whether decode | 40 // Callback when a decoder job finishes its work. Args: whether decode |
| 41 // finished successfully, presentation time, audio output bytes. | 41 // finished successfully, presentation time, audio output bytes. |
| 42 typedef base::Callback<void(DecodeStatus, const base::TimeDelta&, | 42 typedef base::Callback<void(DecodeStatus, const base::TimeDelta&, |
| 43 size_t)> DecoderCallback; | 43 size_t)> DecoderCallback; |
| 44 | 44 |
| 45 virtual ~MediaDecoderJob(); | 45 virtual ~MediaDecoderJob(); |
| 46 | 46 |
| 47 // Called by MediaSourcePlayer when more data for this object has arrived. | 47 // Called by MediaSourcePlayer when more data for this object has arrived. |
| 48 void OnDataReceived( | 48 void OnDataReceived(const DemuxerData& data); |
| 49 const MediaPlayerHostMsg_ReadFromDemuxerAck_Params& params); | |
| 50 | 49 |
| 51 // Returns true if this object has data to decode. | 50 // Returns true if this object has data to decode. |
| 52 bool HasData() const; | 51 bool HasData() const; |
| 53 | 52 |
| 54 // Prefetch so we know the decoder job has data when we call Decode(). | 53 // Prefetch so we know the decoder job has data when we call Decode(). |
| 55 // |prefetch_cb| - Run when prefetching has completed. | 54 // |prefetch_cb| - Run when prefetching has completed. |
| 56 void Prefetch(const base::Closure& prefetch_cb); | 55 void Prefetch(const base::Closure& prefetch_cb); |
| 57 | 56 |
| 58 // Called by MediaSourcePlayer to decode some data. | 57 // Called by MediaSourcePlayer to decode some data. |
| 59 // |callback| - Run when decode operation has completed. | 58 // |callback| - Run when decode operation has completed. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // Callback to run when new data has been received. | 154 // Callback to run when new data has been received. |
| 156 base::Closure on_data_received_cb_; | 155 base::Closure on_data_received_cb_; |
| 157 | 156 |
| 158 // Callback to run when the current Decode() operation completes. | 157 // Callback to run when the current Decode() operation completes. |
| 159 DecoderCallback decode_cb_; | 158 DecoderCallback decode_cb_; |
| 160 | 159 |
| 161 // The current access unit being processed. | 160 // The current access unit being processed. |
| 162 size_t access_unit_index_; | 161 size_t access_unit_index_; |
| 163 | 162 |
| 164 // Data received over IPC from last RequestData() operation. | 163 // Data received over IPC from last RequestData() operation. |
| 165 MediaPlayerHostMsg_ReadFromDemuxerAck_Params received_data_; | 164 DemuxerData received_data_; |
| 166 | 165 |
| 167 bool stop_decode_pending_; | 166 bool stop_decode_pending_; |
| 168 | 167 |
| 169 DISALLOW_IMPLICIT_CONSTRUCTORS(MediaDecoderJob); | 168 DISALLOW_IMPLICIT_CONSTRUCTORS(MediaDecoderJob); |
| 170 }; | 169 }; |
| 171 | 170 |
| 172 } // namespace media | 171 } // namespace media |
| 173 | 172 |
| 174 #endif // MEDIA_BASE_ANDROID_MEDIA_DECODER_JOB_H_ | 173 #endif // MEDIA_BASE_ANDROID_MEDIA_DECODER_JOB_H_ |
| OLD | NEW |