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

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

Issue 222563002: Remove redundant I420-to-YV12 conversion in MediaStreamVideoTrack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow I420 as acceptable default YUV format in ppapi tests. Created 6 years, 8 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 | Annotate | Revision Log
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/webmediaplayer_ms.h" 5 #include "content/renderer/media/webmediaplayer_ms.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 23 matching lines...) Expand all
34 using blink::WebRect; 34 using blink::WebRect;
35 using blink::WebSize; 35 using blink::WebSize;
36 36
37 namespace { 37 namespace {
38 38
39 // This function copies a YV12 or NATIVE_TEXTURE to a new YV12 39 // This function copies a YV12 or NATIVE_TEXTURE to a new YV12
40 // media::VideoFrame. 40 // media::VideoFrame.
41 scoped_refptr<media::VideoFrame> CopyFrameToYV12( 41 scoped_refptr<media::VideoFrame> CopyFrameToYV12(
42 const scoped_refptr<media::VideoFrame>& frame) { 42 const scoped_refptr<media::VideoFrame>& frame) {
43 DCHECK(frame->format() == media::VideoFrame::YV12 || 43 DCHECK(frame->format() == media::VideoFrame::YV12 ||
44 frame->format() == media::VideoFrame::I420 ||
44 frame->format() == media::VideoFrame::NATIVE_TEXTURE); 45 frame->format() == media::VideoFrame::NATIVE_TEXTURE);
45 scoped_refptr<media::VideoFrame> new_frame = 46 scoped_refptr<media::VideoFrame> new_frame =
46 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, 47 media::VideoFrame::CreateFrame(media::VideoFrame::YV12,
47 frame->coded_size(), 48 frame->coded_size(),
48 frame->visible_rect(), 49 frame->visible_rect(),
49 frame->natural_size(), 50 frame->natural_size(),
50 frame->GetTimestamp()); 51 frame->GetTimestamp());
51 52
52 if (frame->format() == media::VideoFrame::NATIVE_TEXTURE) { 53 if (frame->format() == media::VideoFrame::NATIVE_TEXTURE) {
53 SkBitmap bitmap; 54 SkBitmap bitmap;
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 GetClient()->readyStateChanged(); 474 GetClient()->readyStateChanged();
474 } 475 }
475 476
476 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { 477 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() {
477 DCHECK(thread_checker_.CalledOnValidThread()); 478 DCHECK(thread_checker_.CalledOnValidThread());
478 DCHECK(client_); 479 DCHECK(client_);
479 return client_; 480 return client_;
480 } 481 }
481 482
482 } // namespace content 483 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_video_track.cc ('k') | media/filters/skcanvas_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698