Change gflags and gmock includes to be full paths.

This will fix PRESUBMIT warnings developers will get due to
r7014 and r7020.

Also some minor style cleanup in:
webrtc/modules/audio_coding/main/test/RTPFile.cc
webrtc/modules/audio_coding/neteq/test/RTPjitter.cc

BUG=
R=henrik.lundin@webrtc.org, niklas.enbom@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/23429004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7058 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kjellander@webrtc.org 2014-09-04 09:55:40 +00:00
parent 51bb33cc18
commit 3c0aae17f0
73 changed files with 211 additions and 197 deletions
DEPS
webrtc
base
modules
audio_coding
desktop_capture
remote_bitrate_estimator
tools/e2e_quality/audio

1
DEPS

@ -49,6 +49,7 @@ include_rules = [
# checkdeps.py shouldn't check include paths for files in these dirs:
skip_child_includes = [
'gflags',
'testing',
'third_party',
]

@ -14,7 +14,7 @@
#include "webrtc/base/logging.h"
#include "webrtc/base/thread.h"
#if defined(WEBRTC_ANDROID) || defined(GTEST_RELATIVE_PATH)
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#else
#include "testing/base/public/gunit.h"
#endif

@ -9,7 +9,7 @@
*/
#include <string>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc_cng.h"

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
#include "webrtc/modules/audio_coding/codecs/isac/fix/source/filterbank_internal.h"
#include "webrtc/modules/audio_coding/codecs/isac/fix/source/filterbank_tables.h"

@ -7,7 +7,7 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/codecs/isac/fix/source/codec.h"
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
#include "webrtc/typedefs.h"

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/codecs/isac/fix/source/lpc_masking_model.h"
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
#include "webrtc/typedefs.h"

@ -7,7 +7,7 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/codecs/isac/fix/source/codec.h"
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"

@ -10,7 +10,7 @@
#include "webrtc/modules/audio_coding/main/acm2/acm_opus.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/main/acm2/acm_codec_database.h"
namespace webrtc {

@ -12,7 +12,7 @@
#include <algorithm> // std::min
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
#include "webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h"
#include "webrtc/modules/audio_coding/main/acm2/acm_codec_database.h"

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/main/acm2/call_statistics.h"
namespace webrtc {

@ -10,7 +10,7 @@
#include <string.h>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/main/acm2/initial_delay_manager.h"
namespace webrtc {

@ -14,7 +14,7 @@
#include <algorithm>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/typedefs.h"
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"

@ -14,8 +14,8 @@
#include <stdio.h>
#include <string.h>
#include "gtest/gtest.h"
#include "module_common_types.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/interface/module_common_types.h"
namespace webrtc {

@ -20,8 +20,9 @@
#include "audio_coding_module.h"
#include "engine_configurations.h"
#include "gtest/gtest.h" // TODO (tlegrand): Consider removing usage of gtest.
#include "rw_lock_wrapper.h"
// TODO(tlegrand): Consider removing usage of gtest.
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include <stdio.h>
#include <string>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/common_types.h"
#include "webrtc/engine_configurations.h"

@ -14,7 +14,7 @@
#include <string>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/common_types.h"
#include "webrtc/engine_configurations.h"
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"

@ -18,7 +18,7 @@
#include <Windows.h>
#endif
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/engine_configurations.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/audio_coding/main/test/PCMFile.h"

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/main/acm2/acm_common_defs.h"
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
#include "webrtc/modules/audio_coding/main/test/PCMFile.h"

@ -15,7 +15,7 @@
#include <iostream>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/common_types.h"
#include "webrtc/engine_configurations.h"
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"

@ -11,7 +11,7 @@
#include <stdio.h>
#include "gflags/gflags.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
#include "webrtc/modules/audio_coding/main/test/Channel.h"

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/audio_coding/codecs/pcm16b/include/pcm16b.h"
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"

@ -16,7 +16,7 @@
#include <string.h>
#include <string>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/test/testsupport/fileutils.h"
namespace webrtc {

@ -15,7 +15,7 @@
#include <string>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/common_audio/resampler/include/resampler.h"
#ifdef WEBRTC_CODEC_CELT
#include "webrtc/modules/audio_coding/codecs/celt/include/celt_interface.h"

@ -15,7 +15,7 @@
#include <string>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/typedefs.h"
namespace webrtc {

@ -15,7 +15,7 @@
#include <string>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/typedefs.h"
namespace webrtc {

@ -12,7 +12,7 @@
#include "webrtc/modules/audio_coding/neteq/background_noise.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {

@ -14,7 +14,7 @@
#include <math.h> // Access to pow function.
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {

@ -12,7 +12,7 @@
#include "webrtc/modules/audio_coding/neteq/comfort_noise.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/mock/mock_decoder_database.h"
#include "webrtc/modules/audio_coding/neteq/sync_buffer.h"

@ -10,7 +10,7 @@
// Unit tests for DecisionLogic class and derived classes.
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/buffer_level_filter.h"
#include "webrtc/modules/audio_coding/neteq/decoder_database.h"
#include "webrtc/modules/audio_coding/neteq/decision_logic.h"

@ -15,8 +15,8 @@
#include <string>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/mock/mock_audio_decoder.h"
#include "webrtc/test/testsupport/gtest_disable.h"

@ -14,8 +14,8 @@
#include <math.h>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/mock/mock_delay_peak_detector.h"
namespace webrtc {

@ -12,7 +12,7 @@
#include "webrtc/modules/audio_coding/neteq/delay_peak_detector.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {

@ -10,7 +10,7 @@
#include "webrtc/modules/audio_coding/neteq/dsp_helper.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h"
#include "webrtc/typedefs.h"

@ -18,7 +18,7 @@
#include <iostream>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
// Modify the tests so that they pass with the modifications done to DtmfBuffer
// for backwards bit-exactness. Once bit-exactness is no longer required, this

@ -14,7 +14,7 @@
#include <math.h>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h"
namespace webrtc {

@ -12,7 +12,7 @@
#include "webrtc/modules/audio_coding/neteq/expand.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/background_noise.h"
#include "webrtc/modules/audio_coding/neteq/random_vector.h"
#include "webrtc/modules/audio_coding/neteq/sync_buffer.h"

@ -14,7 +14,7 @@
#include <vector>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/background_noise.h"
#include "webrtc/modules/audio_coding/neteq/expand.h"
#include "webrtc/modules/audio_coding/neteq/random_vector.h"

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/interface/audio_decoder.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/audio_vector.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/buffer_level_filter.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/decoder_database.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/delay_manager.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/delay_peak_detector.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/dtmf_buffer.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/dtmf_tone_generator.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/interface/audio_decoder.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/modules/audio_coding/codecs/pcm16b/include/pcm16b.h"
#include "webrtc/typedefs.h"

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/packet_buffer.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/payload_splitter.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {

@ -13,8 +13,8 @@
#include <string>
#include <list>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/interface/neteq.h"
#include "webrtc/modules/audio_coding/neteq/mock/mock_external_decoder_pcm16b.h"
#include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h"

@ -11,8 +11,8 @@
#include "webrtc/modules/audio_coding/neteq/interface/neteq.h"
#include "webrtc/modules/audio_coding/neteq/neteq_impl.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/accelerate.h"
#include "webrtc/modules/audio_coding/neteq/expand.h"
#include "webrtc/modules/audio_coding/neteq/mock/mock_audio_decoder.h"

@ -14,7 +14,7 @@
#include <string>
#include <list>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/codecs/pcm16b/include/pcm16b.h"
#include "webrtc/modules/audio_coding/neteq/interface/neteq.h"
#include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h"

@ -24,7 +24,7 @@
#include <vector>
#include "gflags/gflags.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/test/NETEQTEST_RTPpacket.h"
#include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h"
#include "webrtc/modules/audio_coding/codecs/pcm16b/include/pcm16b.h"

@ -14,7 +14,7 @@
#include <vector>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
#include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h"
#include "webrtc/modules/audio_coding/neteq/background_noise.h"

@ -12,8 +12,8 @@
#include "webrtc/modules/audio_coding/neteq/packet_buffer.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/mock/mock_decoder_database.h"
#include "webrtc/modules/audio_coding/neteq/packet.h"

@ -16,7 +16,7 @@
#include <utility> // pair
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/mock/mock_decoder_database.h"
#include "webrtc/modules/audio_coding/neteq/packet.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"

@ -12,7 +12,7 @@
#include "webrtc/modules/audio_coding/neteq/post_decode_vad.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {

@ -12,7 +12,7 @@
#include "webrtc/modules/audio_coding/neteq/random_vector.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {

@ -10,7 +10,7 @@
#include "webrtc/modules/audio_coding/neteq/sync_buffer.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {

@ -13,7 +13,7 @@
#include <algorithm>
#include <vector>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/test/NETEQTEST_RTPpacket.h"
#define FIRSTLINELEN 40

@ -25,7 +25,7 @@
#include <assert.h>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/typedefs.h"
/*********************/
@ -33,11 +33,13 @@
/*********************/
#define FIRSTLINELEN 40
#define CHECK_NOT_NULL(a) if((a)==NULL){fprintf(stderr,"\n %s \n line: %d \nerror at %s\n",__FILE__,__LINE__,#a );return(-1);}
#define CHECK_NOT_NULL(a) if((a)==NULL){ \
fprintf(stderr,"\n %s \n line: %d \nerror at %s\n",__FILE__,__LINE__,#a ); \
return(-1);}
struct arr_time {
float time;
uint32_t ix;
float time;
uint32_t ix;
};
int filelen(FILE *fid)
@ -61,157 +63,167 @@ int compare_arr_time(const void *x, const void *y);
int main(int argc, char* argv[])
{
unsigned int dat_len, rtp_len, Npack, k;
arr_time *time_vec;
char firstline[FIRSTLINELEN];
unsigned char* rtp_vec = NULL;
unsigned int dat_len, rtp_len, Npack, k;
arr_time *time_vec;
char firstline[FIRSTLINELEN];
unsigned char* rtp_vec = NULL;
unsigned char** packet_ptr = NULL;
unsigned char* temp_packet = NULL;
const unsigned int kRtpDumpHeaderSize = 4 + 4 + 4 + 2 + 2;
uint16_t len;
uint32_t *offset;
const unsigned int kRtpDumpHeaderSize = 4 + 4 + 4 + 2 + 2;
uint16_t len;
uint32_t *offset;
/* check number of parameters */
if (argc != 4) {
/* print help text and exit */
printf("Apply jitter on RTP stream.\n");
printf("The program reads an RTP stream and packet timing from two files.\n");
printf("The RTP stream is modified to have the same jitter as described in the timing files.\n");
printf("The format of the RTP stream file should be the same as for rtpplay,\n");
printf("and can be obtained e.g., from Ethereal by using\n");
printf("Statistics -> RTP -> Show All Streams -> [select a stream] -> Save As\n\n");
printf("Usage:\n\n");
printf("%s RTP_infile dat_file RTP_outfile\n", argv[0]);
printf("where:\n");
if (argc != 4) {
/* print help text and exit */
printf("Apply jitter on RTP stream.\n");
printf("Reads an RTP stream and packet timing from two files.\n");
printf("The RTP stream is modified to have the same jitter as described in "
"the timing files.\n");
printf("The format of the RTP stream file should be the same as for \n");
printf("rtpplay, and can be obtained e.g., from Ethereal by using\n");
printf("Statistics -> RTP -> Show All Streams -> [select a stream] -> "
"Save As\n\n");
printf("Usage:\n\n");
printf("%s RTP_infile dat_file RTP_outfile\n", argv[0]);
printf("where:\n");
printf("RTP_infile : RTP stream input file\n\n");
printf("RTP_infile : RTP stream input file\n\n");
printf("dat_file : file with packet arrival times in ms\n\n");
printf("dat_file : file with packet arrival times in ms\n\n");
printf("RTP_outfile : RTP stream output file\n\n");
printf("RTP_outfile : RTP stream output file\n\n");
return(0);
}
return(0);
}
FILE* in_file=fopen(argv[1],"rb");
CHECK_NOT_NULL(in_file);
printf("Input file: %s\n",argv[1]);
FILE* dat_file=fopen(argv[2],"rb");
CHECK_NOT_NULL(dat_file);
printf("Dat-file: %s\n",argv[2]);
FILE* out_file=fopen(argv[3],"wb");
CHECK_NOT_NULL(out_file);
printf("Output file: %s\n\n",argv[3]);
time_vec = (arr_time *) malloc(sizeof(arr_time)*(filelen(dat_file)/sizeof(float)) + 1000); // add 1000 bytes to avoid (rare) strange error
if (time_vec==NULL) {
fprintf(stderr, "Error: could not allocate memory for reading dat file\n");
goto closing;
}
FILE* in_file=fopen(argv[1],"rb");
CHECK_NOT_NULL(in_file);
printf("Input file: %s\n",argv[1]);
FILE* dat_file=fopen(argv[2],"rb");
CHECK_NOT_NULL(dat_file);
printf("Dat-file: %s\n",argv[2]);
FILE* out_file=fopen(argv[3],"wb");
CHECK_NOT_NULL(out_file);
printf("Output file: %s\n\n",argv[3]);
// add 1000 bytes to avoid (rare) strange error.
time_vec = (arr_time *) malloc(sizeof(arr_time)
*(filelen(dat_file)/sizeof(float)) + 1000);
if (time_vec==NULL) {
fprintf(stderr, "Error: could not allocate memory for reading dat file\n");
goto closing;
}
dat_len=0;
while(fread(&(time_vec[dat_len].time),sizeof(float),1,dat_file)>0) {
time_vec[dat_len].ix=dat_len;
dat_len++;
}
dat_len=0;
while(fread(&(time_vec[dat_len].time),sizeof(float),1,dat_file)>0) {
time_vec[dat_len].ix=dat_len;
dat_len++;
}
if (dat_len == 0) {
fprintf(stderr, "Error: dat_file is empty, no arrival time is given.\n");
goto closing;
}
qsort(time_vec,dat_len,sizeof(arr_time),compare_arr_time);
qsort(time_vec,dat_len,sizeof(arr_time),compare_arr_time);
rtp_vec = (unsigned char *) malloc(sizeof(unsigned char)*filelen(in_file));
if (rtp_vec==NULL) {
fprintf(stderr,"Error: could not allocate memory for reading rtp file\n");
goto closing;
}
rtp_vec = (unsigned char *) malloc(sizeof(unsigned char)*filelen(in_file));
if (rtp_vec==NULL) {
fprintf(stderr,"Error: could not allocate memory for reading rtp file\n");
goto closing;
}
// read file header and write directly to output file
EXPECT_TRUE(fgets(firstline, FIRSTLINELEN, in_file) != NULL);
EXPECT_GT(fputs(firstline, out_file), 0);
EXPECT_EQ(kRtpDumpHeaderSize, fread(firstline, 1, kRtpDumpHeaderSize,
in_file));
EXPECT_EQ(kRtpDumpHeaderSize, fwrite(firstline, 1, kRtpDumpHeaderSize,
out_file));
// read file header and write directly to output file
EXPECT_TRUE(fgets(firstline, FIRSTLINELEN, in_file) != NULL);
EXPECT_GT(fputs(firstline, out_file), 0);
EXPECT_EQ(kRtpDumpHeaderSize, fread(firstline, 1, kRtpDumpHeaderSize,
in_file));
EXPECT_EQ(kRtpDumpHeaderSize, fwrite(firstline, 1, kRtpDumpHeaderSize,
out_file));
// read all RTP packets into vector
rtp_len=0;
Npack=0;
len=(uint16_t) fread(&rtp_vec[rtp_len], sizeof(unsigned char), 2, in_file); // read length of first packet
while(len==2) {
len = ntohs(*((uint16_t *)(rtp_vec + rtp_len)));
rtp_len += 2;
if(fread(&rtp_vec[rtp_len], sizeof(unsigned char), len-2, in_file)!=(unsigned) (len-2)) {
fprintf(stderr,"Error: currupt packet length\n");
goto closing;
}
rtp_len += len-2;
Npack++;
len=(uint16_t) fread(&rtp_vec[rtp_len], sizeof(unsigned char), 2, in_file); // read length of next packet
}
// read all RTP packets into vector
rtp_len=0;
Npack=0;
if (Npack == 0) {
fprintf(stderr, "Error: No RTP packet found.\n");
goto closing;
}
// read length of first packet.
len=(uint16_t) fread(&rtp_vec[rtp_len], sizeof(unsigned char), 2, in_file);
while(len==2) {
len = ntohs(*((uint16_t *)(rtp_vec + rtp_len)));
rtp_len += 2;
if(fread(&rtp_vec[rtp_len], sizeof(unsigned char),
len-2, in_file)!=(unsigned) (len-2)) {
fprintf(stderr,"Error: currupt packet length\n");
goto closing;
}
rtp_len += len-2;
Npack++;
packet_ptr = (unsigned char **) malloc(Npack*sizeof(unsigned char*));
// read length of next packet.
len=(uint16_t) fread(&rtp_vec[rtp_len], sizeof(unsigned char), 2, in_file);
}
packet_ptr[0]=rtp_vec;
k=1;
while(k<Npack) {
len = ntohs(*((uint16_t *) packet_ptr[k-1]));
packet_ptr[k]=packet_ptr[k-1]+len;
k++;
}
if (Npack == 0) {
fprintf(stderr, "Error: No RTP packet found.\n");
goto closing;
}
for(k=0; k<dat_len && k<Npack; k++) {
if(time_vec[k].time < FLT_MAX && time_vec[k].ix < Npack){
temp_packet = packet_ptr[time_vec[k].ix];
offset = (uint32_t *) (temp_packet+4);
if ( time_vec[k].time >= 0 ) {
*offset = htonl((uint32_t) time_vec[k].time);
}
else {
*offset = htonl((uint32_t) 0);
fprintf(stderr, "Warning: negative receive time in dat file transformed to 0.\n");
}
packet_ptr = (unsigned char **) malloc(Npack*sizeof(unsigned char*));
// write packet to file
if (fwrite(temp_packet, sizeof(unsigned char),
ntohs(*((uint16_t*) temp_packet)),
out_file) !=
ntohs(*((uint16_t*) temp_packet))) {
return -1;
}
}
}
packet_ptr[0]=rtp_vec;
k=1;
while(k<Npack) {
len = ntohs(*((uint16_t *) packet_ptr[k-1]));
packet_ptr[k]=packet_ptr[k-1]+len;
k++;
}
for(k=0; k<dat_len && k<Npack; k++) {
if(time_vec[k].time < FLT_MAX && time_vec[k].ix < Npack){
temp_packet = packet_ptr[time_vec[k].ix];
offset = (uint32_t *) (temp_packet+4);
if ( time_vec[k].time >= 0 ) {
*offset = htonl((uint32_t) time_vec[k].time);
}
else {
*offset = htonl((uint32_t) 0);
fprintf(stderr, "Warning: negative receive time in dat file transformed"
" to 0.\n");
}
// write packet to file
if (fwrite(temp_packet, sizeof(unsigned char),
ntohs(*((uint16_t*) temp_packet)),
out_file) !=
ntohs(*((uint16_t*) temp_packet))) {
return -1;
}
}
}
closing:
free(time_vec);
free(rtp_vec);
free(time_vec);
free(rtp_vec);
if (packet_ptr != NULL) {
free(packet_ptr);
free(packet_ptr);
}
fclose(in_file);
fclose(dat_file);
fclose(out_file);
fclose(dat_file);
fclose(out_file);
return(0);
return(0);
}
int compare_arr_time(const void *xp, const void *yp) {
if(((arr_time *)xp)->time == ((arr_time *)yp)->time)
return(0);
else if(((arr_time *)xp)->time > ((arr_time *)yp)->time)
return(1);
if(((arr_time *)xp)->time == ((arr_time *)yp)->time)
return(0);
else if(((arr_time *)xp)->time > ((arr_time *)yp)->time)
return(1);
return(-1);
return(-1);
}

@ -13,7 +13,7 @@
#include <vector>
#include "NETEQTEST_RTPpacket.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
/*********************/
/* Misc. definitions */

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_coding/neteq/accelerate.h"
#include "webrtc/modules/audio_coding/neteq/preemptive_expand.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/background_noise.h"
namespace webrtc {

@ -10,8 +10,8 @@
#include "webrtc/modules/audio_coding/neteq/timestamp_scaler.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/audio_coding/neteq/mock/mock_decoder_database.h"
#include "webrtc/modules/audio_coding/neteq/packet.h"

@ -12,7 +12,7 @@
#include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {
namespace test {

@ -12,7 +12,7 @@
#include "webrtc/modules/audio_coding/neteq/tools/packet.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {
namespace test {

@ -10,7 +10,7 @@
#include "webrtc/modules/desktop_capture/desktop_and_cursor_composer.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/desktop_capture/desktop_capture_options.h"
#include "webrtc/modules/desktop_capture/desktop_frame.h"
#include "webrtc/modules/desktop_capture/mouse_cursor.h"

@ -12,7 +12,7 @@
#include <algorithm>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {

@ -10,7 +10,7 @@
#include "webrtc/modules/desktop_capture/mouse_cursor_monitor.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/desktop_capture/desktop_capture_options.h"
#include "webrtc/modules/desktop_capture/desktop_frame.h"
#include "webrtc/modules/desktop_capture/mouse_cursor.h"

@ -10,7 +10,7 @@
#include "webrtc/modules/desktop_capture/window_capturer.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/desktop_capture/desktop_capture_options.h"
#include "webrtc/modules/desktop_capture/desktop_frame.h"
#include "webrtc/modules/desktop_capture/desktop_region.h"

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "webrtc/modules/remote_bitrate_estimator/test/bwe_test.h"
#include "webrtc/test/testsupport/fileutils.h"

@ -11,7 +11,7 @@
#include <map>
#include <string>
#include <vector>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h"

@ -12,7 +12,7 @@
#include <numeric>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/test/testsupport/fileutils.h"

@ -13,7 +13,7 @@
// flags.
#include "gflags/gflags.h"
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/test/channel_transport/include/channel_transport.h"