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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 const blink::WebRect& rect, | 525 const blink::WebRect& rect, |
526 unsigned char alpha, | 526 unsigned char alpha, |
527 SkXfermode::Mode mode) { | 527 SkXfermode::Mode mode) { |
528 DCHECK(main_thread_checker_.CalledOnValidThread()); | 528 DCHECK(main_thread_checker_.CalledOnValidThread()); |
529 scoped_ptr<blink::WebGraphicsContext3DProvider> provider = | 529 scoped_ptr<blink::WebGraphicsContext3DProvider> provider = |
530 scoped_ptr<blink::WebGraphicsContext3DProvider>(blink::Platform::current( | 530 scoped_ptr<blink::WebGraphicsContext3DProvider>(blink::Platform::current( |
531 )->createSharedOffscreenGraphicsContext3DProvider()); | 531 )->createSharedOffscreenGraphicsContext3DProvider()); |
532 if (!provider) | 532 if (!provider) |
533 return; | 533 return; |
534 blink::WebGraphicsContext3D* context3D = provider->context3d(); | 534 blink::WebGraphicsContext3D* context3D = provider->context3d(); |
535 if (!context3D || !context3D->makeContextCurrent()) | 535 if (!context3D) |
536 return; | 536 return; |
537 | 537 |
538 // Copy video texture into a RGBA texture based bitmap first as video texture | 538 // Copy video texture into a RGBA texture based bitmap first as video texture |
539 // on Android is GL_TEXTURE_EXTERNAL_OES which is not supported by Skia yet. | 539 // on Android is GL_TEXTURE_EXTERNAL_OES which is not supported by Skia yet. |
540 // The bitmap's size needs to be the same as the video and use naturalSize() | 540 // The bitmap's size needs to be the same as the video and use naturalSize() |
541 // here. Check if we could reuse existing texture based bitmap. | 541 // here. Check if we could reuse existing texture based bitmap. |
542 // Otherwise, release existing texture based bitmap and allocate | 542 // Otherwise, release existing texture based bitmap and allocate |
543 // a new one based on video size. | 543 // a new one based on video size. |
544 if (!EnsureTextureBackedSkBitmap(provider->grContext(), bitmap_, | 544 if (!EnsureTextureBackedSkBitmap(provider->grContext(), bitmap_, |
545 naturalSize(), kTopLeft_GrSurfaceOrigin, kSkia8888_GrPixelConfig)) { | 545 naturalSize(), kTopLeft_GrSurfaceOrigin, kSkia8888_GrPixelConfig)) { |
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 } | 1740 } |
1741 | 1741 |
1742 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1742 bool WebMediaPlayerAndroid::IsHLSStream() const { |
1743 std::string mime; | 1743 std::string mime; |
1744 if (!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime)) | 1744 if (!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime)) |
1745 return false; | 1745 return false; |
1746 return !mime.compare("application/x-mpegurl"); | 1746 return !mime.compare("application/x-mpegurl"); |
1747 } | 1747 } |
1748 | 1748 |
1749 } // namespace content | 1749 } // namespace content |
OLD | NEW |