OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/android/media_source_delegate.h" | 5 #include "content/renderer/media/android/media_source_delegate.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 using media::DemuxerData; | 28 using media::DemuxerData; |
29 using blink::WebMediaPlayer; | 29 using blink::WebMediaPlayer; |
30 using blink::WebString; | 30 using blink::WebString; |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 // The size of the access unit to transfer in an IPC in case of MediaSource. | 34 // The size of the access unit to transfer in an IPC in case of MediaSource. |
35 // 4: approximately 64ms of content in 60 fps movies. | 35 // 4: approximately 64ms of content in 60 fps movies. |
36 const size_t kAccessUnitSizeForMediaSource = 4; | 36 const size_t kAccessUnitSizeForMediaSource = 4; |
37 | 37 |
38 const uint8 kVorbisPadding[] = { 0xff, 0xff, 0xff, 0xff }; | 38 const uint8_t kVorbisPadding[] = {0xff, 0xff, 0xff, 0xff}; |
39 | 39 |
40 } // namespace | 40 } // namespace |
41 | 41 |
42 namespace content { | 42 namespace content { |
43 | 43 |
44 MediaSourceDelegate::MediaSourceDelegate( | 44 MediaSourceDelegate::MediaSourceDelegate( |
45 RendererDemuxerAndroid* demuxer_client, | 45 RendererDemuxerAndroid* demuxer_client, |
46 int demuxer_client_id, | 46 int demuxer_client_id, |
47 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 47 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
48 const scoped_refptr<media::MediaLog> media_log) | 48 const scoped_refptr<media::MediaLog> media_log) |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 661 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
662 if (media_source_opened_cb_.is_null()) | 662 if (media_source_opened_cb_.is_null()) |
663 return; | 663 return; |
664 | 664 |
665 media_source_opened_cb_.Run( | 665 media_source_opened_cb_.Run( |
666 new media::WebMediaSourceImpl(chunk_demuxer_.get(), media_log_)); | 666 new media::WebMediaSourceImpl(chunk_demuxer_.get(), media_log_)); |
667 } | 667 } |
668 | 668 |
669 void MediaSourceDelegate::OnEncryptedMediaInitData( | 669 void MediaSourceDelegate::OnEncryptedMediaInitData( |
670 media::EmeInitDataType init_data_type, | 670 media::EmeInitDataType init_data_type, |
671 const std::vector<uint8>& init_data) { | 671 const std::vector<uint8_t>& init_data) { |
672 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 672 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
673 if (encrypted_media_init_data_cb_.is_null()) | 673 if (encrypted_media_init_data_cb_.is_null()) |
674 return; | 674 return; |
675 | 675 |
676 encrypted_media_init_data_cb_.Run(init_data_type, init_data); | 676 encrypted_media_init_data_cb_.Run(init_data_type, init_data); |
677 } | 677 } |
678 | 678 |
679 bool MediaSourceDelegate::IsSeeking() const { | 679 bool MediaSourceDelegate::IsSeeking() const { |
680 base::AutoLock auto_lock(seeking_lock_); | 680 base::AutoLock auto_lock(seeking_lock_); |
681 return seeking_; | 681 return seeking_; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 configs->video_codec = config.codec(); | 749 configs->video_codec = config.codec(); |
750 configs->video_size = config.natural_size(); | 750 configs->video_size = config.natural_size(); |
751 configs->is_video_encrypted = config.is_encrypted(); | 751 configs->is_video_encrypted = config.is_encrypted(); |
752 configs->video_extra_data = config.extra_data(); | 752 configs->video_extra_data = config.extra_data(); |
753 return true; | 753 return true; |
754 } | 754 } |
755 return false; | 755 return false; |
756 } | 756 } |
757 | 757 |
758 } // namespace content | 758 } // namespace content |
OLD | NEW |