Add new codec for FlexFEC.
This CL does nothing except adding new strings and enums corresponding to the new codec. R=stefan@webrtc.org BUG=webrtc:5654 Review-Url: https://codereview.webrtc.org/2470103002 Cr-Commit-Position: refs/heads/master@{#14943}
This commit is contained in:
parent
d8048955fb
commit
87d7d77700
@ -1598,7 +1598,8 @@ bool IsFmtpParam(const std::string& name) {
|
||||
kCodecParamAssociatedPayloadType,
|
||||
cricket::kH264FmtpPacketizationMode,
|
||||
cricket::kH264FmtpLevelAsymmetryAllowed,
|
||||
cricket::kH264FmtpProfileLevelId};
|
||||
cricket::kH264FmtpProfileLevelId,
|
||||
cricket::kFlexfecFmtpRepairWindow};
|
||||
for (size_t i = 0; i < arraysize(kFmtpParams); ++i) {
|
||||
if (name.compare(kFmtpParams[i]) == 0) {
|
||||
return true;
|
||||
|
||||
@ -558,6 +558,7 @@ enum VideoCodecType {
|
||||
kVideoCodecI420,
|
||||
kVideoCodecRED,
|
||||
kVideoCodecULPFEC,
|
||||
kVideoCodecFlexfec,
|
||||
kVideoCodecGeneric,
|
||||
kVideoCodecUnknown
|
||||
};
|
||||
|
||||
@ -78,6 +78,7 @@ size_t EncodedImage::GetBufferPaddingBytes(VideoCodecType codec_type) {
|
||||
case kVideoCodecI420:
|
||||
case kVideoCodecRED:
|
||||
case kVideoCodecULPFEC:
|
||||
case kVideoCodecFlexfec:
|
||||
case kVideoCodecGeneric:
|
||||
case kVideoCodecUnknown:
|
||||
return 0;
|
||||
|
||||
@ -245,6 +245,9 @@ VideoCodec::CodecType VideoCodec::GetCodecType() const {
|
||||
if (_stricmp(payload_name, kUlpfecCodecName) == 0) {
|
||||
return CODEC_ULPFEC;
|
||||
}
|
||||
if (_stricmp(payload_name, kFlexfecCodecName) == 0) {
|
||||
return CODEC_FLEXFEC;
|
||||
}
|
||||
if (_stricmp(payload_name, kRtxCodecName) == 0) {
|
||||
return CODEC_RTX;
|
||||
}
|
||||
|
||||
@ -166,6 +166,7 @@ struct VideoCodec : public Codec {
|
||||
CODEC_VIDEO,
|
||||
CODEC_RED,
|
||||
CODEC_ULPFEC,
|
||||
CODEC_FLEXFEC,
|
||||
CODEC_RTX,
|
||||
};
|
||||
|
||||
|
||||
@ -239,10 +239,12 @@ TEST(CodecTest, TestGetCodecType) {
|
||||
const VideoCodec codec(96, "V");
|
||||
const VideoCodec rtx_codec(96, "rTx");
|
||||
const VideoCodec ulpfec_codec(96, "ulpFeC");
|
||||
const VideoCodec flexfec_codec(96, "FlExFeC-03");
|
||||
const VideoCodec red_codec(96, "ReD");
|
||||
EXPECT_EQ(VideoCodec::CODEC_VIDEO, codec.GetCodecType());
|
||||
EXPECT_EQ(VideoCodec::CODEC_RTX, rtx_codec.GetCodecType());
|
||||
EXPECT_EQ(VideoCodec::CODEC_ULPFEC, ulpfec_codec.GetCodecType());
|
||||
EXPECT_EQ(VideoCodec::CODEC_FLEXFEC, flexfec_codec.GetCodecType());
|
||||
EXPECT_EQ(VideoCodec::CODEC_RED, red_codec.GetCodecType());
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,13 @@ const char kRtxCodecName[] = "rtx";
|
||||
const char kRedCodecName[] = "red";
|
||||
const char kUlpfecCodecName[] = "ulpfec";
|
||||
|
||||
// TODO(brandtr): Change this to 'flexfec' when we are confident that the
|
||||
// header format is not changing anymore.
|
||||
const char kFlexfecCodecName[] = "flexfec-03";
|
||||
|
||||
// draft-ietf-payload-flexible-fec-scheme-02.txt
|
||||
const char kFlexfecFmtpRepairWindow[] = "repair-window";
|
||||
|
||||
const char kCodecParamAssociatedPayloadType[] = "apt";
|
||||
|
||||
const char kOpusCodecName[] = "opus";
|
||||
@ -106,6 +113,7 @@ const int kDefaultVp9PlType = 101;
|
||||
const int kDefaultH264PlType = 107;
|
||||
const int kDefaultRedPlType = 116;
|
||||
const int kDefaultUlpfecType = 117;
|
||||
const int kDefaultFlexfecPlType = 118;
|
||||
const int kDefaultRtxVp8PlType = 96;
|
||||
const int kDefaultRtxVp9PlType = 97;
|
||||
const int kDefaultRtxRedPlType = 98;
|
||||
|
||||
@ -29,6 +29,9 @@ extern const float kProcessCpuThreshold;
|
||||
extern const char kRtxCodecName[];
|
||||
extern const char kRedCodecName[];
|
||||
extern const char kUlpfecCodecName[];
|
||||
extern const char kFlexfecCodecName[];
|
||||
|
||||
extern const char kFlexfecFmtpRepairWindow[];
|
||||
|
||||
// Codec parameters
|
||||
extern const char kCodecParamAssociatedPayloadType[];
|
||||
@ -132,6 +135,7 @@ extern const int kDefaultVp9PlType;
|
||||
extern const int kDefaultH264PlType;
|
||||
extern const int kDefaultRedPlType;
|
||||
extern const int kDefaultUlpfecType;
|
||||
extern const int kDefaultFlexfecPlType;
|
||||
extern const int kDefaultRtxVp8PlType;
|
||||
extern const int kDefaultRtxVp9PlType;
|
||||
extern const int kDefaultRtxRedPlType;
|
||||
|
||||
@ -84,6 +84,7 @@ PayloadTypeMapper::PayloadTypeMapper()
|
||||
{{"minptime", "10"}, {"useinbandfec", "1"}}}, 111},
|
||||
{{kRedCodecName, 90000, 0}, kDefaultRedPlType},
|
||||
{{kUlpfecCodecName, 90000, 0}, kDefaultUlpfecType},
|
||||
{{kFlexfecCodecName, 90000, 0}, kDefaultFlexfecPlType},
|
||||
{{kDtmfCodecName, 8000, 1}, 126}}) {
|
||||
// TODO(ossu): Try to keep this as change-proof as possible until we're able
|
||||
// to remove the payload type constants from everywhere in the code.
|
||||
|
||||
@ -70,6 +70,7 @@ TEST_F(PayloadTypeMapperTest, WebRTCPayloadTypes) {
|
||||
EXPECT_EQ(kDefaultH264PlType, video_mapping(kH264CodecName));
|
||||
EXPECT_EQ(kDefaultRedPlType, video_mapping(kRedCodecName));
|
||||
EXPECT_EQ(kDefaultUlpfecType, video_mapping(kUlpfecCodecName));
|
||||
EXPECT_EQ(kDefaultFlexfecPlType, video_mapping(kFlexfecCodecName));
|
||||
|
||||
auto rtx_mapping = [this] (int payload_type) {
|
||||
return FindMapping({kRtxCodecName, kVideoCodecClockrate, 0,
|
||||
|
||||
@ -2513,6 +2513,11 @@ WebRtcVideoChannel2::MapCodecs(const std::vector<VideoCodec>& codecs) {
|
||||
continue;
|
||||
}
|
||||
|
||||
case VideoCodec::CODEC_FLEXFEC: {
|
||||
// TODO(brandtr): To be implemented.
|
||||
continue;
|
||||
}
|
||||
|
||||
case VideoCodec::CODEC_RTX: {
|
||||
int associated_payload_type;
|
||||
if (!in_codec.GetParam(kCodecParamAssociatedPayloadType,
|
||||
|
||||
@ -178,6 +178,7 @@ void VCMCodecDataBase::Codec(VideoCodecType codec_type, VideoCodec* settings) {
|
||||
return;
|
||||
case kVideoCodecRED:
|
||||
case kVideoCodecULPFEC:
|
||||
case kVideoCodecFlexfec:
|
||||
case kVideoCodecGeneric:
|
||||
case kVideoCodecUnknown:
|
||||
RTC_NOTREACHED();
|
||||
@ -350,6 +351,7 @@ bool VCMCodecDataBase::RequiresEncoderReset(const VideoCodec& new_send_codec) {
|
||||
case kVideoCodecI420:
|
||||
case kVideoCodecRED:
|
||||
case kVideoCodecULPFEC:
|
||||
case kVideoCodecFlexfec:
|
||||
break;
|
||||
// Unknown codec type, reset just to be sure.
|
||||
case kVideoCodecUnknown:
|
||||
|
||||
@ -40,6 +40,7 @@ void RtpFrameReferenceFinder::ManageFrame(
|
||||
}
|
||||
|
||||
switch (frame->codec_type()) {
|
||||
case kVideoCodecFlexfec:
|
||||
case kVideoCodecULPFEC:
|
||||
case kVideoCodecRED:
|
||||
case kVideoCodecUnknown:
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
const NSString * const kRTCRtxCodecMimeType = @(cricket::kRtxCodecName);
|
||||
const NSString * const kRTCRedCodecMimeType = @(cricket::kRedCodecName);
|
||||
const NSString * const kRTCUlpfecCodecMimeType = @(cricket::kUlpfecCodecName);
|
||||
const NSString * const kRTCFlexfecCodecMimeType = @(cricket::kFlexfecCodecName);
|
||||
const NSString * const kRTCOpusCodecMimeType = @(cricket::kOpusCodecName);
|
||||
const NSString * const kRTCIsacCodecMimeType = @(cricket::kIsacCodecName);
|
||||
const NSString * const kRTCL16CodecMimeType = @(cricket::kL16CodecName);
|
||||
|
||||
@ -17,6 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
RTC_EXTERN const NSString * const kRTCRtxCodecMimeType;
|
||||
RTC_EXTERN const NSString * const kRTCRedCodecMimeType;
|
||||
RTC_EXTERN const NSString * const kRTCUlpfecCodecMimeType;
|
||||
RTC_EXTERN const NSString * const kRTCFlexfecCodecMimeType;
|
||||
RTC_EXTERN const NSString * const kRTCOpusCodecMimeType;
|
||||
RTC_EXTERN const NSString * const kRTCIsacCodecMimeType;
|
||||
RTC_EXTERN const NSString * const kRTCL16CodecMimeType;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user