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

Side by Side Diff: content/browser/renderer_host/media/video_capture_device_client.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: Fix unit test breakage from bad merge 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/renderer_host/media/video_capture_device_client.h" 5 #include "content/browser/renderer_host/media/video_capture_device_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "content/browser/compositor/image_transport_factory.h" 10 #include "content/browser/compositor/image_transport_factory.h"
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 DCHECK(mailbox_holder.texture_target); 559 DCHECK(mailbox_holder.texture_target);
560 DCHECK(mailbox_holder.sync_point); 560 DCHECK(mailbox_holder.sync_point);
561 561
562 scoped_refptr<media::VideoFrame> video_frame = 562 scoped_refptr<media::VideoFrame> video_frame =
563 media::VideoFrame::WrapNativeTexture( 563 media::VideoFrame::WrapNativeTexture(
564 mailbox_holder, 564 mailbox_holder,
565 media::BindToCurrentLoop(base::Bind( 565 media::BindToCurrentLoop(base::Bind(
566 &VideoCaptureDeviceClient::TextureWrapHelper::ReleaseCallback, 566 &VideoCaptureDeviceClient::TextureWrapHelper::ReleaseCallback,
567 this, image_id, texture_id)), 567 this, image_id, texture_id)),
568 frame_format.frame_size, gfx::Rect(frame_format.frame_size), 568 frame_format.frame_size, gfx::Rect(frame_format.frame_size),
569 frame_format.frame_size, base::TimeDelta(), true /* allow_overlay */); 569 frame_format.frame_size, base::TimeDelta(), true /* allow_overlay */,
570 true /* has_alpha */);
570 video_frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE, 571 video_frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE,
571 frame_format.frame_rate); 572 frame_format.frame_rate);
572 573
573 BrowserThread::PostTask( 574 BrowserThread::PostTask(
574 BrowserThread::IO, FROM_HERE, 575 BrowserThread::IO, FROM_HERE,
575 base::Bind( 576 base::Bind(
576 &VideoCaptureController::DoIncomingCapturedVideoFrameOnIOThread, 577 &VideoCaptureController::DoIncomingCapturedVideoFrameOnIOThread,
577 controller_, base::Passed(&buffer), video_frame, timestamp)); 578 controller_, base::Passed(&buffer), video_frame, timestamp));
578 } 579 }
579 580
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( 664 void VideoCaptureDeviceClient::TextureWrapHelper::OnError(
664 const std::string& message) { 665 const std::string& message) {
665 DCHECK(capture_task_runner_->BelongsToCurrentThread()); 666 DCHECK(capture_task_runner_->BelongsToCurrentThread());
666 DLOG(ERROR) << message; 667 DLOG(ERROR) << message;
667 BrowserThread::PostTask( 668 BrowserThread::PostTask(
668 BrowserThread::IO, FROM_HERE, 669 BrowserThread::IO, FROM_HERE,
669 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); 670 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_));
670 } 671 }
671 672
672 } // namespace content 673 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698