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 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
474 VideoDecoderConfig FFmpegDemuxerStream::video_decoder_config() { | 474 VideoDecoderConfig FFmpegDemuxerStream::video_decoder_config() { |
475 DCHECK(task_runner_->BelongsToCurrentThread()); | 475 DCHECK(task_runner_->BelongsToCurrentThread()); |
476 CHECK_EQ(type_, VIDEO); | 476 CHECK_EQ(type_, VIDEO); |
477 return video_config_; | 477 return video_config_; |
478 } | 478 } |
479 | 479 |
480 VideoRotation FFmpegDemuxerStream::video_rotation() { | 480 VideoRotation FFmpegDemuxerStream::video_rotation() { |
481 return video_rotation_; | 481 return video_rotation_; |
482 } | 482 } |
483 | 483 |
484 size_t FFmpegDemuxerStream::GetMemoryLimit() const { | |
ddorwin
2015/06/20 01:50:26
Moving part of the discussion from https://coderev
| |
485 // TODO(servolk): Implement better memory limit control for FFMpegDemuxer, | |
486 // currently it has a hard-coded limit of 150Mb across all streams (see | |
487 // IsMaxMemoryUsageReached and crbug.com/343304). | |
488 // Also FFmpegDemuxer is always used with media::BufferDataSource, perhaps | |
489 // we should control buffer size via that for FFmpeg. | |
490 NOTIMPLEMENTED(); | |
491 return 0; | |
ddorwin
2015/06/17 21:02:16
What is going to happen when Blink starts using th
servolk
2015/06/17 22:13:48
For now we are planning to use this API from Blink
ddorwin
2015/06/20 01:50:26
I assume you mean layout tests?
There is nothing t
| |
492 } | |
493 | |
494 void FFmpegDemuxerStream::SetMemoryLimit(size_t memory_limit) { | |
495 // TODO(servolk): Implement better memory limit control for FFMpegDemuxer, | |
496 // currently it has a hard-coded limit of 150Mb across all streams (see | |
497 // IsMaxMemoryUsageReached and crbug.com/343304). | |
498 // Also FFmpegDemuxer is always used with media::BufferDataSource, perhaps | |
499 // we should control buffer size via that for FFmpeg. | |
500 NOTIMPLEMENTED(); | |
501 } | |
502 | |
484 void FFmpegDemuxerStream::SetLiveness(Liveness liveness) { | 503 void FFmpegDemuxerStream::SetLiveness(Liveness liveness) { |
485 DCHECK(task_runner_->BelongsToCurrentThread()); | 504 DCHECK(task_runner_->BelongsToCurrentThread()); |
486 DCHECK_EQ(liveness_, LIVENESS_UNKNOWN); | 505 DCHECK_EQ(liveness_, LIVENESS_UNKNOWN); |
487 liveness_ = liveness; | 506 liveness_ = liveness; |
488 } | 507 } |
489 | 508 |
490 base::TimeDelta FFmpegDemuxerStream::GetElapsedTime() const { | 509 base::TimeDelta FFmpegDemuxerStream::GetElapsedTime() const { |
491 return ConvertStreamTimestamp(stream_->time_base, stream_->cur_dts); | 510 return ConvertStreamTimestamp(stream_->time_base, stream_->cur_dts); |
492 } | 511 } |
493 | 512 |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1303 | 1322 |
1304 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { | 1323 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { |
1305 DCHECK(task_runner_->BelongsToCurrentThread()); | 1324 DCHECK(task_runner_->BelongsToCurrentThread()); |
1306 for (const auto& stream : streams_) { // |stream| is a ref to a pointer. | 1325 for (const auto& stream : streams_) { // |stream| is a ref to a pointer. |
1307 if (stream) | 1326 if (stream) |
1308 stream->SetLiveness(liveness); | 1327 stream->SetLiveness(liveness); |
1309 } | 1328 } |
1310 } | 1329 } |
1311 | 1330 |
1312 } // namespace media | 1331 } // namespace media |
OLD | NEW |