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 // A fake media source that generates video and audio frames to a cast | 5 // A fake media source that generates video and audio frames to a cast |
6 // sender. | 6 // sender. |
7 // This class can transcode a WebM file using FFmpeg. It can also | 7 // This class can transcode a WebM file using FFmpeg. It can also |
8 // generate an animation and audio of fixed frequency. | 8 // generate an animation and audio of fixed frequency. |
9 | 9 |
10 #ifndef MEDIA_CAST_TEST_FAKE_MEDIA_SOURCE_H_ | 10 #ifndef MEDIA_CAST_TEST_FAKE_MEDIA_SOURCE_H_ |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 void Rewind(); | 101 void Rewind(); |
102 | 102 |
103 // Call FFmpeg to fetch one packet. | 103 // Call FFmpeg to fetch one packet. |
104 ScopedAVPacket DemuxOnePacket(bool* audio); | 104 ScopedAVPacket DemuxOnePacket(bool* audio); |
105 | 105 |
106 void DecodeAudio(ScopedAVPacket packet); | 106 void DecodeAudio(ScopedAVPacket packet); |
107 void DecodeVideo(ScopedAVPacket packet); | 107 void DecodeVideo(ScopedAVPacket packet); |
108 void Decode(bool decode_audio); | 108 void Decode(bool decode_audio); |
109 | 109 |
110 // media::AudioConverter::InputCallback implementation. | 110 // media::AudioConverter::InputCallback implementation. |
111 double ProvideInput(media::AudioBus* output_bus, base::TimeDelta buffer_delay) | 111 double ProvideInput(media::AudioBus* output_bus, |
112 final; | 112 uint32_t frames_delayed) final; |
113 | 113 |
114 AVStream* av_audio_stream(); | 114 AVStream* av_audio_stream(); |
115 AVStream* av_video_stream(); | 115 AVStream* av_video_stream(); |
116 AVCodecContext* av_audio_context(); | 116 AVCodecContext* av_audio_context(); |
117 AVCodecContext* av_video_context(); | 117 AVCodecContext* av_video_context(); |
118 | 118 |
119 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 119 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
120 const media::AudioParameters output_audio_params_; | 120 const media::AudioParameters output_audio_params_; |
121 const VideoSenderConfig video_config_; | 121 const VideoSenderConfig video_config_; |
122 const bool keep_frames_; | 122 const bool keep_frames_; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // NOTE: Weak pointers must be invalidated before all other member variables. | 169 // NOTE: Weak pointers must be invalidated before all other member variables. |
170 base::WeakPtrFactory<FakeMediaSource> weak_factory_; | 170 base::WeakPtrFactory<FakeMediaSource> weak_factory_; |
171 | 171 |
172 DISALLOW_COPY_AND_ASSIGN(FakeMediaSource); | 172 DISALLOW_COPY_AND_ASSIGN(FakeMediaSource); |
173 }; | 173 }; |
174 | 174 |
175 } // namespace cast | 175 } // namespace cast |
176 } // namespace media | 176 } // namespace media |
177 | 177 |
178 #endif // MEDIA_CAST_TEST_FAKE_MEDIA_SOURCE_H_ | 178 #endif // MEDIA_CAST_TEST_FAKE_MEDIA_SOURCE_H_ |
OLD | NEW |