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 #include <memory> |
| 12 |
11 #include "webrtc/modules/video_coding/test/receiver_tests.h" | 13 #include "webrtc/modules/video_coding/test/receiver_tests.h" |
12 #include "webrtc/modules/video_coding/test/vcm_payload_sink_factory.h" | 14 #include "webrtc/modules/video_coding/test/vcm_payload_sink_factory.h" |
13 #include "webrtc/system_wrappers/include/trace.h" | 15 #include "webrtc/system_wrappers/include/trace.h" |
14 #include "webrtc/test/testsupport/fileutils.h" | 16 #include "webrtc/test/testsupport/fileutils.h" |
15 | 17 |
16 namespace { | 18 namespace { |
17 | 19 |
18 const bool kConfigProtectionEnabled = true; | 20 const bool kConfigProtectionEnabled = true; |
19 const webrtc::VCMVideoProtection kConfigProtectionMethod = | 21 const webrtc::VCMVideoProtection kConfigProtectionMethod = |
20 webrtc::kProtectionNack; | 22 webrtc::kProtectionNack; |
(...skipping 23 matching lines...) Expand all Loading... |
44 kDefaultVp8PayloadType, "VP8", webrtc::kVideoCodecVP8)); | 46 kDefaultVp8PayloadType, "VP8", webrtc::kVideoCodecVP8)); |
45 | 47 |
46 std::string output_file = args.outputFile; | 48 std::string output_file = args.outputFile; |
47 if (output_file.empty()) | 49 if (output_file.empty()) |
48 output_file = webrtc::test::OutputPath() + "RtpPlay_decoded.yuv"; | 50 output_file = webrtc::test::OutputPath() + "RtpPlay_decoded.yuv"; |
49 | 51 |
50 webrtc::SimulatedClock clock(0); | 52 webrtc::SimulatedClock clock(0); |
51 webrtc::rtpplayer::VcmPayloadSinkFactory factory( | 53 webrtc::rtpplayer::VcmPayloadSinkFactory factory( |
52 output_file, &clock, kConfigProtectionEnabled, kConfigProtectionMethod, | 54 output_file, &clock, kConfigProtectionEnabled, kConfigProtectionMethod, |
53 kConfigRttMs, kConfigRenderDelayMs, kConfigMinPlayoutDelayMs); | 55 kConfigRttMs, kConfigRenderDelayMs, kConfigMinPlayoutDelayMs); |
54 rtc::scoped_ptr<webrtc::rtpplayer::RtpPlayerInterface> rtp_player( | 56 std::unique_ptr<webrtc::rtpplayer::RtpPlayerInterface> rtp_player( |
55 webrtc::rtpplayer::Create(args.inputFile, &factory, &clock, payload_types, | 57 webrtc::rtpplayer::Create(args.inputFile, &factory, &clock, payload_types, |
56 kConfigLossRate, kConfigRttMs, | 58 kConfigLossRate, kConfigRttMs, |
57 kConfigReordering)); | 59 kConfigReordering)); |
58 if (rtp_player.get() == NULL) { | 60 if (rtp_player.get() == NULL) { |
59 return -1; | 61 return -1; |
60 } | 62 } |
61 | 63 |
62 int ret = 0; | 64 int ret = 0; |
63 while ((ret = rtp_player->NextPacket(clock.TimeInMilliseconds())) == 0) { | 65 while ((ret = rtp_player->NextPacket(clock.TimeInMilliseconds())) == 0) { |
64 ret = factory.DecodeAndProcessAll(true); | 66 ret = factory.DecodeAndProcessAll(true); |
(...skipping 14 matching lines...) Expand all Loading... |
79 printf("Failed\n"); | 81 printf("Failed\n"); |
80 return -1; | 82 return -1; |
81 case 0: | 83 case 0: |
82 printf("Timeout\n"); | 84 printf("Timeout\n"); |
83 return -1; | 85 return -1; |
84 } | 86 } |
85 | 87 |
86 webrtc::Trace::ReturnTrace(); | 88 webrtc::Trace::ReturnTrace(); |
87 return 0; | 89 return 0; |
88 } | 90 } |
OLD | NEW |