| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/renderer/media/media_recorder_handler.h" | 5 #include "content/renderer/media/media_recorder_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 namespace content { | 33 namespace content { |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 media::VideoCodec CodecIdToMediaVideoCodec(VideoTrackRecorder::CodecId id) { | 37 media::VideoCodec CodecIdToMediaVideoCodec(VideoTrackRecorder::CodecId id) { |
| 38 switch (id) { | 38 switch (id) { |
| 39 case VideoTrackRecorder::CodecId::VP8: | 39 case VideoTrackRecorder::CodecId::VP8: |
| 40 return media::kCodecVP8; | 40 return media::kCodecVP8; |
| 41 case VideoTrackRecorder::CodecId::VP9: | 41 case VideoTrackRecorder::CodecId::VP9: |
| 42 return media::kCodecVP8; | 42 return media::kCodecVP8; |
| 43 #if BUILDFLAG(RTC_USE_H264) | |
| 44 case VideoTrackRecorder::CodecId::H264: | 43 case VideoTrackRecorder::CodecId::H264: |
| 45 return media::kCodecH264; | 44 return media::kCodecH264; |
| 46 #endif | |
| 47 } | 45 } |
| 48 NOTREACHED() << "Unsupported codec"; | 46 NOTREACHED() << "Unsupported codec"; |
| 49 return media::kUnknownVideoCodec; | 47 return media::kUnknownVideoCodec; |
| 50 } | 48 } |
| 51 | 49 |
| 52 } // anonymous namespace | 50 } // anonymous namespace |
| 53 | 51 |
| 54 MediaRecorderHandler::MediaRecorderHandler() | 52 MediaRecorderHandler::MediaRecorderHandler() |
| 55 : video_bits_per_second_(0), | 53 : video_bits_per_second_(0), |
| 56 audio_bits_per_second_(0), | 54 audio_bits_per_second_(0), |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 recorder->OnData(audio_bus, timestamp); | 304 recorder->OnData(audio_bus, timestamp); |
| 307 } | 305 } |
| 308 | 306 |
| 309 void MediaRecorderHandler::SetAudioFormatForTesting( | 307 void MediaRecorderHandler::SetAudioFormatForTesting( |
| 310 const media::AudioParameters& params) { | 308 const media::AudioParameters& params) { |
| 311 for (auto* recorder : audio_recorders_) | 309 for (auto* recorder : audio_recorders_) |
| 312 recorder->OnSetFormat(params); | 310 recorder->OnSetFormat(params); |
| 313 } | 311 } |
| 314 | 312 |
| 315 } // namespace content | 313 } // namespace content |
| OLD | NEW |