| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/media/android/webmediaplayer_android.h" | 5 #include "webkit/media/android/webmediaplayer_android.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "cc/layers/video_layer.h" | 12 #include "cc/layers/video_layer.h" |
| 13 #include "gpu/GLES2/gl2extchromium.h" | 13 #include "gpu/GLES2/gl2extchromium.h" |
| 14 #include "media/base/android/media_player_android.h" | 14 #include "media/base/android/media_player_android.h" |
| 15 #include "media/base/media_switches.h" | 15 #include "media/base/media_switches.h" |
| 16 #include "media/base/video_frame.h" | 16 #include "media/base/video_frame.h" |
| 17 #include "net/base/mime_util.h" | 17 #include "net/base/mime_util.h" |
| 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.
h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.
h" |
| 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaSource.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaSource.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 24 #include "webkit/media/android/media_source_delegate.h" | |
| 25 #include "webkit/media/android/webmediaplayer_manager_android.h" | 24 #include "webkit/media/android/webmediaplayer_manager_android.h" |
| 26 #include "webkit/media/android/webmediaplayer_proxy_android.h" | 25 #include "webkit/media/android/webmediaplayer_proxy_android.h" |
| 27 #include "webkit/media/webmediaplayer_util.h" | 26 #include "webkit/media/webmediaplayer_util.h" |
| 28 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | 27 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
| 29 | 28 |
| 30 static const uint32 kGLTextureExternalOES = 0x8D65; | 29 static const uint32 kGLTextureExternalOES = 0x8D65; |
| 31 | 30 |
| 32 using WebKit::WebMediaPlayer; | 31 using WebKit::WebMediaPlayer; |
| 33 using WebKit::WebMediaSource; | 32 using WebKit::WebMediaSource; |
| 34 using WebKit::WebSize; | 33 using WebKit::WebSize; |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 Detach(); | 544 Detach(); |
| 546 main_loop_ = NULL; | 545 main_loop_ = NULL; |
| 547 } | 546 } |
| 548 | 547 |
| 549 void WebMediaPlayerAndroid::Detach() { | 548 void WebMediaPlayerAndroid::Detach() { |
| 550 if (stream_id_) { | 549 if (stream_id_) { |
| 551 stream_texture_factory_->DestroyStreamTexture(texture_id_); | 550 stream_texture_factory_->DestroyStreamTexture(texture_id_); |
| 552 stream_id_ = 0; | 551 stream_id_ = 0; |
| 553 } | 552 } |
| 554 | 553 |
| 554 media_source_delegate_.reset(); |
| 555 current_frame_ = NULL; | 555 current_frame_ = NULL; |
| 556 manager_ = NULL; | 556 manager_ = NULL; |
| 557 proxy_ = NULL; | 557 proxy_ = NULL; |
| 558 } | 558 } |
| 559 | 559 |
| 560 void WebMediaPlayerAndroid::ReallocateVideoFrame() { | 560 void WebMediaPlayerAndroid::ReallocateVideoFrame() { |
| 561 if (needs_external_surface_) { | 561 if (needs_external_surface_) { |
| 562 // VideoFrame::CreateHoleFrame is only defined under GOOGLE_TV. | 562 // VideoFrame::CreateHoleFrame is only defined under GOOGLE_TV. |
| 563 #if defined(GOOGLE_TV) | 563 #if defined(GOOGLE_TV) |
| 564 if (!natural_size_.isEmpty()) | 564 if (!natural_size_.isEmpty()) |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 void WebMediaPlayerAndroid::exitFullscreen() { | 690 void WebMediaPlayerAndroid::exitFullscreen() { |
| 691 if (proxy_) | 691 if (proxy_) |
| 692 proxy_->ExitFullscreen(player_id_); | 692 proxy_->ExitFullscreen(player_id_); |
| 693 } | 693 } |
| 694 | 694 |
| 695 bool WebMediaPlayerAndroid::canEnterFullscreen() const { | 695 bool WebMediaPlayerAndroid::canEnterFullscreen() const { |
| 696 return manager_->CanEnterFullscreen(frame_); | 696 return manager_->CanEnterFullscreen(frame_); |
| 697 } | 697 } |
| 698 | 698 |
| 699 } // namespace webkit_media | 699 } // namespace webkit_media |
| OLD | NEW |