Skip to content

Commit

Permalink
[Chromecast] Clear the usage of VLOG in cma and service folder.
Browse files Browse the repository at this point in the history
-Change VLOG(1) and VLOG(2) to LOG(INFO).
-Change VLOG(3) and VLOG(4) to DVLOG.
-Remove the usage of CMALOG(kLogControl)

BUG=internal b/73490388

Test=locally build.

Change-Id: I27976d42ef57346c348b496690a79b870655e9d1
Reviewed-on: https://chromium-review.googlesource.com/c/1343560
Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
Commit-Queue: Ziyang Cheng <ziyangch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610995}
  • Loading branch information
ziyangch authored and Commit Bot committed Nov 27, 2018
1 parent ed2f02d commit 34d83e1
Show file tree
Hide file tree
Showing 23 changed files with 174 additions and 203 deletions.
10 changes: 5 additions & 5 deletions chromecast/media/audio/cast_audio_output_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "base/callback.h"
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chromecast/base/bind_to_task_runner.h"
Expand All @@ -21,7 +22,6 @@
#include "chromecast/media/audio/mixer_service/mixer_service.pb.h"
#include "chromecast/media/audio/mixer_service/mixer_service_connection.h"
#include "chromecast/media/cma/backend/cma_backend_factory.h"
#include "chromecast/media/cma/base/cma_logging.h"
#include "chromecast/public/cast_media_shlib.h"
#include "chromecast/public/media/decoder_config.h"
#include "chromecast/public/media/media_pipeline_device_params.h"
Expand Down Expand Up @@ -660,10 +660,10 @@ void CastAudioOutputStream::OnGetMultiroomInfo(
chromecast::mojom::MultiroomInfoPtr multiroom_info) {
DCHECK_CALLED_ON_VALID_THREAD(audio_thread_checker_);
DCHECK(multiroom_info);
CMALOG(kLogControl) << __FUNCTION__ << ": " << this
<< " session_id=" << application_session_id
<< ", multiroom=" << multiroom_info->multiroom
<< ", audio_channel=" << multiroom_info->audio_channel;
LOG(INFO) << __FUNCTION__ << ": " << this
<< " session_id=" << application_session_id
<< ", multiroom=" << multiroom_info->multiroom
<< ", audio_channel=" << multiroom_info->audio_channel;

// Close the MultiroomManager message pipe so that a connection error does
// not trigger a second call to this function.
Expand Down
16 changes: 8 additions & 8 deletions chromecast/media/cma/backend/alsa/alsa_volume_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class AlsaVolumeControl::ScopedAlsaMixer {
const std::string& mixer_element_name)
: alsa_(alsa) {
DCHECK(alsa_);
VLOG(1) << "Opening mixer element \"" << mixer_element_name
<< "\" on device \"" << mixer_device_name << "\"";
LOG(INFO) << "Opening mixer element \"" << mixer_element_name
<< "\" on device \"" << mixer_device_name << "\"";
int alsa_err = alsa_->MixerOpen(&mixer, 0);
if (alsa_err < 0) {
LOG(ERROR) << "MixerOpen error: " << alsa_->StrError(alsa_err);
Expand Down Expand Up @@ -216,12 +216,12 @@ AlsaVolumeControl::AlsaVolumeControl(Delegate* delegate)
volume_range_max_(0),
mute_mixer_ptr_(nullptr) {
DCHECK(delegate_);
VLOG(1) << "Volume device = " << volume_mixer_device_name_
<< ", element = " << volume_mixer_element_name_;
VLOG(1) << "Mute device = " << mute_mixer_device_name_
<< ", element = " << mute_mixer_element_name_;
VLOG(1) << "Idle device = " << amp_mixer_device_name_
<< ", element = " << amp_mixer_element_name_;
LOG(INFO) << "Volume device = " << volume_mixer_device_name_
<< ", element = " << volume_mixer_element_name_;
LOG(INFO) << "Mute device = " << mute_mixer_device_name_
<< ", element = " << mute_mixer_element_name_;
LOG(INFO) << "Idle device = " << amp_mixer_device_name_
<< ", element = " << amp_mixer_element_name_;

volume_mixer_ = std::make_unique<ScopedAlsaMixer>(
alsa_.get(), volume_mixer_device_name_, volume_mixer_element_name_);
Expand Down
8 changes: 4 additions & 4 deletions chromecast/media/cma/backend/alsa/cast_media_shlib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ MediaPipelineBackend* CastMediaShlib::CreateMediaPipelineBackend(
double CastMediaShlib::GetMediaClockRate() {
int ppm = 0;
if (!g_rate_offset_element) {
VLOG(1) << "g_rate_offset_element is null, ALSA rate offset control will "
"not be possible.";
LOG(INFO) << "g_rate_offset_element is null, ALSA rate offset control will "
"not be possible.";
return kOneMhzReference;
}
snd_ctl_elem_value_t* rate_offset_ppm;
Expand Down Expand Up @@ -171,8 +171,8 @@ void CastMediaShlib::MediaClockRateRange(double* minimum_rate,
bool CastMediaShlib::SetMediaClockRate(double new_rate) {
int new_ppm = new_rate - kOneMhzReference;
if (!g_rate_offset_element) {
VLOG(1) << "g_rate_offset_element is null, ALSA rate offset control will "
"not be possible.";
LOG(INFO) << "g_rate_offset_element is null, ALSA rate offset control will "
"not be possible.";
return false;
}
snd_ctl_elem_value_t* rate_offset_ppm;
Expand Down
42 changes: 21 additions & 21 deletions chromecast/media/cma/backend/android/audio_decoder_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ bool AudioDecoderAndroid::SetPlaybackRate(float rate) {
AudioDecoderAndroid::BufferStatus AudioDecoderAndroid::PushBuffer(
CastDecoderBuffer* buffer) {
if (buffer->end_of_stream()) {
VLOG(3) << __func__ << ": EOS";
DVLOG(3) << __func__ << ": EOS";
} else {
VLOG(3) << __func__ << ":"
<< " size=" << buffer->data_size()
<< " pts=" << buffer->timestamp();
DVLOG(3) << __func__ << ":"
<< " size=" << buffer->data_size()
<< " pts=" << buffer->timestamp();
}
TRACE_FUNCTION_ENTRY0();
DCHECK(task_runner_->BelongsToCurrentThread());
Expand Down Expand Up @@ -239,7 +239,7 @@ void AudioDecoderAndroid::GetStatistics(Statistics* stats) {
DCHECK(stats);
DCHECK(task_runner_->BelongsToCurrentThread());
*stats = stats_;
VLOG(1) << __func__ << ": decoded_bytes=" << stats->decoded_bytes;
LOG(INFO) << __func__ << ": decoded_bytes=" << stats->decoded_bytes;
}

bool AudioDecoderAndroid::SetConfig(const AudioConfig& config) {
Expand Down Expand Up @@ -353,9 +353,9 @@ AudioDecoderAndroid::RenderingDelay AudioDecoderAndroid::GetRenderingDelay() {
}
}

VLOG(2) << __func__ << ":"
<< " delay=" << delay.delay_microseconds
<< " ts=" << delay.timestamp_microseconds;
LOG(INFO) << __func__ << ":"
<< " delay=" << delay.delay_microseconds
<< " ts=" << delay.timestamp_microseconds;

return delay;
}
Expand All @@ -381,11 +381,11 @@ void AudioDecoderAndroid::OnBufferDecoded(
DCHECK(rate_shifter_);

if (decoded->end_of_stream()) {
VLOG(3) << __func__ << ": EOS";
DVLOG(3) << __func__ << ": EOS";
} else {
VLOG(3) << __func__ << ":"
<< " input_bytes=" << input_bytes
<< " decoded.size=" << decoded->data_size();
DVLOG(3) << __func__ << ":"
<< " input_bytes=" << input_bytes
<< " decoded.size=" << decoded->data_size();
}

if (status == CastAudioDecoder::Status::kDecodeError) {
Expand Down Expand Up @@ -473,8 +473,8 @@ void AudioDecoderAndroid::OnBufferDecoded(
}

void AudioDecoderAndroid::CheckBufferComplete() {
VLOG(3) << __func__
<< ": pending_buffer_complete_=" << pending_buffer_complete_;
DVLOG(3) << __func__
<< ": pending_buffer_complete_=" << pending_buffer_complete_;

if (!pending_buffer_complete_) {
return;
Expand All @@ -498,10 +498,10 @@ void AudioDecoderAndroid::CheckBufferComplete() {
}

void AudioDecoderAndroid::PushRateShifted() {
VLOG(3) << __func__ << ":"
<< " pushed_eos_=" << pushed_eos_
<< " pending_output_frames_=" << pending_output_frames_
<< " got_eos_=" << got_eos_;
DVLOG(3) << __func__ << ":"
<< " pushed_eos_=" << pushed_eos_
<< " pending_output_frames_=" << pending_output_frames_
<< " got_eos_=" << got_eos_;

DCHECK(sink_);

Expand Down Expand Up @@ -531,7 +531,7 @@ void AudioDecoderAndroid::PushRateShifted() {

scoped_refptr<DecoderBufferBase> eos_buffer(
new DecoderBufferAdapter(::media::DecoderBuffer::CreateEOSBuffer()));
VLOG(3) << __func__ << ": WritePcm(eos_buffer)";
DVLOG(3) << __func__ << ": WritePcm(eos_buffer)";
sink_->WritePcm(eos_buffer);
}
return;
Expand Down Expand Up @@ -605,7 +605,7 @@ bool AudioDecoderAndroid::BypassDecoder() const {

void AudioDecoderAndroid::OnWritePcmCompletion(BufferStatus status,
const RenderingDelay& delay) {
VLOG(3) << __func__ << ": status=" << status;
DVLOG(3) << __func__ << ": status=" << status;

TRACE_FUNCTION_ENTRY0();
DCHECK(task_runner_->BelongsToCurrentThread());
Expand All @@ -619,7 +619,7 @@ void AudioDecoderAndroid::OnWritePcmCompletion(BufferStatus status,
}

void AudioDecoderAndroid::PushMorePcm() {
VLOG(3) << __func__ << ":";
DVLOG(3) << __func__ << ":";

PushRateShifted();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ void AudioSinkAndroidAudioTrackImpl::TrackRawMonotonicClockDeviation() {

// TODO(ckuiper): Eventually we want to use this to convert from non-RAW to
// RAW timestamps to improve accuracy.
VLOG(3) << __func__ << "(" << this << "):"
<< " now - now_raw=" << (now_usec - now_raw_usec);
DVLOG(3) << __func__ << "(" << this << "):"
<< " now - now_raw=" << (now_usec - now_raw_usec);
}

void AudioSinkAndroidAudioTrackImpl::FeedDataContinue() {
Expand Down Expand Up @@ -325,9 +325,9 @@ void AudioSinkAndroidAudioTrackImpl::PostPcmCallback(
const MediaPipelineBackendAndroid::RenderingDelay& delay) {
RUN_ON_CALLER_THREAD(PostPcmCallback, delay);
DCHECK(pending_data_);
VLOG(3) << __func__ << "(" << this << "): "
<< " delay=" << delay.delay_microseconds
<< " ts=" << delay.timestamp_microseconds;
DVLOG(3) << __func__ << "(" << this << "): "
<< " delay=" << delay.delay_microseconds
<< " ts=" << delay.timestamp_microseconds;
pending_data_ = nullptr;
pending_data_bytes_already_fed_ = 0;
delegate_->OnWritePcmCompletion(MediaPipelineBackendAndroid::kBufferSuccess,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <limits>

#include "base/logging.h"
#include "chromecast/base/task_runner_impl.h"
#include "chromecast/media/cma/backend/android/audio_decoder_android.h"
#include "chromecast/media/cma/backend/video_decoder_null.h"
Expand Down Expand Up @@ -98,10 +99,10 @@ bool MediaPipelineBackendAndroid::SetPlaybackRate(float rate) {
int64_t MediaPipelineBackendAndroid::GetCurrentPts() {
if (audio_decoder_) {
int64_t pts = audio_decoder_->current_pts();
VLOG(1) << __func__ << ": pts=" << pts;
LOG(INFO) << __func__ << ": pts=" << pts;
return pts;
}
VLOG(1) << __func__ << ": pts=<invalid>";
LOG(INFO) << __func__ << ": pts=<invalid>";
return std::numeric_limits<int64_t>::min();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ std::unique_ptr<BufferFeeder> BufferFeeder::LoadAudio(
bool success = decoder->SetConfig(config);
CHECK(success);

VLOG(2) << "Got " << demux_result.frames.size() << " audio input frames";
LOG(INFO) << "Got " << demux_result.frames.size() << " audio input frames";
std::unique_ptr<BufferFeeder> feeder(new BufferFeeder(eos_cb));
feeder->audio_config_ = config;
feeder->Initialize(backend, decoder, demux_result.frames);
Expand Down Expand Up @@ -606,7 +606,7 @@ std::unique_ptr<BufferFeeder> BufferFeeder::LoadVideo(
bool success = decoder->SetConfig(video_config);
CHECK(success);

VLOG(2) << "Got " << buffers.size() << " video input frames";
LOG(INFO) << "Got " << buffers.size() << " video input frames";
std::unique_ptr<BufferFeeder> feeder(new BufferFeeder(eos_cb));
feeder->video_config_ = video_config;
feeder->Initialize(backend, decoder, buffers);
Expand Down Expand Up @@ -890,8 +890,9 @@ void AudioVideoPipelineDeviceTest::MonitorLoop() {
pause_time_ = base::TimeDelta::FromMicroseconds(backend_->GetCurrentPts());
RunPlaybackChecks();

VLOG(2) << "Pausing at " << pause_time_.InMilliseconds() << "ms for " <<
pause_pattern_[pause_pattern_idx_].length.InMilliseconds() << "ms";
LOG(INFO) << "Pausing at " << pause_time_.InMilliseconds() << "ms for "
<< pause_pattern_[pause_pattern_idx_].length.InMilliseconds()
<< "ms";

// Wait for pause finish
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
Expand Down Expand Up @@ -956,7 +957,7 @@ void AudioVideoPipelineDeviceTest::OnPauseCompleted() {
pause_time_ = media_time;
++pause_pattern_idx_;

VLOG(2) << "Pause complete, restarting media clock";
LOG(INFO) << "Pause complete, restarting media clock";
RunPlaybackChecks();

// Resume playback and frame feeding.
Expand Down
6 changes: 3 additions & 3 deletions chromecast/media/cma/backend/buffering_mixer_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ BufferingMixerSource::RenderingDelay BufferingMixerSource::QueueData(
// partial buffer.
if (!locked->started_ && data->timestamp() < playback_start_pts_) {
DCHECK(locked->queue_.empty());
VLOG(4) << "Dropping buffer with ts=" << data->timestamp()
<< ", playback_start_pts=" << playback_start_pts_
<< " difference=" << playback_start_pts_ - data->timestamp();
DVLOG(4) << "Dropping buffer with ts=" << data->timestamp()
<< ", playback_start_pts=" << playback_start_pts_
<< " difference=" << playback_start_pts_ - data->timestamp();
} else {
LOG_IF(INFO, (!locked->started_ &&
(data->timestamp() - playback_start_pts_) < 100000 &&
Expand Down
12 changes: 6 additions & 6 deletions chromecast/media/cma/backend/mock_audio_decoder_for_mixer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ void MockAudioDecoderForMixer::PushBufferPeriodic() {
MediaPipelineBackend::AudioDecoder::RenderingDelay delay(
audio_play_delay, (now_ticks - base::TimeTicks()).InMicroseconds());

VLOG(4) << "audio_buffer_pushed"
<< " current_audio_pts_=" << current_audio_pts_
<< " buffer_timestamp=" << buffer_timestamp
<< " delay.timestamp_microseconds=" << delay.timestamp_microseconds
<< " delay.delay_microseconds=" << delay.delay_microseconds;
DVLOG(4) << "audio_buffer_pushed"
<< " current_audio_pts_=" << current_audio_pts_
<< " buffer_timestamp=" << buffer_timestamp
<< " delay.timestamp_microseconds=" << delay.timestamp_microseconds
<< " delay.delay_microseconds=" << delay.delay_microseconds;
}

void MockAudioDecoderForMixer::PlayAudio() {
Expand All @@ -48,7 +48,7 @@ void MockAudioDecoderForMixer::PlayAudio() {
// maintained after an audio glitch.
if (next_push_buffer_pts_ >= (current_audio_pts_ + audio_play_interval_us_)) {
current_audio_pts_ += audio_play_interval_us_;
VLOG(4) << "current_audio_pts_=" << current_audio_pts_;
DVLOG(4) << "current_audio_pts_=" << current_audio_pts_;
}
}

Expand Down
14 changes: 7 additions & 7 deletions chromecast/media/cma/backend/mock_video_decoder_for_mixer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bool MockVideoDecoderForMixer<CRN, CRD, CF>::Initialize() {
template <int64_t CRN, int64_t CRD, int64_t CF>
bool MockVideoDecoderForMixer<CRN, CRD, CF>::Start(int64_t start_pts,
bool need_avsync) {
VLOG(4) << "start_pts=" << start_pts;
DVLOG(4) << "start_pts=" << start_pts;
start_pts_ = start_pts;
vsync_timer_.Start(FROM_HERE,
base::TimeDelta::FromMicroseconds(
Expand Down Expand Up @@ -147,12 +147,12 @@ void MockVideoDecoderForMixer<CRN, CRD, CF>::UpkeepVsync() {
std::max(difference_in_frames - 1, static_cast<int64_t>(0));
repeated_frames_ +=
std::max(1 - difference_in_frames, static_cast<int64_t>(0));
VLOG(4) << "last_displayed_frame_pts_=" << last_displayed_frame_pts_
<< " current_displayed_frame=" << current_displayed_frame
<< " difference_in_frames=" << difference_in_frames
<< " difference_in_time="
<< (current_displayed_frame - last_displayed_frame_pts_)
<< " dropped_frames_=" << dropped_frames_;
DVLOG(4) << "last_displayed_frame_pts_=" << last_displayed_frame_pts_
<< " current_displayed_frame=" << current_displayed_frame
<< " difference_in_frames=" << difference_in_frames
<< " difference_in_time="
<< (current_displayed_frame - last_displayed_frame_pts_)
<< " dropped_frames_=" << dropped_frames_;
}

last_displayed_frame_pts_ = current_displayed_frame;
Expand Down
5 changes: 3 additions & 2 deletions chromecast/media/cma/backend/post_processing_pipeline_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "base/files/file_path.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/scoped_native_library.h"
#include "base/values.h"
Expand Down Expand Up @@ -205,8 +206,8 @@ void PostProcessingPipelineImpl::SetPostProcessorConfig(
[&name](PostProcessorInfo& p) { return p.name == name; });
if (it != processors_.end()) {
it->ptr->UpdateParameters(config);
VLOG(1) << "Config string: " << config << " was delivered to postprocessor "
<< name;
LOG(INFO) << "Config string: " << config
<< " was delivered to postprocessor " << name;
}
}

Expand Down
Loading

0 comments on commit 34d83e1

Please sign in to comment.