| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "media/base/media_keys.h" | 42 #include "media/base/media_keys.h" |
| 43 #include "media/base/media_log.h" | 43 #include "media/base/media_log.h" |
| 44 #include "media/base/media_switches.h" | 44 #include "media/base/media_switches.h" |
| 45 #include "media/base/timestamp_constants.h" | 45 #include "media/base/timestamp_constants.h" |
| 46 #include "media/base/video_frame.h" | 46 #include "media/base/video_frame.h" |
| 47 #include "media/blink/webcontentdecryptionmodule_impl.h" | 47 #include "media/blink/webcontentdecryptionmodule_impl.h" |
| 48 #include "media/blink/webmediaplayer_cast_android.h" | 48 #include "media/blink/webmediaplayer_cast_android.h" |
| 49 #include "media/blink/webmediaplayer_delegate.h" | 49 #include "media/blink/webmediaplayer_delegate.h" |
| 50 #include "media/blink/webmediaplayer_util.h" | 50 #include "media/blink/webmediaplayer_util.h" |
| 51 #include "net/base/mime_util.h" | 51 #include "net/base/mime_util.h" |
| 52 #include "skia/ext/texture_handle.h" |
| 52 #include "third_party/WebKit/public/platform/Platform.h" | 53 #include "third_party/WebKit/public/platform/Platform.h" |
| 53 #include "third_party/WebKit/public/platform/URLConversion.h" | 54 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 54 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" | 55 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" |
| 55 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h" | 56 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h" |
| 56 #include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h" | 57 #include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h" |
| 57 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" | 58 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" |
| 58 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient.
h" | 59 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient.
h" |
| 59 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 60 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 60 #include "third_party/WebKit/public/platform/WebString.h" | 61 #include "third_party/WebKit/public/platform/WebString.h" |
| 61 #include "third_party/WebKit/public/platform/WebURL.h" | 62 #include "third_party/WebKit/public/platform/WebURL.h" |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 // here. Check if we could reuse existing texture based bitmap. | 657 // here. Check if we could reuse existing texture based bitmap. |
| 657 // Otherwise, release existing texture based bitmap and allocate | 658 // Otherwise, release existing texture based bitmap and allocate |
| 658 // a new one based on video size. | 659 // a new one based on video size. |
| 659 if (!IsSkBitmapProperlySizedTexture(&bitmap_, naturalSize())) { | 660 if (!IsSkBitmapProperlySizedTexture(&bitmap_, naturalSize())) { |
| 660 if (!AllocateSkBitmapTexture(provider->grContext(), &bitmap_, | 661 if (!AllocateSkBitmapTexture(provider->grContext(), &bitmap_, |
| 661 naturalSize())) { | 662 naturalSize())) { |
| 662 return; | 663 return; |
| 663 } | 664 } |
| 664 } | 665 } |
| 665 | 666 |
| 666 unsigned textureId = static_cast<unsigned>( | 667 unsigned textureId = skia::GrBackendObjectToGrGLTextureInfo( |
| 667 (bitmap_.getTexture())->getTextureHandle()); | 668 (bitmap_.getTexture())->getTextureHandle()) |
| 669 ->fID; |
| 668 if (!copyVideoTextureToPlatformTexture(context3D, textureId, | 670 if (!copyVideoTextureToPlatformTexture(context3D, textureId, |
| 669 GL_RGBA, GL_UNSIGNED_BYTE, true, false)) { | 671 GL_RGBA, GL_UNSIGNED_BYTE, true, false)) { |
| 670 return; | 672 return; |
| 671 } | 673 } |
| 672 | 674 |
| 673 // Ensure SkBitmap to make the latest change by external source visible. | 675 // Ensure SkBitmap to make the latest change by external source visible. |
| 674 bitmap_.notifyPixelsChanged(); | 676 bitmap_.notifyPixelsChanged(); |
| 675 | 677 |
| 676 // Draw the texture based bitmap onto the Canvas. If the canvas is | 678 // Draw the texture based bitmap onto the Canvas. If the canvas is |
| 677 // hardware based, this will do a GPU-GPU texture copy. | 679 // hardware based, this will do a GPU-GPU texture copy. |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1656 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; | 1658 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; |
| 1657 } else if (is_hls_url == is_hls) { | 1659 } else if (is_hls_url == is_hls) { |
| 1658 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; | 1660 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; |
| 1659 } | 1661 } |
| 1660 UMA_HISTOGRAM_ENUMERATION( | 1662 UMA_HISTOGRAM_ENUMERATION( |
| 1661 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", | 1663 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", |
| 1662 result, PREDICTION_RESULT_MAX); | 1664 result, PREDICTION_RESULT_MAX); |
| 1663 } | 1665 } |
| 1664 | 1666 |
| 1665 } // namespace content | 1667 } // namespace content |
| OLD | NEW |