Changeset 270256 in webkit


Ignore:
Timestamp:
Nov 30, 2020 11:36:55 AM (20 months ago)
Author:
youenn@apple.com
Message:

Introduce an experimental flag specific to VP9 profile 2
https://bugs.webkit.org/show_bug.cgi?id=219350

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Allow to enable profile 0 but not profile 2 for VP9 encoder and decoder.

  • Source/webrtc/sdk/WebKit/WebKitDecoder.mm:

(webrtc::createWebKitDecoderFactory):

  • Source/webrtc/sdk/WebKit/WebKitEncoder.mm:

(webrtc::createWebKitEncoderFactory):

  • Source/webrtc/sdk/WebKit/WebKitUtilities.h:
  • Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h:
  • Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m:

(-[RTCDefaultVideoDecoderFactory initWithH265:vp9Profile0:vp9Profile2:vp9VTB:]):
(-[RTCDefaultVideoDecoderFactory supportedCodecs]):
(-[RTCDefaultVideoDecoderFactory initWithH265:vp9:vp9VTB:]): Deleted.

  • Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h:
  • Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m:

(-[RTCDefaultVideoEncoderFactory initWithH265:vp9Profile0:vp9Profile2:lowLatencyH264:]):
(+[RTCDefaultVideoEncoderFactory supportedCodecs]):
(+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9Profile0:vp9Profile2:]):
(-[RTCDefaultVideoEncoderFactory supportedCodecs]):
(-[RTCDefaultVideoEncoderFactory initWithH265:vp9:lowLatencyH264:]): Deleted.
(+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9:]): Deleted.

Source/WebCore:

Introduce an experimental flag for VP9 profile 2.
Pass it to libwebrtc backend when creating codec factories.
Profile 2 support is only enabled if profile 0 support is also enabled.
Covered by updated test.

  • page/Page.cpp:

(WebCore::m_shouldRelaxThirdPartyCookieBlocking):

  • page/RuntimeEnabledFeatures.h:

(WebCore::RuntimeEnabledFeatures::webRTCVP9Profile0CodecEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile0CodecEnabled):
(WebCore::RuntimeEnabledFeatures::webRTCVP9Profile2CodecEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile2CodecEnabled):
(WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): Deleted.

  • platform/mediastream/libwebrtc/LibWebRTCProvider.h:

(WebCore::LibWebRTCProvider::setVP9Support):

  • platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:

(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):

  • testing/Internals.cpp:

(WebCore::Internals::setWebRTCVP9Support):

  • testing/Internals.h:
  • testing/Internals.idl:

Source/WebKit:

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences):

