2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-03-01 18:22:48 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2012-06-29 13:20:14 +00:00
|
|
|
#ifndef WEBRTC_VIDEO_ENGINE_VIE_RECEIVER_H_
|
|
|
|
|
#define WEBRTC_VIDEO_ENGINE_VIE_RECEIVER_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-10-13 15:19:55 +00:00
|
|
|
#include <list>
|
|
|
|
|
|
2013-04-02 20:37:14 +00:00
|
|
|
#include "webrtc/engine_configurations.h"
|
|
|
|
|
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
|
|
|
|
|
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
|
|
|
|
#include "webrtc/typedefs.h"
|
|
|
|
|
#include "webrtc/video_engine/vie_defines.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-11-28 22:39:24 +00:00
|
|
|
namespace webrtc {
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
class CriticalSectionWrapper;
|
2011-11-28 22:39:24 +00:00
|
|
|
class Encryption;
|
2012-09-21 13:20:21 +00:00
|
|
|
class RemoteBitrateEstimator;
|
2011-07-07 08:21:25 +00:00
|
|
|
class RtpDump;
|
|
|
|
|
class RtpRtcp;
|
|
|
|
|
class VideoCodingModule;
|
|
|
|
|
|
2013-04-02 20:37:14 +00:00
|
|
|
class ViEReceiver : public RtpData {
|
2011-11-28 22:39:24 +00:00
|
|
|
public:
|
2012-09-21 13:20:21 +00:00
|
|
|
ViEReceiver(const int32_t channel_id, VideoCodingModule* module_vcm,
|
|
|
|
|
RemoteBitrateEstimator* remote_bitrate_estimator);
|
2011-11-28 22:39:24 +00:00
|
|
|
~ViEReceiver();
|
|
|
|
|
|
|
|
|
|
int RegisterExternalDecryption(Encryption* decryption);
|
|
|
|
|
int DeregisterExternalDecryption();
|
|
|
|
|
|
2012-05-11 11:08:54 +00:00
|
|
|
void SetRtpRtcpModule(RtpRtcp* module);
|
|
|
|
|
|
2011-11-28 22:39:24 +00:00
|
|
|
void RegisterSimulcastRtpRtcpModules(const std::list<RtpRtcp*>& rtp_modules);
|
|
|
|
|
|
|
|
|
|
void StartReceive();
|
|
|
|
|
void StopReceive();
|
|
|
|
|
|
|
|
|
|
int StartRTPDump(const char file_nameUTF8[1024]);
|
|
|
|
|
int StopRTPDump();
|
|
|
|
|
|
|
|
|
|
// Receives packets from external transport.
|
|
|
|
|
int ReceivedRTPPacket(const void* rtp_packet, int rtp_packet_length);
|
|
|
|
|
int ReceivedRTCPPacket(const void* rtcp_packet, int rtcp_packet_length);
|
|
|
|
|
|
|
|
|
|
// Implements RtpData.
|
2013-04-09 13:41:51 +00:00
|
|
|
virtual int32_t OnReceivedPayloadData(
|
|
|
|
|
const uint8_t* payload_data,
|
|
|
|
|
const uint16_t payload_size,
|
2011-11-28 22:39:24 +00:00
|
|
|
const WebRtcRTPHeader* rtp_header);
|
|
|
|
|
|
2013-04-09 13:41:51 +00:00
|
|
|
void OnSendReportReceived(const int32_t id,
|
|
|
|
|
const uint32_t senderSSRC,
|
2012-09-21 13:20:21 +00:00
|
|
|
uint32_t ntp_secs,
|
|
|
|
|
uint32_t ntp_frac,
|
|
|
|
|
uint32_t timestamp);
|
|
|
|
|
|
2013-02-06 17:46:39 +00:00
|
|
|
void EstimatedReceiveBandwidth(unsigned int* available_bandwidth) const;
|
2013-02-01 14:33:42 +00:00
|
|
|
|
2011-11-28 22:39:24 +00:00
|
|
|
private:
|
2013-04-09 13:41:51 +00:00
|
|
|
int InsertRTPPacket(const int8_t* rtp_packet, int rtp_packet_length);
|
|
|
|
|
int InsertRTCPPacket(const int8_t* rtcp_packet, int rtcp_packet_length);
|
2011-11-28 22:39:24 +00:00
|
|
|
|
2011-12-22 14:17:53 +00:00
|
|
|
scoped_ptr<CriticalSectionWrapper> receive_cs_;
|
2012-05-11 11:08:54 +00:00
|
|
|
const int32_t channel_id_;
|
|
|
|
|
RtpRtcp* rtp_rtcp_;
|
2011-11-28 22:39:24 +00:00
|
|
|
std::list<RtpRtcp*> rtp_rtcp_simulcast_;
|
2012-05-11 11:08:54 +00:00
|
|
|
VideoCodingModule* vcm_;
|
2012-09-21 13:20:21 +00:00
|
|
|
RemoteBitrateEstimator* remote_bitrate_estimator_;
|
2011-11-28 22:39:24 +00:00
|
|
|
|
|
|
|
|
Encryption* external_decryption_;
|
2013-04-09 13:41:51 +00:00
|
|
|
uint8_t* decryption_buffer_;
|
2011-11-28 22:39:24 +00:00
|
|
|
RtpDump* rtp_dump_;
|
|
|
|
|
bool receiving_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
2011-11-28 22:39:24 +00:00
|
|
|
|
|
|
|
|
} // namespace webrt
|
|
|
|
|
|
2012-06-29 13:20:14 +00:00
|
|
|
#endif // WEBRTC_VIDEO_ENGINE_VIE_RECEIVER_H_
|