Default constructors for new VideoEngine structs.

BUG=
R=mflodman@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4115 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2013-05-28 08:04:45 +00:00
parent 68c05f498c
commit eceb53241e
3 changed files with 48 additions and 3 deletions

View File

@ -63,6 +63,11 @@ class Transport {
}; };
struct RtpStatistics { struct RtpStatistics {
RtpStatistics()
: ssrc(0),
fraction_loss(0),
cumulative_loss(0),
extended_max_sequence_number(0) {}
uint32_t ssrc; uint32_t ssrc;
int fraction_loss; int fraction_loss;
int cumulative_loss; int cumulative_loss;
@ -70,7 +75,7 @@ struct RtpStatistics {
std::string c_name; std::string c_name;
}; };
// RTCP mode to use. Compound mode is described by RFC 4585 and reduced sized // RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size
// RTCP mode is described by RFC 5506. // RTCP mode is described by RFC 5506.
enum RtcpMode { enum RtcpMode {
kRtcpCompound, kRtcpCompound,
@ -79,16 +84,18 @@ enum RtcpMode {
// Settings for NACK, see RFC 4585 for details. // Settings for NACK, see RFC 4585 for details.
struct NackConfig { struct NackConfig {
NackConfig() : rtp_history_ms(0) {}
// Send side: the time RTP packets are stored for retransmissions. // Send side: the time RTP packets are stored for retransmissions.
// Receive side: the time the receiver is prepared to wait for // Receive side: the time the receiver is prepared to wait for
// retransmissions. // retransmissions.
// Set to '0' to disable // Set to '0' to disable.
int rtp_history_ms; int rtp_history_ms;
}; };
// Settings for forward error correction, see RFC 5109 for details. Set the // Settings for forward error correction, see RFC 5109 for details. Set the
// payload types to '-1' to disable. // payload types to '-1' to disable.
struct FecConfig { struct FecConfig {
FecConfig() : ulpfec_payload_type(-1), red_payload_type(-1) {}
// Payload type used for ULPFEC packets. // Payload type used for ULPFEC packets.
int ulpfec_payload_type; int ulpfec_payload_type;
@ -98,7 +105,8 @@ struct FecConfig {
// Settings for RTP retransmission payload format, see RFC 4588 for details. // Settings for RTP retransmission payload format, see RFC 4588 for details.
struct RtxConfig { struct RtxConfig {
// SSRC to use for the RTX stream, set to '0' for a random generated SSRC. RtxConfig() : ssrc(0), rtx_payload_type(0), video_payload_type(0) {}
// SSRC to use for the RTX stream.
uint32_t ssrc; uint32_t ssrc;
// Payload type to use for the RTX stream. // Payload type to use for the RTX stream.
@ -110,6 +118,7 @@ struct RtxConfig {
// RTP header extension to use for the video stream, see RFC 5285. // RTP header extension to use for the video stream, see RFC 5285.
struct RtpExtension { struct RtpExtension {
RtpExtension() : id(0) {}
// TODO(mflodman) Add API to query supported extensions. // TODO(mflodman) Add API to query supported extensions.
std::string name; std::string name;
int id; int id;

View File

@ -41,6 +41,7 @@ struct ReceiveStatistics {
// Receive stream specific RTP settings. // Receive stream specific RTP settings.
struct RtpReceiveConfig { struct RtpReceiveConfig {
RtpReceiveConfig() : ssrc(0), nack(NULL), fec(NULL) {}
// TODO(mflodman) Do we require a set ssrc? What happens if the ssrc changes? // TODO(mflodman) Do we require a set ssrc? What happens if the ssrc changes?
uint32_t ssrc; uint32_t ssrc;
@ -60,6 +61,8 @@ struct RtpReceiveConfig {
// TODO(mflodman) Move all these settings to VideoDecoder and move the // TODO(mflodman) Move all these settings to VideoDecoder and move the
// declaration to common_types.h. // declaration to common_types.h.
struct ExternalVideoDecoder { struct ExternalVideoDecoder {
ExternalVideoDecoder()
: decoder(NULL), payload_type(0), renderer(false), expected_delay_ms(0) {}
// The actual decoder. // The actual decoder.
VideoDecoder* decoder; VideoDecoder* decoder;
@ -78,6 +81,13 @@ struct ExternalVideoDecoder {
}; };
struct VideoReceiveStreamConfig { struct VideoReceiveStreamConfig {
VideoReceiveStreamConfig()
: renderer(NULL),
render_delay_ms(0),
audio_channel_id(0),
pre_decode_callback(NULL),
post_decode_callback(NULL),
target_delay_ms(0) {}
// Codecs the receive stream // Codecs the receive stream
std::vector<VideoCodec> codecs; std::vector<VideoCodec> codecs;

View File

@ -27,6 +27,17 @@ namespace newapi {
struct SendStreamState; struct SendStreamState;
struct SendStatistics { struct SendStatistics {
SendStatistics()
: input_frame_rate(0),
encode_frame(0),
key_frames(0),
delta_frames(0),
video_packets(0),
retransmitted_packets(0),
fec_packets(0),
padding_packets(0),
send_bitrate_bps(0),
delay_ms(0) {}
RtpStatistics rtp; RtpStatistics rtp;
int input_frame_rate; int input_frame_rate;
int encode_frame; int encode_frame;
@ -53,6 +64,12 @@ class VideoSendStreamInput {
}; };
struct RtpSendConfig { struct RtpSendConfig {
RtpSendConfig()
: mode(kRtcpReducedSize),
max_packet_size(0),
nack(NULL),
fec(NULL),
rtx(NULL) {}
RtcpMode mode; RtcpMode mode;
std::vector<uint32_t> ssrcs; std::vector<uint32_t> ssrcs;
@ -77,6 +94,15 @@ struct RtpSendConfig {
}; };
struct VideoSendStreamConfig { struct VideoSendStreamConfig {
VideoSendStreamConfig()
: pre_encode_callback(NULL),
encoded_callback(NULL),
local_renderer(NULL),
render_delay_ms(0),
encoder(NULL),
internal_source(false),
target_delay_ms(0),
start_state(NULL) {}
VideoCodec codec; VideoCodec codec;
RtpSendConfig rtp; RtpSendConfig rtp;