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

Side by Side Diff: webrtc/modules/video_coding/utility/ivf_file_writer.h

Issue 1853813002: Add support for writing raw encoder output to .ivf files. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added checks Created 4 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_VIDEO_CODING_UTILITY_IVF_FILE_WRITER_H_
12 #define WEBRTC_MODULES_VIDEO_CODING_UTILITY_IVF_FILE_WRITER_H_
13
14 #include <memory>
15 #include <string>
16
17 #include "webrtc/base/constructormagic.h"
18 #include "webrtc/base/pathutils.h"
19 #include "webrtc/base/stream.h"
20 #include "webrtc/modules/include/module_common_types.h"
21 #include "webrtc/video_frame.h"
22
23 namespace webrtc {
24
25 class IvfFileWriter {
26 public:
27 ~IvfFileWriter();
28
29 static std::unique_ptr<IvfFileWriter> Open(rtc::Pathname file_name,
30 RtpVideoCodecTypes codec_type);
31 static std::unique_ptr<IvfFileWriter> Open(rtc::StreamInterface* out_stream,
32 RtpVideoCodecTypes codec_type);
33 bool WriteFrame(const EncodedImage& encoded_image);
34 bool Close();
35
36 private:
37 IvfFileWriter(rtc::Pathname path_name, rtc::StreamInterface* out_stream);
38 bool WriteHeader(RtpVideoCodecTypes codec_type);
39
40 size_t num_frames_;
41 uint16_t width_;
42 uint16_t height_;
43 int64_t last_timestamp_;
44 rtc::Pathname file_name_;
45 std::unique_ptr<rtc::StreamInterface> out_stream_;
46
47 RTC_DISALLOW_COPY_AND_ASSIGN(IvfFileWriter);
48 };
49
50 } // namespace webrtc
51
52 #endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_IVF_FILE_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698