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

Unified Diff: media/filters/chunk_demuxer.cc

Issue 9860027: Remove DemuxerFactory and URL parameter from Pipeline. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: again Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/chunk_demuxer_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/chunk_demuxer.cc
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc
index 68e575d35711092dad8fdf3bf5d4adf6db0d324e..452d5353f26ef4abecf6277d92c436e54ab3d681 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -335,8 +335,7 @@ ChunkDemuxer::ChunkDemuxer(ChunkDemuxerClient* client)
: state_(WAITING_FOR_INIT),
client_(client),
buffered_bytes_(0),
- seek_waits_for_data_(true),
- deferred_error_(PIPELINE_OK) {
+ seek_waits_for_data_(true) {
DCHECK(client);
}
@@ -344,7 +343,7 @@ ChunkDemuxer::~ChunkDemuxer() {
DCHECK_NE(state_, INITIALIZED);
}
-void ChunkDemuxer::Init(const PipelineStatusCB& cb) {
+void ChunkDemuxer::Initialize(const PipelineStatusCB& cb) {
DVLOG(1) << "Init()";
{
base::AutoLock auto_lock(lock_);
@@ -362,17 +361,6 @@ void ChunkDemuxer::Init(const PipelineStatusCB& cb) {
client_->DemuxerOpened(this);
}
-void ChunkDemuxer::set_host(DemuxerHost* host) {
- DCHECK(state_ == INITIALIZED || state_ == PARSE_ERROR);
- Demuxer::set_host(host);
- host->SetDuration(duration_);
- host->SetCurrentReadPosition(0);
- if (deferred_error_ != PIPELINE_OK) {
- host->OnDemuxerError(deferred_error_);
- deferred_error_ = PIPELINE_OK;
- }
-}
-
void ChunkDemuxer::Stop(const base::Closure& callback) {
DVLOG(1) << "Stop()";
Shutdown();
@@ -411,8 +399,6 @@ void ChunkDemuxer::OnAudioRendererDisabled() {
audio_ = NULL;
}
-void ChunkDemuxer::SetPreload(Preload preload) {}
-
int ChunkDemuxer::GetBitrate() {
// TODO(acolwell): Implement bitrate reporting.
return 0;
@@ -551,16 +537,14 @@ bool ChunkDemuxer::AppendData(const uint8* data, size_t length) {
}
// Notify the host of 'network activity' because we got data.
- if (host()) {
- host()->SetBufferedBytes(buffered_bytes);
-
- if (buffered_ts.InSeconds() >= 0) {
- host()->SetBufferedTime(buffered_ts);
- }
+ host()->SetBufferedBytes(buffered_bytes);
- host()->SetNetworkActivity(true);
+ if (buffered_ts.InSeconds() >= 0) {
+ host()->SetBufferedTime(buffered_ts);
}
+ host()->SetNetworkActivity(true);
+
if (!cb.is_null())
cb.Run(PIPELINE_OK);
@@ -664,14 +648,8 @@ void ChunkDemuxer::ReportError_Locked(PipelineStatus error) {
return;
}
- DemuxerHost* demuxer_host = host();
- if (demuxer_host) {
- base::AutoUnlock auto_unlock(lock_);
- demuxer_host->OnDemuxerError(error);
- return;
- }
-
- deferred_error_ = error;
+ base::AutoUnlock auto_unlock(lock_);
+ host()->OnDemuxerError(error);
}
void ChunkDemuxer::OnStreamParserInitDone(bool success,
@@ -684,6 +662,8 @@ void ChunkDemuxer::OnStreamParserInitDone(bool success,
}
duration_ = duration;
+ host()->SetDuration(duration_);
+ host()->SetCurrentReadPosition(0);
ChangeState_Locked(INITIALIZED);
PipelineStatusCB cb;
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/chunk_demuxer_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698