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

Side by Side Diff: webrtc/modules/rtp_rtcp/test/testAPI/test_api_audio.cc

Issue 2064523002: GN: Add video_engine_tests (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: audio_receive_stream_unittest compile Created 4 years, 6 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
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
(...skipping 10 matching lines...) Expand all
21 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h" 21 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h"
22 22
23 namespace webrtc { 23 namespace webrtc {
24 namespace { 24 namespace {
25 #define test_rate 64000u 25 #define test_rate 64000u
26 26
27 class VerifyingAudioReceiver : public NullRtpData { 27 class VerifyingAudioReceiver : public NullRtpData {
28 public: 28 public:
29 int32_t OnReceivedPayloadData( 29 int32_t OnReceivedPayloadData(
30 const uint8_t* payloadData, 30 const uint8_t* payloadData,
31 const size_t payloadSize, 31 size_t payloadSize,
32 const webrtc::WebRtcRTPHeader* rtpHeader) override { 32 const webrtc::WebRtcRTPHeader* rtpHeader) override {
33 if (rtpHeader->header.payloadType == 98 || 33 if (rtpHeader->header.payloadType == 98 ||
34 rtpHeader->header.payloadType == 99) { 34 rtpHeader->header.payloadType == 99) {
35 EXPECT_EQ(4u, payloadSize); 35 EXPECT_EQ(4u, payloadSize);
36 char str[5]; 36 char str[5];
37 memcpy(str, payloadData, payloadSize); 37 memcpy(str, payloadData, payloadSize);
38 str[4] = 0; 38 str[4] = 0;
39 // All our test vectors for payload type 96 and 97 even the stereo is on 39 // All our test vectors for payload type 96 and 97 even the stereo is on
40 // a per channel base equal to the 4 chars "test". 40 // a per channel base equal to the 4 chars "test".
41 // Note there is no null termination so we add that to use the 41 // Note there is no null termination so we add that to use the
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 for (; timeStamp <= 740 * 160; timeStamp += 160) { 339 for (; timeStamp <= 740 * 160; timeStamp += 160) {
340 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, 340 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96,
341 timeStamp, -1, test, 4)); 341 timeStamp, -1, test, 4));
342 fake_clock.AdvanceTimeMilliseconds(20); 342 fake_clock.AdvanceTimeMilliseconds(20);
343 module1->Process(); 343 module1->Process();
344 } 344 }
345 } 345 }
346 346
347 } // namespace 347 } // namespace
348 } // namespace webrtc 348 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698