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

Side by Side Diff: webkit/media/android/webmediaplayer_android.cc

Issue 15898002: Fix various MediaSource related crashes on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make Destroy() public and remove friend decl to make compiler happy Created 7 years, 7 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
« no previous file with comments | « webkit/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webkit/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698