OLD | NEW |
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 "media/base/pipeline.h" | 5 #include "media/base/pipeline.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 if ((duration_ - media_time).InMilliseconds() > 250) | 678 if ((duration_ - media_time).InMilliseconds() > 250) |
679 SetDuration(media_time); | 679 SetDuration(media_time); |
680 | 680 |
681 DCHECK_EQ(status_, PIPELINE_OK); | 681 DCHECK_EQ(status_, PIPELINE_OK); |
682 ended_cb_.Run(); | 682 ended_cb_.Run(); |
683 } | 683 } |
684 | 684 |
685 scoped_ptr<TextRenderer> Pipeline::CreateTextRenderer() { | 685 scoped_ptr<TextRenderer> Pipeline::CreateTextRenderer() { |
686 DCHECK(task_runner_->BelongsToCurrentThread()); | 686 DCHECK(task_runner_->BelongsToCurrentThread()); |
687 | 687 |
688 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 688 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
689 if (!cmd_line->HasSwitch(switches::kEnableInbandTextTracks)) | 689 if (!cmd_line->HasSwitch(switches::kEnableInbandTextTracks)) |
690 return scoped_ptr<media::TextRenderer>(); | 690 return scoped_ptr<media::TextRenderer>(); |
691 | 691 |
692 return scoped_ptr<media::TextRenderer>(new media::TextRenderer( | 692 return scoped_ptr<media::TextRenderer>(new media::TextRenderer( |
693 task_runner_, | 693 task_runner_, |
694 base::Bind(&Pipeline::OnAddTextTrack, weak_factory_.GetWeakPtr()))); | 694 base::Bind(&Pipeline::OnAddTextTrack, weak_factory_.GetWeakPtr()))); |
695 } | 695 } |
696 | 696 |
697 void Pipeline::AddTextStreamTask(DemuxerStream* text_stream, | 697 void Pipeline::AddTextStreamTask(DemuxerStream* text_stream, |
698 const TextTrackConfig& config) { | 698 const TextTrackConfig& config) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 metadata_cb_.Run(metadata); | 758 metadata_cb_.Run(metadata); |
759 } | 759 } |
760 | 760 |
761 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { | 761 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { |
762 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; | 762 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; |
763 DCHECK(task_runner_->BelongsToCurrentThread()); | 763 DCHECK(task_runner_->BelongsToCurrentThread()); |
764 buffering_state_cb_.Run(new_buffering_state); | 764 buffering_state_cb_.Run(new_buffering_state); |
765 } | 765 } |
766 | 766 |
767 } // namespace media | 767 } // namespace media |
OLD | NEW |