From 10418acb9790a82aa8f8368c8d6ba2459747149b Mon Sep 17 00:00:00 2001 From: sprang Date: Wed, 11 Jan 2017 05:51:56 -0800 Subject: [PATCH] Remove backwards compatibilty path for OpenH264 v1.4 Deps have rolled to 1.6, and since no one noticed that the old code path was broken and wouldn't even compile, I assume no one is using it. I therefore deem it time to clean away all these nasty ifdefs. ("const kNalHeaderSizeAllocation = 50;" doesn't declare a type) BUG=chromium:614970 Review-Url: https://codereview.webrtc.org/2622233002 Cr-Commit-Position: refs/heads/master@{#16008} --- .../codecs/h264/h264_encoder_impl.cc | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc index e6f9995675..722b0606ad 100644 --- a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc +++ b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc @@ -449,32 +449,14 @@ SEncParamExt H264EncoderImpl::CreateEncoderParams() const { << OPENH264_MINOR; switch (packetization_mode_) { case H264PacketizationMode::SingleNalUnit: -// Limit the size of the packets produced. -#if (OPENH264_MAJOR == 1) && (OPENH264_MINOR <= 5) - encoder_params.sSpatialLayers[0].sSliceCfg.uiSliceMode = SM_DYN_SLICE; - // The slice size is max payload size - room for a NAL header. - // The constant 50 is NAL_HEADER_ADD_0X30BYTES in openh264 source, - // but is not exported. - const kNalHeaderSizeAllocation = 50; - encoder_params.sSpatialLayers[0] - .sSliceCfg.sSliceArgument.uiSliceSizeConstraint = - static_cast(max_payload_size_ - - kNalHeaderSizeAllocation); - encoder_params.uiMaxNalSize = - static_cast(max_payload_size_); -#else + // Limit the size of the packets produced. encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceNum = 1; encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceMode = SM_SIZELIMITED_SLICE; encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceSizeConstraint = static_cast(max_payload_size_); -#endif break; case H264PacketizationMode::NonInterleaved: -#if (OPENH264_MAJOR == 1) && (OPENH264_MINOR <= 5) - // Slice num according to number of threads. - encoder_params.sSpatialLayers[0].sSliceCfg.uiSliceMode = SM_AUTO_SLICE; -#else // When uiSliceMode = SM_FIXEDSLCNUM_SLICE, uiSliceNum = 0 means auto // design it with cpu core number. // TODO(sprang): Set to 0 when we understand why the rate controller borks @@ -482,7 +464,6 @@ SEncParamExt H264EncoderImpl::CreateEncoderParams() const { encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceNum = 1; encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceMode = SM_FIXEDSLCNUM_SLICE; -#endif break; } return encoder_params;