The AudioProcessing class is used as an interface
to the functionality in the audio processing module. Therefore, it should be a pure interface. This CL ensures that is the case. BUG=webrtc:6515 Review-Url: https://codereview.webrtc.org/2406193002 Cr-Commit-Position: refs/heads/master@{#14608}
This commit is contained in:
@ -116,6 +116,8 @@ class FakeAudioProcessing : public webrtc::AudioProcessing {
|
||||
WEBRTC_STUB(StartDebugRecording,
|
||||
(const char filename[kMaxFilenameSize], int64_t max_size_bytes));
|
||||
WEBRTC_STUB(StartDebugRecording, (FILE * handle, int64_t max_size_bytes));
|
||||
WEBRTC_STUB(StartDebugRecording, (FILE * handle));
|
||||
WEBRTC_STUB(StartDebugRecordingForPlatformFile, (rtc::PlatformFile handle));
|
||||
WEBRTC_STUB(StopDebugRecording, ());
|
||||
WEBRTC_VOID_STUB(UpdateHistogramsOnCallEnd, ());
|
||||
webrtc::EchoCancellation* echo_cancellation() const override { return NULL; }
|
||||
|
||||
@ -1251,6 +1251,10 @@ int AudioProcessingImpl::StartDebugRecording(FILE* handle,
|
||||
#endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
|
||||
}
|
||||
|
||||
int AudioProcessingImpl::StartDebugRecording(FILE* handle) {
|
||||
return StartDebugRecording(handle, -1);
|
||||
}
|
||||
|
||||
int AudioProcessingImpl::StartDebugRecordingForPlatformFile(
|
||||
rtc::PlatformFile handle) {
|
||||
// Run in a single-threaded manner.
|
||||
|
||||
@ -65,7 +65,7 @@ class AudioProcessingImpl : public AudioProcessing {
|
||||
int StartDebugRecording(const char filename[kMaxFilenameSize],
|
||||
int64_t max_log_size_bytes) override;
|
||||
int StartDebugRecording(FILE* handle, int64_t max_log_size_bytes) override;
|
||||
|
||||
int StartDebugRecording(FILE* handle) override;
|
||||
int StartDebugRecordingForPlatformFile(rtc::PlatformFile handle) override;
|
||||
int StopDebugRecording() override;
|
||||
|
||||
|
||||
@ -31,9 +31,5 @@ Beamforming::Beamforming(bool enabled,
|
||||
|
||||
Beamforming::~Beamforming() {}
|
||||
|
||||
int AudioProcessing::StartDebugRecordingForPlatformFile(
|
||||
rtc::PlatformFile handle) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -454,14 +454,12 @@ class AudioProcessing {
|
||||
virtual int StartDebugRecording(FILE* handle, int64_t max_log_size_bytes) = 0;
|
||||
|
||||
// TODO(ivoc): Remove this function after Chrome stops using it.
|
||||
int StartDebugRecording(FILE* handle) {
|
||||
return StartDebugRecording(handle, -1);
|
||||
}
|
||||
virtual int StartDebugRecording(FILE* handle) = 0;
|
||||
|
||||
// Same as above but uses an existing PlatformFile handle. Takes ownership
|
||||
// of |handle| and closes it at StopDebugRecording().
|
||||
// TODO(xians): Make this interface pure virtual.
|
||||
virtual int StartDebugRecordingForPlatformFile(rtc::PlatformFile handle);
|
||||
virtual int StartDebugRecordingForPlatformFile(rtc::PlatformFile handle) = 0;
|
||||
|
||||
// Stops recording debugging information, and closes the file. Recording
|
||||
// cannot be resumed in the same file (without overwriting it).
|
||||
|
||||
@ -259,6 +259,10 @@ class MockAudioProcessing : public AudioProcessing {
|
||||
int64_t max_log_size_bytes));
|
||||
MOCK_METHOD2(StartDebugRecording,
|
||||
int(FILE* handle, int64_t max_log_size_bytes));
|
||||
MOCK_METHOD1(StartDebugRecording,
|
||||
int (FILE* handle));
|
||||
MOCK_METHOD1(StartDebugRecording,
|
||||
int(rtc::PlatformFile handle));
|
||||
MOCK_METHOD0(StopDebugRecording,
|
||||
int());
|
||||
MOCK_METHOD0(UpdateHistogramsOnCallEnd, void());
|
||||
|
||||
Reference in New Issue
Block a user