Regression test for issue where Opus DTX status was being forgotten.
BUG=webrtc:6020 Review-Url: https://codereview.webrtc.org/2177263002 Cr-Commit-Position: refs/heads/master@{#13539}
This commit is contained in:
@ -50,6 +50,10 @@ bool AudioEncoder::SetDtx(bool enable) {
|
||||
return !enable;
|
||||
}
|
||||
|
||||
bool AudioEncoder::GetDtx() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AudioEncoder::SetApplication(Application application) {
|
||||
return false;
|
||||
}
|
||||
|
@ -127,6 +127,10 @@ class AudioEncoder {
|
||||
// supported).
|
||||
virtual bool SetDtx(bool enable);
|
||||
|
||||
// Returns the status of codec-internal DTX. The default implementation always
|
||||
// returns false.
|
||||
virtual bool GetDtx() const;
|
||||
|
||||
// Sets the application mode. Returns true if the codec was able to comply.
|
||||
// The default implementation just returns false.
|
||||
enum class Application { kSpeech, kAudio };
|
||||
|
@ -152,6 +152,10 @@ bool AudioEncoderOpus::SetDtx(bool enable) {
|
||||
return RecreateEncoderInstance(conf);
|
||||
}
|
||||
|
||||
bool AudioEncoderOpus::GetDtx() const {
|
||||
return config_.dtx_enabled;
|
||||
}
|
||||
|
||||
bool AudioEncoderOpus::SetApplication(Application application) {
|
||||
auto conf = config_;
|
||||
switch (application) {
|
||||
|
@ -75,6 +75,7 @@ class AudioEncoderOpus final : public AudioEncoder {
|
||||
// being inactive. During that, it still sends 2 packets (one for content, one
|
||||
// for signaling) about every 400 ms.
|
||||
bool SetDtx(bool enable) override;
|
||||
bool GetDtx() const override;
|
||||
|
||||
bool SetApplication(Application application) override;
|
||||
void SetMaxPlaybackRate(int frequency_hz) override;
|
||||
@ -84,7 +85,6 @@ class AudioEncoderOpus final : public AudioEncoder {
|
||||
// Getters for testing.
|
||||
double packet_loss_rate() const { return packet_loss_rate_; }
|
||||
ApplicationMode application() const { return config_.application; }
|
||||
bool dtx_enabled() const { return config_.dtx_enabled; }
|
||||
|
||||
protected:
|
||||
EncodedInfo EncodeImpl(uint32_t rtp_timestamp,
|
||||
|
Reference in New Issue
Block a user