OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/cast/test/fake_media_source.h" | 5 #include "media/cast/test/fake_media_source.h" |
6 | 6 |
7 #include "base/files/memory_mapped_file.h" | 7 #include "base/files/memory_mapped_file.h" |
8 #include "base/files/scoped_file.h" | 8 #include "base/files/scoped_file.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 FakeMediaSource::FakeMediaSource( | 49 FakeMediaSource::FakeMediaSource( |
50 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 50 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
51 base::TickClock* clock, | 51 base::TickClock* clock, |
52 const VideoSenderConfig& video_config) | 52 const VideoSenderConfig& video_config) |
53 : task_runner_(task_runner), | 53 : task_runner_(task_runner), |
54 video_config_(video_config), | 54 video_config_(video_config), |
55 synthetic_count_(0), | 55 synthetic_count_(0), |
56 clock_(clock), | 56 clock_(clock), |
57 audio_frame_count_(0), | 57 audio_frame_count_(0), |
58 video_frame_count_(0), | 58 video_frame_count_(0), |
59 weak_factory_(this), | |
60 av_format_context_(NULL), | 59 av_format_context_(NULL), |
61 audio_stream_index_(-1), | 60 audio_stream_index_(-1), |
62 playback_rate_(1.0), | 61 playback_rate_(1.0), |
63 video_stream_index_(-1), | 62 video_stream_index_(-1), |
64 video_frame_rate_numerator_(video_config.max_frame_rate), | 63 video_frame_rate_numerator_(video_config.max_frame_rate), |
65 video_frame_rate_denominator_(1), | 64 video_frame_rate_denominator_(1), |
66 video_first_pts_(0), | 65 video_first_pts_(0), |
67 video_first_pts_set_(false) { | 66 video_first_pts_set_(false), |
| 67 weak_factory_(this) { |
68 audio_bus_factory_.reset(new TestAudioBusFactory(kAudioChannels, | 68 audio_bus_factory_.reset(new TestAudioBusFactory(kAudioChannels, |
69 kAudioSamplingFrequency, | 69 kAudioSamplingFrequency, |
70 kSoundFrequency, | 70 kSoundFrequency, |
71 kSoundVolume)); | 71 kSoundVolume)); |
72 } | 72 } |
73 | 73 |
74 FakeMediaSource::~FakeMediaSource() { | 74 FakeMediaSource::~FakeMediaSource() { |
75 } | 75 } |
76 | 76 |
77 void FakeMediaSource::SetSourceFile(const base::FilePath& video_file, | 77 void FakeMediaSource::SetSourceFile(const base::FilePath& video_file, |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 AVCodecContext* FakeMediaSource::av_audio_context() { | 585 AVCodecContext* FakeMediaSource::av_audio_context() { |
586 return av_audio_stream()->codec; | 586 return av_audio_stream()->codec; |
587 } | 587 } |
588 | 588 |
589 AVCodecContext* FakeMediaSource::av_video_context() { | 589 AVCodecContext* FakeMediaSource::av_video_context() { |
590 return av_video_stream()->codec; | 590 return av_video_stream()->codec; |
591 } | 591 } |
592 | 592 |
593 } // namespace cast | 593 } // namespace cast |
594 } // namespace media | 594 } // namespace media |
OLD | NEW |