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 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 double rateUB = 0; | 91 double rateUB = 0; |
92 #endif | 92 #endif |
93 FILE* histFile; | 93 FILE* histFile; |
94 FILE* averageFile; | 94 FILE* averageFile; |
95 int sampFreqKHz; | 95 int sampFreqKHz; |
96 int samplesIn10Ms; | 96 int samplesIn10Ms; |
97 int16_t maxStreamLen = 0; | 97 int16_t maxStreamLen = 0; |
98 char histFileName[500]; | 98 char histFileName[500]; |
99 char averageFileName[500]; | 99 char averageFileName[500]; |
100 unsigned int hist[600]; | 100 unsigned int hist[600]; |
101 unsigned int tmpSumStreamLen = 0; | 101 double tmpSumStreamLen = 0; |
102 unsigned int packetCntr = 0; | 102 unsigned int packetCntr = 0; |
103 unsigned int lostPacketCntr = 0; | 103 unsigned int lostPacketCntr = 0; |
104 uint8_t payload[1200]; | 104 uint8_t payload[1200]; |
105 uint8_t payloadRCU[1200]; | 105 uint8_t payloadRCU[1200]; |
106 uint16_t packetLossPercent = 0; | 106 uint16_t packetLossPercent = 0; |
107 int16_t rcuStreamLen = 0; | 107 int16_t rcuStreamLen = 0; |
108 int onlyEncode; | 108 int onlyEncode; |
109 int onlyDecode; | 109 int onlyDecode; |
110 | 110 |
111 BottleNeckModel packetData; | 111 BottleNeckModel packetData; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 maxStreamLen = (stream_len > maxStreamLen) ? stream_len : maxStreamLen; | 368 maxStreamLen = (stream_len > maxStreamLen) ? stream_len : maxStreamLen; |
369 packetCntr++; | 369 packetCntr++; |
370 | 370 |
371 hist[stream_len]++; | 371 hist[stream_len]++; |
372 if (averageFile != NULL) { | 372 if (averageFile != NULL) { |
373 tmpSumStreamLen += stream_len; | 373 tmpSumStreamLen += stream_len; |
374 if (packetCntr == 100) { | 374 if (packetCntr == 100) { |
375 // kbps | 375 // kbps |
376 fprintf(averageFile, "%8.3f ", | 376 fprintf(averageFile, "%8.3f ", |
377 (double)tmpSumStreamLen * 8.0 / (30.0 * packetCntr)); | 377 tmpSumStreamLen * 8.0 / (30.0 * packetCntr)); |
378 packetCntr = 0; | 378 packetCntr = 0; |
379 tmpSumStreamLen = 0; | 379 tmpSumStreamLen = 0; |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
383 if (onlyEncode) { | 383 if (onlyEncode) { |
384 uint8_t auxUW8; | 384 uint8_t auxUW8; |
385 auxUW8 = (uint8_t)(((stream_len & 0x7F00) >> 8) & 0xFF); | 385 auxUW8 = (uint8_t)(((stream_len & 0x7F00) >> 8) & 0xFF); |
386 if (fwrite(&auxUW8, sizeof(uint8_t), 1, outp) != 1) { | 386 if (fwrite(&auxUW8, sizeof(uint8_t), 1, outp) != 1) { |
387 return -1; | 387 return -1; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 int n; | 486 int n; |
487 for (n = 0; n < 600; n++) { | 487 for (n = 0; n < 600; n++) { |
488 fprintf(histFile, "%6d ", hist[n]); | 488 fprintf(histFile, "%6d ", hist[n]); |
489 } | 489 } |
490 fprintf(histFile, "\n"); | 490 fprintf(histFile, "\n"); |
491 fclose(histFile); | 491 fclose(histFile); |
492 } | 492 } |
493 if (averageFile != NULL) { | 493 if (averageFile != NULL) { |
494 if (packetCntr > 0) { | 494 if (packetCntr > 0) { |
495 fprintf(averageFile, "%8.3f ", | 495 fprintf(averageFile, "%8.3f ", |
496 (double)tmpSumStreamLen * 8.0 / (30.0 * packetCntr)); | 496 tmpSumStreamLen * 8.0 / (30.0 * packetCntr)); |
497 } | 497 } |
498 fprintf(averageFile, "\n"); | 498 fprintf(averageFile, "\n"); |
499 fclose(averageFile); | 499 fclose(averageFile); |
500 } | 500 } |
501 | 501 |
502 fclose(inp); | 502 fclose(inp); |
503 fclose(outp); | 503 fclose(outp); |
504 | 504 |
505 WebRtcIsac_Free(ISAC_main_inst); | 505 WebRtcIsac_Free(ISAC_main_inst); |
506 | 506 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 str->lastArrivalTime = 0; | 562 str->lastArrivalTime = 0; |
563 | 563 |
564 str->maxPayloadLB = 0; | 564 str->maxPayloadLB = 0; |
565 str->maxPayloadUB = 0; | 565 str->maxPayloadUB = 0; |
566 str->lbBytes = 0; | 566 str->lbBytes = 0; |
567 str->ubBytes = 0; | 567 str->ubBytes = 0; |
568 | 568 |
569 return 0; | 569 return 0; |
570 }; | 570 }; |
571 #endif | 571 #endif |
OLD | NEW |