Source/WTF:

  • Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

  • webrtc/vp9-expected.txt:
  • webrtc/vp9-vtb.html:
  • webrtc/vp9.html:
Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r270255 r270256  
     12020-11-30  Youenn Fablet  <youenn@apple.com>
     2
     3        Introduce an experimental flag specific to VP9 profile 2
     4        https://bugs.webkit.org/show_bug.cgi?id=219350
     5
     6        Reviewed by Eric Carlson.
     7
     8        * webrtc/vp9-expected.txt:
     9        * webrtc/vp9-vtb.html:
     10        * webrtc/vp9.html:
     11
    1122020-11-30  Youenn Fablet  <youenn@apple.com>
    213
  • trunk/LayoutTests/webrtc/vp9-expected.txt

    r267644 r270256  
    11
    22
    3 PASS VP9 in getCapabilities
     3PASS VP9 in sender getCapabilities
     4PASS VP9 in receiver getCapabilities
    45PASS Verify VP9 activation
    56PASS Setting video exchange
  • trunk/LayoutTests/webrtc/vp9-vtb.html

    r268805 r270256  
    1717test(() => {
    1818    if (window.internals) {
    19         window.internals.setWebRTCVP9Support(true);
     19        window.internals.setWebRTCVP9Support(true, true);
    2020        window.internals.setWebRTCVP9VTBSupport(true);
    2121    }
  • trunk/LayoutTests/webrtc/vp9.html

    r263820 r270256  
    1414        <script src ="routines.js"></script>
    1515        <script>
    16 let hasVP9;
     16let hasVP9 = false;
    1717test(() => {
    1818    if (window.internals)
    19         window.internals.setWebRTCVP9Support(false);
     19        window.internals.setWebRTCVP9Support(false, false);
    2020
    2121    let codecs = RTCRtpSender.getCapabilities("video").codecs;
    22     hasVP9 = codecs.some((codec) => { return codec.mimeType == "video/VP9"; });
    23     assert_false(hasVP9);
     22    vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
     23    assert_equals(vp9Codecs.length, 0, "no vp9 codec");
    2424
    2525    if (window.internals)
    26         window.internals.setWebRTCVP9Support(true);
     26        window.internals.setWebRTCVP9Support(true, false);
    2727
    2828    codecs = RTCRtpSender.getCapabilities("video").codecs;
    29     hasVP9 = codecs.some((codec) => { return codec.mimeType == "video/VP9"; });
    30     assert_true(hasVP9);
    31 }, "VP9 in getCapabilities");
     29    vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
     30    assert_equals(vp9Codecs.length, 1, "One vp9 codec");
     31    assert_equals(vp9Codecs[0].sdpFmtpLine, "profile-id=0", "profile 0");
     32
     33    if (window.internals)
     34        window.internals.setWebRTCVP9Support(true, true);
     35
     36    codecs = RTCRtpSender.getCapabilities("video").codecs;
     37    vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
     38    assert_equals(vp9Codecs[0].sdpFmtpLine, "profile-id=0", "first codec");
     39    assert_equals(vp9Codecs[1].sdpFmtpLine, "profile-id=2", "second codec");
     40
     41    hasVP9 = true;
     42}, "VP9 in sender getCapabilities");
     43
     44test(() => {
     45    if (window.internals)
     46        window.internals.setWebRTCVP9Support(false, false);
     47
     48    let codecs = RTCRtpReceiver.getCapabilities("video").codecs;
     49    vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
     50    assert_equals(vp9Codecs.length, 0, "no vp9 codec");
     51
     52    if (window.internals)
     53        window.internals.setWebRTCVP9Support(true, false);
     54
     55    codecs = RTCRtpReceiver.getCapabilities("video").codecs;
     56    vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
     57    assert_equals(vp9Codecs.length, 1, "One vp9 codec");
     58    assert_equals(vp9Codecs[0].sdpFmtpLine, "profile-id=0", "profile 0");
     59
     60    if (window.internals)
     61        window.internals.setWebRTCVP9Support(true, true);
     62
     63    codecs = RTCRtpReceiver.getCapabilities("video").codecs;
     64    vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
     65    assert_equals(vp9Codecs[0].sdpFmtpLine, "profile-id=0", "first codec");
     66    assert_equals(vp9Codecs[1].sdpFmtpLine, "profile-id=2", "second codec");
     67}, "VP9 in receiver getCapabilities");
    3268
    3369if (hasVP9) {
  • trunk/Source/ThirdParty/libwebrtc/ChangeLog

    r270181 r270256  
     12020-11-30  Youenn Fablet  <youenn@apple.com>
     2
     3        Introduce an experimental flag specific to VP9 profile 2
     4        https://bugs.webkit.org/show_bug.cgi?id=219350
     5
     6        Reviewed by Eric Carlson.
     7
     8        Allow to enable profile 0 but not profile 2 for VP9 encoder and decoder.
     9
     10        * Source/webrtc/sdk/WebKit/WebKitDecoder.mm:
     11        (webrtc::createWebKitDecoderFactory):
     12        * Source/webrtc/sdk/WebKit/WebKitEncoder.mm:
     13        (webrtc::createWebKitEncoderFactory):
     14        * Source/webrtc/sdk/WebKit/WebKitUtilities.h:
     15        * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h:
     16        * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m:
     17        (-[RTCDefaultVideoDecoderFactory initWithH265:vp9Profile0:vp9Profile2:vp9VTB:]):
     18        (-[RTCDefaultVideoDecoderFactory supportedCodecs]):
     19        (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:vp9VTB:]): Deleted.
     20        * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h:
     21        * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m:
     22        (-[RTCDefaultVideoEncoderFactory initWithH265:vp9Profile0:vp9Profile2:lowLatencyH264:]):
     23        (+[RTCDefaultVideoEncoderFactory supportedCodecs]):
     24        (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9Profile0:vp9Profile2:]):
     25        (-[RTCDefaultVideoEncoderFactory supportedCodecs]):
     26        (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:lowLatencyH264:]): Deleted.
     27        (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9:]): Deleted.
     28
    1292020-11-27  Youenn Fablet  <youenn@apple.com>
    230
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitDecoder.mm

    r269306 r270256  
    226226std::unique_ptr<webrtc::VideoDecoderFactory> createWebKitDecoderFactory(WebKitH265 supportsH265, WebKitVP9 supportsVP9, WebKitVP9VTB supportsVP9VTB)
    227227{
    228     auto internalFactory = ObjCToNativeVideoDecoderFactory([[RTCDefaultVideoDecoderFactory alloc] initWithH265: supportsH265 == WebKitH265::On vp9: supportsVP9 == WebKitVP9::On vp9VTB: supportsVP9VTB == WebKitVP9VTB::On]);
     228    auto internalFactory = ObjCToNativeVideoDecoderFactory([[RTCDefaultVideoDecoderFactory alloc] initWithH265: supportsH265 == WebKitH265::On vp9Profile0:supportsVP9 > WebKitVP9::Off vp9Profile2:supportsVP9 == WebKitVP9::Profile0And2 vp9VTB: supportsVP9VTB == WebKitVP9VTB::On]);
    229229    if (videoDecoderCallbacks().createCallback)
    230230        return std::make_unique<RemoteVideoDecoderFactory>(std::move(internalFactory));
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitEncoder.mm

    r269782 r270256  
    221221#endif
    222222
    223     auto internalFactory = ObjCToNativeVideoEncoderFactory([[RTCDefaultVideoEncoderFactory alloc] initWithH265: supportsH265 == WebKitH265::On vp9:supportsVP9 == WebKitVP9::On lowLatencyH264:useH264LowLatency == WebKitH264LowLatency::On]);
     223    auto internalFactory = ObjCToNativeVideoEncoderFactory([[RTCDefaultVideoEncoderFactory alloc] initWithH265: supportsH265 == WebKitH265::On vp9Profile0:supportsVP9 > WebKitVP9::Off vp9Profile2:supportsVP9 == WebKitVP9::Profile0And2 lowLatencyH264:useH264LowLatency == WebKitH264LowLatency::On]);
    224224
    225225    if (videoEncoderCallbacks().createCallback)
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.h

    r269293 r270256  
    3737
    3838enum class WebKitH265 { Off, On };
    39 enum class WebKitVP9 { Off, On };
     39enum class WebKitVP9 { Off, Profile0, Profile0And2 };
    4040enum class WebKitVP9VTB { Off, On };
    4141enum class WebKitH264LowLatency { Off, On };
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h

    r268805 r270256  
    2222__attribute__((objc_runtime_name("WK_RTCDefaultVideoDecoderFactory")))
    2323@interface RTCDefaultVideoDecoderFactory : NSObject <RTCVideoDecoderFactory>
    24 - (id)initWithH265:(bool)supportH265 vp9:(bool)supportsVP9 vp9VTB:(bool)supportsVP9VTB;
     24- (id)initWithH265:(bool)supportH265 vp9Profile0:(bool)supportsVP9Profile0 vp9Profile2:(bool)supportsVP9Profile2 vp9VTB:(bool)supportsVP9VTB;
    2525@end
    2626
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m

    r269642 r270256  
    2929@implementation RTCDefaultVideoDecoderFactory {
    3030  bool _supportsH265;
    31   bool _supportsVP9;
     31  bool _supportsVP9Profile0;
     32  bool _supportsVP9Profile2;
    3233  bool _supportsVP9VTB;
    3334}
    3435
    35 - (id)initWithH265:(bool)supportsH265 vp9:(bool)supportsVP9 vp9VTB:(bool)supportsVP9VTB
     36- (id)initWithH265:(bool)supportsH265 vp9Profile0:(bool)supportsVP9Profile0 vp9Profile2:(bool)supportsVP9Profile2 vp9VTB:(bool)supportsVP9VTB
    3637{
    3738  self = [super init];
    3839  if (self) {
    3940      _supportsH265 = supportsH265;
    40       _supportsVP9 = supportsVP9;
     41      _supportsVP9Profile0 = supportsVP9Profile0;
     42      _supportsVP9Profile2 = supportsVP9Profile2;
    4143      // Use kCMVideoCodecType_VP9 once added to CMFormatDescription.h
    42       _supportsVP9VTB = supportsVP9 && (supportsVP9VTB || VTIsHardwareDecodeSupported('vp09'));
     44      _supportsVP9VTB = (supportsVP9Profile0 || supportsVP9Profile2) && (supportsVP9VTB || VTIsHardwareDecodeSupported('vp09'));
    4345;
    4446  }
     
    8183
    8284#if defined(RTC_ENABLE_VP9)
    83   if (_supportsVP9) {
     85  if (_supportsVP9Profile0) {
    8486    [codecs addObject:[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name parameters: @{
    8587      @"profile-id" : @"0",
    8688    }]];
    87 
     89  }
     90  if (_supportsVP9Profile2) {
    8891    [codecs addObject:[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name parameters: @{
    8992      @"profile-id" : @"2",
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h

    r269293 r270256  
    2323@interface RTCDefaultVideoEncoderFactory : NSObject <RTCVideoEncoderFactory>
    2424
    25 - (id)initWithH265:(bool)supportH265 vp9:(bool)supportsVP9 lowLatencyH264:(bool)useLowLatencyH264;
     25- (id)initWithH265:(bool)supportH265 vp9Profile0:(bool)supportsVP9Profile0 vp9Profile2:(bool)supportsVP9Profile2 lowLatencyH264:(bool)useLowLatencyH264;
    2626+ (NSArray<RTCVideoCodecInfo *> *)supportedCodecs;
    27 + (NSArray<RTCVideoCodecInfo *> *)supportedCodecsWithH265:(bool)supportsH265 vp9:(bool)supportsVP9;
     27+ (NSArray<RTCVideoCodecInfo *> *)supportedCodecsWithH265:(bool)supportsH265 vp9Profile0:(bool)supportsVP9Profile0 vp9Profile2:(bool)supportsVP9Profile2;
    2828
    2929@end
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m

    r269642 r270256  
    2626@implementation RTCDefaultVideoEncoderFactory {
    2727  bool _supportsH265;
    28   bool _supportsVP9;
     28  bool _supportsVP9Profile0;
     29  bool _supportsVP9Profile2;
    2930  bool _useLowLatencyH264;
    3031}
    3132
    32 - (id)initWithH265:(bool)supportsH265 vp9:(bool)supportsVP9 lowLatencyH264:(bool)useLowLatencyH264
     33- (id)initWithH265:(bool)supportsH265 vp9Profile0:(bool)supportsVP9Profile0 vp9Profile2:(bool)supportsVP9Profile2 lowLatencyH264:(bool)useLowLatencyH264
    3334{
    3435  self = [super init];
    3536  if (self) {
    36       _supportsH265 = supportsH265;
    37       _supportsVP9 = supportsVP9;
    38       _useLowLatencyH264 = useLowLatencyH264;
     37    _supportsH265 = supportsH265;
     38    _supportsVP9Profile0 = supportsVP9Profile0;
     39    _supportsVP9Profile2 = supportsVP9Profile2;
     40    _useLowLatencyH264 = useLowLatencyH264;
    3941  }
    4042  return self;
     
    4244
    4345+ (NSArray<RTCVideoCodecInfo *> *)supportedCodecs {
    44     return [self supportedCodecsWithH265:true vp9:true];
     46    return [self supportedCodecsWithH265:true vp9Profile0:true vp9Profile2:true];
    4547}
    4648
    47 + (NSArray<RTCVideoCodecInfo *> *)supportedCodecsWithH265:(bool)supportsH265 vp9:(bool)supportsVP9 {
     49+ (NSArray<RTCVideoCodecInfo *> *)supportedCodecsWithH265:(bool)supportsH265 vp9Profile0:(bool)supportsVP9Profile0 vp9Profile2:(bool)supportsVP9Profile2 {
    4850
    4951   NSMutableArray<RTCVideoCodecInfo *> *codecs = [[NSMutableArray alloc] initWithCapacity:8];
     
    8183
    8284#if defined(RTC_ENABLE_VP9)
    83   if (supportsVP9) {
     85  if (supportsVP9Profile0) {
    8486    [codecs addObject:[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name parameters: @{
    8587      @"profile-id" : @"0",
    8688    }]];
    87 
     89  }
     90  if (supportsVP9Profile2) {
    8891    [codecs addObject:[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name parameters: @{
    8992      @"profile-id" : @"2",
     
    118121
    119122- (NSArray<RTCVideoCodecInfo *> *)supportedCodecs {
    120   return [[self class] supportedCodecsWithH265:_supportsH265 vp9: _supportsVP9];
     123  return [[self class] supportedCodecsWithH265:_supportsH265 vp9Profile0:_supportsVP9Profile0 vp9Profile2: _supportsVP9Profile2];
    121124}
    122125
  • trunk/Source/WTF/ChangeLog

    r270219 r270256  
     12020-11-30  Youenn Fablet  <youenn@apple.com>
     2
     3        Introduce an experimental flag specific to VP9 profile 2
     4        https://bugs.webkit.org/show_bug.cgi?id=219350
     5
     6        Reviewed by Eric Carlson.
     7
     8        * Scripts/Preferences/WebPreferencesExperimental.yaml:
     9
    1102020-11-28  Per Arne Vollan  <pvollan@apple.com>
    211
  • trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml

    r270152 r270256  
    10381038      default: WebKit::defaultWebRTCCodecsInGPUProcess()
    10391039
    1040 # FIXME: Is this implemented for WebKitLegacy? If not, this should be excluded from WebKitLegacy entirely.
    1041 WebRTCVP9CodecEnabled:
    1042   type: bool
    1043   humanReadableName: "WebRTC VP9 codec"
    1044   humanReadableDescription: "Enable WebRTC VP9 codec"
     1040WebRTCVP9Profile0CodecEnabled:
     1041  type: bool
     1042  humanReadableName: "WebRTC VP9 profile 0 codec"
     1043  humanReadableDescription: "Enable WebRTC VP9 profile 0 codec"
     1044  webcoreBinding: RuntimeEnabledFeatures
     1045  condition: ENABLE(WEB_RTC)
     1046  defaultValue:
     1047    WebKitLegacy:
     1048      default: false
     1049    WebKit:
     1050      default: false
     1051
     1052WebRTCVP9Profile2CodecEnabled:
     1053  type: bool
     1054  humanReadableName: "WebRTC VP9 profile 2 codec"
     1055  humanReadableDescription: "Enable WebRTC VP9 profile 2 codec"
    10451056  webcoreBinding: RuntimeEnabledFeatures
    10461057  condition: ENABLE(WEB_RTC)
  • trunk/Source/WebCore/ChangeLog

    r270255 r270256  
     12020-11-30  Youenn Fablet  <youenn@apple.com>
     2
     3        Introduce an experimental flag specific to VP9 profile 2
     4        https://bugs.webkit.org/show_bug.cgi?id=219350
     5
     6        Reviewed by Eric Carlson.
     7
     8        Introduce an experimental flag for VP9 profile 2.
     9        Pass it to libwebrtc backend when creating codec factories.
     10        Profile 2 support is only enabled if profile 0 support is also enabled.
     11        Covered by updated test.
     12
     13        * page/Page.cpp:
     14        (WebCore::m_shouldRelaxThirdPartyCookieBlocking):
     15        * page/RuntimeEnabledFeatures.h:
     16        (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile0CodecEnabled const):
     17        (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile0CodecEnabled):
     18        (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile2CodecEnabled const):
     19        (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile2CodecEnabled):
     20        (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): Deleted.
     21        (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): Deleted.
     22        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
     23        (WebCore::LibWebRTCProvider::setVP9Support):
     24        * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
     25        (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
     26        (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
     27        * testing/Internals.cpp:
     28        (WebCore::Internals::setWebRTCVP9Support):
     29        * testing/Internals.h:
     30        * testing/Internals.idl:
     31
    1322020-11-30  Youenn Fablet  <youenn@apple.com>
    233
  • trunk/Source/WebCore/page/Page.cpp

    r269888 r270256  
    340340#if USE(LIBWEBRTC)
    341341    m_libWebRTCProvider->setH265Support(RuntimeEnabledFeatures::sharedFeatures().webRTCH265CodecEnabled());
    342     m_libWebRTCProvider->setVP9Support(RuntimeEnabledFeatures::sharedFeatures().webRTCVP9CodecEnabled());
     342    m_libWebRTCProvider->setVP9Support(RuntimeEnabledFeatures::sharedFeatures().webRTCVP9Profile0CodecEnabled(), RuntimeEnabledFeatures::sharedFeatures().webRTCVP9Profile2CodecEnabled());
    343343#endif
    344344
  • trunk/Source/WebCore/page/RuntimeEnabledFeatures.h

    r269712 r270256  
    152152    bool webRTCH265CodecEnabled() const { return m_isWebRTCH265CodecEnabled; }
    153153    void setWebRTCH265CodecEnabled(bool isEnabled) { m_isWebRTCH265CodecEnabled = isEnabled; }
    154     bool webRTCVP9CodecEnabled() const { return m_isWebRTCVP9CodecEnabled; }
    155     void setWebRTCVP9CodecEnabled(bool isEnabled) { m_isWebRTCVP9CodecEnabled = isEnabled; }
     154    bool webRTCVP9Profile0CodecEnabled() const { return m_isWebRTCVP9Profile0CodecEnabled; }
     155    void setWebRTCVP9Profile0CodecEnabled(bool isEnabled) { m_isWebRTCVP9Profile0CodecEnabled = isEnabled; }
     156    bool webRTCVP9Profile2CodecEnabled() const { return m_isWebRTCVP9Profile2CodecEnabled; }
     157    void setWebRTCVP9Profile2CodecEnabled(bool isEnabled) { m_isWebRTCVP9Profile2CodecEnabled = isEnabled; }
    156158    bool webRTCH264LowLatencyEncoderEnabled() const { return m_isWebRTCH264LowLatencyEncoderEnabled; }
    157159    void setWebRTCH264LowLatencyEncoderEnabled(bool isEnabled) { m_isWebRTCH264LowLatencyEncoderEnabled = isEnabled; }
     
    313315    bool m_isWebRTCPlatformCodecsInGPUProcessEnabled { false };
    314316    bool m_isWebRTCH265CodecEnabled { false };
    315     bool m_isWebRTCVP9CodecEnabled { false };
     317    bool m_isWebRTCVP9Profile0CodecEnabled { false };
     318    bool m_isWebRTCVP9Profile2CodecEnabled { false };
    316319    bool m_isWebRTCH264LowLatencyEncoderEnabled { false };
    317320#endif
  • trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h

    r268805 r270256  
    108108
    109109    void setH265Support(bool value) { m_supportsH265 = value; }
    110     void setVP9Support(bool value) { m_supportsVP9 = value; }
     110    void setVP9Support(bool supportsVP9Profile0, bool supportsVP9Profile2);
    111111    void setVP9VTBSupport(bool value) { m_supportsVP9VTB = value; }
    112112    bool isSupportingH265() const { return m_supportsH265; }
    113     bool isSupportingVP9() const { return m_supportsVP9; }
     113    bool isSupportingVP9Profile0() const { return m_supportsVP9Profile0; }
     114    bool isSupportingVP9Profile2() const { return m_supportsVP9Profile2; }
    114115    bool isSupportingVP9VTB() const { return m_supportsVP9VTB; }
    115116    virtual void disableNonLocalhostConnections() { m_disableNonLocalhostConnections = true; }
     
    155156    bool m_disableNonLocalhostConnections { false };
    156157    bool m_supportsH265 { false };
    157     bool m_supportsVP9 { false };
     158    bool m_supportsVP9Profile0 { false };
     159    bool m_supportsVP9Profile2 { false };
    158160    bool m_supportsVP9VTB { false };
    159161    bool m_enableLogging { true };
     
    161163#endif
    162164};
     165
     166#if USE(LIBWEBRTC)
     167inline void LibWebRTCProvider::setVP9Support(bool supportsVP9Profile0, bool supportsVP9Profile2)
     168{
     169    m_supportsVP9Profile0 = supportsVP9Profile0;
     170    m_supportsVP9Profile2 = supportsVP9Profile2;
     171}
     172#endif
    163173
    164174} // namespace WebCore
  • trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp

    r269293 r270256  
    6565        return nullptr;
    6666
    67     return webrtc::createWebKitDecoderFactory(isSupportingH265() ? webrtc::WebKitH265::On : webrtc::WebKitH265::Off, isSupportingVP9() ? webrtc::WebKitVP9::On : webrtc::WebKitVP9::Off, isSupportingVP9VTB() ? webrtc::WebKitVP9VTB::On : webrtc::WebKitVP9VTB::Off);
     67    auto vp9Support = isSupportingVP9Profile2() ? webrtc::WebKitVP9::Profile0And2 : isSupportingVP9Profile0() ? webrtc::WebKitVP9::Profile0 : webrtc::WebKitVP9::Off;
     68    return webrtc::createWebKitDecoderFactory(isSupportingH265() ? webrtc::WebKitH265::On : webrtc::WebKitH265::Off, vp9Support, isSupportingVP9VTB() ? webrtc::WebKitVP9VTB::On : webrtc::WebKitVP9VTB::Off);
    6869}
    6970
     
    7576        return nullptr;
    7677
    77     return webrtc::createWebKitEncoderFactory(isSupportingH265() ? webrtc::WebKitH265::On : webrtc::WebKitH265::Off, isSupportingVP9() ? webrtc::WebKitVP9::On : webrtc::WebKitVP9::Off, RuntimeEnabledFeatures::sharedFeatures().webRTCH264LowLatencyEncoderEnabled() ? webrtc::WebKitH264LowLatency::On : webrtc::WebKitH264LowLatency::Off);
     78    auto vp9Support = isSupportingVP9Profile2() ? webrtc::WebKitVP9::Profile0And2 : isSupportingVP9Profile0() ? webrtc::WebKitVP9::Profile0 : webrtc::WebKitVP9::Off;
     79    return webrtc::createWebKitEncoderFactory(isSupportingH265() ? webrtc::WebKitH265::On : webrtc::WebKitH265::Off, vp9Support, RuntimeEnabledFeatures::sharedFeatures().webRTCH264LowLatencyEncoderEnabled() ? webrtc::WebKitH264LowLatency::On : webrtc::WebKitH264LowLatency::Off);
    7880}
    7981
  • trunk/Source/WebCore/testing/Internals.cpp

    r270107 r270256  
    15571557}
    15581558
    1559 void Internals::setWebRTCVP9Support(bool value)
     1559void Internals::setWebRTCVP9Support(bool supportVP9Profile0, bool supportVP9Profile2)
    15601560{
    15611561#if USE(LIBWEBRTC)
    15621562    if (auto* page = contextDocument()->page()) {
    1563         page->libWebRTCProvider().setVP9Support(value);
     1563        page->libWebRTCProvider().setVP9Support(supportVP9Profile0, supportVP9Profile2);
    15641564        page->libWebRTCProvider().clearFactory();
    15651565    }
  • trunk/Source/WebCore/testing/Internals.h

    r270107 r270256  
    608608    void applyRotationForOutgoingVideoSources(RTCPeerConnection&);
    609609    void setWebRTCH265Support(bool);
    610     void setWebRTCVP9Support(bool);
     610    void setWebRTCVP9Support(bool supportVP9Profile0, bool supportVP9Profile2);
    611611    void setWebRTCVP9VTBSupport(bool);
    612612    uint64_t sframeCounter(const RTCRtpSFrameTransform&);
  • trunk/Source/WebCore/testing/Internals.idl

    r270107 r270256  
    801801    [Conditional=WEB_RTC] undefined applyRotationForOutgoingVideoSources(RTCPeerConnection connection);
    802802    [Conditional=WEB_RTC] undefined setWebRTCH265Support(boolean allowed);
    803     [Conditional=WEB_RTC] undefined setWebRTCVP9Support(boolean allowed);
     803    [Conditional=WEB_RTC] undefined setWebRTCVP9Support(boolean supportVP9Profile0, boolean supportVP9Profile2);
    804804    [Conditional=WEB_RTC] undefined setWebRTCVP9VTBSupport(boolean allowed);
    805805    [Conditional=WEB_RTC] unsigned long long sframeCounter(RTCRtpSFrameTransform transform);
  • trunk/Source/WebKit/ChangeLog

    r270249 r270256  
     12020-11-30  Youenn Fablet  <youenn@apple.com>
     2
     3        Introduce an experimental flag specific to VP9 profile 2
     4        https://bugs.webkit.org/show_bug.cgi?id=219350
     5
     6        Reviewed by Eric Carlson.
     7
     8        * WebProcess/WebPage/WebPage.cpp:
     9        (WebKit::WebPage::updatePreferences):
     10
    1112020-11-30  Antti Koivisto  <antti@apple.com>
    212
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r270216 r270256  
    37833783#if USE(LIBWEBRTC)
    37843784    m_page->libWebRTCProvider().setH265Support(RuntimeEnabledFeatures::sharedFeatures().webRTCH265CodecEnabled());
    3785     m_page->libWebRTCProvider().setVP9Support(RuntimeEnabledFeatures::sharedFeatures().webRTCVP9CodecEnabled());
     3785    m_page->libWebRTCProvider().setVP9Support(RuntimeEnabledFeatures::sharedFeatures().webRTCVP9Profile0CodecEnabled(), RuntimeEnabledFeatures::sharedFeatures().webRTCVP9Profile2CodecEnabled());
    37863786    LibWebRTCProvider::setH264HardwareEncoderAllowed(store.getBoolValueForKey(WebPreferencesKey::webRTCH264HardwareEncoderEnabledKey()));
    37873787#endif
Note: See TracChangeset for help on using the changeset viewer.