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/webmediasource_impl.h" | 5 #include "content/renderer/media/webmediasource_impl.h" |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "content/renderer/media/websourcebuffer_impl.h" | 8 #include "content/renderer/media/websourcebuffer_impl.h" |
9 #include "media/filters/chunk_demuxer.h" | 9 #include "media/filters/chunk_demuxer.h" |
10 #include "third_party/WebKit/public/platform/WebCString.h" | 10 #include "third_party/WebKit/public/platform/WebCString.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 WebMediaSource::AddStatus WebMediaSourceImpl::addSourceBuffer( | 36 WebMediaSource::AddStatus WebMediaSourceImpl::addSourceBuffer( |
37 const blink::WebString& type, | 37 const blink::WebString& type, |
38 const blink::WebVector<blink::WebString>& codecs, | 38 const blink::WebVector<blink::WebString>& codecs, |
39 const WebMediaSource::FrameProcessorChoice frame_processor_choice, | 39 const WebMediaSource::FrameProcessorChoice frame_processor_choice, |
40 blink::WebSourceBuffer** source_buffer) { | 40 blink::WebSourceBuffer** source_buffer) { |
41 std::string id = base::GenerateGUID(); | 41 std::string id = base::GenerateGUID(); |
42 std::vector<std::string> new_codecs(codecs.size()); | 42 std::vector<std::string> new_codecs(codecs.size()); |
43 for (size_t i = 0; i < codecs.size(); ++i) | 43 for (size_t i = 0; i < codecs.size(); ++i) |
44 new_codecs[i] = codecs[i].utf8().data(); | 44 new_codecs[i] = codecs[i].utf8().data(); |
45 | 45 |
46 bool use_legacy_frame_processor = false; | 46 // Ignore |frame_processor_choice|. Instead, request the new FrameProcessor. |
47 switch (frame_processor_choice) { | 47 // TODO(wolenetz): Remove |frame_processor_choice| and LegacyFrameProcessor |
48 case UseLegacyFrameProcessor: | 48 // once the new FrameProcessor has stabilized. See http://crbug.com/249422. |
49 use_legacy_frame_processor = true; | |
50 break; | |
51 case UseNewFrameProcessor: | |
52 break; | |
53 } | |
54 | |
55 WebMediaSource::AddStatus result = | 49 WebMediaSource::AddStatus result = |
56 static_cast<WebMediaSource::AddStatus>( | 50 static_cast<WebMediaSource::AddStatus>( |
57 demuxer_->AddId(id, type.utf8().data(), new_codecs, | 51 demuxer_->AddId(id, type.utf8().data(), new_codecs, false)); |
58 use_legacy_frame_processor)); | |
59 | 52 |
60 if (result == WebMediaSource::AddStatusOk) | 53 if (result == WebMediaSource::AddStatusOk) |
61 *source_buffer = new WebSourceBufferImpl(id, demuxer_); | 54 *source_buffer = new WebSourceBufferImpl(id, demuxer_); |
62 | 55 |
63 return result; | 56 return result; |
64 } | 57 } |
65 | 58 |
66 double WebMediaSourceImpl::duration() { | 59 double WebMediaSourceImpl::duration() { |
67 return demuxer_->GetDuration(); | 60 return demuxer_->GetDuration(); |
68 } | 61 } |
(...skipping 19 matching lines...) Expand all Loading... |
88 } | 81 } |
89 | 82 |
90 demuxer_->MarkEndOfStream(pipeline_status); | 83 demuxer_->MarkEndOfStream(pipeline_status); |
91 } | 84 } |
92 | 85 |
93 void WebMediaSourceImpl::unmarkEndOfStream() { | 86 void WebMediaSourceImpl::unmarkEndOfStream() { |
94 demuxer_->UnmarkEndOfStream(); | 87 demuxer_->UnmarkEndOfStream(); |
95 } | 88 } |
96 | 89 |
97 } // namespace content | 90 } // namespace content |
OLD | NEW |