Commit 8639c8f5 authored by Linkun Chen's avatar Linkun Chen Committed by Commit Bot

Make AudioContentType easier to print

Follow-up of
https://chromium-review.googlesource.com/c/chromium/src/+/2220359. This
CL removes related XXXToString() methods.

Bug: None
Change-Id: I99fb653e0f5ed179bb21fa8e48b5c79aa98b6557
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2425386Reviewed-by: default avatarSergey Volk <servolk@chromium.org>
Commit-Queue: Linkun Chen <lkchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809707}
parent 9a563aac
......@@ -11,22 +11,6 @@
namespace chromecast {
namespace media {
// static
const char* GetAudioContentTypeName(const AudioContentType type) {
switch (type) {
case AudioContentType::kMedia:
return "kMedia";
case AudioContentType::kAlarm:
return "kAlarm";
case AudioContentType::kCommunication:
return "kCommunication";
case AudioContentType::kOther:
return "kOther";
default:
return "Unknown";
}
}
// static
bool AudioSinkAndroid::GetSessionIds(SinkType sink_type,
int* media_id,
......
......@@ -20,8 +20,6 @@ namespace media {
const int kDefaultSlewTimeMs = 15;
const char* GetAudioContentTypeName(const AudioContentType type);
class DecoderBufferBase;
// Input handle to the sink. All methods (including constructor and destructor)
......@@ -101,7 +99,6 @@ class AudioSinkAndroid {
virtual bool primary() const = 0;
virtual std::string device_id() const = 0;
virtual AudioContentType content_type() const = 0;
virtual const char* GetContentTypeName() const = 0;
};
// Implementation of "managed" AudioSinkAndroid* object that is
......
......@@ -100,7 +100,7 @@ AudioSinkAndroidAudioTrackImpl::AudioSinkAndroidAudioTrackImpl(
<< " num_channels_=" << num_channels_
<< " input_samples_per_second_=" << input_samples_per_second_
<< " primary_=" << primary_ << " device_id_=" << device_id_
<< " content_type__=" << GetContentTypeName();
<< " content_type_=" << content_type_;
DCHECK(delegate_);
DCHECK_GT(num_channels_, 0);
......@@ -149,10 +149,6 @@ AudioContentType AudioSinkAndroidAudioTrackImpl::content_type() const {
return content_type_;
}
const char* AudioSinkAndroidAudioTrackImpl::GetContentTypeName() const {
return GetAudioContentTypeName(content_type_);
}
void AudioSinkAndroidAudioTrackImpl::FinalizeOnFeederThread() {
RUN_ON_FEEDER_THREAD(FinalizeOnFeederThread);
if (j_audio_sink_audiotrack_impl_.is_null()) {
......
......@@ -70,7 +70,6 @@ class AudioSinkAndroidAudioTrackImpl : public AudioSinkAndroid {
bool primary() const override;
std::string device_id() const override;
AudioContentType content_type() const override;
const char* GetContentTypeName() const override;
// Prevents any further calls to the delegate (ie, called when the delegate
// is being destroyed).
......
......@@ -51,7 +51,7 @@ void AudioSinkManager::Add(AudioSinkAndroid* sink) {
LOG(INFO) << __func__ << " sink(" << sink << "): id=" << sink->device_id()
<< " primary=" << sink->primary()
<< " type=" << sink->GetContentTypeName();
<< " type=" << sink->content_type();
base::AutoLock lock(lock_);
UpdateLimiterMultiplier(sink);
......@@ -62,7 +62,7 @@ void AudioSinkManager::Remove(AudioSinkAndroid* sink) {
DCHECK(sink);
LOG(INFO) << __func__ << " sink(" << sink << "): id=" << sink->device_id()
<< " type=" << sink->GetContentTypeName();
<< " type=" << sink->content_type();
base::AutoLock lock(lock_);
......@@ -75,8 +75,7 @@ void AudioSinkManager::Remove(AudioSinkAndroid* sink) {
}
void AudioSinkManager::SetTypeVolumeDb(AudioContentType type, float level_db) {
LOG(INFO) << __func__ << ": level_db=" << level_db
<< " type=" << GetAudioContentTypeName(type);
LOG(INFO) << __func__ << ": level_db=" << level_db << " type=" << type;
base::AutoLock lock(lock_);
volume_info_[type].volume_db = level_db;
// Since the type volume changed we need to reflect that in the limiter
......@@ -85,8 +84,7 @@ void AudioSinkManager::SetTypeVolumeDb(AudioContentType type, float level_db) {
}
void AudioSinkManager::SetOutputLimitDb(AudioContentType type, float limit_db) {
LOG(INFO) << __func__ << ": limit_db=" << limit_db
<< " type=" << GetAudioContentTypeName(type);
LOG(INFO) << __func__ << ": limit_db=" << limit_db << " type=" << type;
base::AutoLock lock(lock_);
volume_info_[type].limit_db = limit_db;
UpdateAllLimiterMultipliers(type);
......
......@@ -51,17 +51,6 @@ constexpr int kAudioMessageHeaderSize =
constexpr int kRateShifterOutputFrames = 4096;
std::string AudioContentTypeToString(media::AudioContentType type) {
switch (type) {
case media::AudioContentType::kAlarm:
return "alarm";
case media::AudioContentType::kCommunication:
return "communication";
default:
return "media";
}
}
int64_t SamplesToMicroseconds(double samples, int sample_rate) {
return std::round(samples * 1000000 / sample_rate);
}
......@@ -206,9 +195,8 @@ MixerInputConnection::MixerInputConnection(
weak_this_ = weak_factory_.GetWeakPtr();
LOG(INFO) << "Create " << this << " (" << device_id_
<< "), content type: " << AudioContentTypeToString(content_type_)
<< ", focus type: " << AudioContentTypeToString(focus_type_)
<< ", fill size: " << fill_size_
<< "), content type: " << content_type_
<< ", focus type: " << focus_type_ << ", fill size: " << fill_size_
<< ", algorithm fill size: " << algorithm_fill_size_
<< ", channel count: " << num_channels_
<< ", input sample rate: " << input_samples_per_second_
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment