OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webmediaplayer_impl.h" | 5 #include "webkit/media/webmediaplayer_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 return NULL; | 693 return NULL; |
694 } | 694 } |
695 | 695 |
696 void WebMediaPlayerImpl::putCurrentFrame( | 696 void WebMediaPlayerImpl::putCurrentFrame( |
697 WebKit::WebVideoFrame* web_video_frame) { | 697 WebKit::WebVideoFrame* web_video_frame) { |
698 if (web_video_frame) { | 698 if (web_video_frame) { |
699 scoped_refptr<media::VideoFrame> video_frame( | 699 scoped_refptr<media::VideoFrame> video_frame( |
700 WebVideoFrameImpl::toVideoFrame(web_video_frame)); | 700 WebVideoFrameImpl::toVideoFrame(web_video_frame)); |
701 proxy_->PutCurrentFrame(video_frame); | 701 proxy_->PutCurrentFrame(video_frame); |
702 delete web_video_frame; | 702 delete web_video_frame; |
703 } else { | |
704 proxy_->PutCurrentFrame(NULL); | |
705 } | 703 } |
706 } | 704 } |
707 | 705 |
708 bool WebMediaPlayerImpl::sourceAppend(const unsigned char* data, | 706 bool WebMediaPlayerImpl::sourceAppend(const unsigned char* data, |
709 unsigned length) { | 707 unsigned length) { |
710 DCHECK_EQ(main_loop_, MessageLoop::current()); | 708 DCHECK_EQ(main_loop_, MessageLoop::current()); |
711 return proxy_->DemuxerAppend(data, length); | 709 return proxy_->DemuxerAppend(data, length); |
712 } | 710 } |
713 | 711 |
714 void WebMediaPlayerImpl::sourceEndOfStream( | 712 void WebMediaPlayerImpl::sourceEndOfStream( |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 return client_; | 917 return client_; |
920 } | 918 } |
921 | 919 |
922 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 920 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
923 DCHECK_EQ(main_loop_, MessageLoop::current()); | 921 DCHECK_EQ(main_loop_, MessageLoop::current()); |
924 incremented_externally_allocated_memory_ = true; | 922 incremented_externally_allocated_memory_ = true; |
925 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 923 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
926 } | 924 } |
927 | 925 |
928 } // namespace webkit_media | 926 } // namespace webkit_media |
OLD | NEW |