| 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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 return NULL; | 684 return NULL; |
| 685 } | 685 } |
| 686 | 686 |
| 687 void WebMediaPlayerImpl::putCurrentFrame( | 687 void WebMediaPlayerImpl::putCurrentFrame( |
| 688 WebKit::WebVideoFrame* web_video_frame) { | 688 WebKit::WebVideoFrame* web_video_frame) { |
| 689 if (web_video_frame) { | 689 if (web_video_frame) { |
| 690 scoped_refptr<media::VideoFrame> video_frame( | 690 scoped_refptr<media::VideoFrame> video_frame( |
| 691 WebVideoFrameImpl::toVideoFrame(web_video_frame)); | 691 WebVideoFrameImpl::toVideoFrame(web_video_frame)); |
| 692 proxy_->PutCurrentFrame(video_frame); | 692 proxy_->PutCurrentFrame(video_frame); |
| 693 delete web_video_frame; | 693 delete web_video_frame; |
| 694 } else { |
| 695 proxy_->PutCurrentFrame(NULL); |
| 694 } | 696 } |
| 695 } | 697 } |
| 696 | 698 |
| 697 bool WebMediaPlayerImpl::sourceAppend(const unsigned char* data, | 699 bool WebMediaPlayerImpl::sourceAppend(const unsigned char* data, |
| 698 unsigned length) { | 700 unsigned length) { |
| 699 DCHECK_EQ(main_loop_, MessageLoop::current()); | 701 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 700 return proxy_->DemuxerAppend(data, length); | 702 return proxy_->DemuxerAppend(data, length); |
| 701 } | 703 } |
| 702 | 704 |
| 703 void WebMediaPlayerImpl::sourceEndOfStream( | 705 void WebMediaPlayerImpl::sourceEndOfStream( |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 return client_; | 910 return client_; |
| 909 } | 911 } |
| 910 | 912 |
| 911 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 913 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
| 912 DCHECK_EQ(main_loop_, MessageLoop::current()); | 914 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 913 incremented_externally_allocated_memory_ = true; | 915 incremented_externally_allocated_memory_ = true; |
| 914 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 916 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
| 915 } | 917 } |
| 916 | 918 |
| 917 } // namespace webkit_media | 919 } // namespace webkit_media |
| OLD | NEW |