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

Unified Diff: modules/include/module_common_types.h

Issue 3019543002: Remove various IDs (Closed)
Patch Set: compatibility version of UpdateFrame Created 3 years, 3 months 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
Index: modules/include/module_common_types.h
diff --git a/modules/include/module_common_types.h b/modules/include/module_common_types.h
index a75ed42fa0e7ebd42c2eb9112f9925a119362319..7700fc26d76c63b95eef47a43e61b1ff98f59ad3 100644
--- a/modules/include/module_common_types.h
+++ b/modules/include/module_common_types.h
@@ -329,7 +329,18 @@ class AudioFrame {
// ResetWithoutMuting() to skip this wasteful zeroing.
void ResetWithoutMuting();
- void UpdateFrame(int id, uint32_t timestamp, const int16_t* data,
+ // TODO(solenberg): Remove once downstream users of AudioFrame have updated.
+ RTC_DEPRECATED
+ void UpdateFrame(int id, uint32_t timestamp, const int16_t* data,
+ size_t samples_per_channel, int sample_rate_hz,
+ SpeechType speech_type, VADActivity vad_activity,
+ size_t num_channels = 1) {
+ RTC_UNUSED(id);
+ UpdateFrame(timestamp, data, samples_per_channel, sample_rate_hz,
+ speech_type, vad_activity, num_channels);
+ }
+
+ void UpdateFrame(uint32_t timestamp, const int16_t* data,
size_t samples_per_channel, int sample_rate_hz,
SpeechType speech_type, VADActivity vad_activity,
size_t num_channels = 1);
@@ -354,7 +365,6 @@ class AudioFrame {
RTC_DEPRECATED AudioFrame& operator>>=(const int rhs);
RTC_DEPRECATED AudioFrame& operator+=(const AudioFrame& rhs);
- int id_;
// RTP timestamp of the first sample in the AudioFrame.
uint32_t timestamp_ = 0;
// Time since the first frame in milliseconds.
@@ -396,7 +406,6 @@ inline void AudioFrame::Reset() {
}
inline void AudioFrame::ResetWithoutMuting() {
- id_ = -1;
// TODO(wu): Zero is a valid value for |timestamp_|. We should initialize
// to an invalid value, or add a new member to indicate invalidity.
timestamp_ = 0;
@@ -409,15 +418,13 @@ inline void AudioFrame::ResetWithoutMuting() {
vad_activity_ = kVadUnknown;
}
-inline void AudioFrame::UpdateFrame(int id,
- uint32_t timestamp,
+inline void AudioFrame::UpdateFrame(uint32_t timestamp,
const int16_t* data,
size_t samples_per_channel,
int sample_rate_hz,
SpeechType speech_type,
VADActivity vad_activity,
size_t num_channels) {
- id_ = id;
timestamp_ = timestamp;
samples_per_channel_ = samples_per_channel;
sample_rate_hz_ = sample_rate_hz;
@@ -438,7 +445,6 @@ inline void AudioFrame::UpdateFrame(int id,
inline void AudioFrame::CopyFrom(const AudioFrame& src) {
if (this == &src) return;
- id_ = src.id_;
timestamp_ = src.timestamp_;
elapsed_time_ms_ = src.elapsed_time_ms_;
ntp_time_ms_ = src.ntp_time_ms_;

Powered by Google App Engine
This is Rietveld 408576698