OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_TEST_TESTSUPPORT_FRAME_WRITER_H_ | 11 #ifndef WEBRTC_TEST_TESTSUPPORT_FRAME_WRITER_H_ |
12 #define WEBRTC_TEST_TESTSUPPORT_FRAME_WRITER_H_ | 12 #define WEBRTC_TEST_TESTSUPPORT_FRAME_WRITER_H_ |
13 | 13 |
14 #include <stdio.h> | 14 #include <stdio.h> |
15 | 15 |
16 #include <string> | 16 #include <string> |
17 | 17 |
| 18 #include "webrtc/api/video/video_frame.h" |
18 #include "webrtc/typedefs.h" | 19 #include "webrtc/typedefs.h" |
19 | 20 |
20 namespace webrtc { | 21 namespace webrtc { |
21 namespace test { | 22 namespace test { |
22 | 23 |
23 // Handles writing of video files. | 24 // Handles writing of video files. |
24 class FrameWriter { | 25 class FrameWriter { |
25 public: | 26 public: |
26 virtual ~FrameWriter() {} | 27 virtual ~FrameWriter() {} |
27 | 28 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 int height, | 76 int height, |
76 int frame_rate); | 77 int frame_rate); |
77 ~Y4mFrameWriterImpl() override; | 78 ~Y4mFrameWriterImpl() override; |
78 bool Init() override; | 79 bool Init() override; |
79 bool WriteFrame(uint8_t* frame_buffer) override; | 80 bool WriteFrame(uint8_t* frame_buffer) override; |
80 | 81 |
81 private: | 82 private: |
82 const int frame_rate_; | 83 const int frame_rate_; |
83 }; | 84 }; |
84 | 85 |
| 86 // LibJpeg is not available on iOS |
| 87 #if !defined(is_ios) |
| 88 class JpegFrameWriter { |
| 89 public: |
| 90 JpegFrameWriter(const std::string &output_filename); |
| 91 bool WriteFrame(const VideoFrame& input_frame, int quality); |
| 92 |
| 93 private: |
| 94 bool frame_written_; |
| 95 const std::string output_filename_; |
| 96 FILE* output_file_; |
| 97 }; |
| 98 #endif |
| 99 |
85 } // namespace test | 100 } // namespace test |
86 } // namespace webrtc | 101 } // namespace webrtc |
87 | 102 |
88 #endif // WEBRTC_TEST_TESTSUPPORT_FRAME_WRITER_H_ | 103 #endif // WEBRTC_TEST_TESTSUPPORT_FRAME_WRITER_H_ |
OLD | NEW |