Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(951)

Unified Diff: webrtc/modules/audio_coding/main/acm2/acm_receiver.h

Issue 1467183002: Add new method AcmReceiver::last_packet_sample_rate_hz() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@neteq-last-output-rate
Patch Set: Updates after second review Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/main/acm2/acm_receiver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/main/acm2/acm_receiver.h
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver.h b/webrtc/modules/audio_coding/main/acm2/acm_receiver.h
index f02605bb718434ec561b9eb5749c902ef334206d..bcedacd14f42a94a7a7c2705c49be0334bb20c55 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver.h
@@ -15,6 +15,7 @@
#include <vector>
#include "webrtc/base/array_view.h"
+#include "webrtc/base/optional.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/common_audio/vad/include/webrtc_vad.h"
@@ -154,6 +155,12 @@ class AcmReceiver {
//
void ResetInitialDelay();
+ // Returns the sample rate of the decoder associated with the last incoming
+ // packet. If no packet of a registered non-CNG codec has been received, the
+ // return value is empty. Also, if the decoder was unregistered since the last
+ // packet was inserted, the return value is empty.
+ rtc::Optional<int> last_packet_sample_rate_hz() const;
+
// Returns last_output_sample_rate_hz from the NetEq instance.
int last_output_sample_rate_hz() const;
@@ -213,13 +220,6 @@ class AcmReceiver {
bool GetPlayoutTimestamp(uint32_t* timestamp);
//
- // Return the index of the codec associated with the last non-CNG/non-DTMF
- // received payload. If no non-CNG/non-DTMF payload is received -1 is
- // returned.
- //
- int last_audio_codec_id() const; // TODO(turajs): can be inline.
-
- //
// Get the audio codec associated with the last non-CNG/non-DTMF received
// payload. If no non-CNG/non-DTMF packet is received -1 is returned,
// otherwise return 0.
@@ -295,6 +295,7 @@ class AcmReceiver {
bool vad_enabled_;
Clock* clock_; // TODO(henrik.lundin) Make const if possible.
bool resampled_last_output_frame_ GUARDED_BY(crit_sect_);
+ rtc::Optional<int> last_packet_sample_rate_hz_ GUARDED_BY(crit_sect_);
};
} // namespace acm2
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/main/acm2/acm_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698