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

Unified Diff: webrtc/modules/utility/include/file_recorder.h

Issue 2049683003: FileRecorder + FilePlayer: Let Create functions return unique_ptr (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@remove3
Patch Set: Created 4 years, 4 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
Index: webrtc/modules/utility/include/file_recorder.h
diff --git a/webrtc/modules/utility/include/file_recorder.h b/webrtc/modules/utility/include/file_recorder.h
index e04c1e29e1c62c6cdfc5fd54306a362df237f41a..51b497ea39f7be0beb8e2fcbd7b6d6f3908d68d8 100644
--- a/webrtc/modules/utility/include/file_recorder.h
+++ b/webrtc/modules/utility/include/file_recorder.h
@@ -11,6 +11,8 @@
#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_FILE_RECORDER_H_
#define WEBRTC_MODULES_UTILITY_INCLUDE_FILE_RECORDER_H_
+#include <memory>
+
#include "webrtc/common_types.h"
#include "webrtc/engine_configurations.h"
#include "webrtc/modules/include/module_common_types.h"
@@ -22,10 +24,11 @@ namespace webrtc {
class FileRecorder {
public:
// Note: will return NULL for unsupported formats.
- static FileRecorder* CreateFileRecorder(const uint32_t instanceID,
- const FileFormats fileFormat);
+ static std::unique_ptr<FileRecorder> CreateFileRecorder(
ossu 2016/08/17 11:09:05 Do we not need to retain compatibility for CreateF
kwiberg-webrtc 2016/08/17 12:27:39 No, FileRecorder has no external users as far as I
ossu 2016/08/17 13:49:13 Acknowledged.
+ const uint32_t instanceID,
+ const FileFormats fileFormat);
- static void DestroyFileRecorder(FileRecorder* recorder);
+ virtual ~FileRecorder() = default;
virtual int32_t RegisterModuleFileCallback(FileCallback* callback) = 0;
@@ -49,9 +52,7 @@ class FileRecorder {
// Write frame to file. Frame should contain 10ms of un-ecoded audio data.
virtual int32_t RecordAudioToFile(const AudioFrame& frame) = 0;
-
- protected:
- virtual ~FileRecorder() {}
};
+
} // namespace webrtc
#endif // WEBRTC_MODULES_UTILITY_INCLUDE_FILE_RECORDER_H_

Powered by Google App Engine
This is Rietveld 408576698