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

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

Issue 1921803002: Avoid unnecessary post task during frame delivery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments. Created 4 years, 7 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/vpx_video_decoder.h" 5 #include "media/filters/vpx_video_decoder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 InitCB bound_init_cb = BindToCurrentLoop(init_cb); 384 InitCB bound_init_cb = BindToCurrentLoop(init_cb);
385 385
386 if (config.is_encrypted() || !ConfigureDecoder(config)) { 386 if (config.is_encrypted() || !ConfigureDecoder(config)) {
387 bound_init_cb.Run(false); 387 bound_init_cb.Run(false);
388 return; 388 return;
389 } 389 }
390 390
391 // Success! 391 // Success!
392 config_ = config; 392 config_ = config;
393 state_ = kNormal; 393 state_ = kNormal;
394 output_cb_ = BindToCurrentLoop(output_cb); 394 output_cb_ = offload_task_runner_ ? BindToCurrentLoop(output_cb) : output_cb;
395 bound_init_cb.Run(true); 395 bound_init_cb.Run(true);
396 } 396 }
397 397
398 void VpxVideoDecoder::DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer, 398 void VpxVideoDecoder::DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer,
399 const DecodeCB& bound_decode_cb) { 399 const DecodeCB& bound_decode_cb) {
400 DCHECK_NE(state_, kUninitialized) 400 DCHECK_NE(state_, kUninitialized)
401 << "Called Decode() before successful Initialize()"; 401 << "Called Decode() before successful Initialize()";
402 402
403 if (state_ == kError) { 403 if (state_ == kError) {
404 bound_decode_cb.Run(DecodeStatus::DECODE_ERROR); 404 bound_decode_cb.Run(DecodeStatus::DECODE_ERROR);
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 (*video_frame)->visible_data(VideoFrame::kUPlane), 725 (*video_frame)->visible_data(VideoFrame::kUPlane),
726 (*video_frame)->stride(VideoFrame::kUPlane), 726 (*video_frame)->stride(VideoFrame::kUPlane),
727 (*video_frame)->visible_data(VideoFrame::kVPlane), 727 (*video_frame)->visible_data(VideoFrame::kVPlane),
728 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), 728 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(),
729 coded_size.height()); 729 coded_size.height());
730 730
731 return true; 731 return true;
732 } 732 }
733 733
734 } // namespace media 734 } // namespace media
OLDNEW
« media/base/video_decoder.h ('K') | « media/filters/gpu_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698