diff options
author | enal@chromium.org <enal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 18:02:04 +0000 |
---|---|---|
committer | enal@chromium.org <enal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 18:02:04 +0000 |
commit | e6b05e8c5d2d8cc56d6f6c238ff7cf674d05c4b6 (patch) | |
tree | a4ad67abf8535066886876d55533f83a6d80f4e3 /media/audio/linux | |
parent | cd187678ad319a37e01acc91e80d0ebc419cecc4 (diff) | |
download | chromium_src-e6b05e8c5d2d8cc56d6f6c238ff7cf674d05c4b6.zip chromium_src-e6b05e8c5d2d8cc56d6f6c238ff7cf674d05c4b6.tar.gz chromium_src-e6b05e8c5d2d8cc56d6f6c238ff7cf674d05c4b6.tar.bz2 |
Remove unused parameter "stream" from all variants of OnMoreData().
(Also fixing some minor lint errors...)
Review URL: http://codereview.chromium.org/10184011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133726 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/linux')
-rw-r--r-- | media/audio/linux/alsa_output.cc | 4 | ||||
-rw-r--r-- | media/audio/linux/alsa_output_unittest.cc | 13 | ||||
-rw-r--r-- | media/audio/linux/cras_output.cc | 4 | ||||
-rw-r--r-- | media/audio/linux/cras_output_unittest.cc | 17 |
4 files changed, 18 insertions, 20 deletions
diff --git a/media/audio/linux/alsa_output.cc b/media/audio/linux/alsa_output.cc index 9ed2df0..ce301ce 100644 --- a/media/audio/linux/alsa_output.cc +++ b/media/audio/linux/alsa_output.cc @@ -385,7 +385,7 @@ void AlsaPcmOutputStream::BufferPacket(bool* source_exhausted) { // that aren't large enough to make a frame. Without this, packet writing // may stall because the last few bytes in the packet may never get used by // WritePacket. - DCHECK(packet_size % bytes_per_frame_ == 0); + DCHECK_EQ(0u, packet_size % bytes_per_frame_); packet_size = (packet_size / bytes_per_frame_) * bytes_per_frame_; if (should_downmix_) { @@ -792,7 +792,7 @@ uint32 AlsaPcmOutputStream::RunDataCallback(uint8* dest, TRACE_EVENT0("audio", "AlsaPcmOutputStream::RunDataCallback"); if (source_callback_) - return source_callback_->OnMoreData(this, dest, max_size, buffers_state); + return source_callback_->OnMoreData(dest, max_size, buffers_state); return 0; } diff --git a/media/audio/linux/alsa_output_unittest.cc b/media/audio/linux/alsa_output_unittest.cc index be605c1..4b314ce 100644 --- a/media/audio/linux/alsa_output_unittest.cc +++ b/media/audio/linux/alsa_output_unittest.cc @@ -69,8 +69,7 @@ class MockAlsaWrapper : public AlsaWrapper { class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { public: - MOCK_METHOD4(OnMoreData, uint32(AudioOutputStream* stream, - uint8* dest, uint32 max_size, + MOCK_METHOD3(OnMoreData, uint32(uint8* dest, uint32 max_size, AudioBuffersState buffers_state)); MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); }; @@ -440,8 +439,7 @@ TEST_F(AlsaPcmOutputStreamTest, StartStop) { EXPECT_CALL(mock_alsa_wrapper_, PcmDelay(kFakeHandle, _)) .Times(2) .WillRepeatedly(DoAll(SetArgumentPointee<1>(0), Return(0))); - EXPECT_CALL(mock_callback, - OnMoreData(test_stream, _, kTestPacketSize, _)) + EXPECT_CALL(mock_callback, OnMoreData(_, kTestPacketSize, _)) .Times(2) .WillOnce(Return(kTestPacketSize)) .WillOnce(Return(0)); @@ -559,8 +557,7 @@ TEST_F(AlsaPcmOutputStreamTest, BufferPacket) { .WillRepeatedly(Return(0)); // Buffer is full. // Return a partially filled packet. - EXPECT_CALL(mock_callback, - OnMoreData(test_stream, _, _, _)) + EXPECT_CALL(mock_callback, OnMoreData(_, _, _)) .WillOnce(Return(10)); bool source_exhausted; @@ -586,7 +583,7 @@ TEST_F(AlsaPcmOutputStreamTest, BufferPacket_Negative) { .WillOnce(DoAll(SetArgumentPointee<1>(-1), Return(0))); EXPECT_CALL(mock_alsa_wrapper_, PcmAvailUpdate(_)) .WillRepeatedly(Return(0)); // Buffer is full. - EXPECT_CALL(mock_callback, OnMoreData(test_stream, _, _, _)) + EXPECT_CALL(mock_callback, OnMoreData(_, _, _)) .WillOnce(Return(10)); bool source_exhausted; @@ -611,7 +608,7 @@ TEST_F(AlsaPcmOutputStreamTest, BufferPacket_Underrun) { EXPECT_CALL(mock_alsa_wrapper_, PcmAvailUpdate(_)) .WillRepeatedly(Return(0)); // Buffer is full. EXPECT_CALL(mock_callback, - OnMoreData(test_stream, _, _, AllOf( + OnMoreData(_, _, AllOf( Field(&AudioBuffersState::pending_bytes, 0), Field(&AudioBuffersState::hardware_delay_bytes, 0)))) .WillOnce(Return(10)); diff --git a/media/audio/linux/cras_output.cc b/media/audio/linux/cras_output.cc index 28a991b..4de1256 100644 --- a/media/audio/linux/cras_output.cc +++ b/media/audio/linux/cras_output.cc @@ -267,7 +267,7 @@ uint32 CrasOutputStream::Render(size_t frames, uint32 frames_latency = latency_usec * frame_rate_ / 1000000; uint32 bytes_latency = frames_latency * bytes_per_frame; - uint32 rendered = source_callback_->OnMoreData(this, buffer, + uint32 rendered = source_callback_->OnMoreData(buffer, frames * bytes_per_frame, AudioBuffersState(0, bytes_latency)); return rendered / bytes_per_frame; @@ -276,7 +276,7 @@ uint32 CrasOutputStream::Render(size_t frames, void CrasOutputStream::NotifyStreamError(int err) { // This will remove the stream from the client. if (state_ == kIsClosed || state_ == kInError) - return; // Don't care about error if we aren't using it. + return; // Don't care about error if we aren't using it. TransitionTo(kInError); if (source_callback_) source_callback_->OnError(this, err); diff --git a/media/audio/linux/cras_output_unittest.cc b/media/audio/linux/cras_output_unittest.cc index 08f441d..5996808 100644 --- a/media/audio/linux/cras_output_unittest.cc +++ b/media/audio/linux/cras_output_unittest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string> + #include "media/audio/linux/audio_manager_linux.h" #include "media/audio/linux/cras_output.h" #include "testing/gmock/include/gmock/gmock.h" @@ -17,8 +19,7 @@ namespace media { class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { public: - MOCK_METHOD4(OnMoreData, uint32(AudioOutputStream* stream, - uint8* dest, uint32 max_size, + MOCK_METHOD3(OnMoreData, uint32(uint8* dest, uint32 max_size, AudioBuffersState buffers_state)); MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); }; @@ -120,7 +121,7 @@ struct cras_client* const CrasOutputStreamTest::kFakeClient = TEST_F(CrasOutputStreamTest, ConstructedState) { // Should support mono. - CrasOutputStream *test_stream = CreateStream(CHANNEL_LAYOUT_MONO); + CrasOutputStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); EXPECT_EQ(CrasOutputStream::kCreated, test_stream->state()); test_stream->Close(); @@ -154,7 +155,7 @@ TEST_F(CrasOutputStreamTest, ConstructedState) { } TEST_F(CrasOutputStreamTest, OpenClose) { - CrasOutputStream *test_stream = CreateStream(CHANNEL_LAYOUT_MONO); + CrasOutputStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); // Open the stream. ASSERT_TRUE(test_stream->Open()); EXPECT_EQ(CrasOutputStream::kIsOpened, test_stream->state()); @@ -164,7 +165,7 @@ TEST_F(CrasOutputStreamTest, OpenClose) { } TEST_F(CrasOutputStreamTest, StartFailBeforeOpen) { - CrasOutputStream *test_stream = CreateStream(CHANNEL_LAYOUT_MONO); + CrasOutputStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); MockAudioSourceCallback mock_callback; test_stream->Start(&mock_callback); @@ -172,7 +173,7 @@ TEST_F(CrasOutputStreamTest, StartFailBeforeOpen) { } TEST_F(CrasOutputStreamTest, StartStop) { - CrasOutputStream *test_stream = CreateStream(CHANNEL_LAYOUT_MONO); + CrasOutputStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); MockAudioSourceCallback mock_callback; // Open the stream. @@ -192,7 +193,7 @@ TEST_F(CrasOutputStreamTest, StartStop) { } TEST_F(CrasOutputStreamTest, RenderFrames) { - CrasOutputStream *test_stream = CreateStream(CHANNEL_LAYOUT_MONO); + CrasOutputStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); MockAudioSourceCallback mock_callback; const uint32 amount_rendered_return = 2048; @@ -201,7 +202,7 @@ TEST_F(CrasOutputStreamTest, RenderFrames) { EXPECT_EQ(CrasOutputStream::kIsOpened, test_stream->state()); // Render Callback. - EXPECT_CALL(mock_callback, OnMoreData(test_stream, _, + EXPECT_CALL(mock_callback, OnMoreData(_, kTestFramesPerPacket * kTestBytesPerFrame, _)) .WillRepeatedly(Return(amount_rendered_return)); |