Chromium Code Reviews| 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/filters/ffmpeg_demuxer.h" | 5 #include "media/filters/ffmpeg_demuxer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 588 SampleFormat sample_format = audio_config.sample_format(); | 588 SampleFormat sample_format = audio_config.sample_format(); |
| 589 std::string sample_name = SampleFormatToString(sample_format); | 589 std::string sample_name = SampleFormatToString(sample_format); |
| 590 | 590 |
| 591 media_log_->SetStringProperty("audio_sample_format", sample_name); | 591 media_log_->SetStringProperty("audio_sample_format", sample_name); |
| 592 | 592 |
| 593 AVCodec* codec = avcodec_find_decoder(audio_codec->codec_id); | 593 AVCodec* codec = avcodec_find_decoder(audio_codec->codec_id); |
| 594 if (codec) { | 594 if (codec) { |
| 595 media_log_->SetStringProperty("audio_codec_name", codec->name); | 595 media_log_->SetStringProperty("audio_codec_name", codec->name); |
| 596 } | 596 } |
| 597 | 597 |
| 598 media_log_->SetIntegerProperty("audio_sample_rate", | |
| 599 audio_codec->sample_rate); | |
|
Ty Overby
2013/09/05 22:10:57
audio_codec->sample_rate gives you the same inform
| |
| 600 media_log_->SetIntegerProperty("audio_channels_count", | 598 media_log_->SetIntegerProperty("audio_channels_count", |
| 601 audio_codec->channels); | 599 audio_codec->channels); |
| 602 media_log_->SetIntegerProperty("audio_samples_per_second", | 600 media_log_->SetIntegerProperty("audio_samples_per_second", |
| 603 audio_config.samples_per_second()); | 601 audio_config.samples_per_second()); |
| 604 } else { | 602 } else { |
| 605 media_log_->SetBooleanProperty("found_audio_stream", false); | 603 media_log_->SetBooleanProperty("found_audio_stream", false); |
| 606 } | 604 } |
| 607 | 605 |
| 608 // Video logging | 606 // Video logging |
| 609 if (video_stream) { | 607 if (video_stream) { |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 630 "video_format", VideoFrame::FormatToString(video_config.format())); | 628 "video_format", VideoFrame::FormatToString(video_config.format())); |
| 631 media_log_->SetBooleanProperty("video_is_encrypted", | 629 media_log_->SetBooleanProperty("video_is_encrypted", |
| 632 video_config.is_encrypted()); | 630 video_config.is_encrypted()); |
| 633 } else { | 631 } else { |
| 634 media_log_->SetBooleanProperty("found_video_stream", false); | 632 media_log_->SetBooleanProperty("found_video_stream", false); |
| 635 } | 633 } |
| 636 | 634 |
| 637 | 635 |
| 638 media_log_->SetDoubleProperty("max_duration", max_duration.InSecondsF()); | 636 media_log_->SetDoubleProperty("max_duration", max_duration.InSecondsF()); |
| 639 media_log_->SetDoubleProperty("start_time", start_time_.InSecondsF()); | 637 media_log_->SetDoubleProperty("start_time", start_time_.InSecondsF()); |
| 640 media_log_->SetDoubleProperty("filesize_in_bytes", | 638 media_log_->SetDoubleProperty("total_bytes", |
|
Ty Overby
2013/09/05 22:10:57
"total_bytes" is used by the network infrastructur
scherkus (not reviewing)
2013/09/06 20:47:57
I would remove logging this if the it's already ha
Ty Overby
2013/09/09 17:29:04
Sometimes the networking layer doesn't report it,
scherkus (not reviewing)
2013/09/09 17:56:50
ah I thought by network infrastructure you were re
| |
| 641 static_cast<double>(filesize_in_bytes)); | 639 static_cast<double>(filesize_in_bytes)); |
| 642 media_log_->SetIntegerProperty("bitrate", bitrate_); | 640 media_log_->SetIntegerProperty("bitrate", bitrate_); |
| 643 | 641 |
| 644 status_cb.Run(PIPELINE_OK); | 642 status_cb.Run(PIPELINE_OK); |
| 645 } | 643 } |
| 646 | 644 |
| 647 void FFmpegDemuxer::OnSeekFrameDone(const PipelineStatusCB& cb, int result) { | 645 void FFmpegDemuxer::OnSeekFrameDone(const PipelineStatusCB& cb, int result) { |
| 648 DCHECK(message_loop_->BelongsToCurrentThread()); | 646 DCHECK(message_loop_->BelongsToCurrentThread()); |
| 649 CHECK(pending_seek_); | 647 CHECK(pending_seek_); |
| 650 pending_seek_ = false; | 648 pending_seek_ = false; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 838 } | 836 } |
| 839 for (size_t i = 0; i < buffered.size(); ++i) | 837 for (size_t i = 0; i < buffered.size(); ++i) |
| 840 host_->AddBufferedTimeRange(buffered.start(i), buffered.end(i)); | 838 host_->AddBufferedTimeRange(buffered.start(i), buffered.end(i)); |
| 841 } | 839 } |
| 842 | 840 |
| 843 void FFmpegDemuxer::OnDataSourceError() { | 841 void FFmpegDemuxer::OnDataSourceError() { |
| 844 host_->OnDemuxerError(PIPELINE_ERROR_READ); | 842 host_->OnDemuxerError(PIPELINE_ERROR_READ); |
| 845 } | 843 } |
| 846 | 844 |
| 847 } // namespace media | 845 } // namespace media |
| OLD | NEW |