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

Unified Diff: webrtc/modules/video_coding/utility/ivf_file_writer.h

Issue 2303273002: Expose Ivf logging through the native API (Closed)
Patch Set: Fix memory leak Created 4 years, 3 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/video_coding/utility/ivf_file_writer.h
diff --git a/webrtc/modules/video_coding/utility/ivf_file_writer.h b/webrtc/modules/video_coding/utility/ivf_file_writer.h
index 25d68a2803498efd562208ac7ca0b86f2bf4ffbf..8525b1035674a6d7666569b834cdc67c48e6555c 100644
--- a/webrtc/modules/video_coding/utility/ivf_file_writer.h
+++ b/webrtc/modules/video_coding/utility/ivf_file_writer.h
@@ -15,38 +15,38 @@
#include <string>
#include "webrtc/base/constructormagic.h"
+#include "webrtc/base/file.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/video_frame.h"
-#include "webrtc/system_wrappers/include/file_wrapper.h"
namespace webrtc {
class IvfFileWriter {
public:
+ // Takes ownership of the file, which will be closed either through
+ // Close or ~IvfFileWriter.
+ static std::unique_ptr<IvfFileWriter> Wrap(rtc::File file);
~IvfFileWriter();
- static std::unique_ptr<IvfFileWriter> Open(const std::string& file_name,
- VideoCodecType codec_type);
- bool WriteFrame(const EncodedImage& encoded_image);
+ bool WriteFrame(const EncodedImage& encoded_image, VideoCodecType codec_type);
bool Close();
private:
- IvfFileWriter(const std::string& path_name,
- std::unique_ptr<FileWrapper> file,
- VideoCodecType codec_type);
+ explicit IvfFileWriter(rtc::File file);
+
bool WriteHeader();
- bool InitFromFirstFrame(const EncodedImage& encoded_image);
+ bool InitFromFirstFrame(const EncodedImage& encoded_image,
+ VideoCodecType codec_type);
- const VideoCodecType codec_type_;
+ VideoCodecType codec_type_;
size_t num_frames_;
uint16_t width_;
uint16_t height_;
int64_t last_timestamp_;
bool using_capture_timestamps_;
rtc::TimestampWrapAroundHandler wrap_handler_;
- const std::string file_name_;
- std::unique_ptr<FileWrapper> file_;
+ rtc::File file_;
RTC_DISALLOW_COPY_AND_ASSIGN(IvfFileWriter);
};

Powered by Google App Engine
This is Rietveld 408576698