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

Side by Side Diff: media/base/android/media_decoder_job.cc

Issue 699763002: Fix an issue that a browser seek is requested after decoder draining is interrupted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/base/android/media_source_player_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "media/base/android/media_decoder_job.h" 5 #include "media/base/android/media_decoder_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 bool MediaDecoderJob::Decode( 113 bool MediaDecoderJob::Decode(
114 base::TimeTicks start_time_ticks, 114 base::TimeTicks start_time_ticks,
115 base::TimeDelta start_presentation_timestamp, 115 base::TimeDelta start_presentation_timestamp,
116 const DecoderCallback& callback) { 116 const DecoderCallback& callback) {
117 DCHECK(decode_cb_.is_null()); 117 DCHECK(decode_cb_.is_null());
118 DCHECK(data_received_cb_.is_null()); 118 DCHECK(data_received_cb_.is_null());
119 DCHECK(ui_task_runner_->BelongsToCurrentThread()); 119 DCHECK(ui_task_runner_->BelongsToCurrentThread());
120 if (!media_codec_bridge_ || need_to_reconfig_decoder_job_) { 120 if (!media_codec_bridge_ || need_to_reconfig_decoder_job_) {
121 if (drain_decoder_)
122 OnDecoderDrained();
121 need_to_reconfig_decoder_job_ = !CreateMediaCodecBridge(); 123 need_to_reconfig_decoder_job_ = !CreateMediaCodecBridge();
122 if (drain_decoder_) {
123 // Decoder has been recreated, stop draining.
124 drain_decoder_ = false;
125 input_eos_encountered_ = false;
126 output_eos_encountered_ = false;
127 access_unit_index_[current_demuxer_data_index_]++;
128 }
129 skip_eos_enqueue_ = true; 124 skip_eos_enqueue_ = true;
130 if (need_to_reconfig_decoder_job_) 125 if (need_to_reconfig_decoder_job_)
131 return false; 126 return false;
132 } 127 }
133 128
134 decode_cb_ = callback; 129 decode_cb_ = callback;
135 130
136 if (!HasData()) { 131 if (!HasData()) {
137 RequestData(base::Bind(&MediaDecoderJob::DecodeCurrentAccessUnit, 132 RequestData(base::Bind(&MediaDecoderJob::DecodeCurrentAccessUnit,
138 base::Unretained(this), 133 base::Unretained(this),
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 659
665 void MediaDecoderJob::ReleaseMediaCodecBridge() { 660 void MediaDecoderJob::ReleaseMediaCodecBridge() {
666 if (!media_codec_bridge_) 661 if (!media_codec_bridge_)
667 return; 662 return;
668 663
669 media_codec_bridge_.reset(); 664 media_codec_bridge_.reset();
670 input_buf_index_ = -1; 665 input_buf_index_ = -1;
671 } 666 }
672 667
673 } // namespace media 668 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/android/media_source_player_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698