Delete rtc_base/format_macros.h
It defined RTC_PRIuS, which was needed for compatibility with MSVC prior to version 2015. Bug: webrtc:6424 Change-Id: I5668d473376201cad3e8da65927c967fc397804b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261314 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36814}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
cc50b04c02
commit
ea1e6f44f8
@ -11,13 +11,7 @@
|
||||
#ifndef API_CALL_AUDIO_SINK_H_
|
||||
#define API_CALL_AUDIO_SINK_H_
|
||||
|
||||
#if defined(WEBRTC_POSIX) && !defined(__STDC_FORMAT_MACROS)
|
||||
// Avoid conflict with format_macros.h.
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_config.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/location.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/numerics/safe_minmax.h"
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/event.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/location.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "common_audio/resampler/include/push_resampler.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "test/gtest.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -140,7 +139,7 @@ float ComputeSNR(const AudioFrame& ref_frame,
|
||||
best_delay = delay;
|
||||
}
|
||||
}
|
||||
printf("SNR=%.1f dB at delay=%" RTC_PRIuS "\n", best_snr, best_delay);
|
||||
printf("SNR=%.1f dB at delay=%zu\n", best_snr, best_delay);
|
||||
return best_snr;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "common_audio/channel_buffer.h"
|
||||
#include "common_audio/resampler/push_sinc_resampler.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "test/gtest.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -79,7 +78,7 @@ float ComputeSNR(const ChannelBuffer<float>& ref,
|
||||
best_delay = delay;
|
||||
}
|
||||
}
|
||||
printf("SNR=%.1f dB at delay=%" RTC_PRIuS "\n", best_snr, best_delay);
|
||||
printf("SNR=%.1f dB at delay=%zu\n", best_snr, best_delay);
|
||||
return best_snr;
|
||||
}
|
||||
|
||||
@ -131,8 +130,8 @@ void RunAudioConverterTest(size_t src_channels,
|
||||
PushSincResampler::AlgorithmicDelaySeconds(src_sample_rate_hz) *
|
||||
dst_sample_rate_hz);
|
||||
// SNR reported on the same line later.
|
||||
printf("(%" RTC_PRIuS ", %d Hz) -> (%" RTC_PRIuS ", %d Hz) ", src_channels,
|
||||
src_sample_rate_hz, dst_channels, dst_sample_rate_hz);
|
||||
printf("(%zu, %d Hz) -> (%zu, %d Hz) ", src_channels, src_sample_rate_hz,
|
||||
dst_channels, dst_sample_rate_hz);
|
||||
|
||||
std::unique_ptr<AudioConverter> converter = AudioConverter::Create(
|
||||
src_channels, src_frames, dst_channels, dst_frames);
|
||||
|
@ -22,7 +22,6 @@
|
||||
/* include API */
|
||||
#include "modules/audio_coding/codecs/isac/main/include/isac.h"
|
||||
#include "modules/audio_coding/codecs/isac/main/util/utility.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
|
||||
/* Defines */
|
||||
#define SEED_FILE \
|
||||
@ -887,7 +886,7 @@ int main(int argc, char* argv[]) {
|
||||
#endif
|
||||
}
|
||||
printf("\n");
|
||||
printf("total bits = %" RTC_PRIuS " bits\n", totalbits);
|
||||
printf("total bits = %zu bits\n", totalbits);
|
||||
printf("measured average bitrate = %0.3f kbits/s\n",
|
||||
(double)totalbits * (sampFreqKHz) / totalsmpls);
|
||||
if (doTransCoding) {
|
||||
@ -906,14 +905,16 @@ int main(int argc, char* argv[]) {
|
||||
(100 * runtime / length_file));
|
||||
|
||||
if (maxStreamLen30 != 0) {
|
||||
printf("Maximum payload size 30ms Frames %" RTC_PRIuS
|
||||
" bytes (%0.3f kbps)\n",
|
||||
maxStreamLen30, maxStreamLen30 * 8 / 30.);
|
||||
printf(
|
||||
"Maximum payload size 30ms Frames %zu"
|
||||
" bytes (%0.3f kbps)\n",
|
||||
maxStreamLen30, maxStreamLen30 * 8 / 30.);
|
||||
}
|
||||
if (maxStreamLen60 != 0) {
|
||||
printf("Maximum payload size 60ms Frames %" RTC_PRIuS
|
||||
" bytes (%0.3f kbps)\n",
|
||||
maxStreamLen60, maxStreamLen60 * 8 / 60.);
|
||||
printf(
|
||||
"Maximum payload size 60ms Frames %zu"
|
||||
" bytes (%0.3f kbps)\n",
|
||||
maxStreamLen60, maxStreamLen60 * 8 / 60.);
|
||||
}
|
||||
// fprintf(stderr, "\n");
|
||||
|
||||
@ -921,12 +922,12 @@ int main(int argc, char* argv[]) {
|
||||
fprintf(stderr, " %0.1f kbps",
|
||||
(double)totalbits * (sampFreqKHz) / totalsmpls);
|
||||
if (maxStreamLen30 != 0) {
|
||||
fprintf(stderr, " plmax-30ms %" RTC_PRIuS " bytes (%0.0f kbps)",
|
||||
maxStreamLen30, maxStreamLen30 * 8 / 30.);
|
||||
fprintf(stderr, " plmax-30ms %zu bytes (%0.0f kbps)", maxStreamLen30,
|
||||
maxStreamLen30 * 8 / 30.);
|
||||
}
|
||||
if (maxStreamLen60 != 0) {
|
||||
fprintf(stderr, " plmax-60ms %" RTC_PRIuS " bytes (%0.0f kbps)",
|
||||
maxStreamLen60, maxStreamLen60 * 8 / 60.);
|
||||
fprintf(stderr, " plmax-60ms %zu bytes (%0.0f kbps)", maxStreamLen60,
|
||||
maxStreamLen60 * 8 / 60.);
|
||||
}
|
||||
if (doTransCoding) {
|
||||
fprintf(stderr, " transcoding rate %.0f kbps",
|
||||
|
@ -28,7 +28,6 @@
|
||||
/* include API */
|
||||
#include "modules/audio_coding/codecs/isac/main/include/isac.h"
|
||||
#include "modules/audio_coding/codecs/isac/main/util/utility.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
|
||||
/* max number of samples per frame (= 60 ms frame) */
|
||||
#define MAX_FRAMESAMPLES_SWB 1920
|
||||
@ -420,7 +419,7 @@ int main(int argc, char* argv[]) {
|
||||
printf("\n");
|
||||
printf("Measured bit-rate........... %0.3f kbps\n", rate);
|
||||
printf("Measured RCU bit-ratre...... %0.3f kbps\n", rateRCU);
|
||||
printf("Maximum bit-rate/payloadsize %0.3f / %" RTC_PRIuS "\n",
|
||||
printf("Maximum bit-rate/payloadsize %0.3f / %zu\n",
|
||||
maxStreamLen * 8 / 0.03, maxStreamLen);
|
||||
printf("Measured packet-loss........ %0.1f%% \n",
|
||||
100.0f * (float)lostPacketCntr / (float)packetCntr);
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include "api/audio_codecs/opus/audio_encoder_opus.h"
|
||||
#include "modules/audio_coding/neteq/tools/audio_loop.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/file_utils.h"
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <memory>
|
||||
|
||||
#include "modules/audio_coding/codecs/opus/opus_interface.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/file_utils.h"
|
||||
|
||||
@ -70,8 +69,7 @@ class OpusFecTest : public TestWithParam<coding_param> {
|
||||
void OpusFecTest::SetUp() {
|
||||
channels_ = get<0>(GetParam());
|
||||
bit_rate_ = get<1>(GetParam());
|
||||
printf("Coding %" RTC_PRIuS " channel signal at %d bps.\n", channels_,
|
||||
bit_rate_);
|
||||
printf("Coding %zu channel signal at %d bps.\n", channels_, bit_rate_);
|
||||
|
||||
in_filename_ = test::ResourcePath(get<2>(GetParam()), get<3>(GetParam()));
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "modules/audio_coding/codecs/tools/audio_codec_speed_test.h"
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/file_utils.h"
|
||||
|
||||
@ -100,7 +99,7 @@ void AudioCodecSpeedTest::EncodeDecode(size_t audio_duration_sec) {
|
||||
size_t time_now_ms = 0;
|
||||
float time_ms;
|
||||
|
||||
printf("Coding %d kHz-sampled %" RTC_PRIuS "-channel audio at %d bps ...\n",
|
||||
printf("Coding %d kHz-sampled %zu-channel audio at %d bps ...\n",
|
||||
input_sampling_khz_, channels_, bit_rate_);
|
||||
|
||||
while (time_now_ms < audio_duration_sec * 1000) {
|
||||
|
@ -10,10 +10,8 @@
|
||||
|
||||
#include "modules/audio_coding/test/Channel.h"
|
||||
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "modules/audio_device/include/mock_audio_transport.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/event.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/synchronization/mutex.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
#include "test/gmock.h"
|
||||
@ -187,7 +186,7 @@ class FifoAudioStream : public AudioStreamInterface {
|
||||
const size_t size = fifo_->size();
|
||||
if (size > largest_size_) {
|
||||
largest_size_ = size;
|
||||
PRINTD("(%" RTC_PRIuS ")", largest_size_);
|
||||
PRINTD("(%zu)", largest_size_);
|
||||
}
|
||||
total_written_elements_ += size;
|
||||
}
|
||||
@ -532,13 +531,12 @@ class AudioDeviceTest : public ::testing::Test {
|
||||
#ifdef ENABLE_PRINTF
|
||||
PRINT("file name: %s\n", file_name.c_str());
|
||||
const size_t bytes = test::GetFileSize(file_name);
|
||||
PRINT("file size: %" RTC_PRIuS " [bytes]\n", bytes);
|
||||
PRINT("file size: %" RTC_PRIuS " [samples]\n", bytes / kBytesPerSample);
|
||||
PRINT("file size: %zu [bytes]\n", bytes);
|
||||
PRINT("file size: %zu [samples]\n", bytes / kBytesPerSample);
|
||||
const int seconds =
|
||||
static_cast<int>(bytes / (sample_rate * kBytesPerSample));
|
||||
PRINT("file size: %d [secs]\n", seconds);
|
||||
PRINT("file size: %" RTC_PRIuS " [callbacks]\n",
|
||||
seconds * kNumCallbacksPerSecond);
|
||||
PRINT("file size: %zu [callbacks]\n", seconds * kNumCallbacksPerSecond);
|
||||
#endif
|
||||
return file_name;
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "modules/audio_device/android/build_info.h"
|
||||
#include "modules/audio_device/android/ensure_initialized.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "test/gtest.h"
|
||||
|
||||
#define PRINT(...) fprintf(stderr, __VA_ARGS__);
|
||||
@ -153,16 +152,16 @@ TEST_F(AudioManagerTest, ShowAudioParameterInfo) {
|
||||
PRINT("%saudio layer: %s\n", kTag,
|
||||
low_latency_out ? "Low latency OpenSL" : "Java/JNI based AudioTrack");
|
||||
PRINT("%ssample rate: %d Hz\n", kTag, playout_parameters_.sample_rate());
|
||||
PRINT("%schannels: %" RTC_PRIuS "\n", kTag, playout_parameters_.channels());
|
||||
PRINT("%sframes per buffer: %" RTC_PRIuS " <=> %.2f ms\n", kTag,
|
||||
PRINT("%schannels: %zu\n", kTag, playout_parameters_.channels());
|
||||
PRINT("%sframes per buffer: %zu <=> %.2f ms\n", kTag,
|
||||
playout_parameters_.frames_per_buffer(),
|
||||
playout_parameters_.GetBufferSizeInMilliseconds());
|
||||
PRINT("RECORD: \n");
|
||||
PRINT("%saudio layer: %s\n", kTag,
|
||||
low_latency_in ? "Low latency OpenSL" : "Java/JNI based AudioRecord");
|
||||
PRINT("%ssample rate: %d Hz\n", kTag, record_parameters_.sample_rate());
|
||||
PRINT("%schannels: %" RTC_PRIuS "\n", kTag, record_parameters_.channels());
|
||||
PRINT("%sframes per buffer: %" RTC_PRIuS " <=> %.2f ms\n", kTag,
|
||||
PRINT("%schannels: %zu\n", kTag, record_parameters_.channels());
|
||||
PRINT("%sframes per buffer: %zu <=> %.2f ms\n", kTag,
|
||||
record_parameters_.frames_per_buffer(),
|
||||
record_parameters_.GetBufferSizeInMilliseconds());
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "modules/audio_device/android/audio_common.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "modules/audio_device/android/audio_manager.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "modules/audio_device/fine_audio_buffer.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
|
||||
@ -193,7 +192,7 @@ void OpenSLESPlayer::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) {
|
||||
ALOGD("SetPlayoutSampleRate(%d)", sample_rate_hz);
|
||||
audio_device_buffer_->SetPlayoutSampleRate(sample_rate_hz);
|
||||
const size_t channels = audio_parameters_.channels();
|
||||
ALOGD("SetPlayoutChannels(%" RTC_PRIuS ")", channels);
|
||||
ALOGD("SetPlayoutChannels(%zu)", channels);
|
||||
audio_device_buffer_->SetPlayoutChannels(channels);
|
||||
RTC_CHECK(audio_device_buffer_);
|
||||
AllocateDataBuffers();
|
||||
@ -214,7 +213,7 @@ void OpenSLESPlayer::AllocateDataBuffers() {
|
||||
// which reduces jitter.
|
||||
const size_t buffer_size_in_samples =
|
||||
audio_parameters_.frames_per_buffer() * audio_parameters_.channels();
|
||||
ALOGD("native buffer size: %" RTC_PRIuS, buffer_size_in_samples);
|
||||
ALOGD("native buffer size: %zu", buffer_size_in_samples);
|
||||
ALOGD("native buffer size in ms: %.2f",
|
||||
audio_parameters_.GetBufferSizeInMilliseconds());
|
||||
fine_audio_buffer_ = std::make_unique<FineAudioBuffer>(audio_device_buffer_);
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "modules/audio_device/fine_audio_buffer.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
|
||||
@ -178,7 +177,7 @@ void OpenSLESRecorder::AttachAudioBuffer(AudioDeviceBuffer* audio_buffer) {
|
||||
// Ensure that the audio device buffer is informed about the number of
|
||||
// channels preferred by the OS on the recording side.
|
||||
const size_t channels = audio_parameters_.channels();
|
||||
ALOGD("SetRecordingChannels(%" RTC_PRIuS ")", channels);
|
||||
ALOGD("SetRecordingChannels(%zu)", channels);
|
||||
audio_device_buffer_->SetRecordingChannels(channels);
|
||||
// Allocated memory for internal data buffers given existing audio parameters.
|
||||
AllocateDataBuffers();
|
||||
@ -334,12 +333,10 @@ void OpenSLESRecorder::AllocateDataBuffers() {
|
||||
// Create a modified audio buffer class which allows us to deliver any number
|
||||
// of samples (and not only multiple of 10ms) to match the native audio unit
|
||||
// buffer size.
|
||||
ALOGD("frames per native buffer: %" RTC_PRIuS,
|
||||
audio_parameters_.frames_per_buffer());
|
||||
ALOGD("frames per 10ms buffer: %" RTC_PRIuS,
|
||||
ALOGD("frames per native buffer: %zu", audio_parameters_.frames_per_buffer());
|
||||
ALOGD("frames per 10ms buffer: %zu",
|
||||
audio_parameters_.frames_per_10ms_buffer());
|
||||
ALOGD("bytes per native buffer: %" RTC_PRIuS,
|
||||
audio_parameters_.GetBytesPerBuffer());
|
||||
ALOGD("bytes per native buffer: %zu", audio_parameters_.GetBytesPerBuffer());
|
||||
ALOGD("native sample rate: %d", audio_parameters_.sample_rate());
|
||||
RTC_DCHECK(audio_device_buffer_);
|
||||
fine_audio_buffer_ = std::make_unique<FineAudioBuffer>(audio_device_buffer_);
|
||||
|
@ -12,13 +12,13 @@
|
||||
|
||||
#if BWE_TEST_LOGGING_COMPILE_TIME_ENABLE
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "test/rtp_file_reader.h"
|
||||
|
||||
@ -52,10 +51,10 @@ int main(int argc, char* argv[]) {
|
||||
ss << static_cast<int64_t>(packet.time_ms) * 1000000;
|
||||
fprintf(stdout, "%s\n", ss.str().c_str());
|
||||
} else {
|
||||
fprintf(stdout, "%u %u %d %u %u %d %u %" RTC_PRIuS " %" RTC_PRIuS "\n",
|
||||
header.SequenceNumber(), header.Timestamp(), toffset,
|
||||
abs_send_time, packet.time_ms, header.Marker(), header.Ssrc(),
|
||||
packet.length, packet.original_length);
|
||||
fprintf(stdout, "%u %u %d %u %u %d %u %zu %zu\n", header.SequenceNumber(),
|
||||
header.Timestamp(), toffset, abs_send_time, packet.time_ms,
|
||||
header.Marker(), header.Ssrc(), packet.length,
|
||||
packet.original_length);
|
||||
}
|
||||
++packet_counter;
|
||||
}
|
||||
|
@ -127,7 +127,6 @@ rtc_source_set("swap_queue") {
|
||||
rtc_source_set("macromagic") {
|
||||
sources = [
|
||||
"arraysize.h",
|
||||
"format_macros.h",
|
||||
"thread_annotations.h",
|
||||
]
|
||||
deps = [ "system:arch" ]
|
||||
|
@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef RTC_BASE_FORMAT_MACROS_H_
|
||||
#define RTC_BASE_FORMAT_MACROS_H_
|
||||
|
||||
// This file defines the format macros for some integer types and is derived
|
||||
// from Chromium's base/format_macros.h.
|
||||
|
||||
// To print a 64-bit value in a portable way:
|
||||
// int64_t value;
|
||||
// printf("xyz:%" PRId64, value);
|
||||
// The "d" in the macro corresponds to %d; you can also use PRIu64 etc.
|
||||
//
|
||||
// To print a size_t value in a portable way:
|
||||
// size_t size;
|
||||
// printf("xyz: %" RTC_PRIuS, size);
|
||||
// The "u" in the macro corresponds to %u, and S is for "size".
|
||||
|
||||
#if defined(WEBRTC_POSIX)
|
||||
|
||||
#if (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && !defined(PRId64)
|
||||
#error "inttypes.h has already been included before this header file, but "
|
||||
#error "without __STDC_FORMAT_MACROS defined."
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_FORMAT_MACROS)
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "rtc_base/system/arch.h"
|
||||
|
||||
#define RTC_PRIuS "zu"
|
||||
|
||||
#else // WEBRTC_WIN
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#if !defined(PRId64) || !defined(PRIu64) || !defined(PRIx64)
|
||||
#error "inttypes.h provided by win toolchain should define these."
|
||||
#endif
|
||||
|
||||
// PRI*64 were added in MSVC 2013, while "%zu" is supported since MSVC 2015
|
||||
// (so needs to be special-cased to "%Iu" instead).
|
||||
|
||||
#define RTC_PRIuS "Iu"
|
||||
|
||||
#endif
|
||||
|
||||
#endif // RTC_BASE_FORMAT_MACROS_H_
|
@ -19,7 +19,6 @@
|
||||
|
||||
#include "logging/rtc_event_log/rtc_event_processor.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/numerics/sequence_number_util.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/numerics/sequence_number_util.h"
|
||||
#include "rtc_base/rate_statistics.h"
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "common_audio/wav_file.h"
|
||||
#include "modules/audio_processing/test/protobuf_utils.h"
|
||||
#include "modules/audio_processing/test/test_utils.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/ignore_wundef.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
|
||||
@ -480,14 +479,11 @@ int do_main(int argc, char* argv[]) {
|
||||
fprintf(settings_file, " Reverse sample rate: %d\n",
|
||||
reverse_sample_rate);
|
||||
num_input_channels = msg.num_input_channels();
|
||||
fprintf(settings_file, " Input channels: %" RTC_PRIuS "\n",
|
||||
num_input_channels);
|
||||
fprintf(settings_file, " Input channels: %zu\n", num_input_channels);
|
||||
num_output_channels = msg.num_output_channels();
|
||||
fprintf(settings_file, " Output channels: %" RTC_PRIuS "\n",
|
||||
num_output_channels);
|
||||
fprintf(settings_file, " Output channels: %zu\n", num_output_channels);
|
||||
num_reverse_channels = msg.num_reverse_channels();
|
||||
fprintf(settings_file, " Reverse channels: %" RTC_PRIuS "\n",
|
||||
num_reverse_channels);
|
||||
fprintf(settings_file, " Reverse channels: %zu\n", num_reverse_channels);
|
||||
if (msg.has_timestamp_ms()) {
|
||||
const int64_t timestamp = msg.timestamp_ms();
|
||||
fprintf(settings_file, " Timestamp in millisecond: %" PRId64 "\n",
|
||||
|
@ -8,16 +8,16 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "modules/audio_device/include/audio_device.h"
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <numeric>
|
||||
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "modules/audio_device/include/audio_device.h"
|
||||
#include "modules/audio_device/include/mock_audio_transport.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/event.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/synchronization/mutex.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
#include "sdk/android/generated_native_unittests_jni/BuildInfo_jni.h"
|
||||
@ -184,7 +184,7 @@ class FifoAudioStream : public AudioStreamInterface {
|
||||
const size_t size = fifo_->size();
|
||||
if (size > largest_size_) {
|
||||
largest_size_ = size;
|
||||
PRINTD("(%" RTC_PRIuS ")", largest_size_);
|
||||
PRINTD("(%zu)", largest_size_);
|
||||
}
|
||||
total_written_elements_ += size;
|
||||
}
|
||||
@ -547,13 +547,12 @@ class AudioDeviceTest : public ::testing::Test {
|
||||
#ifdef ENABLE_PRINTF
|
||||
PRINT("file name: %s\n", file_name.c_str());
|
||||
const size_t bytes = test::GetFileSize(file_name);
|
||||
PRINT("file size: %" RTC_PRIuS " [bytes]\n", bytes);
|
||||
PRINT("file size: %" RTC_PRIuS " [samples]\n", bytes / kBytesPerSample);
|
||||
PRINT("file size: %zu [bytes]\n", bytes);
|
||||
PRINT("file size: %zu [samples]\n", bytes / kBytesPerSample);
|
||||
const int seconds =
|
||||
static_cast<int>(bytes / (sample_rate * kBytesPerSample));
|
||||
PRINT("file size: %d [secs]\n", seconds);
|
||||
PRINT("file size: %" RTC_PRIuS " [callbacks]\n",
|
||||
seconds * kNumCallbacksPerSecond);
|
||||
PRINT("file size: %zu [callbacks]\n", seconds * kNumCallbacksPerSecond);
|
||||
#endif
|
||||
return file_name;
|
||||
}
|
||||
@ -972,16 +971,16 @@ TEST_F(AudioDeviceTest, ShowAudioParameterInfo) {
|
||||
PRINT("%saudio layer: %s\n", kTag,
|
||||
low_latency_out ? "Low latency OpenSL" : "Java/JNI based AudioTrack");
|
||||
PRINT("%ssample rate: %d Hz\n", kTag, output_parameters_.sample_rate());
|
||||
PRINT("%schannels: %" RTC_PRIuS "\n", kTag, output_parameters_.channels());
|
||||
PRINT("%sframes per buffer: %" RTC_PRIuS " <=> %.2f ms\n", kTag,
|
||||
PRINT("%schannels: %zu\n", kTag, output_parameters_.channels());
|
||||
PRINT("%sframes per buffer: %zu <=> %.2f ms\n", kTag,
|
||||
output_parameters_.frames_per_buffer(),
|
||||
output_parameters_.GetBufferSizeInMilliseconds());
|
||||
PRINT("RECORD: \n");
|
||||
PRINT("%saudio layer: %s\n", kTag,
|
||||
low_latency_in ? "Low latency OpenSL" : "Java/JNI based AudioRecord");
|
||||
PRINT("%ssample rate: %d Hz\n", kTag, input_parameters_.sample_rate());
|
||||
PRINT("%schannels: %" RTC_PRIuS "\n", kTag, input_parameters_.channels());
|
||||
PRINT("%sframes per buffer: %" RTC_PRIuS " <=> %.2f ms\n", kTag,
|
||||
PRINT("%schannels: %zu\n", kTag, input_parameters_.channels());
|
||||
PRINT("%sframes per buffer: %zu <=> %.2f ms\n", kTag,
|
||||
input_parameters_.frames_per_buffer(),
|
||||
input_parameters_.GetBufferSizeInMilliseconds());
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "sdk/android/generated_java_audio_device_module_native_jni/WebRtcAudioTrack_jni.h"
|
||||
|
@ -13,11 +13,11 @@
|
||||
#include <android/log.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "modules/audio_device/fine_audio_buffer.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
#include "sdk/android/src/jni/audio_device/audio_common.h"
|
||||
@ -202,7 +202,7 @@ void OpenSLESPlayer::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) {
|
||||
ALOGD("SetPlayoutSampleRate(%d)", sample_rate_hz);
|
||||
audio_device_buffer_->SetPlayoutSampleRate(sample_rate_hz);
|
||||
const size_t channels = audio_parameters_.channels();
|
||||
ALOGD("SetPlayoutChannels(%" RTC_PRIuS ")", channels);
|
||||
ALOGD("SetPlayoutChannels(%zu)", channels);
|
||||
audio_device_buffer_->SetPlayoutChannels(channels);
|
||||
RTC_CHECK(audio_device_buffer_);
|
||||
AllocateDataBuffers();
|
||||
@ -223,7 +223,7 @@ void OpenSLESPlayer::AllocateDataBuffers() {
|
||||
// which reduces jitter.
|
||||
const size_t buffer_size_in_samples =
|
||||
audio_parameters_.frames_per_buffer() * audio_parameters_.channels();
|
||||
ALOGD("native buffer size: %" RTC_PRIuS, buffer_size_in_samples);
|
||||
ALOGD("native buffer size: %zu", buffer_size_in_samples);
|
||||
ALOGD("native buffer size in ms: %.2f",
|
||||
audio_parameters_.GetBufferSizeInMilliseconds());
|
||||
fine_audio_buffer_ = std::make_unique<FineAudioBuffer>(audio_device_buffer_);
|
||||
|
@ -13,11 +13,11 @@
|
||||
#include <android/log.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "modules/audio_device/fine_audio_buffer.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
#include "sdk/android/src/jni/audio_device/audio_common.h"
|
||||
@ -188,7 +188,7 @@ void OpenSLESRecorder::AttachAudioBuffer(AudioDeviceBuffer* audio_buffer) {
|
||||
// Ensure that the audio device buffer is informed about the number of
|
||||
// channels preferred by the OS on the recording side.
|
||||
const size_t channels = audio_parameters_.channels();
|
||||
ALOGD("SetRecordingChannels(%" RTC_PRIuS ")", channels);
|
||||
ALOGD("SetRecordingChannels(%zu)", channels);
|
||||
audio_device_buffer_->SetRecordingChannels(channels);
|
||||
// Allocated memory for internal data buffers given existing audio parameters.
|
||||
AllocateDataBuffers();
|
||||
@ -345,12 +345,10 @@ void OpenSLESRecorder::AllocateDataBuffers() {
|
||||
// Create a modified audio buffer class which allows us to deliver any number
|
||||
// of samples (and not only multiple of 10ms) to match the native audio unit
|
||||
// buffer size.
|
||||
ALOGD("frames per native buffer: %" RTC_PRIuS,
|
||||
audio_parameters_.frames_per_buffer());
|
||||
ALOGD("frames per 10ms buffer: %" RTC_PRIuS,
|
||||
ALOGD("frames per native buffer: %zu", audio_parameters_.frames_per_buffer());
|
||||
ALOGD("frames per 10ms buffer: %zu",
|
||||
audio_parameters_.frames_per_10ms_buffer());
|
||||
ALOGD("bytes per native buffer: %" RTC_PRIuS,
|
||||
audio_parameters_.GetBytesPerBuffer());
|
||||
ALOGD("bytes per native buffer: %zu", audio_parameters_.GetBytesPerBuffer());
|
||||
ALOGD("native sample rate: %d", audio_parameters_.sample_rate());
|
||||
RTC_DCHECK(audio_device_buffer_);
|
||||
fine_audio_buffer_ = std::make_unique<FineAudioBuffer>(audio_device_buffer_);
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include "modules/rtp_rtcp/source/rtp_util.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/system/arch.h"
|
||||
|
||||
@ -290,15 +289,15 @@ class PcapReader : public RtpFileReaderImpl {
|
||||
}
|
||||
|
||||
printf("Total packets in file: %d\n", total_packet_count);
|
||||
printf("Total RTP/RTCP packets: %" RTC_PRIuS "\n", packets_.size());
|
||||
printf("Total RTP/RTCP packets: %zu\n", packets_.size());
|
||||
|
||||
for (SsrcMapIterator mit = packets_by_ssrc_.begin();
|
||||
mit != packets_by_ssrc_.end(); ++mit) {
|
||||
uint32_t ssrc = mit->first;
|
||||
const std::vector<uint32_t>& packet_indices = mit->second;
|
||||
int pt = packets_[packet_indices[0]].payload_type;
|
||||
printf("SSRC: %08x, %" RTC_PRIuS " packets, pt=%d\n", ssrc,
|
||||
packet_indices.size(), pt);
|
||||
printf("SSRC: %08x, %zu packets, pt=%d\n", ssrc, packet_indices.size(),
|
||||
pt);
|
||||
}
|
||||
|
||||
// TODO(solenberg): Better validation of identified SSRC streams.
|
||||
|
@ -9,6 +9,8 @@
|
||||
*/
|
||||
#include "video/video_analyzer.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
@ -20,7 +22,6 @@
|
||||
#include "modules/rtp_rtcp/source/rtp_packet.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_util.h"
|
||||
#include "rtc_base/cpu_time.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
#include "rtc_base/memory_usage.h"
|
||||
#include "rtc_base/task_queue_for_test.h"
|
||||
#include "rtc_base/task_utils/repeating_task.h"
|
||||
@ -854,7 +855,7 @@ void VideoAnalyzer::PrintSamplesToFile() {
|
||||
});
|
||||
|
||||
fprintf(out, "%s\n", graph_title_.c_str());
|
||||
fprintf(out, "%" RTC_PRIuS "\n", samples_.size());
|
||||
fprintf(out, "%zu\n", samples_.size());
|
||||
fprintf(out,
|
||||
"dropped "
|
||||
"input_time_ms "
|
||||
@ -867,8 +868,7 @@ void VideoAnalyzer::PrintSamplesToFile() {
|
||||
"encode_time_ms\n");
|
||||
for (const Sample& sample : samples_) {
|
||||
fprintf(out,
|
||||
"%d %" PRId64 " %" PRId64 " %" PRId64 " %" PRId64 " %" RTC_PRIuS
|
||||
" %lf %lf\n",
|
||||
"%d %" PRId64 " %" PRId64 " %" PRId64 " %" PRId64 " %zu %lf %lf\n",
|
||||
sample.dropped, sample.input_time_ms, sample.send_time_ms,
|
||||
sample.recv_time_ms, sample.render_time_ms,
|
||||
sample.encoded_frame_size, sample.psnr, sample.ssim);
|
||||
|
Reference in New Issue
Block a user