| 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" | |
| 19 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
| 20 | 19 |
| 21 namespace webrtc { | 20 namespace webrtc { |
| 22 namespace test { | 21 namespace test { |
| 23 | 22 |
| 24 // Handles writing of video files. | 23 // Handles writing of video files. |
| 25 class FrameWriter { | 24 class FrameWriter { |
| 26 public: | 25 public: |
| 27 virtual ~FrameWriter() {} | 26 virtual ~FrameWriter() {} |
| 28 | 27 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 int height, | 75 int height, |
| 77 int frame_rate); | 76 int frame_rate); |
| 78 ~Y4mFrameWriterImpl() override; | 77 ~Y4mFrameWriterImpl() override; |
| 79 bool Init() override; | 78 bool Init() override; |
| 80 bool WriteFrame(uint8_t* frame_buffer) override; | 79 bool WriteFrame(uint8_t* frame_buffer) override; |
| 81 | 80 |
| 82 private: | 81 private: |
| 83 const int frame_rate_; | 82 const int frame_rate_; |
| 84 }; | 83 }; |
| 85 | 84 |
| 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 | |
| 100 } // namespace test | 85 } // namespace test |
| 101 } // namespace webrtc | 86 } // namespace webrtc |
| 102 | 87 |
| 103 #endif // WEBRTC_TEST_TESTSUPPORT_FRAME_WRITER_H_ | 88 #endif // WEBRTC_TEST_TESTSUPPORT_FRAME_WRITER_H_ |
| OLD | NEW |