Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1109)

Unified Diff: media/filters/decoder_stream.cc

Issue 1954633002: MEDIA_LOG for large encoded timestamp gaps in decoder stream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/decoder_stream.h ('k') | media/filters/decoder_stream_traits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decoder_stream.cc
diff --git a/media/filters/decoder_stream.cc b/media/filters/decoder_stream.cc
index 495fec15680f9a744280f0f2e26263557ede4f42..481b5be380cc26a9894315de16c68ae8b2d995a2 100644
--- a/media/filters/decoder_stream.cc
+++ b/media/filters/decoder_stream.cc
@@ -47,7 +47,8 @@ DecoderStream<StreamType>::DecoderStream(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
ScopedVector<Decoder> decoders,
const scoped_refptr<MediaLog>& media_log)
- : task_runner_(task_runner),
+ : traits_(media_log),
+ task_runner_(task_runner),
media_log_(media_log),
state_(STATE_UNINITIALIZED),
stream_(NULL),
@@ -110,6 +111,8 @@ void DecoderStream<StreamType>::Initialize(
waiting_for_decryption_key_cb_ = waiting_for_decryption_key_cb;
stream_ = stream;
+ traits_.OnStreamReset(stream_);
+
state_ = STATE_INITIALIZING;
SelectDecoder(cdm_context);
}
@@ -165,6 +168,7 @@ void DecoderStream<StreamType>::Reset(const base::Closure& closure) {
}
ready_outputs_.clear();
+ traits_.OnStreamReset(stream_);
// It's possible to have received a DECODE_ERROR and entered STATE_ERROR right
// before a Reset() is executed. If we are still waiting for a demuxer read,
@@ -245,7 +249,7 @@ base::TimeDelta DecoderStream<StreamType>::AverageDuration() const {
template <DemuxerStream::Type StreamType>
void DecoderStream<StreamType>::SelectDecoder(CdmContext* cdm_context) {
decoder_selector_->SelectDecoder(
- stream_, cdm_context,
+ &traits_, stream_, cdm_context,
base::Bind(&DecoderStream<StreamType>::OnDecoderSelected,
weak_factory_.GetWeakPtr()),
base::Bind(&DecoderStream<StreamType>::OnDecodeOutputReady,
@@ -360,6 +364,8 @@ void DecoderStream<StreamType>::DecodeInternal(
DCHECK(reset_cb_.is_null());
DCHECK(buffer.get());
+ traits_.OnDecode(buffer);
+
int buffer_size = buffer->end_of_stream() ? 0 : buffer->data_size();
TRACE_EVENT_ASYNC_BEGIN2(
@@ -425,7 +431,7 @@ void DecoderStream<StreamType>::OnDecodeDone(int buffer_size,
state_ = STATE_REINITIALIZING_DECODER;
decoder_selector_->SelectDecoder(
- stream_, nullptr,
+ &traits_, stream_, nullptr,
base::Bind(&DecoderStream<StreamType>::OnDecoderSelected,
weak_factory_.GetWeakPtr()),
base::Bind(&DecoderStream<StreamType>::OnDecodeOutputReady,
@@ -488,6 +494,8 @@ void DecoderStream<StreamType>::OnDecodeOutputReady(
if (!reset_cb_.is_null())
return;
+ traits_.OnDecodeDone(output);
+
++decoded_frames_since_fallback_;
// |decoder_| sucessfully decoded a frame. No need to keep buffers for a
@@ -688,7 +696,7 @@ void DecoderStream<StreamType>::ReinitializeDecoder() {
state_ = STATE_REINITIALIZING_DECODER;
// Decoders should not need a new CDM during reinitialization.
- DecoderStreamTraits<StreamType>::InitializeDecoder(
+ traits_.InitializeDecoder(
decoder_.get(), stream_, nullptr,
base::Bind(&DecoderStream<StreamType>::OnDecoderReinitialized,
weak_factory_.GetWeakPtr()),
« no previous file with comments | « media/filters/decoder_stream.h ('k') | media/filters/decoder_stream_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698