Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Side by Side Diff: media/blink/webmediasource_impl.cc

Issue 495353003: Move WebMediaPlayerImpl and its dependencies to media/blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/blink/webmediasource_impl.h ('k') | media/blink/websourcebuffer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "media/blink/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 "media/blink/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"
11 #include "third_party/WebKit/public/platform/WebString.h" 11 #include "third_party/WebKit/public/platform/WebString.h"
12 12
13 using ::blink::WebString; 13 using ::blink::WebString;
14 using ::blink::WebMediaSource; 14 using ::blink::WebMediaSource;
15 15
16 namespace content { 16 namespace 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>(WebMediaSource::webkit_name) == \ 19 COMPILE_ASSERT(static_cast<int>(WebMediaSource::webkit_name) == \
20 static_cast<int>(media::ChunkDemuxer::chromium_name), \ 20 static_cast<int>(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 WebMediaSourceImpl::WebMediaSourceImpl( 27 WebMediaSourceImpl::WebMediaSourceImpl(
28 media::ChunkDemuxer* demuxer, media::LogCB log_cb) 28 ChunkDemuxer* demuxer, LogCB log_cb)
29 : demuxer_(demuxer), 29 : demuxer_(demuxer),
30 log_cb_(log_cb) { 30 log_cb_(log_cb) {
31 DCHECK(demuxer_); 31 DCHECK(demuxer_);
32 } 32 }
33 33
34 WebMediaSourceImpl::~WebMediaSourceImpl() {} 34 WebMediaSourceImpl::~WebMediaSourceImpl() {}
35 35
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,
(...skipping 17 matching lines...) Expand all
56 return demuxer_->GetDuration(); 56 return demuxer_->GetDuration();
57 } 57 }
58 58
59 void WebMediaSourceImpl::setDuration(double new_duration) { 59 void WebMediaSourceImpl::setDuration(double new_duration) {
60 DCHECK_GE(new_duration, 0); 60 DCHECK_GE(new_duration, 0);
61 demuxer_->SetDuration(new_duration); 61 demuxer_->SetDuration(new_duration);
62 } 62 }
63 63
64 void WebMediaSourceImpl::markEndOfStream( 64 void WebMediaSourceImpl::markEndOfStream(
65 WebMediaSource::EndOfStreamStatus status) { 65 WebMediaSource::EndOfStreamStatus status) {
66 media::PipelineStatus pipeline_status = media::PIPELINE_OK; 66 PipelineStatus pipeline_status = PIPELINE_OK;
67 67
68 switch (status) { 68 switch (status) {
69 case WebMediaSource::EndOfStreamStatusNoError: 69 case WebMediaSource::EndOfStreamStatusNoError:
70 break; 70 break;
71 case WebMediaSource::EndOfStreamStatusNetworkError: 71 case WebMediaSource::EndOfStreamStatusNetworkError:
72 pipeline_status = media::PIPELINE_ERROR_NETWORK; 72 pipeline_status = PIPELINE_ERROR_NETWORK;
73 break; 73 break;
74 case WebMediaSource::EndOfStreamStatusDecodeError: 74 case WebMediaSource::EndOfStreamStatusDecodeError:
75 pipeline_status = media::PIPELINE_ERROR_DECODE; 75 pipeline_status = PIPELINE_ERROR_DECODE;
76 break; 76 break;
77 } 77 }
78 78
79 demuxer_->MarkEndOfStream(pipeline_status); 79 demuxer_->MarkEndOfStream(pipeline_status);
80 } 80 }
81 81
82 void WebMediaSourceImpl::unmarkEndOfStream() { 82 void WebMediaSourceImpl::unmarkEndOfStream() {
83 demuxer_->UnmarkEndOfStream(); 83 demuxer_->UnmarkEndOfStream();
84 } 84 }
85 85
86 } // namespace content 86 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webmediasource_impl.h ('k') | media/blink/websourcebuffer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698