| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 // Flag for video codec. | 131 // Flag for video codec. |
| 132 DEFINE_string(codec, "VP8", "Video codec"); | 132 DEFINE_string(codec, "VP8", "Video codec"); |
| 133 static std::string Codec() { return static_cast<std::string>(FLAGS_codec); } | 133 static std::string Codec() { return static_cast<std::string>(FLAGS_codec); } |
| 134 | 134 |
| 135 } // namespace flags | 135 } // namespace flags |
| 136 | 136 |
| 137 static const uint32_t kReceiverLocalSsrc = 0x123456; | 137 static const uint32_t kReceiverLocalSsrc = 0x123456; |
| 138 | 138 |
| 139 class FileRenderPassthrough : public VideoRenderer { | 139 class FileRenderPassthrough : public rtc::VideoSinkInterface<VideoFrame> { |
| 140 public: | 140 public: |
| 141 FileRenderPassthrough(const std::string& basename, VideoRenderer* renderer) | 141 FileRenderPassthrough(const std::string& basename, |
| 142 rtc::VideoSinkInterface<VideoFrame>* renderer) |
| 142 : basename_(basename), | 143 : basename_(basename), |
| 143 renderer_(renderer), | 144 renderer_(renderer), |
| 144 file_(nullptr), | 145 file_(nullptr), |
| 145 count_(0), | 146 count_(0), |
| 146 last_width_(0), | 147 last_width_(0), |
| 147 last_height_(0) {} | 148 last_height_(0) {} |
| 148 | 149 |
| 149 ~FileRenderPassthrough() { | 150 ~FileRenderPassthrough() { |
| 150 if (file_ != nullptr) | 151 if (file_ != nullptr) |
| 151 fclose(file_); | 152 fclose(file_); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 175 } | 176 } |
| 176 } | 177 } |
| 177 last_width_ = video_frame.width(); | 178 last_width_ = video_frame.width(); |
| 178 last_height_ = video_frame.height(); | 179 last_height_ = video_frame.height(); |
| 179 if (file_ == nullptr) | 180 if (file_ == nullptr) |
| 180 return; | 181 return; |
| 181 PrintVideoFrame(video_frame, file_); | 182 PrintVideoFrame(video_frame, file_); |
| 182 } | 183 } |
| 183 | 184 |
| 184 const std::string basename_; | 185 const std::string basename_; |
| 185 VideoRenderer* const renderer_; | 186 rtc::VideoSinkInterface<VideoFrame>* const renderer_; |
| 186 FILE* file_; | 187 FILE* file_; |
| 187 size_t count_; | 188 size_t count_; |
| 188 int last_width_; | 189 int last_width_; |
| 189 int last_height_; | 190 int last_height_; |
| 190 }; | 191 }; |
| 191 | 192 |
| 192 class DecoderBitstreamFileWriter : public EncodedFrameObserver { | 193 class DecoderBitstreamFileWriter : public EncodedFrameObserver { |
| 193 public: | 194 public: |
| 194 explicit DecoderBitstreamFileWriter(const char* filename) | 195 explicit DecoderBitstreamFileWriter(const char* filename) |
| 195 : file_(fopen(filename, "wb")) { | 196 : file_(fopen(filename, "wb")) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 } | 319 } |
| 319 } // namespace webrtc | 320 } // namespace webrtc |
| 320 | 321 |
| 321 int main(int argc, char* argv[]) { | 322 int main(int argc, char* argv[]) { |
| 322 ::testing::InitGoogleTest(&argc, argv); | 323 ::testing::InitGoogleTest(&argc, argv); |
| 323 google::ParseCommandLineFlags(&argc, &argv, true); | 324 google::ParseCommandLineFlags(&argc, &argv, true); |
| 324 | 325 |
| 325 webrtc::test::RunTest(webrtc::RtpReplay); | 326 webrtc::test::RunTest(webrtc::RtpReplay); |
| 326 return 0; | 327 return 0; |
| 327 } | 328 } |
| OLD | NEW |