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

Unified Diff: remoting/codec/audio_encoder_opus.cc

Issue 1236663002: Allow shaped-desktop hosts to send shape only when it changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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: remoting/codec/audio_encoder_opus.cc
diff --git a/remoting/codec/audio_encoder_opus.cc b/remoting/codec/audio_encoder_opus.cc
index ab7582b8a900217f69273413eb93aa249a16a1c1..315fb9ff2c12b13d8fb440aa15718dd8c764bdd7 100644
--- a/remoting/codec/audio_encoder_opus.cc
+++ b/remoting/codec/audio_encoder_opus.cc
@@ -42,9 +42,9 @@ bool IsSupportedSampleRate(int rate) {
AudioEncoderOpus::AudioEncoderOpus()
: sampling_rate_(0),
channels_(AudioPacket::CHANNELS_STEREO),
- encoder_(NULL),
+ encoder_(nullptr),
frame_size_(0),
- resampling_data_(NULL),
+ resampling_data_(nullptr),
resampling_data_size_(0),
resampling_data_pos_(0) {
}
@@ -93,7 +93,7 @@ void AudioEncoderOpus::InitEncoder() {
void AudioEncoderOpus::DestroyEncoder() {
if (encoder_) {
opus_encoder_destroy(encoder_);
- encoder_ = NULL;
+ encoder_ = nullptr;
}
resampler_.reset();
@@ -118,7 +118,7 @@ bool AudioEncoderOpus::ResetForPacket(AudioPacket* packet) {
InitEncoder();
}
- return encoder_ != NULL;
+ return encoder_ != nullptr;
}
void AudioEncoderOpus::FetchBytesToResample(int resampler_frame_delay,
@@ -164,7 +164,7 @@ scoped_ptr<AudioPacket> AudioEncoderOpus::Encode(
int samples_wanted = frame_size_ + prefetch_samples;
while (leftover_samples_ + samples_in_packet >= samples_wanted) {
- const int16* pcm_buffer = NULL;
+ const int16* pcm_buffer = nullptr;
// Combine the packet with the leftover samples, if any.
if (leftover_samples_ > 0) {
@@ -183,7 +183,7 @@ scoped_ptr<AudioPacket> AudioEncoderOpus::Encode(
resampling_data_pos_ = 0;
resampling_data_size_ = samples_wanted * channels_ * kBytesPerSample;
resampler_->Resample(kFrameSamples, resampler_bus_.get());
- resampling_data_ = NULL;
+ resampling_data_ = nullptr;
samples_consumed = resampling_data_pos_ / channels_ / kBytesPerSample;
resampler_bus_->ToInterleaved(kFrameSamples, kBytesPerSample,
@@ -232,7 +232,7 @@ scoped_ptr<AudioPacket> AudioEncoderOpus::Encode(
leftover_samples_ += samples_in_packet;
}
- // Return NULL if there's nothing in the packet.
+ // Return nullptr if there's nothing in the packet.
if (encoded_packet->data_size() == 0)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698