Removed vie_defines.h
The defines still in use was only used in single files, so they were moved to these specific cc-files. Review URL: https://codereview.webrtc.org/1411573007 Cr-Commit-Position: refs/heads/master@{#10539}
This commit is contained in:
@ -15,7 +15,6 @@
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_packet_history.h"
|
||||
#include "webrtc/system_wrappers/include/clock.h"
|
||||
#include "webrtc/video_engine/vie_defines.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -29,7 +28,7 @@ class RtpPacketHistoryTest : public ::testing::Test {
|
||||
~RtpPacketHistoryTest() {
|
||||
delete hist_;
|
||||
}
|
||||
|
||||
|
||||
SimulatedClock fake_clock_;
|
||||
RTPPacketHistory* hist_;
|
||||
enum {kPayload = 127};
|
||||
@ -54,7 +53,7 @@ class RtpPacketHistoryTest : public ::testing::Test {
|
||||
array[(*cur_pos)++] = ssrc >> 16;
|
||||
array[(*cur_pos)++] = ssrc >> 8;
|
||||
array[(*cur_pos)++] = ssrc;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(RtpPacketHistoryTest, SetStoreStatus) {
|
||||
@ -268,6 +267,7 @@ TEST_F(RtpPacketHistoryTest, DynamicExpansion) {
|
||||
}
|
||||
|
||||
TEST_F(RtpPacketHistoryTest, FullExpansion) {
|
||||
static const int kSendSidePacketHistorySize = 600;
|
||||
hist_->SetStorePacketsStatus(true, kSendSidePacketHistorySize);
|
||||
size_t len;
|
||||
int64_t capture_time_ms = fake_clock_.TimeInMilliseconds();
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#endif
|
||||
#include "webrtc/test/channel_transport/udp_transport.h"
|
||||
#include "webrtc/video_engine/vie_defines.h"
|
||||
#include "webrtc/voice_engine/include/voe_network.h"
|
||||
|
||||
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
|
||||
@ -66,10 +65,11 @@ void VoiceChannelTransport::IncomingRTCPPacket(
|
||||
}
|
||||
|
||||
int VoiceChannelTransport::SetLocalReceiver(uint16_t rtp_port) {
|
||||
static const int kNumReceiveSocketBuffers = 500;
|
||||
int return_value = socket_transport_->InitializeReceiveSockets(this,
|
||||
rtp_port);
|
||||
if (return_value == 0) {
|
||||
return socket_transport_->StartReceiving(kViENumReceiveSocketBuffers);
|
||||
return socket_transport_->StartReceiving(kNumReceiveSocketBuffers);
|
||||
}
|
||||
return return_value;
|
||||
}
|
||||
|
||||
@ -24,7 +24,6 @@ source_set("video") {
|
||||
"../video_engine/stream_synchronization.h",
|
||||
"../video_engine/vie_channel.cc",
|
||||
"../video_engine/vie_channel.h",
|
||||
"../video_engine/vie_defines.h",
|
||||
"../video_engine/vie_encoder.cc",
|
||||
"../video_engine/vie_encoder.h",
|
||||
"../video_engine/vie_receiver.cc",
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/thread_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
#include "webrtc/video_engine/vie_defines.h"
|
||||
#include "webrtc/video_send_stream.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
#include "webrtc/video_engine/encoder_state_feedback.h"
|
||||
#include "webrtc/video_engine/payload_router.h"
|
||||
#include "webrtc/video_engine/vie_channel.h"
|
||||
#include "webrtc/video_engine/vie_defines.h"
|
||||
#include "webrtc/video_engine/vie_encoder.h"
|
||||
#include "webrtc/video_send_stream.h"
|
||||
|
||||
@ -528,6 +527,7 @@ int64_t VideoSendStream::GetRtt() const {
|
||||
}
|
||||
|
||||
bool VideoSendStream::SetSendCodec(VideoCodec video_codec) {
|
||||
static const int kEncoderMinBitrate = 30;
|
||||
if (video_codec.maxBitrate == 0) {
|
||||
// Unset max bitrate -> cap to one bit per pixel.
|
||||
video_codec.maxBitrate =
|
||||
@ -535,10 +535,10 @@ bool VideoSendStream::SetSendCodec(VideoCodec video_codec) {
|
||||
1000;
|
||||
}
|
||||
|
||||
if (video_codec.minBitrate < kViEMinCodecBitrate)
|
||||
video_codec.minBitrate = kViEMinCodecBitrate;
|
||||
if (video_codec.maxBitrate < kViEMinCodecBitrate)
|
||||
video_codec.maxBitrate = kViEMinCodecBitrate;
|
||||
if (video_codec.minBitrate < kEncoderMinBitrate)
|
||||
video_codec.minBitrate = kEncoderMinBitrate;
|
||||
if (video_codec.maxBitrate < kEncoderMinBitrate)
|
||||
video_codec.maxBitrate = kEncoderMinBitrate;
|
||||
|
||||
// Stop the media flow while reconfiguring.
|
||||
vie_encoder_->Pause();
|
||||
|
||||
@ -52,7 +52,6 @@
|
||||
'video_engine/stream_synchronization.h',
|
||||
'video_engine/vie_channel.cc',
|
||||
'video_engine/vie_channel.h',
|
||||
'video_engine/vie_defines.h',
|
||||
'video_engine/vie_encoder.cc',
|
||||
'video_engine/vie_encoder.h',
|
||||
'video_engine/vie_receiver.cc',
|
||||
|
||||
@ -34,12 +34,14 @@
|
||||
#include "webrtc/video_engine/call_stats.h"
|
||||
#include "webrtc/video_engine/payload_router.h"
|
||||
#include "webrtc/video_engine/report_block_stats.h"
|
||||
#include "webrtc/video_engine/vie_defines.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
const int kMaxDecodeWaitTimeMs = 50;
|
||||
static const int kMaxTargetDelayMs = 10000;
|
||||
const int kMinSendSidePacketHistorySize = 600;
|
||||
const int kMaxPacketAgeToNack = 450;
|
||||
const int kMaxNackListSize = 250;
|
||||
|
||||
// Helper class receiving statistics callbacks.
|
||||
class ChannelStatsObserver : public CallStatsObserver {
|
||||
@ -108,7 +110,7 @@ ViEChannel::ViEChannel(uint32_t number_of_cores,
|
||||
packet_router_(packet_router),
|
||||
bandwidth_observer_(bandwidth_observer),
|
||||
transport_feedback_observer_(transport_feedback_observer),
|
||||
nack_history_size_sender_(kSendSidePacketHistorySize),
|
||||
nack_history_size_sender_(kMinSendSidePacketHistorySize),
|
||||
max_nack_reordering_threshold_(kMaxPacketAgeToNack),
|
||||
pre_render_callback_(NULL),
|
||||
report_block_stats_sender_(new ReportBlockStats()),
|
||||
@ -138,6 +140,7 @@ ViEChannel::ViEChannel(uint32_t number_of_cores,
|
||||
}
|
||||
|
||||
int32_t ViEChannel::Init() {
|
||||
static const int kDefaultRenderDelayMs = 10;
|
||||
module_process_thread_->RegisterModule(vie_receiver_.GetReceiveStatistics());
|
||||
|
||||
// RTP/RTCP initialization.
|
||||
@ -160,7 +163,7 @@ int32_t ViEChannel::Init() {
|
||||
vcm_->RegisterFrameTypeCallback(this);
|
||||
vcm_->RegisterReceiveStatisticsCallback(this);
|
||||
vcm_->RegisterDecoderTimingCallback(this);
|
||||
vcm_->SetRenderDelay(kViEDefaultRenderDelayMs);
|
||||
vcm_->SetRenderDelay(kDefaultRenderDelayMs);
|
||||
|
||||
module_process_thread_->RegisterModule(vcm_);
|
||||
module_process_thread_->RegisterModule(&vie_sync_);
|
||||
@ -561,12 +564,12 @@ int ViEChannel::SetSenderBufferingMode(int target_delay_ms) {
|
||||
}
|
||||
if (target_delay_ms == 0) {
|
||||
// Real-time mode.
|
||||
nack_history_size_sender_ = kSendSidePacketHistorySize;
|
||||
nack_history_size_sender_ = kMinSendSidePacketHistorySize;
|
||||
} else {
|
||||
nack_history_size_sender_ = GetRequiredNackListSize(target_delay_ms);
|
||||
// Don't allow a number lower than the default value.
|
||||
if (nack_history_size_sender_ < kSendSidePacketHistorySize) {
|
||||
nack_history_size_sender_ = kSendSidePacketHistorySize;
|
||||
if (nack_history_size_sender_ < kMinSendSidePacketHistorySize) {
|
||||
nack_history_size_sender_ = kMinSendSidePacketHistorySize;
|
||||
}
|
||||
}
|
||||
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
|
||||
|
||||
@ -22,7 +22,6 @@
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/tick_util.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
#include "webrtc/video_engine/vie_defines.h"
|
||||
#include "webrtc/video_engine/vie_receiver.h"
|
||||
#include "webrtc/video_engine/vie_sync_module.h"
|
||||
|
||||
|
||||
@ -1,120 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012 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 WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_
|
||||
#define WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_
|
||||
|
||||
#include "webrtc/engine_configurations.h"
|
||||
|
||||
// TODO(mflodman) Remove.
|
||||
#ifdef WEBRTC_ANDROID
|
||||
#include <arpa/inet.h> // NOLINT
|
||||
#include <linux/net.h> // NOLINT
|
||||
#include <netinet/in.h> // NOLINT
|
||||
#include <pthread.h> // NOLINT
|
||||
#include <stdio.h> // NOLINT
|
||||
#include <stdlib.h> // NOLINT
|
||||
#include <string.h> // NOLINT
|
||||
#include <sys/socket.h> // NOLINT
|
||||
#include <sys/time.h> // NOLINT
|
||||
#include <sys/types.h> // NOLINT
|
||||
#include <time.h> // NOLINT
|
||||
#endif
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// General
|
||||
enum { kViEMinKeyRequestIntervalMs = 300 };
|
||||
|
||||
// ViEBase
|
||||
enum { kViEMaxNumberOfChannels = 64 };
|
||||
|
||||
// ViECodec
|
||||
enum { kViEMaxCodecWidth = 4096 };
|
||||
enum { kViEMaxCodecHeight = 3072 };
|
||||
enum { kViEMaxCodecFramerate = 60 };
|
||||
enum { kViEMinCodecBitrate = 30 };
|
||||
|
||||
// ViENetwork
|
||||
enum { kViEMaxMtu = 1500 };
|
||||
enum { kViESocketThreads = 1 };
|
||||
enum { kViENumReceiveSocketBuffers = 500 };
|
||||
|
||||
// ViERender
|
||||
// Max valid time set in SetRenderTimeoutImage
|
||||
enum { kViEMaxRenderTimeoutTimeMs = 10000 };
|
||||
// Min valid time set in SetRenderTimeoutImage
|
||||
enum { kViEMinRenderTimeoutTimeMs = 33 };
|
||||
enum { kViEDefaultRenderDelayMs = 10 };
|
||||
|
||||
// ViERTP_RTCP
|
||||
enum { kSendSidePacketHistorySize = 600 };
|
||||
|
||||
// NACK
|
||||
enum { kMaxPacketAgeToNack = 450 }; // In sequence numbers.
|
||||
enum { kMaxNackListSize = 250 };
|
||||
|
||||
// Id definitions
|
||||
enum {
|
||||
kViEChannelIdBase = 0x0,
|
||||
kViEChannelIdMax = 0xFF,
|
||||
kViEDummyChannelId = 0xFFFF
|
||||
};
|
||||
|
||||
// Module id
|
||||
// Create a unique id based on the ViE instance id and the
|
||||
// channel id. ViE id > 0 and 0 <= channel id <= 255
|
||||
|
||||
inline int ViEId(const int vieId, const int channelId = -1) {
|
||||
if (channelId == -1) {
|
||||
return static_cast<int>((vieId << 16) + kViEDummyChannelId);
|
||||
}
|
||||
return static_cast<int>((vieId << 16) + channelId);
|
||||
}
|
||||
|
||||
inline int ViEModuleId(const int vieId, const int channelId = -1) {
|
||||
if (channelId == -1) {
|
||||
return static_cast<int>((vieId << 16) + kViEDummyChannelId);
|
||||
}
|
||||
return static_cast<int>((vieId << 16) + channelId);
|
||||
}
|
||||
|
||||
inline int ChannelId(const int moduleId) {
|
||||
return static_cast<int>(moduleId & 0xffff);
|
||||
}
|
||||
|
||||
// Windows specific.
|
||||
#if defined(_WIN32)
|
||||
#define RENDER_MODULE_TYPE kRenderWindows
|
||||
|
||||
// Include libraries.
|
||||
#pragma comment(lib, "winmm.lib")
|
||||
|
||||
#ifndef WEBRTC_EXTERNAL_TRANSPORT
|
||||
#pragma comment(lib, "ws2_32.lib")
|
||||
#pragma comment(lib, "Iphlpapi.lib") // _GetAdaptersAddresses
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Mac specific.
|
||||
#ifdef WEBRTC_MAC
|
||||
#define SLEEP(x) usleep(x * 1000)
|
||||
#define RENDER_MODULE_TYPE kRenderWindows
|
||||
#endif
|
||||
|
||||
// Android specific.
|
||||
#ifdef WEBRTC_ANDROID
|
||||
#define FAR
|
||||
#define __cdecl
|
||||
#endif // WEBRTC_ANDROID
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_
|
||||
@ -33,7 +33,6 @@
|
||||
#include "webrtc/system_wrappers/include/tick_util.h"
|
||||
#include "webrtc/video/send_statistics_proxy.h"
|
||||
#include "webrtc/video_engine/payload_router.h"
|
||||
#include "webrtc/video_engine/vie_defines.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -46,6 +45,8 @@ static const int kMinPacingDelayMs = 200;
|
||||
|
||||
static const float kStopPaddingThresholdMs = 2000;
|
||||
|
||||
static const int kMinKeyFrameRequestIntervalMs = 300;
|
||||
|
||||
std::vector<uint32_t> AllocateStreamBitrates(
|
||||
uint32_t total_bitrate,
|
||||
const SimulcastStream* stream_configs,
|
||||
@ -587,7 +588,8 @@ void ViEEncoder::OnReceivedIntraFrameRequest(uint32_t ssrc) {
|
||||
}
|
||||
|
||||
int64_t now = TickTime::MillisecondTimestamp();
|
||||
if (time_last_intra_request_ms_[ssrc] + kViEMinKeyRequestIntervalMs > now) {
|
||||
if (time_last_intra_request_ms_[ssrc] + kMinKeyFrameRequestIntervalMs
|
||||
> now) {
|
||||
return;
|
||||
}
|
||||
time_last_intra_request_ms_[ssrc] = now;
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
#include "webrtc/modules/video_processing/main/interface/video_processing.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
#include "webrtc/video/video_capture_input.h"
|
||||
#include "webrtc/video_engine/vie_defines.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@
|
||||
#include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
#include "webrtc/video_engine/vie_defines.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -118,7 +117,7 @@ class ViEReceiver : public RtpData {
|
||||
rtc::scoped_ptr<RemoteNtpTimeEstimator> ntp_estimator_;
|
||||
|
||||
bool receiving_;
|
||||
uint8_t restored_packet_[kViEMaxMtu];
|
||||
uint8_t restored_packet_[IP_PACKET_SIZE];
|
||||
bool restored_packet_in_use_;
|
||||
bool receiving_ast_enabled_;
|
||||
bool receiving_cvo_enabled_;
|
||||
|
||||
Reference in New Issue
Block a user