modules/audio_device/android/audio_track_jni.cc
void AudioTrackJni::OnGetPlayoutData(int length) {
  DCHECK(thread_checker_java_.CalledOnValidThread());
  DCHECK_EQ(frames_per_buffer_, length / kBytesPerFrame);
  if (!audio_device_buffer_) {
    ALOGE("AttachAudioBuffer has not been called!");
    return;
  }
  // Pull decoded data (in 16-bit PCM format) from jitter buffer.
  int samples = audio_device_buffer_->RequestPlayoutData(frames_per_buffer_);
  if (samples <= 0) {
    ALOGE("AudioDeviceBuffer::RequestPlayoutData failed!");
    return;
  }
  DCHECK_EQ(samples, frames_per_buffer_);
  // Copy decoded data into common byte buffer to ensure that it can be
  // written to the Java based audio track.
  samples = audio_device_buffer_->GetPlayoutData(direct_buffer_address_);
  DCHECK_EQ(length, kBytesPerFrame * samples);
}
// This method is called on a high-priority thread from Java. The name of
// the thread is 'AudioRecordTrack'.
This method is called on a high-priority thread from Java. The name of
the thread is 'AudioRecordTrack'.
This method is called on a high - priority thread from Java . The name of the thread is ' AudioRecordTrack ' .
void AudioTrackJni::OnGetPlayoutData(int length) {
  DCHECK(thread_checker_java_.CalledOnValidThread());
  DCHECK_EQ(frames_per_buffer_, length / kBytesPerFrame);
  if (!audio_device_buffer_) {
    ALOGE("AttachAudioBuffer has not been called!");
    return;
  }
  int samples = audio_device_buffer_->RequestPlayoutData(frames_per_buffer_);
  if (samples <= 0) {
    ALOGE("AudioDeviceBuffer::RequestPlayoutData failed!");
    return;
  }
  DCHECK_EQ(samples, frames_per_buffer_);
  samples = audio_device_buffer_->GetPlayoutData(direct_buffer_address_);
  DCHECK_EQ(length, kBytesPerFrame * samples);
}
void AudioTrackJni :: OnGetPlayoutData ( int length ) { DCHECK ( thread_checker_java_ . CalledOnValidThread ( ) ) ; DCHECK_EQ ( frames_per_buffer_ , length / kBytesPerFrame ) ; if ( ! audio_device_buffer_ ) { ALOGE ( " " ) ; return ; } int samples = audio_device_buffer_ -> RequestPlayoutData ( frames_per_buffer_ ) ; if ( samples <= 0 ) { ALOGE ( " " ) ; return ; } DCHECK_EQ ( samples , frames_per_buffer_ ) ; samples = audio_device_buffer_ -> GetPlayoutData ( direct_buffer_address_ ) ; DCHECK_EQ ( length , kBytesPerFrame * samples ) ; }
This method is called on a high-priority thread from Java.
This method is called on a high - priority thread from Java .
// Pull decoded data (in 16-bit PCM format) from jitter buffer. // Copy decoded data into common byte buffer to ensure that it can be // written to the Java based audio track.