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

Unified Diff: media/cast/audio_sender/audio_encoder.cc

Issue 109413004: Cast:Adding cast_transport_config and cleaning up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 11 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
« no previous file with comments | « media/cast/audio_sender/audio_encoder.h ('k') | media/cast/audio_sender/audio_encoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/audio_sender/audio_encoder.cc
diff --git a/media/cast/audio_sender/audio_encoder.cc b/media/cast/audio_sender/audio_encoder.cc
index c71329a52e5e075190590faec9a45268cd500c27..a642b77fc6aebd62f5a762272232500ebcfe86a9 100644
--- a/media/cast/audio_sender/audio_encoder.cc
+++ b/media/cast/audio_sender/audio_encoder.cc
@@ -38,7 +38,7 @@ void LogAudioEncodedEvent(CastEnvironment* const cast_environment,
class AudioEncoder::ImplBase {
public:
ImplBase(CastEnvironment* cast_environment,
- AudioCodec codec, int num_channels, int sampling_rate,
+ transport::AudioCodec codec, int num_channels, int sampling_rate,
const FrameEncodedCallback& callback)
: cast_environment_(cast_environment),
codec_(codec), num_channels_(num_channels),
@@ -50,7 +50,7 @@ class AudioEncoder::ImplBase {
CHECK_GT(samples_per_10ms_, 0);
CHECK_EQ(sampling_rate % 100, 0);
CHECK_LE(samples_per_10ms_ * num_channels_,
- EncodedAudioFrame::kMaxNumberOfSamples);
+ transport::EncodedAudioFrame::kMaxNumberOfSamples);
}
virtual ~ImplBase() {}
@@ -76,7 +76,8 @@ class AudioEncoder::ImplBase {
}
if (buffer_fill_end_ == samples_per_10ms_) {
- scoped_ptr<EncodedAudioFrame> audio_frame(new EncodedAudioFrame());
+ scoped_ptr<transport::EncodedAudioFrame> audio_frame(
+ new transport::EncodedAudioFrame());
audio_frame->codec = codec_;
audio_frame->frame_id = frame_id_++;
audio_frame->samples = samples_per_10ms_;
@@ -106,7 +107,7 @@ class AudioEncoder::ImplBase {
virtual bool EncodeFromFilledBuffer(std::string* out) = 0;
CastEnvironment* const cast_environment_;
- const AudioCodec codec_;
+ const transport::AudioCodec codec_;
const int num_channels_;
const int samples_per_10ms_;
const FrameEncodedCallback callback_;
@@ -129,8 +130,8 @@ class AudioEncoder::OpusImpl : public AudioEncoder::ImplBase {
OpusImpl(CastEnvironment* cast_environment,
int num_channels, int sampling_rate, int bitrate,
const FrameEncodedCallback& callback)
- : ImplBase(cast_environment, kOpus, num_channels, sampling_rate,
- callback),
+ : ImplBase(cast_environment, transport::kOpus, num_channels,
+ sampling_rate, callback),
encoder_memory_(new uint8[opus_encoder_get_size(num_channels)]),
opus_encoder_(reinterpret_cast<OpusEncoder*>(encoder_memory_.get())),
buffer_(new float[num_channels * samples_per_10ms_]) {
@@ -203,8 +204,8 @@ class AudioEncoder::Pcm16Impl : public AudioEncoder::ImplBase {
Pcm16Impl(CastEnvironment* cast_environment,
int num_channels, int sampling_rate,
const FrameEncodedCallback& callback)
- : ImplBase(cast_environment, kPcm16, num_channels, sampling_rate,
- callback),
+ : ImplBase(cast_environment, transport::kPcm16, num_channels,
+ sampling_rate, callback),
buffer_(new int16[num_channels * samples_per_10ms_]) {}
virtual ~Pcm16Impl() {}
@@ -246,12 +247,12 @@ AudioEncoder::AudioEncoder(
insert_thread_checker_.DetachFromThread();
switch (audio_config.codec) {
- case kOpus:
+ case transport::kOpus:
impl_.reset(new OpusImpl(
cast_environment, audio_config.channels, audio_config.frequency,
audio_config.bitrate, frame_encoded_callback));
break;
- case kPcm16:
+ case transport::kPcm16:
impl_.reset(new Pcm16Impl(
cast_environment, audio_config.channels, audio_config.frequency,
frame_encoded_callback));
« no previous file with comments | « media/cast/audio_sender/audio_encoder.h ('k') | media/cast/audio_sender/audio_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698