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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1154153003: Relanding 1143663007: VideoFrame: Separate Pixel Format from Storage Type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NV12 support in CrOS Created 5 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
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/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 if (needs_external_surface_) 653 if (needs_external_surface_)
654 return false; 654 return false;
655 655
656 scoped_refptr<VideoFrame> video_frame; 656 scoped_refptr<VideoFrame> video_frame;
657 { 657 {
658 base::AutoLock auto_lock(current_frame_lock_); 658 base::AutoLock auto_lock(current_frame_lock_);
659 video_frame = current_frame_; 659 video_frame = current_frame_;
660 } 660 }
661 661
662 if (!video_frame.get() || 662 if (!video_frame.get() ||
663 video_frame->format() != media::VideoFrame::NATIVE_TEXTURE) 663 video_frame->storage_type() != media::VideoFrame::STORAGE_TEXTURE)
664 return false; 664 return false;
665 DCHECK_EQ(1u, media::VideoFrame::NumTextures(video_frame->texture_format())); 665 DCHECK_EQ(1u, media::VideoFrame::NumPlanes(video_frame->format()));
666 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(0); 666 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(0);
667 DCHECK((!is_remote_ && 667 DCHECK((!is_remote_ &&
668 mailbox_holder.texture_target == GL_TEXTURE_EXTERNAL_OES) || 668 mailbox_holder.texture_target == GL_TEXTURE_EXTERNAL_OES) ||
669 (is_remote_ && mailbox_holder.texture_target == GL_TEXTURE_2D)); 669 (is_remote_ && mailbox_holder.texture_target == GL_TEXTURE_2D));
670 670
671 web_graphics_context->waitSyncPoint(mailbox_holder.sync_point); 671 web_graphics_context->waitSyncPoint(mailbox_holder.sync_point);
672 672
673 // Ensure the target of texture is set before copyTextureCHROMIUM, otherwise 673 // Ensure the target of texture is set before copyTextureCHROMIUM, otherwise
674 // an invalid texture target may be used for copy texture. 674 // an invalid texture target may be used for copy texture.
675 uint32 src_texture = web_graphics_context->createAndConsumeTextureCHROMIUM( 675 uint32 src_texture = web_graphics_context->createAndConsumeTextureCHROMIUM(
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1864 1864
1865 bool WebMediaPlayerAndroid::IsHLSStream() const { 1865 bool WebMediaPlayerAndroid::IsHLSStream() const {
1866 std::string mime; 1866 std::string mime;
1867 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; 1867 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_;
1868 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) 1868 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime))
1869 return false; 1869 return false;
1870 return !mime.compare("application/x-mpegurl"); 1870 return !mime.compare("application/x-mpegurl");
1871 } 1871 }
1872 1872
1873 } // namespace content 1873 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/gpu_video_encode_accelerator.cc ('k') | content/renderer/media/rtc_video_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698