OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/media/webmediasourceclient_impl.h" | 5 #include "webkit/media/webmediasourceclient_impl.h" |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "media/filters/chunk_demuxer.h" | 8 #include "media/filters/chunk_demuxer.h" |
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h" | 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h" |
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
11 #include "webkit/media/websourcebuffer_impl.h" | 11 #include "webkit/media/websourcebuffer_impl.h" |
12 | 12 |
13 using ::WebKit::WebString; | 13 using ::WebKit::WebString; |
14 using ::WebKit::WebMediaSourceClient; | 14 using ::WebKit::WebMediaSourceClient; |
15 | 15 |
16 namespace webkit_media { | 16 namespace webkit_media { |
17 | 17 |
18 #define COMPILE_ASSERT_MATCHING_STATUS_ENUM(webkit_name, chromium_name) \ | 18 #define COMPILE_ASSERT_MATCHING_STATUS_ENUM(webkit_name, chromium_name) \ |
19 COMPILE_ASSERT(static_cast<int>(WebMediaSourceClient::webkit_name) == \ | 19 COMPILE_ASSERT(static_cast<int>(WebMediaSourceClient::webkit_name) == \ |
20 static_cast<int>(media::ChunkDemuxer::chromium_name), \ | 20 static_cast<int>(media::ChunkDemuxer::chromium_name), \ |
21 mismatching_status_enums) | 21 mismatching_status_enums) |
22 COMPILE_ASSERT_MATCHING_STATUS_ENUM(AddStatusOk, kOk); | 22 COMPILE_ASSERT_MATCHING_STATUS_ENUM(AddStatusOk, kOk); |
23 COMPILE_ASSERT_MATCHING_STATUS_ENUM(AddStatusNotSupported, kNotSupported); | 23 COMPILE_ASSERT_MATCHING_STATUS_ENUM(AddStatusNotSupported, kNotSupported); |
24 COMPILE_ASSERT_MATCHING_STATUS_ENUM(AddStatusReachedIdLimit, kReachedIdLimit); | 24 COMPILE_ASSERT_MATCHING_STATUS_ENUM(AddStatusReachedIdLimit, kReachedIdLimit); |
25 #undef COMPILE_ASSERT_MATCHING_STATUS_ENUM | 25 #undef COMPILE_ASSERT_MATCHING_STATUS_ENUM |
26 | 26 |
27 WebMediaSourceClientImpl::WebMediaSourceClientImpl( | 27 WebMediaSourceClientImpl::WebMediaSourceClientImpl( |
28 const scoped_refptr<media::ChunkDemuxer>& demuxer, | 28 media::ChunkDemuxer* demuxer, media::LogCB log_cb) |
29 media::LogCB log_cb) | |
30 : demuxer_(demuxer), | 29 : demuxer_(demuxer), |
31 log_cb_(log_cb) { | 30 log_cb_(log_cb) { |
32 DCHECK(demuxer_); | 31 DCHECK(demuxer_); |
33 } | 32 } |
34 | 33 |
35 WebMediaSourceClientImpl::~WebMediaSourceClientImpl() {} | 34 WebMediaSourceClientImpl::~WebMediaSourceClientImpl() {} |
36 | 35 |
37 WebMediaSourceClient::AddStatus WebMediaSourceClientImpl::addSourceBuffer( | 36 WebMediaSourceClient::AddStatus WebMediaSourceClientImpl::addSourceBuffer( |
38 const WebKit::WebString& type, | 37 const WebKit::WebString& type, |
39 const WebKit::WebVector<WebKit::WebString>& codecs, | 38 const WebKit::WebVector<WebKit::WebString>& codecs, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 break; | 75 break; |
77 default: | 76 default: |
78 NOTIMPLEMENTED(); | 77 NOTIMPLEMENTED(); |
79 } | 78 } |
80 | 79 |
81 if (!demuxer_->EndOfStream(pipeline_status)) | 80 if (!demuxer_->EndOfStream(pipeline_status)) |
82 DVLOG(1) << "EndOfStream call failed."; | 81 DVLOG(1) << "EndOfStream call failed."; |
83 } | 82 } |
84 | 83 |
85 } // namespace webkit_media | 84 } // namespace webkit_media |
OLD | NEW |