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

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

Issue 57403003: Remove EMPTY from VideoFrame::Format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vframe_rgb
Patch Set: Created 7 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 | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/filters/video_frame_stream.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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 // Throw away any already-decoded, not-yet-delivered frames. 85 // Throw away any already-decoded, not-yet-delivered frames.
86 ready_video_frames_.clear(); 86 ready_video_frames_.clear();
87 87
88 if (!vda_) { 88 if (!vda_) {
89 gvd_loop_proxy_->PostTask(FROM_HERE, closure); 89 gvd_loop_proxy_->PostTask(FROM_HERE, closure);
90 return; 90 return;
91 } 91 }
92 92
93 if (!pending_decode_cb_.is_null()) 93 if (!pending_decode_cb_.is_null())
94 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); 94 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEOSFrame());
95 95
96 DCHECK(pending_reset_cb_.is_null()); 96 DCHECK(pending_reset_cb_.is_null());
97 pending_reset_cb_ = BindToCurrentLoop(closure); 97 pending_reset_cb_ = BindToCurrentLoop(closure);
98 98
99 vda_->Reset(); 99 vda_->Reset();
100 } 100 }
101 101
102 void GpuVideoDecoder::Stop(const base::Closure& closure) { 102 void GpuVideoDecoder::Stop(const base::Closure& closure) {
103 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread()); 103 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread());
104 if (vda_) 104 if (vda_)
105 DestroyVDA(); 105 DestroyVDA();
106 if (!pending_decode_cb_.is_null()) 106 if (!pending_decode_cb_.is_null())
107 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); 107 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEOSFrame());
108 if (!pending_reset_cb_.is_null()) 108 if (!pending_reset_cb_.is_null())
109 base::ResetAndReturn(&pending_reset_cb_).Run(); 109 base::ResetAndReturn(&pending_reset_cb_).Run();
110 BindToCurrentLoop(closure).Run(); 110 BindToCurrentLoop(closure).Run();
111 } 111 }
112 112
113 static bool IsCodedSizeSupported(const gfx::Size& coded_size) { 113 static bool IsCodedSizeSupported(const gfx::Size& coded_size) {
114 // Only non-Windows, Ivy Bridge+ platforms can support more than 1920x1080. 114 // Only non-Windows, Ivy Bridge+ platforms can support more than 1920x1080.
115 // We test against 1088 to account for 16x16 macroblocks. 115 // We test against 1088 to account for 16x16 macroblocks.
116 if (coded_size.width() <= 1920 && coded_size.height() <= 1088) 116 if (coded_size.width() <= 1920 && coded_size.height() <= 1088)
117 return true; 117 return true;
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 567
568 DestroyPictureBuffers(&assigned_picture_buffers_); 568 DestroyPictureBuffers(&assigned_picture_buffers_);
569 DestroyPictureBuffers(&dismissed_picture_buffers_); 569 DestroyPictureBuffers(&dismissed_picture_buffers_);
570 } 570 }
571 571
572 void GpuVideoDecoder::NotifyFlushDone() { 572 void GpuVideoDecoder::NotifyFlushDone() {
573 DVLOG(3) << "NotifyFlushDone()"; 573 DVLOG(3) << "NotifyFlushDone()";
574 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread()); 574 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread());
575 DCHECK_EQ(state_, kDrainingDecoder); 575 DCHECK_EQ(state_, kDrainingDecoder);
576 state_ = kDecoderDrained; 576 state_ = kDecoderDrained;
577 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); 577 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEOSFrame());
578 } 578 }
579 579
580 void GpuVideoDecoder::NotifyResetDone() { 580 void GpuVideoDecoder::NotifyResetDone() {
581 DVLOG(3) << "NotifyResetDone()"; 581 DVLOG(3) << "NotifyResetDone()";
582 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread()); 582 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread());
583 DCHECK(ready_video_frames_.empty()); 583 DCHECK(ready_video_frames_.empty());
584 584
585 // This needs to happen after the Reset() on vda_ is done to ensure pictures 585 // This needs to happen after the Reset() on vda_ is done to ensure pictures
586 // delivered during the reset can find their time data. 586 // delivered during the reset can find their time data.
587 input_buffer_data_.clear(); 587 input_buffer_data_.clear();
588 588
589 if (!pending_reset_cb_.is_null()) 589 if (!pending_reset_cb_.is_null())
590 base::ResetAndReturn(&pending_reset_cb_).Run(); 590 base::ResetAndReturn(&pending_reset_cb_).Run();
591 591
592 if (!pending_decode_cb_.is_null()) 592 if (!pending_decode_cb_.is_null())
593 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); 593 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEOSFrame());
594 } 594 }
595 595
596 void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { 596 void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) {
597 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread()); 597 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread());
598 if (!vda_) 598 if (!vda_)
599 return; 599 return;
600 600
601 DLOG(ERROR) << "VDA Error: " << error; 601 DLOG(ERROR) << "VDA Error: " << error;
602 DestroyVDA(); 602 DestroyVDA();
603 603
604 state_ = kError; 604 state_ = kError;
605 605
606 if (!pending_decode_cb_.is_null()) { 606 if (!pending_decode_cb_.is_null()) {
607 base::ResetAndReturn(&pending_decode_cb_).Run(kDecodeError, NULL); 607 base::ResetAndReturn(&pending_decode_cb_).Run(kDecodeError, NULL);
608 return; 608 return;
609 } 609 }
610 } 610 }
611 611
612 } // namespace media 612 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/filters/video_frame_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698