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_MODULES_AUDIO_CODING_TEST_CHANNEL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_TEST_CHANNEL_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_TEST_CHANNEL_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_TEST_CHANNEL_H_ |
13 | 13 |
14 #include <stdio.h> | 14 #include <stdio.h> |
15 | 15 |
| 16 #include "webrtc/base/criticalsection.h" |
16 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 17 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
17 #include "webrtc/modules/include/module_common_types.h" | 18 #include "webrtc/modules/include/module_common_types.h" |
18 #include "webrtc/typedefs.h" | 19 #include "webrtc/typedefs.h" |
19 | 20 |
20 namespace webrtc { | 21 namespace webrtc { |
21 | 22 |
22 class CriticalSectionWrapper; | |
23 | |
24 #define MAX_NUM_PAYLOADS 50 | 23 #define MAX_NUM_PAYLOADS 50 |
25 #define MAX_NUM_FRAMESIZES 6 | 24 #define MAX_NUM_FRAMESIZES 6 |
26 | 25 |
27 // TODO(turajs): Write constructor for this structure. | 26 // TODO(turajs): Write constructor for this structure. |
28 struct ACMTestFrameSizeStats { | 27 struct ACMTestFrameSizeStats { |
29 uint16_t frameSizeSample; | 28 uint16_t frameSizeSample; |
30 size_t maxPayloadLen; | 29 size_t maxPayloadLen; |
31 uint32_t numPackets; | 30 uint32_t numPackets; |
32 uint64_t totalPayloadLenByte; | 31 uint64_t totalPayloadLenByte; |
33 uint64_t totalEncodedSamples; | 32 uint64_t totalEncodedSamples; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 93 } |
95 | 94 |
96 private: | 95 private: |
97 void CalcStatistics(WebRtcRTPHeader& rtpInfo, size_t payloadSize); | 96 void CalcStatistics(WebRtcRTPHeader& rtpInfo, size_t payloadSize); |
98 | 97 |
99 AudioCodingModule* _receiverACM; | 98 AudioCodingModule* _receiverACM; |
100 uint16_t _seqNo; | 99 uint16_t _seqNo; |
101 // 60msec * 32 sample(max)/msec * 2 description (maybe) * 2 bytes/sample | 100 // 60msec * 32 sample(max)/msec * 2 description (maybe) * 2 bytes/sample |
102 uint8_t _payloadData[60 * 32 * 2 * 2]; | 101 uint8_t _payloadData[60 * 32 * 2 * 2]; |
103 | 102 |
104 CriticalSectionWrapper* _channelCritSect; | 103 mutable rtc::CriticalSection _channelCritSect; |
105 FILE* _bitStreamFile; | 104 FILE* _bitStreamFile; |
106 bool _saveBitStream; | 105 bool _saveBitStream; |
107 int16_t _lastPayloadType; | 106 int16_t _lastPayloadType; |
108 ACMTestPayloadStats _payloadStats[MAX_NUM_PAYLOADS]; | 107 ACMTestPayloadStats _payloadStats[MAX_NUM_PAYLOADS]; |
109 bool _isStereo; | 108 bool _isStereo; |
110 WebRtcRTPHeader _rtpInfo; | 109 WebRtcRTPHeader _rtpInfo; |
111 bool _leftChannel; | 110 bool _leftChannel; |
112 uint32_t _lastInTimestamp; | 111 uint32_t _lastInTimestamp; |
113 bool _useLastFrameSize; | 112 bool _useLastFrameSize; |
114 uint32_t _lastFrameSizeSample; | 113 uint32_t _lastFrameSizeSample; |
115 // FEC Test variables | 114 // FEC Test variables |
116 int16_t _packetLoss; | 115 int16_t _packetLoss; |
117 bool _useFECTestWithPacketLoss; | 116 bool _useFECTestWithPacketLoss; |
118 uint64_t _beginTime; | 117 uint64_t _beginTime; |
119 uint64_t _totalBytes; | 118 uint64_t _totalBytes; |
120 | 119 |
121 // External timing info, defaulted to -1. Only used if they are | 120 // External timing info, defaulted to -1. Only used if they are |
122 // non-negative. | 121 // non-negative. |
123 int64_t external_send_timestamp_; | 122 int64_t external_send_timestamp_; |
124 int32_t external_sequence_number_; | 123 int32_t external_sequence_number_; |
125 int num_packets_to_drop_; | 124 int num_packets_to_drop_; |
126 }; | 125 }; |
127 | 126 |
128 } // namespace webrtc | 127 } // namespace webrtc |
129 | 128 |
130 #endif // WEBRTC_MODULES_AUDIO_CODING_TEST_CHANNEL_H_ | 129 #endif // WEBRTC_MODULES_AUDIO_CODING_TEST_CHANNEL_H_ |
OLD | NEW |