Files
platform-external-webrtc/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h
stefan@webrtc.org 20ed36dada Break out RtpClock to system_wrappers and make it more generic.
The goal with this new clock interface is to have something which is used all
over WebRTC to make it easier to switch clock implementation depending on where
the components are used. This is a first step in that direction.

Next steps will be to, step by step, move all modules, video engine and voice
engine over to the new interface, effectively deprecating the old clock
interfaces. Long-term my vision is that we should be able to deprecate the clock
of WebRTC and rely on the user providing the implementation.

TEST=vie_auto_test, rtp_rtcp_unittests, trybots

Review URL: https://webrtc-codereview.appspot.com/1041004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3381 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-17 14:01:20 +00:00

144 lines
5.2 KiB
C++

/*
* 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_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_
#include <list>
#include "typedefs.h"
#include "common_types.h" // Transport
#include "rtp_rtcp_config.h"
#include "rtp_rtcp_defines.h"
#include "rtp_utility.h"
#include "video_codec_information.h"
#include "forward_error_correction.h"
#include "bitrate.h"
#include "rtp_sender.h"
#include "producer_fec.h"
namespace webrtc {
class CriticalSectionWrapper;
struct RtpPacket;
class RTPSenderVideo
{
public:
RTPSenderVideo(const WebRtc_Word32 id, Clock* clock,
RTPSenderInterface* rtpSender);
virtual ~RTPSenderVideo();
virtual RtpVideoCodecTypes VideoCodecType() const;
WebRtc_UWord16 FECPacketOverhead() const;
WebRtc_Word32 RegisterVideoPayload(
const char payloadName[RTP_PAYLOAD_NAME_SIZE],
const WebRtc_Word8 payloadType,
const WebRtc_UWord32 maxBitRate,
ModuleRTPUtility::Payload*& payload);
WebRtc_Word32 SendVideo(const RtpVideoCodecTypes videoType,
const FrameType frameType,
const WebRtc_Word8 payloadType,
const uint32_t captureTimeStamp,
int64_t capture_time_ms,
const WebRtc_UWord8* payloadData,
const WebRtc_UWord32 payloadSize,
const RTPFragmentationHeader* fragmentation,
VideoCodecInformation* codecInfo,
const RTPVideoTypeHeader* rtpTypeHdr);
WebRtc_Word32 SendRTPIntraRequest();
void SetVideoCodecType(RtpVideoCodecTypes type);
VideoCodecInformation* CodecInformationVideo();
void SetMaxConfiguredBitrateVideo(const WebRtc_UWord32 maxBitrate);
WebRtc_UWord32 MaxConfiguredBitrateVideo() const;
// FEC
WebRtc_Word32 SetGenericFECStatus(const bool enable,
const WebRtc_UWord8 payloadTypeRED,
const WebRtc_UWord8 payloadTypeFEC);
WebRtc_Word32 GenericFECStatus(bool& enable,
WebRtc_UWord8& payloadTypeRED,
WebRtc_UWord8& payloadTypeFEC) const;
WebRtc_Word32 SetFecParameters(const FecProtectionParams* delta_params,
const FecProtectionParams* key_params);
void ProcessBitrate();
WebRtc_UWord32 VideoBitrateSent() const;
WebRtc_UWord32 FecOverheadRate() const;
int SelectiveRetransmissions() const;
int SetSelectiveRetransmissions(uint8_t settings);
protected:
virtual WebRtc_Word32 SendVideoPacket(WebRtc_UWord8* dataBuffer,
const WebRtc_UWord16 payloadLength,
const WebRtc_UWord16 rtpHeaderLength,
int64_t capture_time_ms,
StorageType storage,
bool protect);
private:
WebRtc_Word32 SendGeneric(const WebRtc_Word8 payloadType,
const uint32_t captureTimeStamp,
int64_t capture_time_ms,
const WebRtc_UWord8* payloadData,
const WebRtc_UWord32 payloadSize);
WebRtc_Word32 SendVP8(const FrameType frameType,
const WebRtc_Word8 payloadType,
const uint32_t captureTimeStamp,
int64_t capture_time_ms,
const WebRtc_UWord8* payloadData,
const WebRtc_UWord32 payloadSize,
const RTPFragmentationHeader* fragmentation,
const RTPVideoTypeHeader* rtpTypeHdr);
private:
WebRtc_Word32 _id;
RTPSenderInterface& _rtpSender;
CriticalSectionWrapper* _sendVideoCritsect;
RtpVideoCodecTypes _videoType;
VideoCodecInformation* _videoCodecInformation;
WebRtc_UWord32 _maxBitrate;
WebRtc_Word32 _retransmissionSettings;
// FEC
ForwardErrorCorrection _fec;
bool _fecEnabled;
WebRtc_Word8 _payloadTypeRED;
WebRtc_Word8 _payloadTypeFEC;
unsigned int _numberFirstPartition;
FecProtectionParams delta_fec_params_;
FecProtectionParams key_fec_params_;
ProducerFec producer_fec_;
// Bitrate used for FEC payload, RED headers, RTP headers for FEC packets
// and any padding overhead.
Bitrate _fecOverheadRate;
// Bitrate used for video payload and RTP headers
Bitrate _videoBitrate;
};
} // namespace webrtc
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_