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

Side by Side Diff: webkit/media/webmediaplayer_proxy.cc

Issue 10164017: Implement sourceAddId() & sourceRemoveId() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments Created 8 years, 8 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 | « webkit/media/webmediaplayer_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/webmediaplayer_proxy.h" 5 #include "webkit/media/webmediaplayer_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "media/base/pipeline_status.h" 10 #include "media/base/pipeline_status.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 void WebMediaPlayerProxy::DemuxerClosed() { 180 void WebMediaPlayerProxy::DemuxerClosed() {
181 render_loop_->PostTask(FROM_HERE, base::Bind( 181 render_loop_->PostTask(FROM_HERE, base::Bind(
182 &WebMediaPlayerProxy::DemuxerClosedTask, this)); 182 &WebMediaPlayerProxy::DemuxerClosedTask, this));
183 } 183 }
184 184
185 void WebMediaPlayerProxy::DemuxerFlush() { 185 void WebMediaPlayerProxy::DemuxerFlush() {
186 if (chunk_demuxer_.get()) 186 if (chunk_demuxer_.get())
187 chunk_demuxer_->FlushData(); 187 chunk_demuxer_->FlushData();
188 } 188 }
189 189
190 bool WebMediaPlayerProxy::DemuxerAppend(const uint8* data, size_t length) { 190 media::ChunkDemuxer::Status WebMediaPlayerProxy::DemuxerAddId(
191 if (chunk_demuxer_.get()) 191 const std::string& id,
192 return chunk_demuxer_->AppendData(data, length); 192 const std::string& type) {
193 return false; 193 return chunk_demuxer_->AddId(id, type);
194 }
195
196 void WebMediaPlayerProxy::DemuxerRemoveId(const std::string& id) {
197 chunk_demuxer_->RemoveId(id);
198 }
199
200 bool WebMediaPlayerProxy::DemuxerAppend(const std::string& id,
201 const uint8* data,
202 size_t length) {
203 return chunk_demuxer_->AppendData(id, data, length);
194 } 204 }
195 205
196 void WebMediaPlayerProxy::DemuxerEndOfStream(media::PipelineStatus status) { 206 void WebMediaPlayerProxy::DemuxerEndOfStream(media::PipelineStatus status) {
197 if (chunk_demuxer_.get()) 207 chunk_demuxer_->EndOfStream(status);
198 chunk_demuxer_->EndOfStream(status);
199 } 208 }
200 209
201 void WebMediaPlayerProxy::DemuxerShutdown() { 210 void WebMediaPlayerProxy::DemuxerShutdown() {
202 if (chunk_demuxer_.get()) 211 if (chunk_demuxer_.get())
203 chunk_demuxer_->Shutdown(); 212 chunk_demuxer_->Shutdown();
204 } 213 }
205 214
206 void WebMediaPlayerProxy::DemuxerOpenedTask( 215 void WebMediaPlayerProxy::DemuxerOpenedTask(
207 const scoped_refptr<media::ChunkDemuxer>& demuxer) { 216 const scoped_refptr<media::ChunkDemuxer>& demuxer) {
208 DCHECK(render_loop_->BelongsToCurrentThread()); 217 DCHECK(render_loop_->BelongsToCurrentThread());
209 chunk_demuxer_ = demuxer; 218 chunk_demuxer_ = demuxer;
210 if (webmediaplayer_) 219 if (webmediaplayer_)
211 webmediaplayer_->OnDemuxerOpened(); 220 webmediaplayer_->OnDemuxerOpened();
212 } 221 }
213 222
214 void WebMediaPlayerProxy::DemuxerClosedTask() { 223 void WebMediaPlayerProxy::DemuxerClosedTask() {
215 chunk_demuxer_ = NULL; 224 chunk_demuxer_ = NULL;
216 } 225 }
217 226
218 } // namespace webkit_media 227 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/webmediaplayer_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698