Changeset 259452 in webkit
- Timestamp:
- Apr 3, 2020, 3:46:02 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 25 added
- 55 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r259440 r259452 1 2020-04-03 youenn fablet <youenn@apple.com> 2 3 Add initial support for WebRTC HEVC 4 https://bugs.webkit.org/show_bug.cgi?id=204283 5 6 Reviewed by Eric Carlson. 7 8 * TestExpectations: 9 * webrtc/h265-expected.txt: Added. 10 * webrtc/h265.html: Added. 11 1 12 2020-04-02 John Wilander <wilander@apple.com> 2 13 -
trunk/LayoutTests/TestExpectations
r259261 r259452 1778 1778 # Media Sessions is not yet enabled by default: ENABLE(MEDIA_SESSION) 1779 1779 media/session [ Skip ] 1780 1781 # Experimental H265 support. 1782 webrtc/h265.html [ Pass Failure ] 1780 1783 1781 1784 webrtc/simulcast-h264.html [ Slow ] -
trunk/Source/ThirdParty/libwebrtc/CMakeLists.txt
r259345 r259452 1405 1405 target_compile_definitions(webrtc PRIVATE 1406 1406 OPENSSL_NO_ASM 1407 DISABLE_H265 1407 1408 DYNAMIC_ANNOTATIONS_ENABLED=1 1408 1409 EXPAT_RELATIVE_PATH -
trunk/Source/ThirdParty/libwebrtc/ChangeLog
r259422 r259452 1 2020-04-03 youenn fablet <youenn@apple.com> 2 3 Add initial support for WebRTC HEVC 4 https://bugs.webkit.org/show_bug.cgi?id=204283 5 6 Reviewed by Eric Carlson. 7 8 Add H265 packetization/depacketization and ObjC H265 encoder/decoder. 9 Support is switchable using a boolean given to the decoder/encoder factories. 10 11 * Source/webrtc/api/video/video_codec_type.h: 12 * Source/webrtc/api/video_codecs/video_codec.cc: 13 * Source/webrtc/api/video_codecs/video_codec.h: 14 (webrtc::VideoCodecH265::operator!= const): 15 * Source/webrtc/api/video_codecs/video_encoder.cc: 16 * Source/webrtc/api/video_codecs/video_encoder.h: 17 * Source/webrtc/api/video_codecs/video_encoder_config.cc: 18 * Source/webrtc/api/video_codecs/video_encoder_config.h: 19 * Source/webrtc/build_overrides/build.gni: 20 * Source/webrtc/call/rtp_payload_params.cc: 21 * Source/webrtc/common_video/BUILD.gn: 22 * Source/webrtc/common_video/h265/h265_common.cc: Added. 23 * Source/webrtc/common_video/h265/h265_common.h: Added. 24 * Source/webrtc/common_video/h265/h265_pps_parser.cc: Added. 25 * Source/webrtc/common_video/h265/h265_pps_parser.h: Added. 26 * Source/webrtc/common_video/h265/h265_sps_parser.cc: Added. 27 * Source/webrtc/common_video/h265/h265_sps_parser.h: Added. 28 * Source/webrtc/common_video/h265/h265_vps_parser.cc: Added. 29 * Source/webrtc/common_video/h265/h265_vps_parser.h: Added. 30 * Source/webrtc/media/base/media_constants.cc: 31 * Source/webrtc/media/base/media_constants.h: 32 * Source/webrtc/modules/rtp_rtcp/BUILD.gn: 33 * Source/webrtc/modules/rtp_rtcp/source/create_video_rtp_depacketizer.cc: 34 * Source/webrtc/modules/rtp_rtcp/source/h265_sps_parser.cc: Added. 35 * Source/webrtc/modules/rtp_rtcp/source/h265_sps_parser.h: Added. 36 (webrtc::H265SpsParser::width): 37 (webrtc::H265SpsParser::height): 38 * Source/webrtc/modules/rtp_rtcp/source/rtp_format.cc: 39 * Source/webrtc/modules/rtp_rtcp/source/rtp_format_h265.cc: Added. 40 * Source/webrtc/modules/rtp_rtcp/source/rtp_format_h265.h: Added. 41 (webrtc::RtpPacketizerH265::Packet::Packet): 42 (webrtc::RtpPacketizerH265::PacketUnit::PacketUnit): 43 (webrtc::VideoRtpDepacketizerH265::~VideoRtpDepacketizerH265): 44 * Source/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc: 45 * Source/webrtc/modules/rtp_rtcp/source/rtp_video_header.h: 46 * Source/webrtc/modules/video_coding/BUILD.gn: 47 * Source/webrtc/modules/video_coding/codecs/h265/include/h265_globals.h: Added. 48 * Source/webrtc/modules/video_coding/encoded_frame.cc: 49 * Source/webrtc/modules/video_coding/h265_vps_sps_pps_tracker.cc: Added. 50 * Source/webrtc/modules/video_coding/h265_vps_sps_pps_tracker.h: Added. 51 * Source/webrtc/modules/video_coding/include/video_codec_interface.h: 52 * Source/webrtc/modules/video_coding/jitter_buffer_common.h: 53 * Source/webrtc/modules/video_coding/packet.cc: 54 * Source/webrtc/modules/video_coding/packet_buffer.cc: 55 * Source/webrtc/modules/video_coding/session_info.cc: 56 * Source/webrtc/modules/video_coding/session_info.h: 57 * Source/webrtc/rtc_base/experiments/min_video_bitrate_experiment.cc: 58 * Source/webrtc/sdk/WebKit/WebKitUtilities.h: 59 * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: 60 (webrtc::createWebKitEncoderFactory): 61 (webrtc::createWebKitDecoderFactory): 62 * Source/webrtc/sdk/objc/components/video_codec/RTCCodecSpecificInfoH265+Private.h: Copied from Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h. 63 * Source/webrtc/sdk/objc/components/video_codec/RTCCodecSpecificInfoH265.h: Added. 64 * Source/webrtc/sdk/objc/components/video_codec/RTCCodecSpecificInfoH265.mm: Added. 65 (-[RTCCodecSpecificInfoH265 nativeCodecSpecificInfo]): 66 * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: 67 * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: 68 (-[RTCDefaultVideoDecoderFactory initWithH265:]): 69 (-[RTCDefaultVideoDecoderFactory supportedCodecs]): 70 (-[RTCDefaultVideoDecoderFactory createDecoder:]): 71 * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: 72 * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: 73 (-[RTCDefaultVideoEncoderFactory initWithH265:]): 74 (+[RTCDefaultVideoEncoderFactory supportedCodecs]): 75 (-[RTCDefaultVideoEncoderFactory createEncoder:]): 76 (-[RTCDefaultVideoEncoderFactory supportedCodecs]): 77 * Source/webrtc/sdk/objc/components/video_codec/RTCH265ProfileLevelId.h: Copied from Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h. 78 * Source/webrtc/sdk/objc/components/video_codec/RTCH265ProfileLevelId.mm: Added. 79 * Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH265.h: Copied from Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h. 80 * Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH265.mm: Added. 81 (RTCH265FrameDecodeParams::RTCH265FrameDecodeParams): 82 (h265DecompressionOutputCallback): 83 (-[RTCVideoDecoderH265 init]): 84 (-[RTCVideoDecoderH265 dealloc]): 85 (-[RTCVideoDecoderH265 startDecodeWithNumberOfCores:]): 86 (-[RTCVideoDecoderH265 decode:missingFrames:codecSpecificInfo:renderTimeMs:]): 87 (-[RTCVideoDecoderH265 setCallback:]): 88 (-[RTCVideoDecoderH265 releaseDecoder]): 89 (-[RTCVideoDecoderH265 resetDecompressionSession]): 90 (-[RTCVideoDecoderH265 configureDecompressionSession]): 91 (-[RTCVideoDecoderH265 destroyDecompressionSession]): 92 (-[RTCVideoDecoderH265 setVideoFormat:]): 93 (-[RTCVideoDecoderH265 implementationName]): 94 * Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH265.h: Copied from Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h. 95 * Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH265.mm: Added. 96 (-[RTCVideoEncoderH265 initWithCodecInfo:]): 97 (-[RTCVideoEncoderH265 dealloc]): 98 (-[RTCVideoEncoderH265 startEncodeWithSettings:numberOfCores:]): 99 (-[RTCVideoEncoderH265 encode:codecSpecificInfo:frameTypes:]): 100 (-[RTCVideoEncoderH265 setCallback:]): 101 (-[RTCVideoEncoderH265 setBitrate:framerate:]): 102 (-[RTCVideoEncoderH265 releaseEncoder]): 103 (-[RTCVideoEncoderH265 resetCompressionSession]): 104 (-[RTCVideoEncoderH265 configureCompressionSession]): 105 (-[RTCVideoEncoderH265 destroyCompressionSession]): 106 (-[RTCVideoEncoderH265 implementationName]): 107 (-[RTCVideoEncoderH265 setBitrateBps:]): 108 (-[RTCVideoEncoderH265 setEncoderBitrateBps:]): 109 (-[RTCVideoEncoderH265 frameWasEncoded:flags:sampleBuffer:width:height:renderTimeMs:timestamp:rotation:]): 110 (-[RTCVideoEncoderH265 scalingSettings]): 111 * Source/webrtc/sdk/objc/components/video_codec/nalu_rewriter.cc: 112 * Source/webrtc/sdk/objc/components/video_codec/nalu_rewriter.h: 113 * Source/webrtc/sdk/objc/native/src/objc_video_decoder_factory.mm: 114 (webrtc::ObjCVideoDecoderFactory::CreateVideoDecoder): 115 * Source/webrtc/sdk/objc/native/src/objc_video_encoder_factory.mm: 116 (webrtc::ObjCVideoEncoderFactory::CreateVideoEncoder): 117 * Source/webrtc/video/rtp_video_stream_receiver.cc: 118 * Source/webrtc/video/rtp_video_stream_receiver.h: 119 * Source/webrtc/video/send_statistics_proxy.cc: 120 * Source/webrtc/video/video_receive_stream.cc: 121 * Source/webrtc/video/video_stream_encoder.cc: 122 * libwebrtc.xcodeproj/project.pbxproj: 123 1 124 2020-04-02 Keith Rollin <krollin@apple.com> 2 125 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/api/video/video_codec_type.h
r259345 r259452 23 23 kVideoCodecAV1, 24 24 kVideoCodecH264, 25 #ifndef DISABLE_H265 26 kVideoCodecH265, 27 #endif 25 28 kVideoCodecMultiplex, 26 29 }; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/api/video_codecs/video_codec.cc
r259345 r259452 26 26 constexpr char kPayloadNameAv1[] = "AV1X"; 27 27 constexpr char kPayloadNameH264[] = "H264"; 28 #ifndef DISABLE_H265 29 constexpr char kPayloadNameH265[] = "H265"; 30 #endif 28 31 constexpr char kPayloadNameGeneric[] = "Generic"; 29 32 constexpr char kPayloadNameMultiplex[] = "Multiplex"; … … 56 59 numberOfTemporalLayers == other.numberOfTemporalLayers); 57 60 } 61 62 #ifndef DISABLE_H265 63 bool VideoCodecH265::operator==(const VideoCodecH265& other) const { 64 return (frameDroppingOn == other.frameDroppingOn && 65 keyFrameInterval == other.keyFrameInterval && 66 vpsLen == other.vpsLen && spsLen == other.spsLen && 67 ppsLen == other.ppsLen && 68 (spsLen == 0 || memcmp(spsData, other.spsData, spsLen) == 0) && 69 (ppsLen == 0 || memcmp(ppsData, other.ppsData, ppsLen) == 0)); 70 } 71 #endif 58 72 59 73 bool SpatialLayer::operator==(const SpatialLayer& other) const { … … 116 130 } 117 131 132 #ifndef DISABLE_H265 133 VideoCodecH265* VideoCodec::H265() { 134 RTC_DCHECK_EQ(codecType, kVideoCodecH265); 135 return &codec_specific_.H265; 136 } 137 138 const VideoCodecH265& VideoCodec::H265() const { 139 RTC_DCHECK_EQ(codecType, kVideoCodecH265); 140 return codec_specific_.H265; 141 } 142 #endif 143 118 144 const char* CodecTypeToPayloadString(VideoCodecType type) { 119 145 switch (type) { … … 126 152 case kVideoCodecH264: 127 153 return kPayloadNameH264; 154 #ifndef DISABLE_H265 155 case kVideoCodecH265: 156 return kPayloadNameH265; 157 #endif 128 158 case kVideoCodecMultiplex: 129 159 return kPayloadNameMultiplex; … … 142 172 if (absl::EqualsIgnoreCase(name, kPayloadNameH264)) 143 173 return kVideoCodecH264; 174 #ifndef DISABLE_H265 175 if (absl::EqualsIgnoreCase(name, kPayloadNameH265)) 176 return kVideoCodecH265; 177 #endif 144 178 if (absl::EqualsIgnoreCase(name, kPayloadNameMultiplex)) 145 179 return kVideoCodecMultiplex; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/api/video_codecs/video_codec.h
r259345 r259452 85 85 }; 86 86 87 #ifndef DISABLE_H265 88 struct VideoCodecH265 { 89 bool operator==(const VideoCodecH265& other) const; 90 bool operator!=(const VideoCodecH265& other) const { 91 return !(*this == other); 92 } 93 bool frameDroppingOn; 94 int keyFrameInterval; 95 const uint8_t* vpsData; 96 size_t vpsLen; 97 const uint8_t* spsData; 98 size_t spsLen; 99 const uint8_t* ppsData; 100 size_t ppsLen; 101 }; 102 #endif 103 87 104 // Translates from name of codec to codec type and vice versa. 88 105 RTC_EXPORT const char* CodecTypeToPayloadString(VideoCodecType type); … … 93 110 VideoCodecVP9 VP9; 94 111 VideoCodecH264 H264; 112 #ifndef DISABLE_H265 113 VideoCodecH265 H265; 114 #endif 95 115 }; 96 116 … … 160 180 VideoCodecH264* H264(); 161 181 const VideoCodecH264& H264() const; 182 #ifndef DISABLE_H265 183 VideoCodecH265* H265(); 184 const VideoCodecH265& H265() const; 185 #endif 162 186 163 187 private: -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/api/video_codecs/video_encoder.cc
r259345 r259452 60 60 return h264_settings; 61 61 } 62 63 #ifndef DISABLE_H265 64 VideoCodecH265 VideoEncoder::GetDefaultH265Settings() { 65 VideoCodecH265 h265_settings; 66 memset(&h265_settings, 0, sizeof(h265_settings)); 67 68 // h265_settings.profile = kProfileBase; 69 h265_settings.frameDroppingOn = true; 70 h265_settings.keyFrameInterval = 3000; 71 h265_settings.spsData = nullptr; 72 h265_settings.spsLen = 0; 73 h265_settings.ppsData = nullptr; 74 h265_settings.ppsLen = 0; 75 76 return h265_settings; 77 } 78 #endif 62 79 63 80 VideoEncoder::ScalingSettings::ScalingSettings() = default; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/api/video_codecs/video_encoder.h
r259345 r259452 321 321 static VideoCodecVP9 GetDefaultVp9Settings(); 322 322 static VideoCodecH264 GetDefaultH264Settings(); 323 #ifndef DISABLE_H265 324 static VideoCodecH265 GetDefaultH265Settings(); 325 #endif 323 326 324 327 virtual ~VideoEncoder() {} -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/api/video_codecs/video_encoder_config.cc
r259345 r259452 94 94 } else if (codec->codecType == kVideoCodecVP9) { 95 95 FillVideoCodecVp9(codec->VP9()); 96 #ifndef DISABLE_H265 97 } else if (codec->codecType == kVideoCodecH265) { 98 FillVideoCodecH265(codec->H265()); 99 #endif 96 100 } else { 97 101 RTC_NOTREACHED() << "Encoder specifics set/used for unknown codec type."; … … 103 107 RTC_NOTREACHED(); 104 108 } 109 110 #ifndef DISABLE_H265 111 void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecH265( 112 VideoCodecH265* h265_settings) const { 113 RTC_NOTREACHED(); 114 } 115 #endif 105 116 106 117 void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecVp8( … … 123 134 } 124 135 136 #ifndef DISABLE_H265 137 VideoEncoderConfig::H265EncoderSpecificSettings::H265EncoderSpecificSettings( 138 const VideoCodecH265& specifics) 139 : specifics_(specifics) {} 140 141 void VideoEncoderConfig::H265EncoderSpecificSettings::FillVideoCodecH265( 142 VideoCodecH265* h265_settings) const { 143 *h265_settings = specifics_; 144 } 145 #endif 146 125 147 VideoEncoderConfig::Vp8EncoderSpecificSettings::Vp8EncoderSpecificSettings( 126 148 const VideoCodecVP8& specifics) -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/api/video_codecs/video_encoder_config.h
r259345 r259452 85 85 virtual void FillVideoCodecVp9(VideoCodecVP9* vp9_settings) const; 86 86 virtual void FillVideoCodecH264(VideoCodecH264* h264_settings) const; 87 #ifndef DISABLE_H265 88 virtual void FillVideoCodecH265(VideoCodecH265* h265_settings) const; 89 #endif 87 90 88 91 private: … … 99 102 VideoCodecH264 specifics_; 100 103 }; 104 105 #ifndef DISABLE_H265 106 class H265EncoderSpecificSettings : public EncoderSpecificSettings { 107 public: 108 explicit H265EncoderSpecificSettings(const VideoCodecH265& specifics); 109 void FillVideoCodecH265(VideoCodecH265* h265_settings) const override; 110 111 private: 112 VideoCodecH265 specifics_; 113 }; 114 #endif 101 115 102 116 class Vp8EncoderSpecificSettings : public EncoderSpecificSettings { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/build_overrides/build.gni
r238967 r259452 36 36 ignore_elf32_limitations = true 37 37 38 if (is_win || is_ios || is_android) { 39 rtc_use_h265 = true 40 } else { 41 rtc_use_h265 = false 42 } 43 38 44 # Use bundled hermetic Xcode installation maintainted by Chromium, 39 45 # except for local iOS builds where it's unsupported. -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/call/rtp_payload_params.cc
r259345 r259452 106 106 return; 107 107 } 108 #ifndef DISABLE_H265 109 case kVideoCodecH265: { 110 auto h265_header = rtp->video_type_header.emplace<RTPVideoHeaderH265>(); 111 h265_header.packetization_mode = 112 info.codecSpecific.H265.packetization_mode; 113 } 114 return; 115 #endif 108 116 case kVideoCodecMultiplex: 109 117 case kVideoCodecGeneric: … … 301 309 } 302 310 return; 311 #ifndef DISABLE_H265 312 case VideoCodecType::kVideoCodecH265: 313 #endif 303 314 case VideoCodecType::kVideoCodecMultiplex: 304 315 return; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/BUILD.gn
r259345 r259452 41 41 "video_render_frames.h", 42 42 ] 43 44 if (rtc_use_h265) { 45 sources += [ 46 "h265/h265_common.cc", 47 "h265/h265_common.h", 48 "h265/h265_pps_parser.cc", 49 "h265/h265_pps_parser.h", 50 "h265/h265_sps_parser.cc", 51 "h265/h265_sps_parser.h", 52 "h265/h265_vps_parser.cc", 53 "h265/h265_vps_parser.h", 54 ] 55 } 43 56 44 57 deps = [ -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/media/base/media_constants.cc
r259345 r259452 108 108 const char kAv1CodecName[] = "AV1X"; 109 109 const char kH264CodecName[] = "H264"; 110 #ifndef DISABLE_H265 111 const char kH265CodecName[] = "H265"; 112 #endif 110 113 111 114 // RFC 6184 RTP Payload Format for H.264 video … … 115 118 const char kH264FmtpSpropParameterSets[] = "sprop-parameter-sets"; 116 119 const char kH264ProfileLevelConstrainedBaseline[] = "42e01f"; 120 #ifndef DISABLE_H265 121 // RFC 7798 RTP Payload Format for H.265 video 122 const char kH265FmtpProfileSpace[] = "profile-space"; 123 const char kH265FmtpProfileId[] = "profile-id"; 124 const char kH265FmtpTierFlag[] = "tier-flag"; 125 const char kH265FmtpLevelId[] = "level-id"; 126 #endif 117 127 118 128 const int kDefaultVideoMaxFramerate = 60; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/media/base/media_constants.h
r259345 r259452 137 137 RTC_EXPORT extern const char kAv1CodecName[]; 138 138 RTC_EXPORT extern const char kH264CodecName[]; 139 #ifndef DISABLE_H265 140 RTC_EXPORT extern const char kH265CodecName[]; 141 #endif 139 142 140 143 // RFC 6184 RTP Payload Format for H.264 video … … 144 147 extern const char kH264FmtpSpropParameterSets[]; 145 148 extern const char kH264ProfileLevelConstrainedBaseline[]; 149 150 #ifndef DISABLE_H265 151 // RFC 7798 RTP Payload Format for H.265 video 152 RTC_EXPORT extern const char kH265FmtpProfileSpace[]; 153 RTC_EXPORT extern const char kH265FmtpProfileId[]; 154 RTC_EXPORT extern const char kH265FmtpTierFlag[]; 155 RTC_EXPORT extern const char kH265FmtpLevelId[]; 156 #endif 146 157 147 158 extern const int kDefaultVideoMaxFramerate; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/rtp_rtcp/BUILD.gn
r259345 r259452 235 235 } else { 236 236 defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ] 237 } 238 239 if (rtc_use_h265) { 240 sources += [ 241 "source/rtp_format_h265.cc", 242 "source/rtp_format_h265.h", 243 ] 244 } 245 246 if (!rtc_use_h265) { 247 defines += ["DISABLE_H265"] 237 248 } 238 249 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/rtp_rtcp/source/create_video_rtp_depacketizer.cc
r259345 r259452 14 14 15 15 #include "api/video/video_codec_type.h" 16 #ifndef DISABLE_H265 17 #include "modules/rtp_rtcp/source/rtp_format_h265.h" 18 #endif 16 19 #include "modules/rtp_rtcp/source/video_rtp_depacketizer.h" 17 20 #include "modules/rtp_rtcp/source/video_rtp_depacketizer_av1.h" … … 28 31 case kVideoCodecH264: 29 32 return std::make_unique<VideoRtpDepacketizerH264>(); 33 #ifndef DISABLE_H265 34 case kVideoCodecH265: 35 return std::make_unique<VideoRtpDepacketizerH265>(); 36 #endif 30 37 case kVideoCodecVP8: 31 38 return std::make_unique<VideoRtpDepacketizerVp8>(); -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/rtp_rtcp/source/rtp_format.cc
r259345 r259452 15 15 #include "absl/types/variant.h" 16 16 #include "modules/rtp_rtcp/source/rtp_format_h264.h" 17 #ifndef DISABLE_H265 18 #include "modules/rtp_rtcp/source/rtp_format_h265.h" 19 #endif 17 20 #include "modules/rtp_rtcp/source/rtp_format_video_generic.h" 18 21 #include "modules/rtp_rtcp/source/rtp_format_vp8.h" … … 20 23 #include "modules/rtp_rtcp/source/rtp_packetizer_av1.h" 21 24 #include "modules/video_coding/codecs/h264/include/h264_globals.h" 25 #ifndef DISABLE_H265 26 #include "modules/video_coding/codecs/h265/include/h265_globals.h" 27 #endif 22 28 #include "modules/video_coding/codecs/vp8/include/vp8_globals.h" 23 29 #include "modules/video_coding/codecs/vp9/include/vp9_globals.h" … … 46 52 payload, limits, h264.packetization_mode, *fragmentation); 47 53 } 54 #ifndef DISABLE_H265 55 case kVideoCodecH265: { 56 RTC_CHECK(fragmentation); 57 const auto& h265 = 58 absl::get<RTPVideoHeaderH265>(rtp_video_header.video_type_header); 59 return absl::make_unique<RtpPacketizerH265>( 60 payload, limits, h265.packetization_mode, *fragmentation); 61 } 62 #endif 48 63 case kVideoCodecVP8: { 49 64 const auto& vp8 = -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
r259345 r259452 800 800 } 801 801 uint8_t operator()(const RTPVideoHeaderH264&) { return kNoTemporalIdx; } 802 #ifndef DISABLE_H265 803 uint8_t operator()(const RTPVideoHeaderH265&) { return kNoTemporalIdx; } 804 #endif 802 805 uint8_t operator()(const RTPVideoHeaderLegacyGeneric&) { 803 806 return kNoTemporalIdx; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/rtp_rtcp/source/rtp_video_header.h
r259345 r259452 26 26 #include "common_types.h" // NOLINT(build/include) 27 27 #include "modules/video_coding/codecs/h264/include/h264_globals.h" 28 #ifndef DISABLE_H265 29 #include "modules/video_coding/codecs/h265/include/h265_globals.h" 30 #endif 28 31 #include "modules/video_coding/codecs/vp8/include/vp8_globals.h" 29 32 #include "modules/video_coding/codecs/vp9/include/vp9_globals.h" … … 37 40 }; 38 41 42 #ifndef DISABLE_H265 43 using RTPVideoTypeHeader = absl::variant<absl::monostate, 44 RTPVideoHeaderVP8, 45 RTPVideoHeaderVP9, 46 RTPVideoHeaderH264, 47 RTPVideoHeaderH265, 48 RTPVideoHeaderLegacyGeneric>; 49 #else 39 50 using RTPVideoTypeHeader = absl::variant<absl::monostate, 40 51 RTPVideoHeaderVP8, … … 42 53 RTPVideoHeaderH264, 43 54 RTPVideoHeaderLegacyGeneric>; 55 #endif 44 56 45 57 struct RTPVideoHeader { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/BUILD.gn
r259345 r259452 15 15 "encoded_frame.h", 16 16 ] 17 18 if (rtc_use_h265) { 19 sources += [ 20 "h265_vps_sps_pps_tracker.cc", 21 "h265_vps_sps_pps_tracker.h", 22 ] 23 } 24 17 25 deps = [ 18 26 ":codec_globals_headers", -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/encoded_frame.cc
r259345 r259452 152 152 break; 153 153 } 154 #ifndef DISABLE_H265 155 case kVideoCodecH265: { 156 _codecSpecificInfo.codecType = kVideoCodecH265; 157 break; 158 } 159 #endif 154 160 default: { 155 161 _codecSpecificInfo.codecType = kVideoCodecGeneric; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/include/video_codec_interface.h
r259345 r259452 21 21 #include "modules/include/module_common_types.h" 22 22 #include "modules/video_coding/codecs/h264/include/h264_globals.h" 23 #ifndef DISABLE_H265 24 #include "modules/video_coding/codecs/h265/include/h265_globals.h" 25 #endif 23 26 #include "modules/video_coding/codecs/vp9/include/vp9_globals.h" 24 27 #include "modules/video_coding/include/video_error_codes.h" … … 93 96 static_assert(std::is_pod<CodecSpecificInfoH264>::value, ""); 94 97 98 #ifndef DISABLE_H265 99 struct CodecSpecificInfoH265 { 100 H265PacketizationMode packetization_mode; 101 bool idr_frame; 102 }; 103 #endif 104 95 105 union CodecSpecificInfoUnion { 96 106 CodecSpecificInfoVP8 VP8; 97 107 CodecSpecificInfoVP9 VP9; 98 108 CodecSpecificInfoH264 H264; 109 #ifndef DISABLE_H265 110 CodecSpecificInfoH265 H265; 111 #endif 99 112 }; 100 113 static_assert(std::is_pod<CodecSpecificInfoUnion>::value, ""); -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/jitter_buffer_common.h
r252472 r259452 55 55 56 56 enum { kH264StartCodeLengthBytes = 4 }; 57 #ifndef DISABLE_H265 58 enum { kH265StartCodeLengthBytes = 4 }; 59 #endif 57 60 } // namespace webrtc 58 61 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/packet.cc
r252472 r259452 45 45 timesNacked(-1), 46 46 completeNALU(kNaluIncomplete), 47 insertStartCode(videoHeader.codec == kVideoCodecH264 && 47 #ifndef DISABLE_H265 48 insertStartCode((videoHeader.codec == kVideoCodecH264 || videoHeader.codec == kVideoCodecH265) && 48 49 videoHeader.is_first_packet_in_frame), 50 #else 51 insertStartCode(videoHeader.codec == kVideoCodecH264 && 52 videoHeader.is_first_packet_in_frame), 53 #endif 49 54 video_header(videoHeader), 50 55 packet_info(rtp_header, receive_time_ms) { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/packet_buffer.cc
r259345 r259452 25 25 #include "api/video/video_frame_type.h" 26 26 #include "common_video/h264/h264_common.h" 27 #ifndef DISABLE_H265 28 #include "common_video/h265/h265_common.h" 29 #endif 27 30 #include "modules/rtp_rtcp/source/rtp_header_extensions.h" 28 31 #include "modules/rtp_rtcp/source/rtp_packet_received.h" … … 30 33 #include "modules/rtp_rtcp/source/video_rtp_depacketizer_av1.h" 31 34 #include "modules/video_coding/codecs/h264/include/h264_globals.h" 35 #ifndef DISABLE_H265 36 #include "modules/video_coding/codecs/h265/include/h265_globals.h" 37 #endif 32 38 #include "modules/video_coding/frame_object.h" 33 39 #include "rtc_base/checks.h" … … 290 296 bool has_h264_idr = false; 291 297 bool is_h264_keyframe = false; 298 bool is_h265 = false; 299 #ifndef DISABLE_H265 300 is_h265 = buffer_[start_index].packet->codec() == kVideoCodecH265; 301 bool has_h265_sps = false; 302 bool has_h265_pps = false; 303 bool has_h265_idr = false; 304 bool is_h265_keyframe = false; 305 #endif 292 306 int idr_width = -1; 293 307 int idr_height = -1; … … 295 309 ++tested_packets; 296 310 297 if (!is_h264 && buffer_[start_index].frame_begin())311 if (!is_h264 && !is_h265 && buffer_[start_index].frame_begin()) 298 312 break; 299 313 … … 328 342 } 329 343 } 330 344 #ifndef DISABLE_H265 345 if (is_h265 && !is_h265_keyframe) { 346 const auto* h265_header = absl::get_if<RTPVideoHeaderH265>( 347 &buffer_[start_index].packet->video_header.video_type_header); 348 if (!h265_header || h265_header->nalus_length >= kMaxNalusPerPacket) 349 return found_frames; 350 for (size_t j = 0; j < h265_header->nalus_length; ++j) { 351 if (h265_header->nalus[j].type == H265::NaluType::kSps) { 352 has_h265_sps = true; 353 } else if (h265_header->nalus[j].type == H265::NaluType::kPps) { 354 has_h265_pps = true; 355 } else if (h265_header->nalus[j].type == H265::NaluType::kIdrWRadl 356 || h265_header->nalus[j].type == H265::NaluType::kIdrNLp 357 || h265_header->nalus[j].type == H265::NaluType::kCra) { 358 has_h265_idr = true; 359 } 360 } 361 if ((has_h265_sps && has_h265_pps) || has_h265_idr) { 362 is_h265_keyframe = true; 363 } 364 } 365 #endif 331 366 if (tested_packets == buffer_.size()) 332 367 break; … … 340 375 // the PacketBuffer to hand out incomplete frames. 341 376 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=7106 342 if ( is_h264&&377 if ((is_h264 || is_h265) && 343 378 (!buffer_[start_index].used() || 344 379 buffer_[start_index].packet->timestamp != frame_timestamp)) { … … 394 429 } 395 430 431 #ifndef DISABLE_H265 432 if (is_h265) { 433 // Warn if this is an unsafe frame. 434 if (has_h265_idr && (!has_h265_sps || !has_h265_pps)) { 435 std::stringstream ss; 436 ss << "Received H.265-IDR frame " 437 << "(SPS: " << has_h265_sps << ", PPS: " << has_h265_pps << "). "; 438 ss << "Treating as delta frame since " 439 "WebRTC-SpsPpsIdrIsH265Keyframe is always enabled."; 440 RTC_LOG(LS_WARNING) << ss.str(); 441 } 442 443 // Now that we have decided whether to treat this frame as a key frame 444 // or delta frame in the frame buffer, we update the field that 445 // determines if the RtpFrameObject is a key frame or delta frame. 446 const size_t first_packet_index = start_seq_num % buffer_.size(); 447 RTC_CHECK_LT(first_packet_index, buffer_.size()); 448 if (is_h265_keyframe) { 449 buffer_[first_packet_index].packet->video_header.frame_type = VideoFrameType::kVideoFrameKey; 450 } else { 451 buffer_[first_packet_index].packet->video_header.frame_type = VideoFrameType::kVideoFrameDelta; 452 } 453 454 // If this is not a key frame, make sure there are no gaps in the 455 // packet sequence numbers up until this point. 456 if (!is_h265_keyframe && missing_packets_.upper_bound(start_seq_num) != 457 missing_packets_.begin()) { 458 uint16_t stop_index = (index + 1) % buffer_.size(); 459 while (start_index != stop_index) { 460 // FIXME: find what it does. 461 //sequence_buffer_[start_index].frame_created = false; 462 start_index = (start_index + 1) % buffer_.size(); 463 } 464 465 return found_frames; 466 } 467 } 468 #endif 469 396 470 if (auto frame = AssembleFrame(start_seq_num, seq_num)) { 397 471 found_frames.push_back(std::move(frame)); … … 400 474 << start_seq_num << "-" << seq_num; 401 475 } 476 402 477 403 478 missing_packets_.erase(missing_packets_.begin(), -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/session_info.cc
r259345 r259452 154 154 } 155 155 156 #ifndef DISABLE_H265 157 std::vector<H265NaluInfo> VCMSessionInfo::GetH265NaluInfos() const { 158 if (packets_.empty() || packets_.front().video_header.codec != kVideoCodecH265) 159 return std::vector<H265NaluInfo>(); 160 std::vector<H265NaluInfo> nalu_infos; 161 for (const VCMPacket& packet : packets_) { 162 const auto& h265 = 163 absl::get<RTPVideoHeaderH265>(packet.video_header.video_type_header); 164 for (size_t i = 0; i < h265.nalus_length; ++i) { 165 nalu_infos.push_back(h265.nalus[i]); 166 } 167 } 168 return nalu_infos; 169 } 170 #endif 171 156 172 void VCMSessionInfo::SetGofInfo(const GofInfoVP9& gof_info, size_t idx) { 157 173 if (packets_.empty()) … … 212 228 // header supplied by the H264 depacketizer. 213 229 const size_t kH264NALHeaderLengthInBytes = 1; 230 #ifndef DISABLE_H265 231 const size_t kH265NALHeaderLengthInBytes = 2; 232 const auto* h265 = 233 absl::get_if<RTPVideoHeaderH265>(&packet.video_header.video_type_header); 234 #endif 214 235 const size_t kLengthFieldLength = 2; 215 236 const auto* h264 = … … 237 258 return packet.sizeBytes; 238 259 } 260 #ifndef DISABLE_H265 261 else if (h265 && h265->packetization_type == kH265AP) { 262 // Similar to H264, for H265 aggregation packets, we rely on jitter buffer 263 // to remove the two length bytes between each NAL unit, and potentially add 264 // start codes. 265 size_t required_length = 0; 266 const uint8_t* nalu_ptr = 267 packet_buffer + kH265NALHeaderLengthInBytes; // skip payloadhdr 268 while (nalu_ptr < packet_buffer + packet.sizeBytes) { 269 size_t length = BufferToUWord16(nalu_ptr); 270 required_length += 271 length + (packet.insertStartCode ? kH265StartCodeLengthBytes : 0); 272 nalu_ptr += kLengthFieldLength + length; 273 } 274 ShiftSubsequentPackets(packet_it, required_length); 275 nalu_ptr = packet_buffer + kH265NALHeaderLengthInBytes; 276 uint8_t* frame_buffer_ptr = frame_buffer + offset; 277 while (nalu_ptr < packet_buffer + packet.sizeBytes) { 278 size_t length = BufferToUWord16(nalu_ptr); 279 nalu_ptr += kLengthFieldLength; 280 // since H265 shares the same start code as H264, use the same Insert 281 // function to handle start code. 282 frame_buffer_ptr += Insert(nalu_ptr, length, packet.insertStartCode, 283 const_cast<uint8_t*>(frame_buffer_ptr)); 284 nalu_ptr += length; 285 } 286 packet.sizeBytes = required_length; 287 return packet.sizeBytes; 288 } 289 #endif 239 290 ShiftSubsequentPackets( 240 291 packet_it, packet.sizeBytes + … … 463 514 last_packet_seq_num_ = packet.seqNum; 464 515 } 516 #ifndef DISABLE_H265 517 } else if (packet.codec() == kVideoCodecH265) { 518 frame_type_ = packet.video_header.frame_type; 519 if (packet.is_first_packet_in_frame() && 520 (first_packet_seq_num_ == -1 || 521 IsNewerSequenceNumber(first_packet_seq_num_, packet.seqNum))) { 522 first_packet_seq_num_ = packet.seqNum; 523 } 524 if (packet.markerBit && 525 (last_packet_seq_num_ == -1 || 526 IsNewerSequenceNumber(packet.seqNum, last_packet_seq_num_))) { 527 last_packet_seq_num_ = packet.seqNum; 528 } 529 #else 465 530 } else { 531 #endif 466 532 // Only insert media packets between first and last packets (when 467 533 // available). -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/session_info.h
r252472 r259452 66 66 67 67 std::vector<NaluInfo> GetNaluInfos() const; 68 68 #ifndef DISABLE_H265 69 std::vector<H265NaluInfo> GetH265NaluInfos() const; 70 #endif 69 71 void SetGofInfo(const GofInfoVP9& gof_info, size_t idx); 70 72 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/experiments/min_video_bitrate_experiment.cc
r259345 r259452 101 101 case kVideoCodecH264: 102 102 return min_bitrate_h264.GetOptional(); 103 #ifndef DISABLE_H265 104 case kVideoCodecH265: 105 #endif 103 106 case kVideoCodecGeneric: 104 107 case kVideoCodecMultiplex: -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.h
r254050 r259452 40 40 class VideoFrame; 41 41 42 enum class WebKitCodecSupport { H264 , H264AndVP8 };42 enum class WebKitCodecSupport { H264VP8AndH265, H264AndVP8 }; 43 43 44 44 std::unique_ptr<webrtc::VideoEncoderFactory> createWebKitEncoderFactory(WebKitCodecSupport); -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.mm
r254050 r259452 117 117 #endif 118 118 119 auto internalFactory = ObjCToNativeVideoEncoderFactory( codecSupport == WebKitCodecSupport::H264AndVP8 ? [[RTCDefaultVideoEncoderFactory alloc] init] : [[RTCVideoEncoderFactoryH264 alloc] init]);119 auto internalFactory = ObjCToNativeVideoEncoderFactory([[RTCDefaultVideoEncoderFactory alloc] initWithH265: codecSupport == WebKitCodecSupport::H264VP8AndH265]); 120 120 return std::make_unique<VideoEncoderFactoryWithSimulcast>(std::move(internalFactory)); 121 121 } … … 272 272 std::unique_ptr<webrtc::VideoDecoderFactory> createWebKitDecoderFactory(WebKitCodecSupport codecSupport) 273 273 { 274 auto internalFactory = ObjCToNativeVideoDecoderFactory( codecSupport == WebKitCodecSupport::H264AndVP8 ? [[RTCDefaultVideoDecoderFactory alloc] init] : [[RTCVideoDecoderFactoryH264 alloc] init]);274 auto internalFactory = ObjCToNativeVideoDecoderFactory([[RTCDefaultVideoDecoderFactory alloc] initWithH265: codecSupport == WebKitCodecSupport::H264VP8AndH265]); 275 275 if (videoDecoderCallbacks().createCallback) 276 276 return std::make_unique<RemoteVideoDecoderFactory>(std::move(internalFactory)); -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCCodecSpecificInfoH265+Private.h
r259451 r259452 8 8 * be found in the AUTHORS file in the root of the source tree. 9 9 */ 10 /* This file is borrowed from sdk/objc/components/video_codec/RTCCodecSpecificInfoH264+Private.h */ 10 11 11 #import <Foundation/Foundation.h>12 #import "RTCCodecSpecificInfoH265.h" 12 13 13 #import "RTCMacros.h" 14 #import "RTCVideoDecoderFactory.h" 14 #include "modules/video_coding/include/video_codec_interface.h" 15 15 16 16 NS_ASSUME_NONNULL_BEGIN 17 17 18 /** This decoder factory include support for all codecs bundled with WebRTC. If using custom 19 * codecs, create custom implementations of RTCVideoEncoderFactory and RTCVideoDecoderFactory. 20 */ 21 RTC_OBJC_EXPORT 22 __attribute__((objc_runtime_name("WK_RTCDefaultVideoDecoderFactory"))) 23 @interface RTCDefaultVideoDecoderFactory : NSObject <RTCVideoDecoderFactory> 18 /* Interfaces for converting to/from internal C++ formats. */ 19 @interface RTCCodecSpecificInfoH265 () 20 21 - (webrtc::CodecSpecificInfo)nativeCodecSpecificInfo; 22 24 23 @end 25 24 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h
r237075 r259452 22 22 __attribute__((objc_runtime_name("WK_RTCDefaultVideoDecoderFactory"))) 23 23 @interface RTCDefaultVideoDecoderFactory : NSObject <RTCVideoDecoderFactory> 24 - (id)initWithH265:(bool)supportH265; 24 25 @end 25 26 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m
r259345 r259452 19 19 #import "api/video_codec/RTCVideoDecoderVP9.h" 20 20 #endif 21 #if !defined(RTC_DISABLE_H265) 22 #import "RTCH265ProfileLevelId.h" 23 #import "RTCVideoDecoderH265.h" 24 #endif 21 25 22 @implementation RTCDefaultVideoDecoderFactory 26 @implementation RTCDefaultVideoDecoderFactory { 27 bool _supportH265; 28 } 29 30 - (id)initWithH265:(bool)supportH265 31 { 32 self = [super init]; 33 if (self) { 34 _supportH265 = supportH265; 35 } 36 return self; 37 } 23 38 24 39 - (NSArray<RTCVideoCodecInfo *> *)supportedCodecs { … … 43 58 RTCVideoCodecInfo *vp8Info = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp8Name]; 44 59 60 #if !defined(RTC_DISABLE_H265) 61 RTCVideoCodecInfo *h265Info = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecH265Name]; 62 #endif 63 45 64 #if defined(RTC_ENABLE_VP9) 46 65 RTCVideoCodecInfo *vp9Info = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name]; 47 66 #endif 48 67 68 if (!_supportH265) { 69 return @[ 70 constrainedHighInfo, 71 constrainedBaselineInfo, 72 vp8Info, 73 #if defined(RTC_ENABLE_VP9) 74 vp9Info, 75 #endif 76 ]; 77 } 49 78 return @[ 50 79 constrainedHighInfo, 51 80 constrainedBaselineInfo, 81 #if !defined(RTC_DISABLE_H265) 82 h265Info, 83 #endif 52 84 vp8Info, 53 85 #if defined(RTC_ENABLE_VP9) … … 62 94 } else if ([info.name isEqualToString:kRTCVideoCodecVp8Name]) { 63 95 return [RTCVideoDecoderVP8 vp8Decoder]; 96 #if !defined(RTC_DISABLE_H265) 97 } else if ([info.name isEqualToString:kRTCVideoCodecH265Name]) { 98 return [[RTCVideoDecoderH265 alloc] init]; 99 #endif 64 100 #if defined(RTC_ENABLE_VP9) 65 101 } else if ([info.name isEqualToString:kRTCVideoCodecVp9Name]) { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h
r237075 r259452 23 23 @interface RTCDefaultVideoEncoderFactory : NSObject <RTCVideoEncoderFactory> 24 24 25 @property(nonatomic, retain) RTCVideoCodecInfo *preferredCodec; 26 25 - (id)initWithH265:(bool)supportH265; 27 26 + (NSArray<RTCVideoCodecInfo *> *)supportedCodecs; 28 27 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m
r252472 r259452 19 19 #import "api/video_codec/RTCVideoEncoderVP9.h" 20 20 #endif 21 #if !defined(DISABLE_H265) 22 #import "RTCH265ProfileLevelId.h" 23 #import "RTCVideoEncoderH265.h" 24 #endif 21 25 22 @implementation RTCDefaultVideoEncoderFactory 26 @implementation RTCDefaultVideoEncoderFactory { 27 bool _supportH265; 28 } 23 29 24 @synthesize preferredCodec; 30 - (id)initWithH265:(bool)supportH265 31 { 32 self = [super init]; 33 if (self) { 34 _supportH265 = supportH265; 35 } 36 return self; 37 } 25 38 26 39 + (NSArray<RTCVideoCodecInfo *> *)supportedCodecs { … … 43 56 parameters:constrainedBaselineParams]; 44 57 58 #if !defined(DISABLE_H265) 59 RTCVideoCodecInfo *h265Info = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecH265Name]; 60 #endif 61 45 62 RTCVideoCodecInfo *vp8Info = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp8Name]; 46 63 … … 52 69 constrainedHighInfo, 53 70 constrainedBaselineInfo, 71 #if !defined(DISABLE_H265) 72 h265Info, 73 #endif 54 74 vp8Info, 55 75 #if defined(RTC_ENABLE_VP9) … … 68 88 return [RTCVideoEncoderVP9 vp9Encoder]; 69 89 #endif 90 #if !defined(DISABLE_H265) 91 } else if (@available(iOS 11, *)) { 92 if ([info.name isEqualToString:kRTCVideoCodecH265Name]) { 93 return [[RTCVideoEncoderH265 alloc] initWithCodecInfo:info]; 94 } 95 #endif 70 96 } 71 97 … … 77 103 78 104 NSMutableArray<RTCVideoCodecInfo *> *orderedCodecs = [NSMutableArray array]; 79 NSUInteger index = [codecs indexOfObject:self.preferredCodec];80 if (index != NSNotFound) {81 [orderedCodecs addObject:[codecs objectAtIndex:index]];82 [codecs removeObjectAtIndex:index];83 }84 105 [orderedCodecs addObjectsFromArray:codecs]; 106 if (!_supportH265) 107 [orderedCodecs removeObjectAtIndex:0]; 85 108 86 109 return [orderedCodecs copy]; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCH265ProfileLevelId.h
r259451 r259452 12 12 13 13 #import "RTCMacros.h" 14 #import "RTCVideoDecoderFactory.h"15 14 16 NS_ASSUME_NONNULL_BEGIN 17 18 /** This decoder factory include support for all codecs bundled with WebRTC. If using custom 19 * codecs, create custom implementations of RTCVideoEncoderFactory and RTCVideoDecoderFactory. 20 */ 21 RTC_OBJC_EXPORT 22 __attribute__((objc_runtime_name("WK_RTCDefaultVideoDecoderFactory"))) 23 @interface RTCDefaultVideoDecoderFactory : NSObject <RTCVideoDecoderFactory> 24 @end 25 26 NS_ASSUME_NONNULL_END 15 RTC_OBJC_EXPORT extern NSString *const kRTCVideoCodecH265Name; 16 RTC_OBJC_EXPORT extern NSString *const kRTCLevel31Main; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH265.h
r259451 r259452 12 12 13 13 #import "RTCMacros.h" 14 #import "RTCVideoDecoder Factory.h"14 #import "RTCVideoDecoder.h" 15 15 16 NS_ASSUME_NONNULL_BEGIN17 18 /** This decoder factory include support for all codecs bundled with WebRTC. If using custom19 * codecs, create custom implementations of RTCVideoEncoderFactory and RTCVideoDecoderFactory.20 */21 16 RTC_OBJC_EXPORT 22 __attribute__((objc_runtime_name("WK_RTC DefaultVideoDecoderFactory")))23 @interface RTC DefaultVideoDecoderFactory : NSObject <RTCVideoDecoderFactory>17 __attribute__((objc_runtime_name("WK_RTCVideoDecoderH265"))) 18 @interface RTCVideoDecoderH265 : NSObject <RTCVideoDecoder> 24 19 @end 25 26 NS_ASSUME_NONNULL_END -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH265.h
r259451 r259452 12 12 13 13 #import "RTCMacros.h" 14 #import "RTCVideoDecoderFactory.h" 14 #import "RTCVideoCodecInfo.h" 15 #import "RTCVideoEncoder.h" 15 16 16 NS_ASSUME_NONNULL_BEGIN 17 RTC_OBJC_EXPORT 18 __attribute__((objc_runtime_name("WK_RTCVideoEncoderH265"))) 19 @interface RTCVideoEncoderH265 : NSObject <RTCVideoEncoder> 17 20 18 /** This decoder factory include support for all codecs bundled with WebRTC. If using custom 19 * codecs, create custom implementations of RTCVideoEncoderFactory and RTCVideoDecoderFactory. 20 */ 21 RTC_OBJC_EXPORT 22 __attribute__((objc_runtime_name("WK_RTCDefaultVideoDecoderFactory"))) 23 @interface RTCDefaultVideoDecoderFactory : NSObject <RTCVideoDecoderFactory> 21 - (instancetype)initWithCodecInfo:(RTCVideoCodecInfo *)codecInfo; 22 24 23 @end 25 26 NS_ASSUME_NONNULL_END -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/nalu_rewriter.cc
r252472 r259452 249 249 } 250 250 251 #ifndef DISABLE_H265 252 bool H265CMSampleBufferToAnnexBBuffer( 253 CMSampleBufferRef hvcc_sample_buffer, 254 bool is_keyframe, 255 rtc::Buffer* annexb_buffer, 256 std::unique_ptr<RTPFragmentationHeader> *out_header) { 257 RTC_DCHECK(hvcc_sample_buffer); 258 RTC_DCHECK(out_header); 259 out_header->reset(nullptr); 260 261 // Get format description from the sample buffer. 262 CMVideoFormatDescriptionRef description = 263 CMSampleBufferGetFormatDescription(hvcc_sample_buffer); 264 if (description == nullptr) { 265 RTC_LOG(LS_ERROR) << "Failed to get sample buffer's description."; 266 return false; 267 } 268 269 // Get parameter set information. 270 int nalu_header_size = 0; 271 size_t param_set_count = 0; 272 OSStatus status = CMVideoFormatDescriptionGetHEVCParameterSetAtIndex( 273 description, 0, nullptr, nullptr, ¶m_set_count, &nalu_header_size); 274 if (status != noErr) { 275 RTC_LOG(LS_ERROR) << "Failed to get parameter set."; 276 return false; 277 } 278 RTC_CHECK_EQ(nalu_header_size, kAvccHeaderByteSize); 279 RTC_DCHECK_EQ(param_set_count, 3); 280 281 // Truncate any previous data in the buffer without changing its capacity. 282 annexb_buffer->SetSize(0); 283 284 size_t nalu_offset = 0; 285 std::vector<size_t> frag_offsets; 286 std::vector<size_t> frag_lengths; 287 288 // Place all parameter sets at the front of buffer. 289 if (is_keyframe) { 290 size_t param_set_size = 0; 291 const uint8_t* param_set = nullptr; 292 for (size_t i = 0; i < param_set_count; ++i) { 293 status = CMVideoFormatDescriptionGetHEVCParameterSetAtIndex( 294 description, i, ¶m_set, ¶m_set_size, nullptr, nullptr); 295 if (status != noErr) { 296 RTC_LOG(LS_ERROR) << "Failed to get parameter set."; 297 return false; 298 } 299 // Update buffer. 300 annexb_buffer->AppendData(kAnnexBHeaderBytes, sizeof(kAnnexBHeaderBytes)); 301 annexb_buffer->AppendData(reinterpret_cast<const char*>(param_set), 302 param_set_size); 303 // Update fragmentation. 304 frag_offsets.push_back(nalu_offset + sizeof(kAnnexBHeaderBytes)); 305 frag_lengths.push_back(param_set_size); 306 nalu_offset += sizeof(kAnnexBHeaderBytes) + param_set_size; 307 } 308 } 309 310 // Get block buffer from the sample buffer. 311 CMBlockBufferRef block_buffer = 312 CMSampleBufferGetDataBuffer(hvcc_sample_buffer); 313 if (block_buffer == nullptr) { 314 RTC_LOG(LS_ERROR) << "Failed to get sample buffer's block buffer."; 315 return false; 316 } 317 CMBlockBufferRef contiguous_buffer = nullptr; 318 // Make sure block buffer is contiguous. 319 if (!CMBlockBufferIsRangeContiguous(block_buffer, 0, 0)) { 320 status = CMBlockBufferCreateContiguous( 321 nullptr, block_buffer, nullptr, nullptr, 0, 0, 0, &contiguous_buffer); 322 if (status != noErr) { 323 RTC_LOG(LS_ERROR) << "Failed to flatten non-contiguous block buffer: " 324 << status; 325 return false; 326 } 327 } else { 328 contiguous_buffer = block_buffer; 329 // Retain to make cleanup easier. 330 CFRetain(contiguous_buffer); 331 block_buffer = nullptr; 332 } 333 334 // Now copy the actual data. 335 char* data_ptr = nullptr; 336 size_t block_buffer_size = CMBlockBufferGetDataLength(contiguous_buffer); 337 status = CMBlockBufferGetDataPointer(contiguous_buffer, 0, nullptr, nullptr, 338 &data_ptr); 339 if (status != noErr) { 340 RTC_LOG(LS_ERROR) << "Failed to get block buffer data."; 341 CFRelease(contiguous_buffer); 342 return false; 343 } 344 size_t bytes_remaining = block_buffer_size; 345 while (bytes_remaining > 0) { 346 // The size type here must match |nalu_header_size|, we expect 4 bytes. 347 // Read the length of the next packet of data. Must convert from big endian 348 // to host endian. 349 RTC_DCHECK_GE(bytes_remaining, (size_t)nalu_header_size); 350 uint32_t* uint32_data_ptr = reinterpret_cast<uint32_t*>(data_ptr); 351 uint32_t packet_size = CFSwapInt32BigToHost(*uint32_data_ptr); 352 // Update buffer. 353 annexb_buffer->AppendData(kAnnexBHeaderBytes, sizeof(kAnnexBHeaderBytes)); 354 annexb_buffer->AppendData(data_ptr + nalu_header_size, packet_size); 355 // Update fragmentation. 356 frag_offsets.push_back(nalu_offset + sizeof(kAnnexBHeaderBytes)); 357 frag_lengths.push_back(packet_size); 358 nalu_offset += sizeof(kAnnexBHeaderBytes) + packet_size; 359 360 size_t bytes_written = packet_size + sizeof(kAnnexBHeaderBytes); 361 bytes_remaining -= bytes_written; 362 data_ptr += bytes_written; 363 } 364 RTC_DCHECK_EQ(bytes_remaining, (size_t)0); 365 366 std::unique_ptr<RTPFragmentationHeader> header(new RTPFragmentationHeader()); 367 header->VerifyAndAllocateFragmentationHeader(frag_offsets.size()); 368 RTC_DCHECK_EQ(frag_lengths.size(), frag_offsets.size()); 369 for (size_t i = 0; i < frag_offsets.size(); ++i) { 370 header->fragmentationOffset[i] = frag_offsets[i]; 371 header->fragmentationLength[i] = frag_lengths[i]; 372 } 373 *out_header = std::move(header); 374 CFRelease(contiguous_buffer); 375 return true; 376 } 377 378 bool H265AnnexBBufferToCMSampleBuffer(const uint8_t* annexb_buffer, 379 size_t annexb_buffer_size, 380 CMVideoFormatDescriptionRef video_format, 381 CMSampleBufferRef* out_sample_buffer) { 382 RTC_DCHECK(annexb_buffer); 383 RTC_DCHECK(out_sample_buffer); 384 RTC_DCHECK(video_format); 385 *out_sample_buffer = nullptr; 386 387 AnnexBBufferReader reader(annexb_buffer, annexb_buffer_size); 388 if (reader.SeekToNextNaluOfType(H265::kVps)) { 389 // Buffer contains an SPS NALU - skip it and the following PPS 390 const uint8_t* data; 391 size_t data_len; 392 if (!reader.ReadNalu(&data, &data_len)) { 393 RTC_LOG(LS_ERROR) << "Failed to read VPS"; 394 return false; 395 } 396 if (!reader.ReadNalu(&data, &data_len)) { 397 RTC_LOG(LS_ERROR) << "Failed to read SPS"; 398 return false; 399 } 400 if (!reader.ReadNalu(&data, &data_len)) { 401 RTC_LOG(LS_ERROR) << "Failed to read PPS"; 402 return false; 403 } 404 } else { 405 // No SPS NALU - start reading from the first NALU in the buffer 406 reader.SeekToStart(); 407 } 408 409 // Allocate memory as a block buffer. 410 // TODO(tkchin): figure out how to use a pool. 411 CMBlockBufferRef block_buffer = nullptr; 412 OSStatus status = CMBlockBufferCreateWithMemoryBlock( 413 nullptr, nullptr, reader.BytesRemaining(), nullptr, nullptr, 0, 414 reader.BytesRemaining(), kCMBlockBufferAssureMemoryNowFlag, 415 &block_buffer); 416 if (status != kCMBlockBufferNoErr) { 417 RTC_LOG(LS_ERROR) << "Failed to create block buffer."; 418 return false; 419 } 420 421 // Make sure block buffer is contiguous. 422 CMBlockBufferRef contiguous_buffer = nullptr; 423 if (!CMBlockBufferIsRangeContiguous(block_buffer, 0, 0)) { 424 status = CMBlockBufferCreateContiguous( 425 nullptr, block_buffer, nullptr, nullptr, 0, 0, 0, &contiguous_buffer); 426 if (status != noErr) { 427 RTC_LOG(LS_ERROR) << "Failed to flatten non-contiguous block buffer: " 428 << status; 429 CFRelease(block_buffer); 430 return false; 431 } 432 } else { 433 contiguous_buffer = block_buffer; 434 block_buffer = nullptr; 435 } 436 437 // Get a raw pointer into allocated memory. 438 size_t block_buffer_size = 0; 439 char* data_ptr = nullptr; 440 status = CMBlockBufferGetDataPointer(contiguous_buffer, 0, nullptr, 441 &block_buffer_size, &data_ptr); 442 if (status != kCMBlockBufferNoErr) { 443 RTC_LOG(LS_ERROR) << "Failed to get block buffer data pointer."; 444 CFRelease(contiguous_buffer); 445 return false; 446 } 447 RTC_DCHECK(block_buffer_size == reader.BytesRemaining()); 448 449 // Write Avcc NALUs into block buffer memory. 450 AvccBufferWriter writer(reinterpret_cast<uint8_t*>(data_ptr), 451 block_buffer_size); 452 while (reader.BytesRemaining() > 0) { 453 const uint8_t* nalu_data_ptr = nullptr; 454 size_t nalu_data_size = 0; 455 if (reader.ReadNalu(&nalu_data_ptr, &nalu_data_size)) { 456 writer.WriteNalu(nalu_data_ptr, nalu_data_size); 457 } 458 } 459 460 // Create sample buffer. 461 status = CMSampleBufferCreate(nullptr, contiguous_buffer, true, nullptr, 462 nullptr, video_format, 1, 0, nullptr, 0, 463 nullptr, out_sample_buffer); 464 if (status != noErr) { 465 RTC_LOG(LS_ERROR) << "Failed to create sample buffer."; 466 CFRelease(contiguous_buffer); 467 return false; 468 } 469 CFRelease(contiguous_buffer); 470 return true; 471 } 472 #endif 473 251 474 CMVideoFormatDescriptionRef CreateVideoFormatDescription( 252 475 const uint8_t* annexb_buffer, … … 279 502 } 280 503 504 #ifndef DISABLE_H265 505 CMVideoFormatDescriptionRef CreateH265VideoFormatDescription( 506 const uint8_t* annexb_buffer, 507 size_t annexb_buffer_size) { 508 const uint8_t* param_set_ptrs[3] = {}; 509 size_t param_set_sizes[3] = {}; 510 AnnexBBufferReader reader(annexb_buffer, annexb_buffer_size); 511 // Skip everyting before the VPS, then read the VPS, SPS and PPS 512 if (!reader.SeekToNextNaluOfType(H265::kVps)) { 513 return nullptr; 514 } 515 if (!reader.ReadNalu(¶m_set_ptrs[0], ¶m_set_sizes[0])) { 516 RTC_LOG(LS_ERROR) << "Failed to read VPS"; 517 return nullptr; 518 } 519 if (!reader.ReadNalu(¶m_set_ptrs[1], ¶m_set_sizes[1])) { 520 RTC_LOG(LS_ERROR) << "Failed to read SPS"; 521 return nullptr; 522 } 523 if (!reader.ReadNalu(¶m_set_ptrs[2], ¶m_set_sizes[2])) { 524 RTC_LOG(LS_ERROR) << "Failed to read PPS"; 525 return nullptr; 526 } 527 528 // Parse the SPS and PPS into a CMVideoFormatDescription. 529 CMVideoFormatDescriptionRef description = nullptr; 530 OSStatus status = CMVideoFormatDescriptionCreateFromHEVCParameterSets( 531 kCFAllocatorDefault, 3, param_set_ptrs, param_set_sizes, 4, nullptr, 532 &description); 533 if (status != noErr) { 534 RTC_LOG(LS_ERROR) << "Failed to create video format description."; 535 return nullptr; 536 } 537 return description; 538 } 539 #endif 540 281 541 AnnexBBufferReader::AnnexBBufferReader(const uint8_t* annexb_buffer, 282 542 size_t length) … … 325 585 return false; 326 586 } 587 588 #ifndef DISABLE_H265 589 bool AnnexBBufferReader::SeekToNextNaluOfType(H265::NaluType type) { 590 for (; offset_ != offsets_.end(); ++offset_) { 591 if (offset_->payload_size < 1) 592 continue; 593 if (H265::ParseNaluType(*(start_ + offset_->payload_start_offset)) == type) 594 return true; 595 } 596 return false; 597 } 598 #endif 599 327 600 AvccBufferWriter::AvccBufferWriter(uint8_t* const avcc_buffer, size_t length) 328 601 : start_(avcc_buffer), offset_(0), length_(length) { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/nalu_rewriter.h
r238967 r259452 19 19 20 20 #include "common_video/h264/h264_common.h" 21 #ifndef DISABLE_H265 22 #include "common_video/h265/h265_common.h" 23 #endif 21 24 #include "modules/include/module_common_types.h" 22 25 #include "rtc_base/buffer.h" … … 48 51 CMMemoryPoolRef memory_pool); 49 52 53 #ifndef DISABLE_H265 54 // Converts a sample buffer emitted from the VideoToolbox encoder into a buffer 55 // suitable for RTP. The sample buffer is in hvcc format whereas the rtp buffer 56 // needs to be in Annex B format. Data is written directly to |annexb_buffer| 57 // and a new RTPFragmentationHeader is returned in |out_header|. 58 bool H265CMSampleBufferToAnnexBBuffer( 59 CMSampleBufferRef hvcc_sample_buffer, 60 bool is_keyframe, 61 rtc::Buffer* annexb_buffer, 62 std::unique_ptr<RTPFragmentationHeader> *out_header) 63 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_11_0); 64 65 // Converts a buffer received from RTP into a sample buffer suitable for the 66 // VideoToolbox decoder. The RTP buffer is in annex b format whereas the sample 67 // buffer is in hvcc format. 68 // If |is_keyframe| is true then |video_format| is ignored since the format will 69 // be read from the buffer. Otherwise |video_format| must be provided. 70 // Caller is responsible for releasing the created sample buffer. 71 bool H265AnnexBBufferToCMSampleBuffer(const uint8_t* annexb_buffer, 72 size_t annexb_buffer_size, 73 CMVideoFormatDescriptionRef video_format, 74 CMSampleBufferRef* out_sample_buffer) 75 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_11_0); 76 #endif 77 50 78 // Returns a video format description created from the sps/pps information in 51 79 // the Annex B buffer. If there is no such information, nullptr is returned. … … 54 82 const uint8_t* annexb_buffer, 55 83 size_t annexb_buffer_size); 84 85 #ifndef DISABLE_H265 86 CMVideoFormatDescriptionRef CreateH265VideoFormatDescription( 87 const uint8_t* annexb_buffer, 88 size_t annexb_buffer_size) 89 __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_11_0); 90 #endif 56 91 57 92 // Helper class for reading NALUs from an RTP Annex B buffer. … … 79 114 // reached the end instead 80 115 bool SeekToNextNaluOfType(H264::NaluType type); 116 #ifndef DISABLE_H265 117 bool SeekToNextNaluOfType(H265::NaluType type); 118 #endif 81 119 82 120 private: -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/native/src/objc_video_decoder_factory.mm
r259345 r259452 98 98 id<RTCVideoDecoder> decoder = [decoder_factory_ createDecoder:codecInfo]; 99 99 100 if ([decoder isKindOfClass:[RTCWrappedNativeVideoDecoder class]]) { 100 // Because of symbol conflict, isKindOfClass doesn't work as expected. 101 // See https://bugs.webkit.org/show_bug.cgi?id=198782. 102 // if ([decoder isKindOfClass:[RTCWrappedNativeVideoDecoder class]]) { 103 if ([codecName isEqual:@"VP8"] || [codecName isEqual:@"VP9"]) { 101 104 return [(RTCWrappedNativeVideoDecoder *)decoder releaseWrappedDecoder]; 102 105 } else { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/native/src/objc_video_encoder_factory.mm
r252472 r259452 16 16 #import "base/RTCVideoEncoderFactory.h" 17 17 #import "components/video_codec/RTCCodecSpecificInfoH264+Private.h" 18 #ifndef DISABLE_H265 19 #import "components/video_codec/RTCCodecSpecificInfoH265+Private.h" 20 #endif 18 21 #import "sdk/objc/api/peerconnection/RTCEncodedImage+Private.h" 19 22 #import "sdk/objc/api/peerconnection/RTCRtpFragmentationHeader+Private.h" … … 66 69 // Handle types that can be converted into one of CodecSpecificInfo's hard coded cases. 67 70 CodecSpecificInfo codecSpecificInfo; 68 if ([info isKindOfClass:[RTCCodecSpecificInfoH264 class]]) { 71 // Because of symbol conflict, isKindOfClass doesn't work as expected. 72 // See https://bugs.webkit.org/show_bug.cgi?id=198782. 73 if ([NSStringFromClass([info class]) isEqual:@"WK_RTCCodecSpecificInfoH264"]) { 74 // if ([info isKindOfClass:[RTCCodecSpecificInfoH264 class]]) { 69 75 codecSpecificInfo = [(RTCCodecSpecificInfoH264 *)info nativeCodecSpecificInfo]; 76 #ifndef DISABLE_H265 77 } else if ([NSStringFromClass([info class]) isEqual:@"WK_RTCCodecSpecificInfoH265"]) { 78 // if ([info isKindOfClass:[RTCCodecSpecificInfoH265 class]]) { 79 codecSpecificInfo = [(RTCCodecSpecificInfoH265 *)info nativeCodecSpecificInfo]; 80 #endif 70 81 } 71 82 … … 168 179 RTCVideoCodecInfo *info = [[RTCVideoCodecInfo alloc] initWithNativeSdpVideoFormat:format]; 169 180 id<RTCVideoEncoder> encoder = [encoder_factory_ createEncoder:info]; 170 if ([encoder isKindOfClass:[RTCWrappedNativeVideoEncoder class]]) { 181 // Because of symbol conflict, isKindOfClass doesn't work as expected. 182 // See https://bugs.webkit.org/show_bug.cgi?id=198782. 183 // if ([encoder isKindOfClass:[RTCWrappedNativeVideoEncoder class]]) { 184 if ([info.name isEqual:@"VP8"] || [info.name isEqual:@"VP9"]) { 171 185 return [(RTCWrappedNativeVideoEncoder *)encoder releaseWrappedEncoder]; 172 186 } else { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/video/rtp_video_stream_receiver.cc
r259345 r259452 588 588 break; 589 589 } 590 590 #ifndef DISABLE_H265 591 } else if (packet->codec() == kVideoCodecH265) { 592 video_coding::H265VpsSpsPpsTracker::FixedBitstream fixed = 593 h265_tracker_.CopyAndFixBitstream( 594 rtc::MakeArrayView(codec_payload.cdata(), codec_payload.size()), 595 &packet->video_header); 596 switch (fixed.action) { 597 case video_coding::H265VpsSpsPpsTracker::kRequestKeyframe: 598 rtcp_feedback_buffer_.RequestKeyFrame(); 599 rtcp_feedback_buffer_.SendBufferedRtcpFeedback(); 600 ABSL_FALLTHROUGH_INTENDED; 601 case video_coding::H265VpsSpsPpsTracker::kDrop: 602 return; 603 case video_coding::H265VpsSpsPpsTracker::kInsert: 604 packet->video_payload = std::move(fixed.bitstream); 605 break; 606 } 607 #endif 591 608 } else { 592 609 packet->video_payload = std::move(codec_payload); -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/video/rtp_video_stream_receiver.h
r259345 r259452 39 39 #include "modules/video_coding/h264_sps_pps_tracker.h" 40 40 #include "modules/video_coding/loss_notification_controller.h" 41 #ifndef DISABLE_H265 42 #include "modules/video_coding/h265_vps_sps_pps_tracker.h" 43 #endif 41 44 #include "modules/video_coding/packet_buffer.h" 42 45 #include "modules/video_coding/rtp_frame_reference_finder.h" … … 318 321 std::map<uint8_t, std::unique_ptr<VideoRtpDepacketizer>> payload_type_map_; 319 322 323 #ifndef DISABLE_H265 324 video_coding::H265VpsSpsPpsTracker h265_tracker_; 325 #endif 326 320 327 // TODO(johan): Remove pt_codec_params_ once 321 328 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6883 is resolved. -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/video/send_statistics_proxy.cc
r259345 r259452 48 48 kVideoVp9 = 2, 49 49 kVideoH264 = 3, 50 kVideoH265 = 4, 50 51 kVideoMax = 64, 51 52 }; … … 75 76 case kVideoCodecH264: 76 77 return kVideoH264; 78 #ifndef DISABLE_H265 79 case kVideoCodecH265: 80 return kVideoH265; 81 #endif 77 82 default: 78 83 return kVideoUnknown; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/video/video_receive_stream.cc
r259345 r259452 135 135 return associated_codec; 136 136 } 137 #ifndef DISABLE_H265 138 else if (codec.codecType == kVideoCodecH265) { 139 *(codec.H265()) = VideoEncoder::GetDefaultH265Settings(); 140 } 141 #endif 137 142 138 143 codec.width = 320; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/video/video_stream_encoder.cc
r259345 r259452 101 101 } 102 102 break; 103 103 #ifndef DISABLE_H265 104 case kVideoCodecH265: 105 if (new_send_codec.H265() != prev_send_codec.H265()) { 106 return true; 107 } 108 break; 109 #endif 104 110 default: 105 111 break; … … 1404 1410 (codec_specific_info->codecType == kVideoCodecVP8 || 1405 1411 codec_specific_info->codecType == kVideoCodecH264 || 1412 #ifndef DISABLE_H265 1413 codec_specific_info->codecType == kVideoCodecH265 || 1414 #endif 1406 1415 codec_specific_info->codecType == kVideoCodecGeneric)) { 1407 1416 simulcast_id = encoded_image.SpatialIndex().value_or(0); -
trunk/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj
r259422 r259452 30 30 410091DD242E0BBC00C5EDA2 /* recordable_encoded_frame.h in Headers */ = {isa = PBXBuildFile; fileRef = 410091D8242E0BBB00C5EDA2 /* recordable_encoded_frame.h */; }; 31 31 410091DE242E0BBC00C5EDA2 /* video_frame_type.h in Headers */ = {isa = PBXBuildFile; fileRef = 410091D9242E0BBB00C5EDA2 /* video_frame_type.h */; }; 32 410091E6242E2AA300C5EDA2 /* rtp_format_h265.cc in Sources */ = {isa = PBXBuildFile; fileRef = 410091E0242E2AA100C5EDA2 /* rtp_format_h265.cc */; }; 33 410091E7242E2AA300C5EDA2 /* rtp_format_h265.h in Headers */ = {isa = PBXBuildFile; fileRef = 410091E1242E2AA200C5EDA2 /* rtp_format_h265.h */; }; 34 410091ED242E317400C5EDA2 /* h265_vps_sps_pps_tracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 410091EB242E317300C5EDA2 /* h265_vps_sps_pps_tracker.h */; }; 35 410091F9242E362200C5EDA2 /* h265_sps_parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 410091F1242E362100C5EDA2 /* h265_sps_parser.h */; }; 36 410091FD242E362200C5EDA2 /* h265_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 410091F5242E362100C5EDA2 /* h265_common.h */; }; 37 410091FE242E362200C5EDA2 /* h265_vps_parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 410091F6242E362200C5EDA2 /* h265_vps_parser.h */; }; 38 410091FF242E362200C5EDA2 /* h265_common.cc in Sources */ = {isa = PBXBuildFile; fileRef = 410091F7242E362200C5EDA2 /* h265_common.cc */; }; 39 41009209242E3A4600C5EDA2 /* RTCVideoDecoderH265.h in Headers */ = {isa = PBXBuildFile; fileRef = 41009200242E3A4300C5EDA2 /* RTCVideoDecoderH265.h */; }; 40 4100920A242E3A4600C5EDA2 /* RTCH265ProfileLevelId.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41009201242E3A4400C5EDA2 /* RTCH265ProfileLevelId.mm */; }; 41 4100920E242E3A4600C5EDA2 /* RTCH265ProfileLevelId.h in Headers */ = {isa = PBXBuildFile; fileRef = 41009205242E3A4500C5EDA2 /* RTCH265ProfileLevelId.h */; }; 32 42 4102F6A121273262006AE8D7 /* remix_resample.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4102F69721273260006AE8D7 /* remix_resample.cc */; }; 33 43 4102F6A221273262006AE8D7 /* audio_level.h in Headers */ = {isa = PBXBuildFile; fileRef = 4102F69821273260006AE8D7 /* audio_level.h */; }; … … 1965 1975 41E02CD32127360700C27CD6 /* sample_counter.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E02CD12127360600C27CD6 /* sample_counter.h */; }; 1966 1976 41E02CD42127360700C27CD6 /* sample_counter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 41E02CD22127360700C27CD6 /* sample_counter.cc */; }; 1977 41E84BCE24373BDE00D34E41 /* h265_pps_parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 410091F3242E362100C5EDA2 /* h265_pps_parser.cc */; }; 1978 41E84BCF24373BE200D34E41 /* h265_sps_parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 410091F0242E362000C5EDA2 /* h265_sps_parser.cc */; }; 1979 41E84BD024373BE600D34E41 /* h265_vps_parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 410091F4242E362100C5EDA2 /* h265_vps_parser.cc */; }; 1980 41E84BD124373C0700D34E41 /* h265_vps_sps_pps_tracker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 410091EC242E317300C5EDA2 /* h265_vps_sps_pps_tracker.cc */; }; 1981 41E84BD224373C1400D34E41 /* RTCVideoDecoderH265.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41009207242E3A4500C5EDA2 /* RTCVideoDecoderH265.mm */; }; 1982 41E84BD324373C1A00D34E41 /* RTCVideoEncoderH265.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41009206242E3A4500C5EDA2 /* RTCVideoEncoderH265.mm */; }; 1983 41E84BD424373C2900D34E41 /* RTCCodecSpecificInfoH265.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41009208242E3A4600C5EDA2 /* RTCCodecSpecificInfoH265.mm */; }; 1967 1984 41EA53A51EFC2C14002FF04C /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 41EA53A41EFC2BFD002FF04C /* hmac.c */; }; 1968 1985 41EA53AB1EFC2C4D002FF04C /* digest.c in Sources */ = {isa = PBXBuildFile; fileRef = 41EA53A71EFC2C4D002FF04C /* digest.c */; }; … … 3927 3944 410091D8242E0BBB00C5EDA2 /* recordable_encoded_frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = recordable_encoded_frame.h; sourceTree = "<group>"; }; 3928 3945 410091D9242E0BBB00C5EDA2 /* video_frame_type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = video_frame_type.h; sourceTree = "<group>"; }; 3946 410091E0242E2AA100C5EDA2 /* rtp_format_h265.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rtp_format_h265.cc; sourceTree = "<group>"; }; 3947 410091E1242E2AA200C5EDA2 /* rtp_format_h265.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rtp_format_h265.h; sourceTree = "<group>"; }; 3948 410091EB242E317300C5EDA2 /* h265_vps_sps_pps_tracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = h265_vps_sps_pps_tracker.h; sourceTree = "<group>"; }; 3949 410091EC242E317300C5EDA2 /* h265_vps_sps_pps_tracker.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = h265_vps_sps_pps_tracker.cc; sourceTree = "<group>"; }; 3950 410091F0242E362000C5EDA2 /* h265_sps_parser.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = h265_sps_parser.cc; sourceTree = "<group>"; }; 3951 410091F1242E362100C5EDA2 /* h265_sps_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = h265_sps_parser.h; sourceTree = "<group>"; }; 3952 410091F2242E362100C5EDA2 /* h265_pps_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = h265_pps_parser.h; sourceTree = "<group>"; }; 3953 410091F3242E362100C5EDA2 /* h265_pps_parser.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = h265_pps_parser.cc; sourceTree = "<group>"; }; 3954 410091F4242E362100C5EDA2 /* h265_vps_parser.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = h265_vps_parser.cc; sourceTree = "<group>"; }; 3955 410091F5242E362100C5EDA2 /* h265_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = h265_common.h; sourceTree = "<group>"; }; 3956 410091F6242E362200C5EDA2 /* h265_vps_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = h265_vps_parser.h; sourceTree = "<group>"; }; 3957 410091F7242E362200C5EDA2 /* h265_common.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = h265_common.cc; sourceTree = "<group>"; }; 3958 41009200242E3A4300C5EDA2 /* RTCVideoDecoderH265.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCVideoDecoderH265.h; sourceTree = "<group>"; }; 3959 41009201242E3A4400C5EDA2 /* RTCH265ProfileLevelId.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RTCH265ProfileLevelId.mm; sourceTree = "<group>"; }; 3960 41009202242E3A4400C5EDA2 /* RTCCodecSpecificInfoH265.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCCodecSpecificInfoH265.h; sourceTree = "<group>"; }; 3961 41009203242E3A4400C5EDA2 /* RTCCodecSpecificInfoH265+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RTCCodecSpecificInfoH265+Private.h"; sourceTree = "<group>"; }; 3962 41009204242E3A4500C5EDA2 /* RTCVideoEncoderH265.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCVideoEncoderH265.h; sourceTree = "<group>"; }; 3963 41009205242E3A4500C5EDA2 /* RTCH265ProfileLevelId.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCH265ProfileLevelId.h; sourceTree = "<group>"; }; 3964 41009206242E3A4500C5EDA2 /* RTCVideoEncoderH265.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RTCVideoEncoderH265.mm; sourceTree = "<group>"; }; 3965 41009207242E3A4500C5EDA2 /* RTCVideoDecoderH265.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RTCVideoDecoderH265.mm; sourceTree = "<group>"; }; 3966 41009208242E3A4600C5EDA2 /* RTCCodecSpecificInfoH265.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RTCCodecSpecificInfoH265.mm; sourceTree = "<group>"; }; 3929 3967 4100CDE521CACFD000F9B87D /* LPC_fit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = LPC_fit.c; path = silk/LPC_fit.c; sourceTree = "<group>"; }; 3930 3968 4100CDE821CAD03300F9B87D /* vq_sse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vq_sse.h; path = x86/vq_sse.h; sourceTree = "<group>"; }; … … 7858 7896 7859 7897 /* Begin PBXGroup section */ 7898 410091EF242E360800C5EDA2 /* h265 */ = { 7899 isa = PBXGroup; 7900 children = ( 7901 410091F7242E362200C5EDA2 /* h265_common.cc */, 7902 410091F5242E362100C5EDA2 /* h265_common.h */, 7903 410091F3242E362100C5EDA2 /* h265_pps_parser.cc */, 7904 410091F2242E362100C5EDA2 /* h265_pps_parser.h */, 7905 410091F0242E362000C5EDA2 /* h265_sps_parser.cc */, 7906 410091F1242E362100C5EDA2 /* h265_sps_parser.h */, 7907 410091F4242E362100C5EDA2 /* h265_vps_parser.cc */, 7908 410091F6242E362200C5EDA2 /* h265_vps_parser.h */, 7909 ); 7910 path = h265; 7911 sourceTree = "<group>"; 7912 }; 7860 7913 4105EB64212E018C008C0C20 /* libvpx */ = { 7861 7914 isa = PBXGroup; … … 9119 9172 417953AC2169823D0028266B /* nalu_rewriter.cc */, 9120 9173 411521D521698220000ABAF7 /* nalu_rewriter.h */, 9121 417953B2216982410028266B /* RTCCodecSpecificInfoH264+Private.h */,9122 9174 416225F1216981F300A91C9B /* RTCCodecSpecificInfoH264.h */, 9123 9175 416225ED216981F200A91C9B /* RTCCodecSpecificInfoH264.mm */, 9176 417953B2216982410028266B /* RTCCodecSpecificInfoH264+Private.h */, 9177 41009202242E3A4400C5EDA2 /* RTCCodecSpecificInfoH265.h */, 9178 41009208242E3A4600C5EDA2 /* RTCCodecSpecificInfoH265.mm */, 9179 41009203242E3A4400C5EDA2 /* RTCCodecSpecificInfoH265+Private.h */, 9124 9180 417953B3216982420028266B /* RTCDefaultVideoDecoderFactory.h */, 9125 9181 417953AD2169823E0028266B /* RTCDefaultVideoDecoderFactory.m */, … … 9128 9184 411521D42169821F000ABAF7 /* RTCH264ProfileLevelId.h */, 9129 9185 411521D621698220000ABAF7 /* RTCH264ProfileLevelId.mm */, 9186 41009205242E3A4500C5EDA2 /* RTCH265ProfileLevelId.h */, 9187 41009201242E3A4400C5EDA2 /* RTCH265ProfileLevelId.mm */, 9130 9188 416225F2216981F300A91C9B /* RTCVideoDecoderFactoryH264.h */, 9131 9189 417953B0216982400028266B /* RTCVideoDecoderFactoryH264.m */, 9132 9190 416225F3216981F300A91C9B /* RTCVideoDecoderH264.h */, 9133 9191 416225F4216981F300A91C9B /* RTCVideoDecoderH264.mm */, 9192 41009200242E3A4300C5EDA2 /* RTCVideoDecoderH265.h */, 9193 41009207242E3A4500C5EDA2 /* RTCVideoDecoderH265.mm */, 9134 9194 416225EF216981F200A91C9B /* RTCVideoEncoderFactoryH264.h */, 9135 9195 417953B1216982400028266B /* RTCVideoEncoderFactoryH264.m */, 9136 9196 416225EC216981F200A91C9B /* RTCVideoEncoderH264.h */, 9137 9197 416225F6216981F400A91C9B /* RTCVideoEncoderH264.mm */, 9198 41009204242E3A4500C5EDA2 /* RTCVideoEncoderH265.h */, 9199 41009206242E3A4500C5EDA2 /* RTCVideoEncoderH265.mm */, 9138 9200 416225EE216981F200A91C9B /* UIDevice+H264Profile.h */, 9139 9201 417953AE2169823F0028266B /* UIDevice+H264Profile.mm */, … … 11710 11772 4131C42A234C7D700028A615 /* generic_frame_descriptor */, 11711 11773 5CDD83411E43256400621E92 /* h264 */, 11774 410091EF242E360800C5EDA2 /* h265 */, 11712 11775 41109AA41E5FA18100C0955A /* include */, 11713 11776 5CDD83651E4325C200621E92 /* libyuv */, … … 12633 12696 5CDD839A1E439A6F00621E92 /* h264_sps_pps_tracker.cc */, 12634 12697 5CDD839B1E439A6F00621E92 /* h264_sps_pps_tracker.h */, 12698 410091EC242E317300C5EDA2 /* h265_vps_sps_pps_tracker.cc */, 12699 410091EB242E317300C5EDA2 /* h265_vps_sps_pps_tracker.h */, 12635 12700 5CDD839C1E439A6F00621E92 /* histogram.cc */, 12636 12701 5CDD839D1E439A6F00621E92 /* histogram.h */, … … 13323 13388 5CDD882E1E43BE3C00621E92 /* rtp_format_h264.cc */, 13324 13389 5CDD882F1E43BE3C00621E92 /* rtp_format_h264.h */, 13390 410091E0242E2AA100C5EDA2 /* rtp_format_h265.cc */, 13391 410091E1242E2AA200C5EDA2 /* rtp_format_h265.h */, 13325 13392 5CDD88301E43BE3C00621E92 /* rtp_format_video_generic.cc */, 13326 13393 5CDD88311E43BE3C00621E92 /* rtp_format_video_generic.h */, … … 14626 14693 5CDD85E81E43B81000621E92 /* aecm_core.h in Headers */, 14627 14694 5CDD85E91E43B81000621E92 /* aecm_defines.h in Headers */, 14695 410091E7242E2AA300C5EDA2 /* rtp_format_h265.h in Headers */, 14628 14696 5C0885271E4A99D200403995 /* aes.h in Headers */, 14629 14697 5C0885241E4A99D200403995 /* aes_gcm_ossl.h in Headers */, … … 14965 15033 5CDD8B971E43C2B500621E92 /* encode.h in Headers */, 14966 15034 5CDD87B61E43BC0500621E92 /* encode_lpc_swb.h in Headers */, 15035 41009209242E3A4600C5EDA2 /* RTCVideoDecoderH265.h in Headers */, 14967 15036 5CDD8A961E43C00F00621E92 /* encode_neteq_input.h in Headers */, 14968 15037 418938D8242A69CC007FDC41 /* encode_usage_resource.h in Headers */, … … 14997 15066 41BE71A6215C463700A7B196 /* expr.h in Headers */, 14998 15067 5CDD894B1E43BF3A00621E92 /* extended_jitter_report.h in Headers */, 15068 410091FE242E362200C5EDA2 /* h265_vps_parser.h in Headers */, 14999 15069 5CDD894E1E43BF3A00621E92 /* extended_reports.h in Headers */, 15000 15070 4131BF46234B88200028A615 /* external_hmac.h in Headers */, … … 15435 15505 4131C4B7234C83DD0028A615 /* remote_estimate.h in Headers */, 15436 15506 5CDD8FE21E43CD6600621E92 /* remote_estimator_proxy.h in Headers */, 15507 410091F9242E362200C5EDA2 /* h265_sps_parser.h in Headers */, 15437 15508 419C83C51FE247B40040C30F /* remote_ntp_time_estimator.h in Headers */, 15438 15509 4145E4DA1EF8CC9B00FCF6E6 /* render_buffer.h in Headers */, … … 15567 15638 4131C4EF234C86110028A615 /* rtcp_statistics.h in Headers */, 15568 15639 419C83031FE20F020040C30F /* rtcp_transceiver.h in Headers */, 15640 410091FD242E362200C5EDA2 /* h265_common.h in Headers */, 15569 15641 419C83011FE20F020040C30F /* rtcp_transceiver_config.h in Headers */, 15570 15642 419C83051FE20F020040C30F /* rtcp_transceiver_impl.h in Headers */, … … 15612 15684 413E678F216987DB00EF37ED /* RTCVideoFrame.h in Headers */, 15613 15685 413E6791216987DB00EF37ED /* RTCVideoFrameBuffer.h in Headers */, 15686 410091ED242E317400C5EDA2 /* h265_vps_sps_pps_tracker.h in Headers */, 15614 15687 413A24411FE1991A00373E99 /* RTCVideoFrameBuffer.h in Headers */, 15615 15688 413A246F1FE1991A00373E99 /* RTCVideoRenderer.h in Headers */, … … 15950 16023 4102F6CF212733B7006AE8D7 /* video_quality_observer.h in Headers */, 15951 16024 419C82C41FE20DCD0040C30F /* video_receive_stream.h in Headers */, 16025 4100920E242E3A4600C5EDA2 /* RTCH265ProfileLevelId.h in Headers */, 15952 16026 5CDD85CB1E43B5C000621E92 /* video_receive_stream.h in Headers */, 15953 16027 41893A17242A757A007FDC41 /* video_receiver2.h in Headers */, … … 17347 17421 5CDD86401E43B8B500621E92 /* auto_corr_to_refl_coef.c in Sources */, 17348 17422 5CDD86411E43B8B500621E92 /* auto_correlation.c in Sources */, 17423 41E84BD324373C1A00D34E41 /* RTCVideoEncoderH265.mm in Sources */, 17349 17424 4131C405234C7B7E0028A615 /* auto_correlation.cc in Sources */, 17350 17425 5CDD8A071E43BFB300621E92 /* background_noise.cc in Sources */, … … 17524 17599 5CD285BE1E6A63430094FDC8 /* echo_remover_metrics.cc in Sources */, 17525 17600 5CDD8B961E43C2B500621E92 /* encode.c in Sources */, 17601 41E84BD224373C1400D34E41 /* RTCVideoDecoderH265.mm in Sources */, 17526 17602 5CDD87B71E43BC0500621E92 /* encode.c in Sources */, 17527 17603 41433D121F79B33400387B4D /* encode.c in Sources */, … … 17686 17762 5CDD8BBF1E43C2B500621E92 /* interpolate.c in Sources */, 17687 17763 5CDD8BBD1E43C2B500621E92 /* interpolate_samples.c in Sources */, 17764 41E84BD424373C2900D34E41 /* RTCCodecSpecificInfoH265.mm in Sources */, 17688 17765 415F1FB221272FBA00064CBF /* interpolated_gain_curve.cc in Sources */, 17689 17766 419C829A1FE20CA10040C30F /* interval_budget.cc in Sources */, … … 17715 17792 41294092212E128D00AD95E7 /* libvpx_vp8_encoder.cc in Sources */, 17716 17793 416D3BE6212731C200775F09 /* limiter.cc in Sources */, 17794 41E84BCF24373BE200D34E41 /* h265_sps_parser.cc in Sources */, 17717 17795 4131C4C5234C84520028A615 /* link_capacity_estimator.cc in Sources */, 17718 17796 4131BF4A234B88200028A615 /* local_audio_source.cc in Sources */, … … 17730 17808 5CDD8BC11E43C2B500621E92 /* lpc_encode.c in Sources */, 17731 17809 5CDD87C71E43BC0500621E92 /* lpc_gain_swb_tables.c in Sources */, 17810 410091E6242E2AA300C5EDA2 /* rtp_format_h265.cc in Sources */, 17732 17811 41433CEE1F79B33400387B4D /* lpc_masking_model.c in Sources */, 17733 17812 5CDD87C91E43BC0500621E92 /* lpc_shape_swb12_tables.c in Sources */, … … 17758 17837 4131C315234B8DC20028A615 /* media_stream_interface.cc in Sources */, 17759 17838 4131BF25234B88200028A615 /* media_stream_observer.cc in Sources */, 17839 41E84BD024373BE600D34E41 /* h265_vps_parser.cc in Sources */, 17760 17840 418939F7242A74F8007FDC41 /* media_transport_config.cc in Sources */, 17761 17841 418939F6242A74F8007FDC41 /* media_transport_interface.cc in Sources */, … … 17826 17906 4131C1B5234B8A4A0028A615 /* p2p_constants.cc in Sources */, 17827 17907 4131C1D4234B8A4B0028A615 /* p2p_transport_channel.cc in Sources */, 17908 41E84BD124373C0700D34E41 /* h265_vps_sps_pps_tracker.cc in Sources */, 17828 17909 41F2639A21267F5E00274F59 /* pa_ringbuffer.c in Sources */, 17829 17910 5CDD8FA21E43CCBE00621E92 /* paced_sender.cc in Sources */, … … 18027 18108 413E67982169883900EF37ED /* RTCVideoCodecInfo.m in Sources */, 18028 18109 417953B8216982420028266B /* RTCVideoDecoderFactoryH264.m in Sources */, 18110 41E84BCE24373BDE00D34E41 /* h265_pps_parser.cc in Sources */, 18029 18111 417953C72169824B0028266B /* RTCVideoDecoderH264.mm in Sources */, 18030 18112 413E67682169854B00EF37ED /* RTCVideoDecoderVP8.mm in Sources */, … … 18230 18312 5CDD8A5A1E43BFB300621E92 /* time_stretch.cc in Sources */, 18231 18313 5CDD88DA1E43BE3D00621E92 /* time_util.cc in Sources */, 18314 4100920A242E3A4600C5EDA2 /* RTCH265ProfileLevelId.mm in Sources */, 18232 18315 4131C14A234B89E20028A615 /* time_utils.cc in Sources */, 18233 18316 419241E321275A3000634FCF /* timestamp.cc in Sources */, … … 18354 18437 4131C27A234B8CC40028A615 /* webrtc_media_engine.cc in Sources */, 18355 18438 4131C278234B8CC40028A615 /* webrtc_media_engine_defaults.cc in Sources */, 18439 410091FF242E362200C5EDA2 /* h265_common.cc in Sources */, 18356 18440 4131BF50234B88200028A615 /* webrtc_sdp.cc in Sources */, 18357 18441 4131BEF4234B88200028A615 /* webrtc_session_description_factory.cc in Sources */, -
trunk/Source/WebCore/ChangeLog
r259449 r259452 1 2020-04-03 youenn fablet <youenn@apple.com> 2 3 Add initial support for WebRTC HEVC 4 https://bugs.webkit.org/show_bug.cgi?id=204283 5 6 Reviewed by Eric Carlson. 7 8 Add a runtime flag for H265 in lieu of VP8 and pipe it to libwebrtc factories. 9 Test: webrtc/h265.html 10 11 * page/Page.cpp: 12 (WebCore::m_deviceOrientationUpdateProvider): 13 * page/RuntimeEnabledFeatures.h: 14 (WebCore::RuntimeEnabledFeatures::webRTCH265CodecEnabled const): 15 (WebCore::RuntimeEnabledFeatures::setWebRTCH265CodecEnabled): 16 * platform/mediastream/libwebrtc/LibWebRTCProvider.h: 17 * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: 18 (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): 19 (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): 20 * testing/Internals.cpp: 21 (WebCore::Internals::resetToConsistentState): 22 1 23 2020-04-03 Yousuke Kimoto <yousuke.kimoto@sony.com> 2 24 -
trunk/Source/WebCore/page/Page.cpp
r259435 r259452 328 328 329 329 #if USE(LIBWEBRTC) 330 m_libWebRTCProvider->supports VP8(RuntimeEnabledFeatures::sharedFeatures().webRTCVP8CodecEnabled());330 m_libWebRTCProvider->supportsH265(RuntimeEnabledFeatures::sharedFeatures().webRTCH265CodecEnabled()); 331 331 #endif 332 332 -
trunk/Source/WebCore/page/RuntimeEnabledFeatures.h
r258498 r259452 237 237 bool webRTCDTMFEnabled() const { return m_isWebRTCDTMFEnabled; } 238 238 void setWebRTCDTMFEnabled(bool isEnabled) { m_isWebRTCDTMFEnabled = isEnabled; } 239 bool webRTC VP8CodecEnabled() const { return m_isWebRTCVP8CodecEnabled; }240 void setWebRTC VP8CodecEnabled(bool isEnabled) { m_isWebRTCVP8CodecEnabled = isEnabled; }239 bool webRTCH265CodecEnabled() const { return m_isWebRTCH265CodecEnabled; } 240 void setWebRTCH265CodecEnabled(bool isEnabled) { m_isWebRTCH265CodecEnabled = isEnabled; } 241 241 bool peerConnectionEnabled() const { return m_isPeerConnectionEnabled; } 242 242 void setPeerConnectionEnabled(bool isEnabled) { m_isPeerConnectionEnabled = isEnabled; } … … 503 503 #if ENABLE(WEB_RTC) 504 504 bool m_isWebRTCDTMFEnabled { true }; 505 bool m_isWebRTC VP8CodecEnabled { true };505 bool m_isWebRTCH265CodecEnabled { true }; 506 506 bool m_isPeerConnectionEnabled { true }; 507 507 bool m_isWebRTCMDNSICECandidatesEnabled { false }; -
trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h
r257234 r259452 104 104 void enableEnumeratingAllNetworkInterfaces(); 105 105 106 void supports VP8(bool value) { m_supportsVP8= value; }106 void supportsH265(bool value) { m_supportsH265 = value; } 107 107 virtual void disableNonLocalhostConnections() { m_disableNonLocalhostConnections = true; } 108 108 … … 141 141 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> m_factory; 142 142 bool m_disableNonLocalhostConnections { false }; 143 bool m_supports VP8{ false };143 bool m_supportsH265 { false }; 144 144 bool m_enableLogging { true }; 145 145 bool m_useDTLS10 { false }; -
trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp
r256377 r259452 55 55 ASSERT(isMainThread()); 56 56 57 auto codecSupport = m_supports VP8 ? webrtc::WebKitCodecSupport::H264AndVP8 : webrtc::WebKitCodecSupport::H264;57 auto codecSupport = m_supportsH265 ? webrtc::WebKitCodecSupport::H264VP8AndH265 : webrtc::WebKitCodecSupport::H264AndVP8; 58 58 return webrtc::createWebKitDecoderFactory(codecSupport); 59 59 } … … 63 63 ASSERT(isMainThread()); 64 64 65 auto codecSupport = m_supports VP8 ? webrtc::WebKitCodecSupport::H264AndVP8 : webrtc::WebKitCodecSupport::H264;65 auto codecSupport = m_supportsH265 ? webrtc::WebKitCodecSupport::H264VP8AndH265 : webrtc::WebKitCodecSupport::H264AndVP8; 66 66 return webrtc::createWebKitEncoderFactory(codecSupport); 67 67 } -
trunk/Source/WebCore/testing/Internals.cpp
r259435 r259452 554 554 WebCore::useRealRTCPeerConnectionFactory(rtcProvider); 555 555 rtcProvider.disableNonLocalhostConnections(); 556 RuntimeEnabledFeatures::sharedFeatures().setWebRTC VP8CodecEnabled(true);556 RuntimeEnabledFeatures::sharedFeatures().setWebRTCH265CodecEnabled(true); 557 557 page.settings().setWebRTCEncryptionEnabled(true); 558 558 #endif -
trunk/Source/WebKit/ChangeLog
r259449 r259452 1 2020-04-03 youenn fablet <youenn@apple.com> 2 3 Add initial support for WebRTC HEVC 4 https://bugs.webkit.org/show_bug.cgi?id=204283 5 6 Reviewed by Eric Carlson. 7 8 Remove VP8 runtime flag and add a H365 runtime flag instead. 9 10 * Shared/WebPreferences.yaml: 11 * WebProcess/WebPage/WebPage.cpp: 12 (WebKit::WebPage::updatePreferences): 13 1 14 2020-04-03 Yousuke Kimoto <yousuke.kimoto@sony.com> 2 15 -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r259275 r259452 582 582 condition: ENABLE(MEDIA_STREAM) 583 583 584 WebRTC VP8CodecEnabled:585 type: bool 586 defaultValue: true584 WebRTCH265CodecEnabled: 585 type: bool 586 defaultValue: false 587 587 webcoreBinding: RuntimeEnabledFeatures 588 588 condition: ENABLE(WEB_RTC) 589 humanReadableName: "WebRTC VP8codec"590 humanReadableDescription: "Enable WebRTC VP8codec"591 category: internal589 humanReadableName: "WebRTC H265 codec" 590 humanReadableDescription: "Enable WebRTC H265 codec" 591 category: experimental 592 592 593 593 WebRTCPlatformCodecsInGPUProcessEnabled: -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r259392 r259452 3666 3666 m_drawingArea->updatePreferences(store); 3667 3667 3668 #if USE(LIBWEBRTC) 3669 m_page->libWebRTCProvider().supportsH265(RuntimeEnabledFeatures::sharedFeatures().webRTCH265CodecEnabled()); 3670 #endif 3671 3668 3672 #if ENABLE(GPU_PROCESS) 3669 3673 // FIXME: useGPUProcessForMedia should be a RuntimeEnabledFeature since it's global.
Note:
See TracChangeset
for help on using the changeset viewer.