| 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); |
| 703 } | 705 } |
| 704 } | 706 } |
| 705 | 707 |
| 706 bool WebMediaPlayerImpl::sourceAppend(const unsigned char* data, | 708 bool WebMediaPlayerImpl::sourceAppend(const unsigned char* data, |
| 707 unsigned length) { | 709 unsigned length) { |
| 708 DCHECK_EQ(main_loop_, MessageLoop::current()); | 710 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 709 return proxy_->DemuxerAppend(data, length); | 711 return proxy_->DemuxerAppend(data, length); |
| 710 } | 712 } |
| 711 | 713 |
| 712 void WebMediaPlayerImpl::sourceEndOfStream( | 714 void WebMediaPlayerImpl::sourceEndOfStream( |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 return client_; | 919 return client_; |
| 918 } | 920 } |
| 919 | 921 |
| 920 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 922 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
| 921 DCHECK_EQ(main_loop_, MessageLoop::current()); | 923 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 922 incremented_externally_allocated_memory_ = true; | 924 incremented_externally_allocated_memory_ = true; |
| 923 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 925 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
| 924 } | 926 } |
| 925 | 927 |
| 926 } // namespace webkit_media | 928 } // namespace webkit_media |
| OLD | NEW |