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

Side by Side Diff: content/renderer/media/rtc_video_decoder.cc

Issue 1134643002: Add distinction between RGB and RGBA native texture video frames and resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/media/rtc_video_decoder.h" 5 #include "content/renderer/media/rtc_video_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 // Convert timestamp from 90KHz to ms. 419 // Convert timestamp from 90KHz to ms.
420 base::TimeDelta timestamp_ms = base::TimeDelta::FromInternalValue( 420 base::TimeDelta timestamp_ms = base::TimeDelta::FromInternalValue(
421 base::checked_cast<uint64_t>(timestamp) * 1000 / 90); 421 base::checked_cast<uint64_t>(timestamp) * 1000 / 90);
422 return media::VideoFrame::WrapNativeTexture( 422 return media::VideoFrame::WrapNativeTexture(
423 make_scoped_ptr(new gpu::MailboxHolder(pb.texture_mailbox(), 423 make_scoped_ptr(new gpu::MailboxHolder(pb.texture_mailbox(),
424 decoder_texture_target_, 0)), 424 decoder_texture_target_, 0)),
425 media::BindToCurrentLoop(base::Bind( 425 media::BindToCurrentLoop(base::Bind(
426 &RTCVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), 426 &RTCVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(),
427 factories_, picture.picture_buffer_id(), pb.texture_id())), 427 factories_, picture.picture_buffer_id(), pb.texture_id())),
428 pb.size(), visible_rect, visible_rect.size(), timestamp_ms, 428 pb.size(), visible_rect, visible_rect.size(), timestamp_ms,
429 picture.allow_overlay()); 429 picture.allow_overlay(), true /* has_alpha */);
430 } 430 }
431 431
432 void RTCVideoDecoder::NotifyEndOfBitstreamBuffer(int32 id) { 432 void RTCVideoDecoder::NotifyEndOfBitstreamBuffer(int32 id) {
433 DVLOG(3) << "NotifyEndOfBitstreamBuffer. id=" << id; 433 DVLOG(3) << "NotifyEndOfBitstreamBuffer. id=" << id;
434 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); 434 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
435 435
436 std::map<int32, SHMBuffer*>::iterator it = 436 std::map<int32, SHMBuffer*>::iterator it =
437 bitstream_buffers_in_decoder_.find(id); 437 bitstream_buffers_in_decoder_.find(id);
438 if (it == bitstream_buffers_in_decoder_.end()) { 438 if (it == bitstream_buffers_in_decoder_.end()) {
439 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); 439 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeSuccess", sample); 779 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeSuccess", sample);
780 return status; 780 return status;
781 } 781 }
782 782
783 void RTCVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 783 void RTCVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
784 const { 784 const {
785 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 785 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
786 } 786 }
787 787
788 } // namespace content 788 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698