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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 DCHECK(!stream_id_); | 535 DCHECK(!stream_id_); |
536 DCHECK(!texture_id_); | 536 DCHECK(!texture_id_); |
537 stream_id_ = stream_texture_factory_->CreateStreamTexture(&texture_id_); | 537 stream_id_ = stream_texture_factory_->CreateStreamTexture(&texture_id_); |
538 if (texture_id_) | 538 if (texture_id_) |
539 video_frame_.reset(new WebVideoFrameImpl(VideoFrame::WrapNativeTexture( | 539 video_frame_.reset(new WebVideoFrameImpl(VideoFrame::WrapNativeTexture( |
540 texture_id_, | 540 texture_id_, |
541 kGLTextureExternalOES, | 541 kGLTextureExternalOES, |
542 texture_size_.width, | 542 texture_size_.width, |
543 texture_size_.height, | 543 texture_size_.height, |
544 base::TimeDelta(), | 544 base::TimeDelta(), |
545 base::TimeDelta(), | |
546 base::Bind(&WebMediaPlayerAndroid::DestroyStreamTexture, | 545 base::Bind(&WebMediaPlayerAndroid::DestroyStreamTexture, |
547 base::Unretained(this))))); | 546 base::Unretained(this))))); |
548 } | 547 } |
549 | 548 |
550 void WebMediaPlayerAndroid::DestroyStreamTexture() { | 549 void WebMediaPlayerAndroid::DestroyStreamTexture() { |
551 DCHECK(stream_id_); | 550 DCHECK(stream_id_); |
552 DCHECK(texture_id_); | 551 DCHECK(texture_id_); |
553 stream_texture_factory_->DestroyStreamTexture(texture_id_); | 552 stream_texture_factory_->DestroyStreamTexture(texture_id_); |
554 texture_id_ = 0; | 553 texture_id_ = 0; |
555 stream_id_ = 0; | 554 stream_id_ = 0; |
(...skipping 18 matching lines...) Expand all Loading... |
574 } | 573 } |
575 | 574 |
576 // This gets called both on compositor and main thread. | 575 // This gets called both on compositor and main thread. |
577 void WebMediaPlayerAndroid::setStreamTextureClient( | 576 void WebMediaPlayerAndroid::setStreamTextureClient( |
578 WebKit::WebStreamTextureClient* client) { | 577 WebKit::WebStreamTextureClient* client) { |
579 if (stream_texture_proxy_.get()) | 578 if (stream_texture_proxy_.get()) |
580 stream_texture_proxy_->SetClient(client); | 579 stream_texture_proxy_->SetClient(client); |
581 } | 580 } |
582 | 581 |
583 } // namespace webkit_media | 582 } // namespace webkit_media |
OLD | NEW |