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 "webkit/renderer/media/android/media_source_delegate.h" | 5 #include "content/renderer/media/android/media_source_delegate.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "content/renderer/media/android/webmediaplayer_proxy_android.h" |
9 #include "media/base/android/demuxer_stream_player_params.h" | 10 #include "media/base/android/demuxer_stream_player_params.h" |
10 #include "media/base/bind_to_loop.h" | 11 #include "media/base/bind_to_loop.h" |
11 #include "media/base/demuxer_stream.h" | 12 #include "media/base/demuxer_stream.h" |
12 #include "media/base/media_log.h" | 13 #include "media/base/media_log.h" |
13 #include "media/filters/chunk_demuxer.h" | 14 #include "media/filters/chunk_demuxer.h" |
14 #include "third_party/WebKit/public/platform/WebString.h" | 15 #include "third_party/WebKit/public/platform/WebString.h" |
15 #include "third_party/WebKit/public/web/WebMediaSource.h" | 16 #include "third_party/WebKit/public/web/WebMediaSource.h" |
16 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 17 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
17 #include "webkit/renderer/media/android/webmediaplayer_proxy_android.h" | |
18 #include "webkit/renderer/media/webmediaplayer_util.h" | 18 #include "webkit/renderer/media/webmediaplayer_util.h" |
19 #include "webkit/renderer/media/webmediasourceclient_impl.h" | 19 #include "webkit/renderer/media/webmediasourceclient_impl.h" |
20 | 20 |
21 using media::DemuxerStream; | 21 using media::DemuxerStream; |
22 using media::MediaPlayerHostMsg_DemuxerReady_Params; | 22 using media::MediaPlayerHostMsg_DemuxerReady_Params; |
23 using media::MediaPlayerHostMsg_ReadFromDemuxerAck_Params; | 23 using media::MediaPlayerHostMsg_ReadFromDemuxerAck_Params; |
| 24 using webkit_media::ConvertToWebTimeRanges; |
| 25 using webkit_media::PipelineErrorToNetworkState; |
| 26 using webkit_media::WebMediaSourceClientImpl; |
24 using WebKit::WebMediaPlayer; | 27 using WebKit::WebMediaPlayer; |
25 using WebKit::WebString; | 28 using WebKit::WebString; |
26 | 29 |
27 namespace { | 30 namespace { |
28 | 31 |
29 // The size of the access unit to transfer in an IPC in case of MediaSource. | 32 // The size of the access unit to transfer in an IPC in case of MediaSource. |
30 // 16: approximately 250ms of content in 60 fps movies. | 33 // 16: approximately 250ms of content in 60 fps movies. |
31 const size_t kAccessUnitSizeForMediaSource = 16; | 34 const size_t kAccessUnitSizeForMediaSource = 16; |
32 | 35 |
33 const uint8 kVorbisPadding[] = { 0xff, 0xff, 0xff, 0xff }; | 36 const uint8 kVorbisPadding[] = { 0xff, 0xff, 0xff, 0xff }; |
34 | 37 |
35 } // namespace | 38 } // namespace |
36 | 39 |
37 namespace webkit_media { | 40 namespace content { |
38 | 41 |
39 #define BIND_TO_RENDER_LOOP(function) \ | 42 #define BIND_TO_RENDER_LOOP(function) \ |
40 media::BindToLoop(base::MessageLoopProxy::current(), \ | 43 media::BindToLoop(base::MessageLoopProxy::current(), \ |
41 base::Bind(function, weak_this_.GetWeakPtr())) | 44 base::Bind(function, weak_this_.GetWeakPtr())) |
42 | 45 |
43 #define BIND_TO_RENDER_LOOP_1(function, arg1) \ | 46 #define BIND_TO_RENDER_LOOP_1(function, arg1) \ |
44 media::BindToLoop(base::MessageLoopProxy::current(), \ | 47 media::BindToLoop(base::MessageLoopProxy::current(), \ |
45 base::Bind(function, weak_this_.GetWeakPtr(), arg1)) | 48 base::Bind(function, weak_this_.GetWeakPtr(), arg1)) |
46 | 49 |
47 #define BIND_TO_RENDER_LOOP_2(function, arg1, arg2) \ | 50 #define BIND_TO_RENDER_LOOP_2(function, arg1, arg2) \ |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 need_key_cb_.Run(session_id, type, init_data.Pass(), init_data_size); | 435 need_key_cb_.Run(session_id, type, init_data.Pass(), init_data_size); |
433 } | 436 } |
434 | 437 |
435 scoped_ptr<media::TextTrack> MediaSourceDelegate::OnAddTextTrack( | 438 scoped_ptr<media::TextTrack> MediaSourceDelegate::OnAddTextTrack( |
436 media::TextKind kind, | 439 media::TextKind kind, |
437 const std::string& label, | 440 const std::string& label, |
438 const std::string& language) { | 441 const std::string& language) { |
439 return scoped_ptr<media::TextTrack>(); | 442 return scoped_ptr<media::TextTrack>(); |
440 } | 443 } |
441 | 444 |
442 } // namespace webkit_media | 445 } // namespace content |
OLD | NEW |