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

Side by Side Diff: media/filters/gpu_video_decoder.cc

Issue 1560983002: Fix MP4 mid-stream resolution changes for MSE on android spitzer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
OLDNEW
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 #include "media/filters/gpu_video_decoder.h" 5 #include "media/filters/gpu_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 170 }
171 171
172 config_ = config; 172 config_ = config;
173 needs_all_picture_buffers_to_decode_ = 173 needs_all_picture_buffers_to_decode_ =
174 capabilities.flags & 174 capabilities.flags &
175 VideoDecodeAccelerator::Capabilities::NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE; 175 VideoDecodeAccelerator::Capabilities::NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE;
176 needs_bitstream_conversion_ = (config.codec() == kCodecH264); 176 needs_bitstream_conversion_ = (config.codec() == kCodecH264);
177 output_cb_ = BindToCurrentLoop(output_cb); 177 output_cb_ = BindToCurrentLoop(output_cb);
178 178
179 if (previously_initialized) { 179 if (previously_initialized) {
180 DVLOG(3) << __FUNCTION__
181 << " Expecting initialized VDA to detect in-stream config change.";
180 // Reinitialization with a different config (but same codec and profile). 182 // Reinitialization with a different config (but same codec and profile).
181 // VDA should handle it by detecting this in-stream by itself, 183 // VDA should handle it by detecting this in-stream by itself,
182 // no need to notify it. 184 // no need to notify it.
183 bound_init_cb.Run(true); 185 bound_init_cb.Run(true);
184 return; 186 return;
185 } 187 }
186 188
187 vda_ = factories_->CreateVideoDecodeAccelerator(); 189 vda_ = factories_->CreateVideoDecodeAccelerator();
188 190
189 VideoDecodeAccelerator::Config vda_config(config); 191 VideoDecodeAccelerator::Config vda_config(config);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 break; 285 break;
284 case kDrainingDecoder: 286 case kDrainingDecoder:
285 case kError: 287 case kError:
286 NOTREACHED(); 288 NOTREACHED();
287 return; 289 return;
288 } 290 }
289 291
290 DCHECK_EQ(state_, kNormal); 292 DCHECK_EQ(state_, kNormal);
291 293
292 if (buffer->end_of_stream()) { 294 if (buffer->end_of_stream()) {
295 DVLOG(3) << __FUNCTION__ << " Initiating Flush for EOS()";
watk 2016/01/06 20:05:51 parens after EOS?
chcunningham 2016/01/07 02:14:48 Done.
293 state_ = kDrainingDecoder; 296 state_ = kDrainingDecoder;
294 eos_decode_cb_ = bound_decode_cb; 297 eos_decode_cb_ = bound_decode_cb;
295 vda_->Flush(); 298 vda_->Flush();
296 return; 299 return;
297 } 300 }
298 301
299 size_t size = buffer->data_size(); 302 size_t size = buffer->data_size();
300 scoped_ptr<SHMBuffer> shm_buffer = GetSHM(size); 303 scoped_ptr<SHMBuffer> shm_buffer = GetSHM(size);
301 if (!shm_buffer) { 304 if (!shm_buffer) {
302 bound_decode_cb.Run(kDecodeError); 305 bound_decode_cb.Run(kDecodeError);
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 } 676 }
674 return false; 677 return false;
675 } 678 }
676 679
677 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 680 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
678 const { 681 const {
679 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 682 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
680 } 683 }
681 684
682 } // namespace media 685 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698