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

Side by Side Diff: content/renderer/media/webmediasourceclient_impl.cc

Issue 19649007: Update the WebMediaSourceClientImpl & ChunkDemuxer to received explicit end of stream cancellation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make chromium style enforcers happy Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/webmediasourceclient_impl.h ('k') | media/filters/chunk_demuxer.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/webmediasourceclient_impl.h" 5 #include "content/renderer/media/webmediasourceclient_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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 double WebMediaSourceClientImpl::duration() { 54 double WebMediaSourceClientImpl::duration() {
55 return demuxer_->GetDuration(); 55 return demuxer_->GetDuration();
56 } 56 }
57 57
58 void WebMediaSourceClientImpl::setDuration(double new_duration) { 58 void WebMediaSourceClientImpl::setDuration(double new_duration) {
59 DCHECK_GE(new_duration, 0); 59 DCHECK_GE(new_duration, 0);
60 demuxer_->SetDuration(new_duration); 60 demuxer_->SetDuration(new_duration);
61 } 61 }
62 62
63 // TODO(acolwell): Remove this once endOfStream() is removed from Blink.
63 void WebMediaSourceClientImpl::endOfStream( 64 void WebMediaSourceClientImpl::endOfStream(
64 WebMediaSourceClient::EndOfStreamStatus status) { 65 WebMediaSourceClient::EndOfStreamStatus status) {
66 markEndOfStream(status);
67 }
68
69 void WebMediaSourceClientImpl::markEndOfStream(
70 WebMediaSourceClient::EndOfStreamStatus status) {
65 media::PipelineStatus pipeline_status = media::PIPELINE_OK; 71 media::PipelineStatus pipeline_status = media::PIPELINE_OK;
66 72
67 switch (status) { 73 switch (status) {
68 case WebMediaSourceClient::EndOfStreamStatusNoError: 74 case WebMediaSourceClient::EndOfStreamStatusNoError:
69 break; 75 break;
70 case WebMediaSourceClient::EndOfStreamStatusNetworkError: 76 case WebMediaSourceClient::EndOfStreamStatusNetworkError:
71 pipeline_status = media::PIPELINE_ERROR_NETWORK; 77 pipeline_status = media::PIPELINE_ERROR_NETWORK;
72 break; 78 break;
73 case WebMediaSourceClient::EndOfStreamStatusDecodeError: 79 case WebMediaSourceClient::EndOfStreamStatusDecodeError:
74 pipeline_status = media::PIPELINE_ERROR_DECODE; 80 pipeline_status = media::PIPELINE_ERROR_DECODE;
75 break; 81 break;
76 default: 82 default:
77 NOTIMPLEMENTED(); 83 NOTIMPLEMENTED();
78 } 84 }
79 85
80 demuxer_->EndOfStream(pipeline_status); 86 demuxer_->MarkEndOfStream(pipeline_status);
87 }
88
89 void WebMediaSourceClientImpl::unmarkEndOfStream() {
90 demuxer_->UnmarkEndOfStream();
81 } 91 }
82 92
83 } // namespace content 93 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webmediasourceclient_impl.h ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698