2015-02-16 12:02:20 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2015 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_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_H_
|
|
|
|
|
#define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_H_
|
|
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
|
|
#include "webrtc/modules/remote_bitrate_estimator/test/packet.h"
|
|
|
|
|
#include "webrtc/modules/bitrate_controller/include/bitrate_controller.h"
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace testing {
|
|
|
|
|
namespace bwe {
|
|
|
|
|
|
2015-02-24 13:24:19 +00:00
|
|
|
const int kMinBitrateKbps = 150;
|
|
|
|
|
const int kMaxBitrateKbps = 2000;
|
|
|
|
|
|
2015-02-17 16:03:45 +00:00
|
|
|
class BweSender : public Module {
|
2015-02-16 12:02:20 +00:00
|
|
|
public:
|
2015-02-17 16:03:45 +00:00
|
|
|
BweSender() {}
|
|
|
|
|
virtual ~BweSender() {}
|
2015-02-16 12:02:20 +00:00
|
|
|
|
|
|
|
|
virtual int GetFeedbackIntervalMs() const = 0;
|
|
|
|
|
virtual void GiveFeedback(const FeedbackPacket& feedback) = 0;
|
|
|
|
|
|
|
|
|
|
private:
|
2015-02-17 16:03:45 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(BweSender);
|
2015-02-16 12:02:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class BweReceiver {
|
|
|
|
|
public:
|
|
|
|
|
explicit BweReceiver(int flow_id) : flow_id_(flow_id) {}
|
|
|
|
|
virtual ~BweReceiver() {}
|
|
|
|
|
|
|
|
|
|
virtual void ReceivePacket(int64_t arrival_time_ms,
|
2015-02-17 16:03:45 +00:00
|
|
|
const MediaPacket& media_packet) {}
|
2015-02-16 12:02:20 +00:00
|
|
|
virtual FeedbackPacket* GetFeedback(int64_t now_ms) { return NULL; }
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
int flow_id_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum BandwidthEstimatorType {
|
|
|
|
|
kNullEstimator,
|
2015-02-17 16:03:45 +00:00
|
|
|
kNadaEstimator,
|
2015-02-16 12:02:20 +00:00
|
|
|
kRembEstimator,
|
|
|
|
|
kFullSendSideEstimator
|
|
|
|
|
};
|
|
|
|
|
|
2015-02-24 13:24:19 +00:00
|
|
|
int64_t GetAbsSendTimeInMs(uint32_t abs_send_time);
|
|
|
|
|
|
2015-02-17 16:03:45 +00:00
|
|
|
BweSender* CreateBweSender(BandwidthEstimatorType estimator,
|
|
|
|
|
int kbps,
|
|
|
|
|
BitrateObserver* observer,
|
|
|
|
|
Clock* clock);
|
2015-02-16 12:02:20 +00:00
|
|
|
|
|
|
|
|
BweReceiver* CreateBweReceiver(BandwidthEstimatorType type,
|
|
|
|
|
int flow_id,
|
|
|
|
|
bool plot);
|
|
|
|
|
} // namespace bwe
|
|
|
|
|
} // namespace testing
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
#endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_H_
|