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

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

Issue 339653003: No EOS frame in {Audio|Video}Decoder::OutputCB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | media/filters/opus_audio_decoder.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 (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 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // callsite to always be called with the same stat name (can't parameterize it). 141 // callsite to always be called with the same stat name (can't parameterize it).
142 static void ReportGpuVideoDecoderInitializeStatusToUMAAndRunCB( 142 static void ReportGpuVideoDecoderInitializeStatusToUMAAndRunCB(
143 const PipelineStatusCB& cb, 143 const PipelineStatusCB& cb,
144 PipelineStatus status) { 144 PipelineStatus status) {
145 UMA_HISTOGRAM_ENUMERATION( 145 UMA_HISTOGRAM_ENUMERATION(
146 "Media.GpuVideoDecoderInitializeStatus", status, PIPELINE_STATUS_MAX + 1); 146 "Media.GpuVideoDecoderInitializeStatus", status, PIPELINE_STATUS_MAX + 1);
147 cb.Run(status); 147 cb.Run(status);
148 } 148 }
149 149
150 void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config, 150 void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config,
151 bool live_mode, 151 bool /* low_delay */,
152 const PipelineStatusCB& orig_status_cb, 152 const PipelineStatusCB& orig_status_cb,
153 const OutputCB& output_cb) { 153 const OutputCB& output_cb) {
154 DVLOG(3) << "Initialize()"; 154 DVLOG(3) << "Initialize()";
155 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); 155 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
156 DCHECK(config.IsValidConfig()); 156 DCHECK(config.IsValidConfig());
157 DCHECK(!config.is_encrypted()); 157 DCHECK(!config.is_encrypted());
158 158
159 PipelineStatusCB status_cb = 159 PipelineStatusCB status_cb =
160 base::Bind(&ReportGpuVideoDecoderInitializeStatusToUMAAndRunCB, 160 base::Bind(&ReportGpuVideoDecoderInitializeStatusToUMAAndRunCB,
161 BindToCurrentLoop(orig_status_cb)); 161 BindToCurrentLoop(orig_status_cb));
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 it->second.shm_buffer->shm->Close(); 574 it->second.shm_buffer->shm->Close();
575 } 575 }
576 bitstream_buffers_in_decoder_.clear(); 576 bitstream_buffers_in_decoder_.clear();
577 } 577 }
578 578
579 void GpuVideoDecoder::NotifyFlushDone() { 579 void GpuVideoDecoder::NotifyFlushDone() {
580 DVLOG(3) << "NotifyFlushDone()"; 580 DVLOG(3) << "NotifyFlushDone()";
581 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); 581 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
582 DCHECK_EQ(state_, kDrainingDecoder); 582 DCHECK_EQ(state_, kDrainingDecoder);
583 state_ = kDecoderDrained; 583 state_ = kDecoderDrained;
584 DeliverFrame(VideoFrame::CreateEOSFrame());
585 base::ResetAndReturn(&eos_decode_cb_).Run(kOk); 584 base::ResetAndReturn(&eos_decode_cb_).Run(kOk);
586 } 585 }
587 586
588 void GpuVideoDecoder::NotifyResetDone() { 587 void GpuVideoDecoder::NotifyResetDone() {
589 DVLOG(3) << "NotifyResetDone()"; 588 DVLOG(3) << "NotifyResetDone()";
590 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); 589 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
591 DCHECK(bitstream_buffers_in_decoder_.empty()); 590 DCHECK(bitstream_buffers_in_decoder_.empty());
592 591
593 // This needs to happen after the Reset() on vda_ is done to ensure pictures 592 // This needs to happen after the Reset() on vda_ is done to ensure pictures
594 // delivered during the reset can find their time data. 593 // delivered during the reset can find their time data.
(...skipping 13 matching lines...) Expand all
608 DLOG(ERROR) << "VDA Error: " << error; 607 DLOG(ERROR) << "VDA Error: " << error;
609 DestroyVDA(); 608 DestroyVDA();
610 } 609 }
611 610
612 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 611 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
613 const { 612 const {
614 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 613 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
615 } 614 }
616 615
617 } // namespace media 616 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | media/filters/opus_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698