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

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

Issue 313623003: WIP: Option2: Android media: VideoFrame should not store so many sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | no next file » | 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 .Run(kOk, ready_video_frames_.front()); 509 .Run(kOk, ready_video_frames_.front());
510 ready_video_frames_.pop_front(); 510 ready_video_frames_.pop_front();
511 } 511 }
512 512
513 // static 513 // static
514 void GpuVideoDecoder::ReleaseMailbox( 514 void GpuVideoDecoder::ReleaseMailbox(
515 base::WeakPtr<GpuVideoDecoder> decoder, 515 base::WeakPtr<GpuVideoDecoder> decoder,
516 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, 516 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories,
517 int64 picture_buffer_id, 517 int64 picture_buffer_id,
518 uint32 texture_id, 518 uint32 texture_id,
519 const std::vector<uint32>& release_sync_points) { 519 const std::map<std::string, uint32>& release_sync_points) {
520 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); 520 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread());
521 521
522 for (size_t i = 0; i < release_sync_points.size(); i++) 522 for (std::map<std::string, uint32>::const_iterator iter =
523 factories->WaitSyncPoint(release_sync_points[i]); 523 release_sync_points.begin();
524 iter != release_sync_points.end();
525 iter++) {
526 factories->WaitSyncPoint(iter->second);
527 }
524 528
525 if (decoder) { 529 if (decoder) {
526 decoder->ReusePictureBuffer(picture_buffer_id); 530 decoder->ReusePictureBuffer(picture_buffer_id);
527 return; 531 return;
528 } 532 }
529 // It's the last chance to delete the texture after display, 533 // It's the last chance to delete the texture after display,
530 // because GpuVideoDecoder was destructed. 534 // because GpuVideoDecoder was destructed.
531 factories->DeleteTexture(texture_id); 535 factories->DeleteTexture(texture_id);
532 } 536 }
533 537
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 return; 658 return;
655 } 659 }
656 } 660 }
657 661
658 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 662 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
659 const { 663 const {
660 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 664 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
661 } 665 }
662 666
663 } // namespace media 667 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698