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

Side by Side Diff: media/base/pipeline_impl.cc

Issue 42635: Lots of files touched for a very simple change. Everywhere we used a const M... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/pipeline_impl.h ('k') | media/filters/audio_renderer_base.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 (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "media/base/filter_host_impl.h" 6 #include "media/base/filter_host_impl.h"
7 #include "media/base/media_format.h" 7 #include "media/base/media_format.h"
8 #include "media/base/pipeline_impl.h" 8 #include "media/base/pipeline_impl.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 message_loop()->Quit(); 411 message_loop()->Quit();
412 } 412 }
413 } 413 }
414 414
415 template <class Decoder, class Renderer> 415 template <class Decoder, class Renderer>
416 void PipelineThread::Render(FilterFactory* filter_factory, Demuxer* demuxer) { 416 void PipelineThread::Render(FilterFactory* filter_factory, Demuxer* demuxer) {
417 DCHECK(PipelineOk()); 417 DCHECK(PipelineOk());
418 const std::string major_mime_type = Decoder::major_mime_type(); 418 const std::string major_mime_type = Decoder::major_mime_type();
419 const int num_outputs = demuxer->GetNumberOfStreams(); 419 const int num_outputs = demuxer->GetNumberOfStreams();
420 for (int i = 0; i < num_outputs; ++i) { 420 for (int i = 0; i < num_outputs; ++i) {
421 scoped_refptr<DemuxerStream> demuxer_stream = demuxer->GetStream(i); 421 scoped_refptr<DemuxerStream> stream = demuxer->GetStream(i);
422 const MediaFormat* stream_format = demuxer_stream->GetMediaFormat();
423 std::string value; 422 std::string value;
424 if (stream_format->GetAsString(MediaFormat::kMimeType, &value) && 423 if (stream->media_format().GetAsString(MediaFormat::kMimeType, &value) &&
425 0 == value.compare(0, major_mime_type.length(), major_mime_type)) { 424 0 == value.compare(0, major_mime_type.length(), major_mime_type)) {
426 scoped_refptr<Decoder> decoder = 425 scoped_refptr<Decoder> decoder =
427 CreateFilter<Decoder, DemuxerStream>(filter_factory, demuxer_stream); 426 CreateFilter<Decoder, DemuxerStream>(filter_factory, stream);
428 if (PipelineOk()) { 427 if (PipelineOk()) {
429 DCHECK(decoder); 428 DCHECK(decoder);
430 CreateFilter<Renderer, Decoder>(filter_factory, decoder); 429 CreateFilter<Renderer, Decoder>(filter_factory, decoder);
431 } 430 }
432 if (PipelineOk()) { 431 if (PipelineOk()) {
433 pipeline_->InsertRenderedMimeType(major_mime_type); 432 pipeline_->InsertRenderedMimeType(major_mime_type);
434 } 433 }
435 break; 434 break;
436 } 435 }
437 } 436 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 iter != filter_hosts_.end() && NULL == *filter_out; 492 iter != filter_hosts_.end() && NULL == *filter_out;
494 iter++) { 493 iter++) {
495 (*iter)->GetFilter(filter_out); 494 (*iter)->GetFilter(filter_out);
496 } 495 }
497 } 496 }
498 497
499 template <class Filter, class Source> 498 template <class Filter, class Source>
500 scoped_refptr<Filter> PipelineThread::CreateFilter( 499 scoped_refptr<Filter> PipelineThread::CreateFilter(
501 FilterFactory* filter_factory, 500 FilterFactory* filter_factory,
502 Source source, 501 Source source,
503 const MediaFormat* media_format) { 502 const MediaFormat& media_format) {
504 DCHECK(PipelineOk()); 503 DCHECK(PipelineOk());
505 scoped_refptr<Filter> filter = filter_factory->Create<Filter>(media_format); 504 scoped_refptr<Filter> filter = filter_factory->Create<Filter>(media_format);
506 if (!filter) { 505 if (!filter) {
507 Error(PIPELINE_ERROR_REQUIRED_FILTER_MISSING); 506 Error(PIPELINE_ERROR_REQUIRED_FILTER_MISSING);
508 } else { 507 } else {
509 DCHECK(!host_initializing_); 508 DCHECK(!host_initializing_);
510 host_initializing_ = new FilterHostImpl(this, filter.get()); 509 host_initializing_ = new FilterHostImpl(this, filter.get());
511 if (NULL == host_initializing_) { 510 if (NULL == host_initializing_) {
512 Error(PIPELINE_ERROR_OUT_OF_MEMORY); 511 Error(PIPELINE_ERROR_OUT_OF_MEMORY);
513 } else { 512 } else {
(...skipping 28 matching lines...) Expand all
542 filter = NULL; 541 filter = NULL;
543 } 542 }
544 return filter; 543 return filter;
545 } 544 }
546 545
547 scoped_refptr<DataSource> PipelineThread::CreateDataSource( 546 scoped_refptr<DataSource> PipelineThread::CreateDataSource(
548 FilterFactory* filter_factory, const std::string& url) { 547 FilterFactory* filter_factory, const std::string& url) {
549 MediaFormat url_format; 548 MediaFormat url_format;
550 url_format.SetAsString(MediaFormat::kMimeType, mime_type::kURL); 549 url_format.SetAsString(MediaFormat::kMimeType, mime_type::kURL);
551 url_format.SetAsString(MediaFormat::kURL, url); 550 url_format.SetAsString(MediaFormat::kURL, url);
552 return CreateFilter<DataSource>(filter_factory, url, &url_format); 551 return CreateFilter<DataSource>(filter_factory, url, url_format);
553 } 552 }
554 553
555 // Called as a result of destruction of the thread. 554 // Called as a result of destruction of the thread.
556 void PipelineThread::WillDestroyCurrentMessageLoop() { 555 void PipelineThread::WillDestroyCurrentMessageLoop() {
557 while (!filter_hosts_.empty()) { 556 while (!filter_hosts_.empty()) {
558 delete filter_hosts_.back(); 557 delete filter_hosts_.back();
559 filter_hosts_.pop_back(); 558 filter_hosts_.pop_back();
560 } 559 }
561 } 560 }
562 561
563 } // namespace media 562 } // namespace media
OLDNEW
« no previous file with comments | « media/base/pipeline_impl.h ('k') | media/filters/audio_renderer_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698