OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |