Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license | |
| 5 * that can be found in the LICENSE file in the root of the source | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_FACTORY_H_ | |
| 12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_FACTORY_H_ | |
| 13 | |
| 14 #include <memory> | |
| 15 #include <vector> | |
| 16 | |
| 17 #include "webrtc/api/audio_codecs/audio_format.h" | |
| 18 #include "webrtc/base/refcount.h" | |
| 19 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" | |
| 20 | |
| 21 namespace webrtc { | |
| 22 | |
| 23 // A factory that creates AudioEncoders. | |
| 24 // NOTE: This class is still under development and may change without notice. | |
| 25 class AudioEncoderFactory : public rtc::RefCountInterface { | |
| 26 public: | |
| 27 virtual std::vector<AudioCodecSpec> GetSupportedEncoders() = 0; | |
| 28 | |
| 29 virtual bool IsSupportedEncoder(const SdpAudioFormat& format) = 0; | |
| 30 | |
| 31 virtual rtc::Optional<AudioFormatInfo> QueryAudioFormat( | |
|
the sun
2017/03/14 20:48:29
May be good to add "Encoder" to this method name -
ossu
2017/03/15 11:26:52
The decoder has no QueryAudioFormat method as it s
the sun
2017/03/15 11:57:39
FWIW, I think I'd prefer to drop IsSupported[Encod
kwiberg-webrtc
2017/03/15 13:33:17
Hmm. Having one object implement multiple interfac
kwiberg-webrtc
2017/03/15 13:33:17
The helper is unnecessary---rtc::Optional converts
the sun
2017/03/15 13:37:44
Yeah, but it may make the code more readable...
the sun
2017/03/15 13:37:44
Agree, but in certain cases there may be shared re
kwiberg-webrtc
2017/03/15 14:10:24
In this case not much, I'd argue. It's pretty obvi
kwiberg-webrtc
2017/03/15 14:10:24
In which case the encoder and decoder objects shou
| |
| 32 const SdpAudioFormat& format) = 0; | |
| 33 | |
| 34 virtual std::unique_ptr<AudioEncoder> MakeAudioEncoder( | |
| 35 int payload_type, | |
| 36 const SdpAudioFormat& format) = 0; | |
| 37 }; | |
| 38 | |
| 39 } // namespace webrtc | |
| 40 | |
| 41 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_FACTORY_H_ | |
| OLD | NEW |