2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-02-10 12:13:12 +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_CHANNEL_H_
|
|
|
|
|
#define WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_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/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
|
|
|
|
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
|
|
|
|
|
#include "webrtc/modules/video_coding/main/interface/video_coding_defines.h"
|
|
|
|
|
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
|
|
|
|
#include "webrtc/system_wrappers/interface/tick_util.h"
|
|
|
|
|
#include "webrtc/typedefs.h"
|
|
|
|
|
#include "webrtc/video_engine/include/vie_network.h"
|
|
|
|
|
#include "webrtc/video_engine/include/vie_rtp_rtcp.h"
|
|
|
|
|
#include "webrtc/video_engine/vie_defines.h"
|
|
|
|
|
#include "webrtc/video_engine/vie_frame_provider_base.h"
|
|
|
|
|
#include "webrtc/video_engine/vie_receiver.h"
|
|
|
|
|
#include "webrtc/video_engine/vie_sender.h"
|
|
|
|
|
#include "webrtc/video_engine/vie_sync_module.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
namespace webrtc {
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-02-19 22:09:36 +00:00
|
|
|
class CallStatsObserver;
|
2012-11-26 12:40:15 +00:00
|
|
|
class ChannelStatsObserver;
|
2013-05-13 10:50:50 +00:00
|
|
|
class Config;
|
2011-07-07 08:21:25 +00:00
|
|
|
class CriticalSectionWrapper;
|
2013-11-26 11:41:59 +00:00
|
|
|
class EncodedImageCallback;
|
2013-10-21 10:34:43 +00:00
|
|
|
class I420FrameCallback;
|
2012-11-13 21:12:39 +00:00
|
|
|
class PacedSender;
|
2011-07-07 08:21:25 +00:00
|
|
|
class ProcessThread;
|
2013-11-20 12:46:11 +00:00
|
|
|
class RtcpRttStats;
|
2013-05-13 10:50:50 +00:00
|
|
|
class RtpRtcp;
|
2011-07-07 08:21:25 +00:00
|
|
|
class ThreadWrapper;
|
|
|
|
|
class ViEDecoderObserver;
|
|
|
|
|
class ViEEffectFilter;
|
|
|
|
|
class ViERTCPObserver;
|
|
|
|
|
class ViERTPObserver;
|
2013-05-13 10:50:50 +00:00
|
|
|
class VideoCodingModule;
|
|
|
|
|
class VideoDecoder;
|
|
|
|
|
class VideoRenderCallback;
|
2011-07-07 08:21:25 +00:00
|
|
|
class VoEVideoSync;
|
|
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
class ViEChannel
|
|
|
|
|
: public VCMFrameTypeCallback,
|
|
|
|
|
public VCMReceiveCallback,
|
|
|
|
|
public VCMReceiveStatisticsCallback,
|
2013-10-23 23:59:45 +00:00
|
|
|
public VCMDecoderTimingCallback,
|
2011-12-15 15:23:08 +00:00
|
|
|
public VCMPacketRequestCallback,
|
|
|
|
|
public RtcpFeedback,
|
|
|
|
|
public RtpFeedback,
|
|
|
|
|
public ViEFrameProviderBase {
|
|
|
|
|
public:
|
2012-11-26 12:40:15 +00:00
|
|
|
friend class ChannelStatsObserver;
|
|
|
|
|
|
2013-04-09 13:41:51 +00:00
|
|
|
ViEChannel(int32_t channel_id,
|
|
|
|
|
int32_t engine_id,
|
|
|
|
|
uint32_t number_of_cores,
|
2013-05-13 10:50:50 +00:00
|
|
|
const Config& config,
|
2012-04-27 05:25:53 +00:00
|
|
|
ProcessThread& module_process_thread,
|
|
|
|
|
RtcpIntraFrameObserver* intra_frame_observer,
|
2012-05-11 11:08:54 +00:00
|
|
|
RtcpBandwidthObserver* bandwidth_observer,
|
2012-06-07 08:10:14 +00:00
|
|
|
RemoteBitrateEstimator* remote_bitrate_estimator,
|
2013-11-20 12:46:11 +00:00
|
|
|
RtcpRttStats* rtt_stats,
|
2012-11-13 21:12:39 +00:00
|
|
|
PacedSender* paced_sender,
|
2012-08-20 14:29:52 +00:00
|
|
|
RtpRtcp* default_rtp_rtcp,
|
|
|
|
|
bool sender);
|
2011-12-15 15:23:08 +00:00
|
|
|
~ViEChannel();
|
|
|
|
|
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t Init();
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Sets the encoder to use for the channel. |new_stream| indicates the encoder
|
|
|
|
|
// type has changed and we should start a new RTP stream.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t SetSendCodec(const VideoCodec& video_codec, bool new_stream = true);
|
|
|
|
|
int32_t SetReceiveCodec(const VideoCodec& video_codec);
|
|
|
|
|
int32_t GetReceiveCodec(VideoCodec* video_codec);
|
|
|
|
|
int32_t RegisterCodecObserver(ViEDecoderObserver* observer);
|
2013-04-09 00:34:42 +00:00
|
|
|
// Registers an external decoder. |buffered_rendering| means that the decoder
|
|
|
|
|
// will render frames after decoding according to the render timestamp
|
|
|
|
|
// provided by the video coding module. |render_delay| indicates the time
|
|
|
|
|
// needed to decode and render a frame.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t RegisterExternalDecoder(const uint8_t pl_type,
|
|
|
|
|
VideoDecoder* decoder,
|
|
|
|
|
bool buffered_rendering,
|
|
|
|
|
int32_t render_delay);
|
|
|
|
|
int32_t DeRegisterExternalDecoder(const uint8_t pl_type);
|
|
|
|
|
int32_t ReceiveCodecStatistics(uint32_t* num_key_frames,
|
|
|
|
|
uint32_t* num_delta_frames);
|
|
|
|
|
uint32_t DiscardedPackets() const;
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2012-12-14 14:02:10 +00:00
|
|
|
// Returns the estimated delay in milliseconds.
|
|
|
|
|
int ReceiveDelay() const;
|
|
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
// Only affects calls to SetReceiveCodec done after this call.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t WaitForKeyFrame(bool wait);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// If enabled, a key frame request will be sent as soon as there are lost
|
|
|
|
|
// packets. If |only_key_frames| are set, requests are only sent for loss in
|
|
|
|
|
// key frames.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t SetSignalPacketLossStatus(bool enable, bool only_key_frames);
|
|
|
|
|
|
|
|
|
|
int32_t SetRTCPMode(const RTCPMethod rtcp_mode);
|
|
|
|
|
int32_t GetRTCPMode(RTCPMethod* rtcp_mode);
|
|
|
|
|
int32_t SetNACKStatus(const bool enable);
|
|
|
|
|
int32_t SetFECStatus(const bool enable,
|
|
|
|
|
const unsigned char payload_typeRED,
|
|
|
|
|
const unsigned char payload_typeFEC);
|
|
|
|
|
int32_t SetHybridNACKFECStatus(const bool enable,
|
|
|
|
|
const unsigned char payload_typeRED,
|
|
|
|
|
const unsigned char payload_typeFEC);
|
2013-02-15 23:22:18 +00:00
|
|
|
int SetSenderBufferingMode(int target_delay_ms);
|
|
|
|
|
int SetReceiverBufferingMode(int target_delay_ms);
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t SetKeyFrameRequestMethod(const KeyFrameRequestMethod method);
|
2011-12-22 10:26:13 +00:00
|
|
|
bool EnableRemb(bool enable);
|
2012-08-13 17:13:27 +00:00
|
|
|
int SetSendTimestampOffsetStatus(bool enable, int id);
|
|
|
|
|
int SetReceiveTimestampOffsetStatus(bool enable, int id);
|
2013-05-20 12:00:23 +00:00
|
|
|
int SetSendAbsoluteSendTimeStatus(bool enable, int id);
|
|
|
|
|
int SetReceiveAbsoluteSendTimeStatus(bool enable, int id);
|
2013-05-27 16:02:56 +00:00
|
|
|
bool GetReceiveAbsoluteSendTimeStatus() const;
|
2013-11-21 08:57:04 +00:00
|
|
|
void SetRtcpXrRrtrStatus(bool enable);
|
2012-09-12 13:47:06 +00:00
|
|
|
void SetTransmissionSmoothingStatus(bool enable);
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t EnableTMMBR(const bool enable);
|
|
|
|
|
int32_t EnableKeyFrameRequestCallback(const bool enable);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Sets SSRC for outgoing stream.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t SetSSRC(const uint32_t SSRC,
|
|
|
|
|
const StreamType usage,
|
|
|
|
|
const unsigned char simulcast_idx);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2012-10-25 11:30:29 +00:00
|
|
|
// Gets SSRC for outgoing stream number |idx|.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t GetLocalSSRC(uint8_t idx, unsigned int* ssrc);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Gets SSRC for the incoming stream.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t GetRemoteSSRC(uint32_t* ssrc);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Gets the CSRC for the incoming stream.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t GetRemoteCSRC(uint32_t CSRCs[kRtpCsrcSize]);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-04-12 14:55:46 +00:00
|
|
|
int SetRtxSendPayloadType(int payload_type);
|
|
|
|
|
void SetRtxReceivePayloadType(int payload_type);
|
|
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
// Sets the starting sequence number, must be called before StartSend.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t SetStartSequenceNumber(uint16_t sequence_number);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Sets the CName for the outgoing stream on the channel.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t SetRTCPCName(const char rtcp_cname[]);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Gets the CName for the outgoing stream on the channel.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t GetRTCPCName(char rtcp_cname[]);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Gets the CName of the incoming stream.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t GetRemoteRTCPCName(char rtcp_cname[]);
|
|
|
|
|
int32_t RegisterRtpObserver(ViERTPObserver* observer);
|
|
|
|
|
int32_t RegisterRtcpObserver(ViERTCPObserver* observer);
|
|
|
|
|
int32_t SendApplicationDefinedRTCPPacket(
|
|
|
|
|
const uint8_t sub_type,
|
|
|
|
|
uint32_t name,
|
|
|
|
|
const uint8_t* data,
|
|
|
|
|
uint16_t data_length_in_bytes);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2012-01-03 09:54:29 +00:00
|
|
|
// Returns statistics reported by the remote client in an RTCP packet.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t GetSendRtcpStatistics(uint16_t* fraction_lost,
|
|
|
|
|
uint32_t* cumulative_lost,
|
|
|
|
|
uint32_t* extended_max,
|
|
|
|
|
uint32_t* jitter_samples,
|
|
|
|
|
int32_t* rtt_ms);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-12-05 09:48:44 +00:00
|
|
|
// Called on receipt of RTCP report block from remote side.
|
|
|
|
|
void RegisterSendChannelRtcpStatisticsCallback(
|
|
|
|
|
RtcpStatisticsCallback* callback);
|
|
|
|
|
|
2012-01-03 09:54:29 +00:00
|
|
|
// Returns our localy created statistics of the received RTP stream.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t GetReceivedRtcpStatistics(uint16_t* fraction_lost,
|
|
|
|
|
uint32_t* cumulative_lost,
|
|
|
|
|
uint32_t* extended_max,
|
|
|
|
|
uint32_t* jitter_samples,
|
|
|
|
|
int32_t* rtt_ms);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-12-19 13:26:02 +00:00
|
|
|
// Called on generation of RTCP stats
|
|
|
|
|
void RegisterReceiveChannelRtcpStatisticsCallback(
|
|
|
|
|
RtcpStatisticsCallback* callback);
|
|
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
// Gets sent/received packets statistics.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t GetRtpStatistics(uint32_t* bytes_sent,
|
|
|
|
|
uint32_t* packets_sent,
|
|
|
|
|
uint32_t* bytes_received,
|
|
|
|
|
uint32_t* packets_received) const;
|
2013-12-05 14:29:02 +00:00
|
|
|
|
|
|
|
|
// Called on update of RTP statistics.
|
|
|
|
|
void RegisterSendChannelRtpStatisticsCallback(
|
2014-01-23 10:00:39 +00:00
|
|
|
StreamDataCountersCallback* callback);
|
|
|
|
|
|
|
|
|
|
// Called on update of RTP statistics.
|
|
|
|
|
void RegisterReceiveChannelRtpStatisticsCallback(
|
2013-12-05 14:29:02 +00:00
|
|
|
StreamDataCountersCallback* callback);
|
|
|
|
|
|
2014-02-19 11:59:02 +00:00
|
|
|
void GetRtcpPacketTypeCounters(RtcpPacketTypeCounter* packets_sent,
|
|
|
|
|
RtcpPacketTypeCounter* packets_received) const;
|
|
|
|
|
|
2012-06-27 09:49:37 +00:00
|
|
|
void GetBandwidthUsage(uint32_t* total_bitrate_sent,
|
|
|
|
|
uint32_t* video_bitrate_sent,
|
|
|
|
|
uint32_t* fec_bitrate_sent,
|
|
|
|
|
uint32_t* nackBitrateSent) const;
|
2013-12-05 14:05:07 +00:00
|
|
|
bool GetSendSideDelay(int* avg_send_delay, int* max_send_delay) const;
|
2014-02-10 19:12:14 +00:00
|
|
|
void GetReceiveBandwidthEstimatorStats(
|
|
|
|
|
ReceiveBandwidthEstimatorStats* output) const;
|
2012-03-23 09:41:44 +00:00
|
|
|
|
2013-12-13 09:46:59 +00:00
|
|
|
// Called on any new send bitrate estimate.
|
|
|
|
|
void RegisterSendBitrateObserver(BitrateStatisticsObserver* observer);
|
|
|
|
|
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t StartRTPDump(const char file_nameUTF8[1024],
|
|
|
|
|
RTPDirections direction);
|
|
|
|
|
int32_t StopRTPDump(RTPDirections direction);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Implements RtcpFeedback.
|
2012-05-11 11:08:54 +00:00
|
|
|
// TODO(pwestin) Depricate this functionality.
|
2013-04-09 13:41:51 +00:00
|
|
|
virtual void OnApplicationDataReceived(const int32_t id,
|
|
|
|
|
const uint8_t sub_type,
|
|
|
|
|
const uint32_t name,
|
|
|
|
|
const uint16_t length,
|
|
|
|
|
const uint8_t* data);
|
2011-12-15 15:23:08 +00:00
|
|
|
// Implements RtpFeedback.
|
2013-04-09 13:41:51 +00:00
|
|
|
virtual int32_t OnInitializeDecoder(
|
|
|
|
|
const int32_t id,
|
|
|
|
|
const int8_t payload_type,
|
2012-03-01 18:22:48 +00:00
|
|
|
const char payload_name[RTP_PAYLOAD_NAME_SIZE],
|
2011-12-15 15:23:08 +00:00
|
|
|
const int frequency,
|
2013-04-09 13:41:51 +00:00
|
|
|
const uint8_t channels,
|
|
|
|
|
const uint32_t rate);
|
|
|
|
|
virtual void OnIncomingSSRCChanged(const int32_t id,
|
2013-08-21 20:58:21 +00:00
|
|
|
const uint32_t ssrc);
|
2013-04-09 13:41:51 +00:00
|
|
|
virtual void OnIncomingCSRCChanged(const int32_t id,
|
|
|
|
|
const uint32_t CSRC,
|
2011-12-15 15:23:08 +00:00
|
|
|
const bool added);
|
2013-08-21 20:58:21 +00:00
|
|
|
virtual void ResetStatistics(uint32_t);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t SetLocalReceiver(const uint16_t rtp_port,
|
|
|
|
|
const uint16_t rtcp_port,
|
|
|
|
|
const char* ip_address);
|
|
|
|
|
int32_t GetLocalReceiver(uint16_t* rtp_port,
|
|
|
|
|
uint16_t* rtcp_port,
|
|
|
|
|
char* ip_address) const;
|
|
|
|
|
int32_t SetSendDestination(const char* ip_address,
|
|
|
|
|
const uint16_t rtp_port,
|
|
|
|
|
const uint16_t rtcp_port,
|
|
|
|
|
const uint16_t source_rtp_port,
|
|
|
|
|
const uint16_t source_rtcp_port);
|
|
|
|
|
int32_t GetSendDestination(char* ip_address,
|
|
|
|
|
uint16_t* rtp_port,
|
|
|
|
|
uint16_t* rtcp_port,
|
|
|
|
|
uint16_t* source_rtp_port,
|
|
|
|
|
uint16_t* source_rtcp_port) const;
|
|
|
|
|
int32_t GetSourceInfo(uint16_t* rtp_port,
|
|
|
|
|
uint16_t* rtcp_port,
|
|
|
|
|
char* ip_address,
|
|
|
|
|
uint32_t ip_address_length);
|
|
|
|
|
|
2013-08-15 23:38:54 +00:00
|
|
|
int32_t SetRemoteSSRCType(const StreamType usage, const uint32_t SSRC);
|
2013-04-09 13:41:51 +00:00
|
|
|
|
|
|
|
|
int32_t StartSend();
|
|
|
|
|
int32_t StopSend();
|
2011-12-15 15:23:08 +00:00
|
|
|
bool Sending();
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t StartReceive();
|
|
|
|
|
int32_t StopReceive();
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t RegisterSendTransport(Transport* transport);
|
|
|
|
|
int32_t DeregisterSendTransport();
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Incoming packet from external transport.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t ReceivedRTPPacket(const void* rtp_packet,
|
2013-12-13 00:21:03 +00:00
|
|
|
const int32_t rtp_packet_length,
|
|
|
|
|
const PacketTime& packet_time);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Incoming packet from external transport.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t ReceivedRTCPPacket(const void* rtcp_packet,
|
|
|
|
|
const int32_t rtcp_packet_length);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Sets the maximum transfer unit size for the network link, i.e. including
|
|
|
|
|
// IP, UDP and RTP headers.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t SetMTU(uint16_t mtu);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Returns maximum allowed payload size, i.e. the maximum allowed size of
|
|
|
|
|
// encoded data in each packet.
|
2013-04-09 13:41:51 +00:00
|
|
|
uint16_t MaxDataPayloadLength() const;
|
|
|
|
|
int32_t SetMaxPacketBurstSize(uint16_t max_number_of_packets);
|
|
|
|
|
int32_t SetPacketBurstSpreadState(bool enable, const uint16_t frame_periodMS);
|
|
|
|
|
|
|
|
|
|
int32_t EnableColorEnhancement(bool enable);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2011-12-22 10:26:13 +00:00
|
|
|
// Gets the modules used by the channel.
|
|
|
|
|
RtpRtcp* rtp_rtcp();
|
|
|
|
|
|
2013-02-19 22:09:36 +00:00
|
|
|
CallStatsObserver* GetStatsObserver();
|
2012-11-26 12:40:15 +00:00
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
// Implements VCMReceiveCallback.
|
2013-04-09 13:41:51 +00:00
|
|
|
virtual int32_t FrameToRender(I420VideoFrame& video_frame); // NOLINT
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Implements VCMReceiveCallback.
|
2013-04-09 13:41:51 +00:00
|
|
|
virtual int32_t ReceivedDecodedReferenceFrame(
|
|
|
|
|
const uint64_t picture_id);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-08-12 14:20:49 +00:00
|
|
|
// Implements VCMReceiveCallback.
|
|
|
|
|
virtual void IncomingCodecChanged(const VideoCodec& codec);
|
|
|
|
|
|
2013-10-23 23:59:45 +00:00
|
|
|
// Implements VCMReceiveStatisticsCallback.
|
2013-08-15 23:38:54 +00:00
|
|
|
virtual int32_t OnReceiveStatisticsUpdate(const uint32_t bit_rate,
|
2013-04-09 13:41:51 +00:00
|
|
|
const uint32_t frame_rate);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-10-23 23:59:45 +00:00
|
|
|
// Implements VCMDecoderTimingCallback.
|
|
|
|
|
virtual void OnDecoderTiming(int decode_ms,
|
|
|
|
|
int max_decode_ms,
|
|
|
|
|
int current_delay_ms,
|
|
|
|
|
int target_delay_ms,
|
|
|
|
|
int jitter_buffer_ms,
|
|
|
|
|
int min_playout_delay_ms,
|
|
|
|
|
int render_delay_ms);
|
|
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
// Implements VideoFrameTypeCallback.
|
2013-04-09 13:41:51 +00:00
|
|
|
virtual int32_t RequestKeyFrame();
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Implements VideoFrameTypeCallback.
|
2013-04-09 13:41:51 +00:00
|
|
|
virtual int32_t SliceLossIndicationRequest(
|
|
|
|
|
const uint64_t picture_id);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Implements VideoPacketRequestCallback.
|
2013-04-09 13:41:51 +00:00
|
|
|
virtual int32_t ResendPackets(const uint16_t* sequence_numbers,
|
|
|
|
|
uint16_t length);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t SetVoiceChannel(int32_t ve_channel_id,
|
|
|
|
|
VoEVideoSync* ve_sync_interface);
|
|
|
|
|
int32_t VoiceChannel();
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Implements ViEFrameProviderBase.
|
|
|
|
|
virtual int FrameCallbackChanged() {return -1;}
|
|
|
|
|
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t RegisterEffectFilter(ViEEffectFilter* effect_filter);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-11-26 11:41:59 +00:00
|
|
|
// New-style callbacks, used by VideoReceiveStream.
|
2013-10-21 10:34:43 +00:00
|
|
|
void RegisterPreRenderCallback(I420FrameCallback* pre_render_callback);
|
2013-11-26 11:41:59 +00:00
|
|
|
void RegisterPreDecodeImageCallback(
|
|
|
|
|
EncodedImageCallback* pre_decode_callback);
|
2013-10-21 10:34:43 +00:00
|
|
|
|
2013-12-04 15:09:27 +00:00
|
|
|
void RegisterSendFrameCountObserver(FrameCountObserver* observer);
|
|
|
|
|
|
2014-03-24 20:28:11 +00:00
|
|
|
void ReceivedBWEPacket(int64_t arrival_time_ms, int payload_size,
|
|
|
|
|
const RTPHeader& header);
|
|
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
protected:
|
|
|
|
|
static bool ChannelDecodeThreadFunction(void* obj);
|
|
|
|
|
bool ChannelDecodeProcess();
|
|
|
|
|
|
2012-11-26 12:40:15 +00:00
|
|
|
void OnRttUpdate(uint32_t rtt);
|
|
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
private:
|
|
|
|
|
// Assumed to be protected.
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t StartDecodeThread();
|
|
|
|
|
int32_t StopDecodeThread();
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t ProcessNACKRequest(const bool enable);
|
|
|
|
|
int32_t ProcessFECRequest(const bool enable,
|
|
|
|
|
const unsigned char payload_typeRED,
|
|
|
|
|
const unsigned char payload_typeFEC);
|
2013-02-15 23:22:18 +00:00
|
|
|
// Compute NACK list parameters for the buffering mode.
|
|
|
|
|
int GetRequiredNackListSize(int target_delay_ms);
|
2011-12-15 15:23:08 +00:00
|
|
|
|
2013-04-09 13:41:51 +00:00
|
|
|
int32_t channel_id_;
|
|
|
|
|
int32_t engine_id_;
|
|
|
|
|
uint32_t number_of_cores_;
|
|
|
|
|
uint8_t num_socket_threads_;
|
2011-12-15 15:23:08 +00:00
|
|
|
|
|
|
|
|
// Used for all registered callbacks except rendering.
|
2011-12-22 14:17:53 +00:00
|
|
|
scoped_ptr<CriticalSectionWrapper> callback_cs_;
|
2012-05-24 11:28:31 +00:00
|
|
|
scoped_ptr<CriticalSectionWrapper> rtp_rtcp_cs_;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-05-10 23:01:04 +00:00
|
|
|
RtpRtcp* default_rtp_rtcp_;
|
2012-05-11 11:08:54 +00:00
|
|
|
|
|
|
|
|
// Owned modules/classes.
|
|
|
|
|
scoped_ptr<RtpRtcp> rtp_rtcp_;
|
2011-12-15 15:23:08 +00:00
|
|
|
std::list<RtpRtcp*> simulcast_rtp_rtcp_;
|
2013-02-20 16:00:27 +00:00
|
|
|
std::list<RtpRtcp*> removed_rtp_rtcp_;
|
2014-05-23 09:41:07 +00:00
|
|
|
VideoCodingModule* const vcm_;
|
2012-05-11 11:08:54 +00:00
|
|
|
ViEReceiver vie_receiver_;
|
|
|
|
|
ViESender vie_sender_;
|
|
|
|
|
ViESyncModule vie_sync_;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-11-26 12:40:15 +00:00
|
|
|
// Helper to report call statistics.
|
|
|
|
|
scoped_ptr<ChannelStatsObserver> stats_observer_;
|
|
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
// Not owned.
|
|
|
|
|
ProcessThread& module_process_thread_;
|
|
|
|
|
ViEDecoderObserver* codec_observer_;
|
|
|
|
|
bool do_key_frame_callbackRequest_;
|
|
|
|
|
ViERTPObserver* rtp_observer_;
|
|
|
|
|
ViERTCPObserver* rtcp_observer_;
|
2012-04-27 05:25:53 +00:00
|
|
|
RtcpIntraFrameObserver* intra_frame_observer_;
|
2013-11-20 12:46:11 +00:00
|
|
|
RtcpRttStats* rtt_stats_;
|
2012-11-13 21:12:39 +00:00
|
|
|
PacedSender* paced_sender_;
|
|
|
|
|
|
2012-05-03 11:36:06 +00:00
|
|
|
scoped_ptr<RtcpBandwidthObserver> bandwidth_observer_;
|
2012-08-13 17:13:27 +00:00
|
|
|
int send_timestamp_extension_id_;
|
2013-05-20 12:00:23 +00:00
|
|
|
int absolute_send_time_extension_id_;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
Transport* external_transport_;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
bool decoder_reset_;
|
2013-08-12 14:20:49 +00:00
|
|
|
// Current receive codec used for codec change callback.
|
|
|
|
|
VideoCodec receive_codec_;
|
2011-12-15 15:23:08 +00:00
|
|
|
bool wait_for_key_frame_;
|
|
|
|
|
ThreadWrapper* decode_thread_;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
ViEEffectFilter* effect_filter_;
|
|
|
|
|
bool color_enhancement_;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-03-30 14:35:51 +00:00
|
|
|
// User set MTU, -1 if not set.
|
|
|
|
|
uint16_t mtu_;
|
2012-08-20 14:29:52 +00:00
|
|
|
const bool sender_;
|
2013-02-01 19:33:21 +00:00
|
|
|
|
|
|
|
|
int nack_history_size_sender_;
|
2013-02-15 23:22:18 +00:00
|
|
|
int max_nack_reordering_threshold_;
|
2013-10-21 10:34:43 +00:00
|
|
|
I420FrameCallback* pre_render_callback_;
|
2013-12-04 10:24:26 +00:00
|
|
|
const Config& config_;
|
2011-12-15 15:23:08 +00:00
|
|
|
};
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-15 15:23:08 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-06-29 13:20:14 +00:00
|
|
|
#endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_H_
|