OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, | 5 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, |
6 // potential deadlocks, etc... | 6 // potential deadlocks, etc... |
7 | 7 |
8 #include "media/base/pipeline_impl.h" | 8 #include "media/base/pipeline_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/stl_util-inl.h" | 15 #include "base/stl_util-inl.h" |
16 #include "base/synchronization/condition_variable.h" | 16 #include "base/synchronization/condition_variable.h" |
17 #include "media/filters/rtc_video_decoder.h" | 17 #include "googleurl/src/gurl.h" |
scherkus (not reviewing)
2011/06/24 21:33:39
media shouldn't depend on googleurl
Ronghua
2011/06/27 22:34:51
Done.
| |
18 #include "media/base/clock.h" | 18 #include "media/base/clock.h" |
19 #include "media/base/filter_collection.h" | 19 #include "media/base/filter_collection.h" |
20 #include "media/base/media_format.h" | 20 #include "media/base/media_format.h" |
21 | 21 |
22 namespace media { | 22 namespace media { |
23 | 23 |
24 PipelineStatusNotification::PipelineStatusNotification() | 24 PipelineStatusNotification::PipelineStatusNotification() |
25 : cv_(&lock_), status_(PIPELINE_OK), notified_(false) { | 25 : cv_(&lock_), status_(PIPELINE_OK), notified_(false) { |
26 callback_.reset(NewCallback(this, &PipelineStatusNotification::Notify)); | 26 callback_.reset(NewCallback(this, &PipelineStatusNotification::Notify)); |
27 } | 27 } |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
610 DCHECK_EQ(kCreated, state_); | 610 DCHECK_EQ(kCreated, state_); |
611 filter_collection_.reset(filter_collection); | 611 filter_collection_.reset(filter_collection); |
612 url_ = url; | 612 url_ = url; |
613 seek_callback_.reset(start_callback); | 613 seek_callback_.reset(start_callback); |
614 | 614 |
615 // Kick off initialization. | 615 // Kick off initialization. |
616 pipeline_init_state_.reset(new PipelineInitState()); | 616 pipeline_init_state_.reset(new PipelineInitState()); |
617 pipeline_init_state_->composite_ = new CompositeFilter(message_loop_); | 617 pipeline_init_state_->composite_ = new CompositeFilter(message_loop_); |
618 pipeline_init_state_->composite_->set_host(this); | 618 pipeline_init_state_->composite_->set_host(this); |
619 | 619 |
620 if (RTCVideoDecoder::IsUrlSupported(url)) { | 620 GURL gurl(url); |
621 if (gurl.SchemeIs(kRawVideoScheme)) { | |
scherkus (not reviewing)
2011/06/24 21:33:39
hmm... perhaps we can just do a check using std::s
Ronghua
2011/06/27 22:34:51
Done.
| |
621 set_state(kInitVideoDecoder); | 622 set_state(kInitVideoDecoder); |
622 InitializeVideoDecoder(NULL); | 623 InitializeVideoDecoder(NULL); |
623 } else { | 624 } else { |
624 set_state(kInitDemuxer); | 625 set_state(kInitDemuxer); |
625 InitializeDemuxer(); | 626 InitializeDemuxer(); |
626 } | 627 } |
627 } | 628 } |
628 | 629 |
629 // Main initialization method called on the pipeline thread. This code attempts | 630 // Main initialization method called on the pipeline thread. This code attempts |
630 // to use the specified filter factory to build a pipeline. | 631 // to use the specified filter factory to build a pipeline. |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1300 case kStopping: | 1301 case kStopping: |
1301 case kStopped: | 1302 case kStopped: |
1302 NOTREACHED() << "Unexpected state for teardown: " << state_; | 1303 NOTREACHED() << "Unexpected state for teardown: " << state_; |
1303 break; | 1304 break; |
1304 // default: intentionally left out to force new states to cause compiler | 1305 // default: intentionally left out to force new states to cause compiler |
1305 // errors. | 1306 // errors. |
1306 }; | 1307 }; |
1307 } | 1308 } |
1308 | 1309 |
1309 } // namespace media | 1310 } // namespace media |
OLD | NEW |