| Index: media/filters/ffmpeg_audio_decoder.cc
|
| diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
|
| index 66544c31b51aff5351b05b3aa4ebe29528971182..787aab0092a655261152e116c88e937ed2de8435 100644
|
| --- a/media/filters/ffmpeg_audio_decoder.cc
|
| +++ b/media/filters/ffmpeg_audio_decoder.cc
|
| @@ -28,13 +28,13 @@ struct QueuedAudioBuffer {
|
| };
|
|
|
| // Returns true if the decode result was end of stream.
|
| -static inline bool IsEndOfStream(int result, int decoded_size,
|
| +static inline bool is_end_of_stream(int result, int decoded_size,
|
| const scoped_refptr<DecoderBuffer>& input) {
|
| // Three conditions to meet to declare end of stream for this decoder:
|
| // 1. FFmpeg didn't read anything.
|
| // 2. FFmpeg didn't output anything.
|
| // 3. An end of stream buffer is received.
|
| - return result == 0 && decoded_size == 0 && input->IsEndOfStream();
|
| + return result == 0 && decoded_size == 0 && input->is_end_of_stream();
|
| }
|
|
|
| FFmpegAudioDecoder::FFmpegAudioDecoder(
|
| @@ -157,7 +157,7 @@ void FFmpegAudioDecoder::BufferReady(
|
|
|
| // Send a "end of stream" buffer to the decode loop
|
| // to output any remaining data still in the decoder.
|
| - RunDecodeLoop(DecoderBuffer::CreateEOSBuffer(), true);
|
| + RunDecodeLoop(DecoderBuffer::create_eos_buffer(), true);
|
|
|
| DVLOG(1) << "Config changed.";
|
|
|
| @@ -184,7 +184,7 @@ void FFmpegAudioDecoder::BufferReady(
|
|
|
| // Make sure we are notified if http://crbug.com/49709 returns. Issue also
|
| // occurs with some damaged files.
|
| - if (!input->IsEndOfStream() && input->GetTimestamp() == kNoTimestamp() &&
|
| + if (!input->is_end_of_stream() && input->get_timestamp() == kNoTimestamp() &&
|
| output_timestamp_helper_->base_timestamp() == kNoTimestamp()) {
|
| DVLOG(1) << "Received a buffer without timestamps!";
|
| base::ResetAndReturn(&read_cb_).Run(kDecodeError, NULL);
|
| @@ -192,28 +192,28 @@ void FFmpegAudioDecoder::BufferReady(
|
| }
|
|
|
| bool is_vorbis = codec_context_->codec_id == AV_CODEC_ID_VORBIS;
|
| - if (!input->IsEndOfStream()) {
|
| + if (!input->is_end_of_stream()) {
|
| if (last_input_timestamp_ == kNoTimestamp()) {
|
| - if (is_vorbis && (input->GetTimestamp() < base::TimeDelta())) {
|
| + if (is_vorbis && (input->get_timestamp() < base::TimeDelta())) {
|
| // Dropping frames for negative timestamps as outlined in section A.2
|
| // in the Vorbis spec. http://xiph.org/vorbis/doc/Vorbis_I_spec.html
|
| int frames_to_drop = floor(
|
| - 0.5 + -input->GetTimestamp().InSecondsF() * samples_per_second_);
|
| + 0.5 + -input->get_timestamp().InSecondsF() * samples_per_second_);
|
| output_bytes_to_drop_ = bytes_per_frame_ * frames_to_drop;
|
| } else {
|
| - last_input_timestamp_ = input->GetTimestamp();
|
| + last_input_timestamp_ = input->get_timestamp();
|
| }
|
| - } else if (input->GetTimestamp() != kNoTimestamp()) {
|
| - if (input->GetTimestamp() < last_input_timestamp_) {
|
| - base::TimeDelta diff = input->GetTimestamp() - last_input_timestamp_;
|
| + } else if (input->get_timestamp() != kNoTimestamp()) {
|
| + if (input->get_timestamp() < last_input_timestamp_) {
|
| + base::TimeDelta diff = input->get_timestamp() - last_input_timestamp_;
|
| DVLOG(1) << "Input timestamps are not monotonically increasing! "
|
| - << " ts " << input->GetTimestamp().InMicroseconds() << " us"
|
| + << " ts " << input->get_timestamp().InMicroseconds() << " us"
|
| << " diff " << diff.InMicroseconds() << " us";
|
| base::ResetAndReturn(&read_cb_).Run(kDecodeError, NULL);
|
| return;
|
| }
|
|
|
| - last_input_timestamp_ = input->GetTimestamp();
|
| + last_input_timestamp_ = input->get_timestamp();
|
| }
|
| }
|
|
|
| @@ -341,12 +341,12 @@ void FFmpegAudioDecoder::RunDecodeLoop(
|
| bool skip_eos_append) {
|
| AVPacket packet;
|
| av_init_packet(&packet);
|
| - if (input->IsEndOfStream()) {
|
| + if (input->is_end_of_stream()) {
|
| packet.data = NULL;
|
| packet.size = 0;
|
| } else {
|
| - packet.data = const_cast<uint8*>(input->GetData());
|
| - packet.size = input->GetDataSize();
|
| + packet.data = const_cast<uint8*>(input->get_data());
|
| + packet.size = input->get_data_size();
|
| }
|
|
|
| // Each audio packet may contain several frames, so we must call the decoder
|
| @@ -362,16 +362,16 @@ void FFmpegAudioDecoder::RunDecodeLoop(
|
| codec_context_, av_frame_, &frame_decoded, &packet);
|
|
|
| if (result < 0) {
|
| - DCHECK(!input->IsEndOfStream())
|
| + DCHECK(!input->is_end_of_stream())
|
| << "End of stream buffer produced an error! "
|
| << "This is quite possibly a bug in the audio decoder not handling "
|
| << "end of stream AVPackets correctly.";
|
|
|
| DLOG(ERROR)
|
| << "Error decoding an audio frame with timestamp: "
|
| - << input->GetTimestamp().InMicroseconds() << " us, duration: "
|
| - << input->GetDuration().InMicroseconds() << " us, packet size: "
|
| - << input->GetDataSize() << " bytes";
|
| + << input->get_timestamp().InMicroseconds() << " us, duration: "
|
| + << input->get_duration().InMicroseconds() << " us, packet size: "
|
| + << input->get_data_size() << " bytes";
|
|
|
| // TODO(dalecurtis): We should return a kDecodeError here instead:
|
| // http://crbug.com/145276
|
| @@ -384,15 +384,15 @@ void FFmpegAudioDecoder::RunDecodeLoop(
|
| packet.data += result;
|
|
|
| if (output_timestamp_helper_->base_timestamp() == kNoTimestamp() &&
|
| - !input->IsEndOfStream()) {
|
| - DCHECK(input->GetTimestamp() != kNoTimestamp());
|
| + !input->is_end_of_stream()) {
|
| + DCHECK(input->get_timestamp() != kNoTimestamp());
|
| if (output_bytes_to_drop_ > 0) {
|
| // Currently Vorbis is the only codec that causes us to drop samples.
|
| // If we have to drop samples it always means the timeline starts at 0.
|
| DCHECK_EQ(codec_context_->codec_id, AV_CODEC_ID_VORBIS);
|
| output_timestamp_helper_->SetBaseTimestamp(base::TimeDelta());
|
| } else {
|
| - output_timestamp_helper_->SetBaseTimestamp(input->GetTimestamp());
|
| + output_timestamp_helper_->SetBaseTimestamp(input->get_timestamp());
|
| }
|
| }
|
|
|
| @@ -485,7 +485,7 @@ void FFmpegAudioDecoder::RunDecodeLoop(
|
| output->set_duration(
|
| output_timestamp_helper_->GetDuration(decoded_audio_size));
|
| output_timestamp_helper_->AddBytes(decoded_audio_size);
|
| - } else if (IsEndOfStream(result, decoded_audio_size, input) &&
|
| + } else if (is_end_of_stream(result, decoded_audio_size, input) &&
|
| !skip_eos_append) {
|
| DCHECK_EQ(packet.size, 0);
|
| output = DataBuffer::create_eos_buffer();
|
|
|