Changeset 270294 in webkit
- Timestamp:
- Dec 1, 2020 4:34:23 AM (20 months ago)
- Location:
- trunk
- Files:
-
- 5 added
- 32 edited
- 2 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/webrtc/audio-script-transform-expected.txt (added)
-
LayoutTests/http/wpt/webrtc/audio-script-transform.html (added)
-
LayoutTests/http/wpt/webrtc/context-transform.js (added)
-
LayoutTests/http/wpt/webrtc/video-script-transform-expected.txt (added)
-
LayoutTests/http/wpt/webrtc/video-script-transform.html (added)
-
Source/ThirdParty/libwebrtc/ChangeLog (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Source/webrtc/api/rtp_receiver_interface.h (modified) (2 diffs)
-
Source/ThirdParty/libwebrtc/Source/webrtc/api/rtp_sender_interface.h (modified) (2 diffs)
-
Source/ThirdParty/libwebrtc/Source/webrtc/call/video_send_stream.h (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Source/webrtc/media/engine/webrtc_video_engine.cc (modified) (2 diffs)
-
Source/ThirdParty/libwebrtc/Source/webrtc/media/engine/webrtc_video_engine.h (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Source/webrtc/pc/rtp_sender.cc (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Source/webrtc/pc/rtp_sender.h (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Source/webrtc/pc/video_rtp_receiver.cc (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Source/webrtc/pc/video_rtp_receiver.h (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Source/webrtc/video/video_send_stream.cc (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Source/webrtc/video/video_send_stream.h (modified) (1 diff)
-
Source/WebCore/CMakeLists.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/DerivedSources-input.xcfilelist (modified) (1 diff)
-
Source/WebCore/DerivedSources-output.xcfilelist (modified) (1 diff)
-
Source/WebCore/DerivedSources.make (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/RTCEncodedVideoFrame.cpp (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/RTCEncodedVideoFrame.h (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/RTCEncodedVideoFrame.idl (modified) (2 diffs)
-
Source/WebCore/Modules/mediastream/RTCRtpScriptTransformer.cpp (modified) (2 diffs)
-
Source/WebCore/Modules/mediastream/RTCRtpScriptTransformerContext.h (copied) (copied from trunk/Source/WebCore/Modules/mediastream/RTCEncodedVideoFrame.h) (1 diff)
-
Source/WebCore/Modules/mediastream/RTCRtpScriptTransformerContext.idl (copied) (copied from trunk/Source/WebCore/Modules/mediastream/RTCEncodedVideoFrame.idl) (1 diff)
-
Source/WebCore/Modules/mediastream/RTCRtpTransformBackend.h (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/RTCRtpTransformableFrame.h (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.cpp (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.h (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.cpp (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.h (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.cpp (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.h (modified) (1 diff)
-
Source/WebCore/Sources.txt (modified) (1 diff)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r270290 r270294 1 2020-12-01 Youenn Fablet <youenn@apple.com> 2 3 Allow RTCRtpScriptTransformer to request key frames 4 https://bugs.webkit.org/show_bug.cgi?id=219199 5 6 Reviewed by Eric Carlson. 7 8 * http/wpt/webrtc/audio-script-transform-expected.txt: Added. 9 * http/wpt/webrtc/audio-script-transform.html: Added. 10 * http/wpt/webrtc/video-script-transform-expected.txt: Added. 11 * http/wpt/webrtc/video-script-transform.html: Added. 12 * http/wpt/webrtc/context-transform.js: Added. 13 1 14 2020-12-01 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/Source/ThirdParty/libwebrtc/ChangeLog
r270256 r270294 1 2020-12-01 Youenn Fablet <youenn@apple.com> 2 3 Allow RTCRtpScriptTransformer to request key frames 4 https://bugs.webkit.org/show_bug.cgi?id=219199 5 6 Reviewed by Eric Carlson. 7 8 Add GenerateKeyFrame to sender and receiver interface. 9 Pipe the request to the necessary underlying objects implementing this as follows: 10 - Ask encoder to generate a key frame for sender transforms 11 - Send a FIR network request from receiver to sender for receiver transforms 12 13 * Source/webrtc/api/rtp_receiver_interface.h: 14 * Source/webrtc/api/rtp_sender_interface.h: 15 * Source/webrtc/call/video_send_stream.h: 16 * Source/webrtc/media/base/media_channel.h: 17 (cricket::MediaChannel::GenerateKeyFrame): 18 * Source/webrtc/media/engine/webrtc_video_engine.cc: 19 * Source/webrtc/media/engine/webrtc_video_engine.h: 20 * Source/webrtc/pc/rtp_sender.cc: 21 * Source/webrtc/pc/rtp_sender.h: 22 * Source/webrtc/pc/video_rtp_receiver.cc: 23 * Source/webrtc/pc/video_rtp_receiver.h: 24 * Source/webrtc/video/video_send_stream.cc: 25 * Source/webrtc/video/video_send_stream.h: 26 1 27 2020-11-30 Youenn Fablet <youenn@apple.com> 2 28 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/api/rtp_receiver_interface.h
r269642 r270294 114 114 virtual void SetDepacketizerToDecoderFrameTransformer( 115 115 rtc::scoped_refptr<FrameTransformerInterface> frame_transformer); 116 #if defined(WEBRTC_WEBKIT_BUILD) 117 virtual void GenerateKeyFrame() { } 118 #endif 116 119 117 120 protected: … … 143 146 SetDepacketizerToDecoderFrameTransformer, 144 147 rtc::scoped_refptr<FrameTransformerInterface>) 148 #if defined(WEBRTC_WEBKIT_BUILD) 149 PROXY_METHOD0(void, GenerateKeyFrame) 150 #endif 145 151 END_PROXY_MAP() 146 152 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/api/rtp_sender_interface.h
r269642 r270294 97 97 virtual void SetEncoderToPacketizerFrameTransformer( 98 98 rtc::scoped_refptr<FrameTransformerInterface> frame_transformer); 99 #if defined(WEBRTC_WEBKIT_BUILD) 100 virtual void GenerateKeyFrame() { } 101 #endif 99 102 100 103 protected: … … 127 130 SetEncoderToPacketizerFrameTransformer, 128 131 rtc::scoped_refptr<FrameTransformerInterface>) 132 #if defined(WEBRTC_WEBKIT_BUILD) 133 PROXY_METHOD0(void, GenerateKeyFrame) 134 #endif 129 135 END_PROXY_MAP() 130 136 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/call/video_send_stream.h
r269642 r270294 239 239 virtual Stats GetStats() = 0; 240 240 241 #if defined(WEBRTC_WEBKIT_BUILD) 242 virtual void GenerateKeyFrame() = 0; 243 #endif 244 241 245 protected: 242 246 virtual ~VideoSendStream() {} -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/media/engine/webrtc_video_engine.cc
r269642 r270294 2644 2644 RecreateWebRtcStream(); 2645 2645 } 2646 2647 #if defined(WEBRTC_WEBKIT_BUILD) 2648 void WebRtcVideoChannel::WebRtcVideoSendStream::GenerateKeyFrame() { 2649 RTC_DCHECK_RUN_ON(&thread_checker_); 2650 if (stream_ != NULL) 2651 stream_->GenerateKeyFrame(); 2652 } 2653 #endif 2646 2654 2647 2655 void WebRtcVideoChannel::WebRtcVideoSendStream::RecreateWebRtcStream() { … … 3317 3325 if (stream) { 3318 3326 stream->GenerateKeyFrame(); 3319 } else { 3320 RTC_LOG(LS_ERROR) 3321 << "Absent receive stream; ignoring key frame generation for ssrc " 3322 << ssrc; 3323 } 3327 return; 3328 } 3329 #if defined(WEBRTC_WEBKIT_BUILD) 3330 if (ssrc != 0) { 3331 auto matching_stream = send_streams_.find(ssrc); 3332 if (matching_stream != send_streams_.end()) { 3333 matching_stream->second->GenerateKeyFrame(); 3334 return; 3335 } 3336 } 3337 #endif 3338 RTC_LOG(LS_ERROR) 3339 << "Absent receive stream; ignoring key frame generation for ssrc " 3340 << ssrc; 3324 3341 } 3325 3342 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/media/engine/webrtc_video_engine.h
r269642 r270294 360 360 rtc::scoped_refptr<webrtc::FrameTransformerInterface> 361 361 frame_transformer); 362 #if defined(WEBRTC_WEBKIT_BUILD) 363 void GenerateKeyFrame(); 364 #endif 362 365 363 366 private: -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/rtp_sender.cc
r269642 r270294 648 648 } 649 649 650 #if defined(WEBRTC_WEBKIT_BUILD) 651 void VideoRtpSender::GenerateKeyFrame() 652 { 653 if (video_media_channel() && ssrc_ && !stopped_) { 654 worker_thread_->Invoke<void>(RTC_FROM_HERE, [&] { 655 video_media_channel()->GenerateKeyFrame(ssrc_); 656 }); 657 } 658 } 659 #endif 660 650 661 } // namespace webrtc -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/rtp_sender.h
r269642 r270294 349 349 void AttachTrack() override; 350 350 351 #if defined(WEBRTC_WEBKIT_BUILD) 352 void GenerateKeyFrame() override; 353 #endif 354 351 355 private: 352 356 cricket::VideoMediaChannel* video_media_channel() { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/video_rtp_receiver.cc
r269642 r270294 116 116 } 117 117 118 #if defined(WEBRTC_WEBKIT_BUILD) 119 void VideoRtpReceiver::GenerateKeyFrame() 120 { 121 worker_thread_->Invoke<void>(RTC_FROM_HERE, [&] { 122 RTC_DCHECK_RUN_ON(worker_thread_); 123 if (media_channel_ && !stopped_) { 124 media_channel_->GenerateKeyFrame(ssrc_.value_or(0)); 125 } 126 }); 127 } 128 #endif 129 118 130 void VideoRtpReceiver::Stop() { 119 131 // TODO(deadbeef): Need to do more here to fully stop receiving packets. -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/video_rtp_receiver.h
r269642 r270294 89 89 void SetDepacketizerToDecoderFrameTransformer( 90 90 rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) override; 91 #if defined(WEBRTC_WEBKIT_BUILD) 92 void GenerateKeyFrame() override; 93 #endif 91 94 92 95 // RtpReceiverInternal implementation. -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/video/video_send_stream.cc
r269642 r270294 241 241 } 242 242 243 #if defined(WEBRTC_WEBKIT_BUILD) 244 void VideoSendStream::GenerateKeyFrame() 245 { 246 RTC_DCHECK_RUN_ON(&thread_checker_); 247 if (video_stream_encoder_) 248 video_stream_encoder_->SendKeyFrame(); 249 } 250 #endif 251 243 252 } // namespace internal 244 253 } // namespace webrtc -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/video/video_send_stream.h
r269642 r270294 87 87 void ReconfigureVideoEncoder(VideoEncoderConfig) override; 88 88 Stats GetStats() override; 89 #if defined(WEBRTC_WEBKIT_BUILD) 90 void GenerateKeyFrame() override; 91 #endif 89 92 90 93 void StopPermanentlyAndGetRtpStates(RtpStateMap* rtp_state_map, -
trunk/Source/WebCore/CMakeLists.txt
r270257 r270294 411 411 Modules/mediastream/RTCRtpScriptTransformer.idl 412 412 Modules/mediastream/RTCRtpScriptTransformerConstructor.idl 413 Modules/mediastream/RTCRtpScriptTransformerContext.idl 413 414 Modules/mediastream/RTCRtpSendParameters.idl 414 415 Modules/mediastream/RTCRtpSender+Transform.idl -
trunk/Source/WebCore/ChangeLog
r270293 r270294 1 2020-12-01 Youenn Fablet <youenn@apple.com> 2 3 Allow RTCRtpScriptTransformer to request key frames 4 https://bugs.webkit.org/show_bug.cgi?id=219199 5 <rdar://problem/71763010> 6 7 Reviewed by Eric Carlson. 8 9 Expose RTCRtpScriptTransformerContext to RTCRtpScriptTransformer as part of third parameter of the 'start' callback. 10 This context exposes some states (sender or receiver transform, audio or video transform). 11 It also exposes the ability to request key frames for video transforms. 12 13 Make RTCRtpTransformableFrame ref counted so that we can keep it even though the frame was piped to the writable stream. 14 Make LibWebRTCRtpTransformableFrame able to cope with a nullptr internal rtc frame. 15 16 Add support for RTCEncodedVideoFrame.type. 17 18 Tests: http/wpt/webrtc/audio-script-transform.html 19 http/wpt/webrtc/video-script-transform.html 20 21 * CMakeLists.txt: 22 * DerivedSources-input.xcfilelist: 23 * DerivedSources-output.xcfilelist: 24 * DerivedSources.make: 25 * Modules/mediastream/RTCEncodedVideoFrame.cpp: 26 (WebCore::RTCEncodedVideoFrame::RTCEncodedVideoFrame): 27 * Modules/mediastream/RTCEncodedVideoFrame.h: 28 (WebCore::RTCEncodedVideoFrame::type const): 29 * Modules/mediastream/RTCEncodedVideoFrame.idl: 30 * Modules/mediastream/RTCRtpScriptTransformerContext.h: Added. 31 (WebCore::RTCRtpScriptTransformerContext::side const): 32 (WebCore::RTCRtpScriptTransformerContext::mediaType const): 33 (WebCore::RTCRtpScriptTransformerContext::create): 34 (WebCore::RTCRtpScriptTransformerContext::RTCRtpScriptTransformerContext): 35 (WebCore::RTCRtpScriptTransformerContext::requestKeyFrame): 36 * Modules/mediastream/RTCRtpScriptTransformerContext.idl: Added. 37 * Modules/mediastream/RTCRtpTransformBackend.h: 38 * Modules/mediastream/RTCRtpTransformableFrame.h: 39 * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.cpp: 40 (WebCore::LibWebRTCRtpReceiverTransformBackend::requestKeyFrame): 41 * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.h: 42 * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.cpp: 43 (WebCore::LibWebRTCRtpSenderTransformBackend::requestKeyFrame): 44 * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.h: 45 * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.cpp: 46 (WebCore::LibWebRTCRtpTransformableFrame::isKeyFrame const): 47 * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.h: 48 * Sources.txt: 49 * WebCore.xcodeproj/project.pbxproj: 50 1 51 2020-12-01 Rob Buis <rbuis@igalia.com> 2 52 -
trunk/Source/WebCore/DerivedSources-input.xcfilelist
r270257 r270294 245 245 $(PROJECT_DIR)/Modules/mediastream/RTCRtpScriptTransformer.idl 246 246 $(PROJECT_DIR)/Modules/mediastream/RTCRtpScriptTransformerConstructor.idl 247 $(PROJECT_DIR)/Modules/mediastream/RTCRtpScriptTransformerContext.idl 247 248 $(PROJECT_DIR)/Modules/mediastream/RTCRtpSendParameters.idl 248 249 $(PROJECT_DIR)/Modules/mediastream/RTCRtpSender+Transform.idl -
trunk/Source/WebCore/DerivedSources-output.xcfilelist
r270257 r270294 1718 1718 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCRtpScriptTransformerConstructor.cpp 1719 1719 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCRtpScriptTransformerConstructor.h 1720 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCRtpScriptTransformerContext.cpp 1721 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCRtpScriptTransformerContext.h 1720 1722 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCRtpSendParameters.cpp 1721 1723 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCRtpSendParameters.h -
trunk/Source/WebCore/DerivedSources.make
r270257 r270294 272 272 $(WebCore)/Modules/mediastream/RTCRtpScriptTransformer.idl \ 273 273 $(WebCore)/Modules/mediastream/RTCRtpScriptTransformerConstructor.idl \ 274 $(WebCore)/Modules/mediastream/RTCRtpScriptTransformerContext.idl \ 274 275 $(WebCore)/Modules/mediastream/RTCRtpSynchronizationSource.idl \ 275 276 $(WebCore)/Modules/mediastream/RTCRtpTransceiver.idl \ -
trunk/Source/WebCore/Modules/mediastream/RTCEncodedVideoFrame.cpp
r270290 r270294 33 33 RTCEncodedVideoFrame::RTCEncodedVideoFrame(Ref<RTCRtpTransformableFrame>&& frame) 34 34 : RTCEncodedFrame(WTFMove(frame)) 35 , m_type(m_frame->isKeyFrame() ? Type::Key : Type::Delta) 35 36 { 36 37 } -
trunk/Source/WebCore/Modules/mediastream/RTCEncodedVideoFrame.h
r270290 r270294 37 37 ~RTCEncodedVideoFrame(); 38 38 39 enum class Type { Empty, Key, Delta }; 40 Type type() const { return m_type; } 41 39 42 private: 40 43 explicit RTCEncodedVideoFrame(Ref<RTCRtpTransformableFrame>&&); 44 45 Type m_type; 41 46 }; 42 47 -
trunk/Source/WebCore/Modules/mediastream/RTCEncodedVideoFrame.idl
r270107 r270294 24 24 */ 25 25 26 enum RTCEncodedVideoFrameType { "empty", "key", "delta" }; 27 26 28 [ 27 29 Conditional=WEB_RTC, … … 29 31 ImplementationLacksVTable, 30 32 ] interface RTCEncodedVideoFrame { 31 //readonly attribute RTCEncodedVideoFrameType type;33 readonly attribute RTCEncodedVideoFrameType type; 32 34 // readonly attribute unsigned long long timestamp; 33 35 attribute ArrayBuffer data; -
trunk/Source/WebCore/Modules/mediastream/RTCRtpScriptTransformer.cpp
r270290 r270294 33 33 #include "JSRTCEncodedAudioFrame.h" 34 34 #include "JSRTCEncodedVideoFrame.h" 35 #include "JSRTCRtpScriptTransformerContext.h" 35 36 #include "RTCRtpTransformableFrame.h" 36 37 #include "ReadableStream.h" … … 103 104 args.append(toJSNewlyCreated(&globalObject, &globalObject, readableStream.releaseReturnValue())); 104 105 args.append(toJSNewlyCreated(&globalObject, &globalObject, writableStream.releaseReturnValue())); 106 args.append(toJSNewlyCreated(&globalObject, &globalObject, RTCRtpScriptTransformerContext::create(makeRef(backend)))); 105 107 106 108 NakedPtr<JSC::Exception> returnedException; -
trunk/Source/WebCore/Modules/mediastream/RTCRtpScriptTransformerContext.h
r270293 r270294 28 28 #if ENABLE(WEB_RTC) 29 29 30 #include "RTCEncodedFrame.h" 30 #include "RTCRtpTransformBackend.h" 31 #include <wtf/Ref.h> 31 32 32 33 namespace WebCore { 33 34 34 class RTCEncodedVideoFrame : public RTCEncodedFrame { 35 class RTCRtpTransformBackend; 36 37 class RTCRtpScriptTransformerContext 38 : public RefCounted<RTCRtpScriptTransformerContext> { 35 39 public: 36 static Ref<RTCEncodedVideoFrame> create(Ref<RTCRtpTransformableFrame>&& frame) { return adoptRef(*new RTCEncodedVideoFrame(WTFMove(frame))); } 37 ~RTCEncodedVideoFrame(); 40 static Ref<RTCRtpScriptTransformerContext> create(Ref<RTCRtpTransformBackend>&&); 41 ~RTCRtpScriptTransformerContext() = default; 42 43 using Side = RTCRtpTransformBackend::Side; 44 Side side() const { return m_backend->side(); } 45 46 using MediaType = RTCRtpTransformBackend::MediaType; 47 MediaType mediaType() const { return m_backend->mediaType(); } 48 49 ExceptionOr<void> requestKeyFrame(); 38 50 39 51 private: 40 explicit RTCEncodedVideoFrame(Ref<RTCRtpTransformableFrame>&&); 52 explicit RTCRtpScriptTransformerContext(Ref<RTCRtpTransformBackend>&&); 53 54 Ref<RTCRtpTransformBackend> m_backend; 41 55 }; 56 57 inline Ref<RTCRtpScriptTransformerContext> RTCRtpScriptTransformerContext::create(Ref<RTCRtpTransformBackend>&& backend) 58 { 59 return adoptRef(*new RTCRtpScriptTransformerContext(WTFMove(backend))); 60 } 61 62 inline RTCRtpScriptTransformerContext::RTCRtpScriptTransformerContext(Ref<RTCRtpTransformBackend>&& backend) 63 : m_backend(WTFMove(backend)) 64 { 65 } 66 67 inline ExceptionOr<void> RTCRtpScriptTransformerContext::requestKeyFrame() 68 { 69 switch (mediaType()) { 70 case MediaType::Audio: 71 return Exception { InvalidStateError, "Cannot request key frame on audio sender"_s }; 72 case MediaType::Video: 73 m_backend->requestKeyFrame(); 74 return { }; 75 } 76 } 42 77 43 78 } // namespace WebCore -
trunk/Source/WebCore/Modules/mediastream/RTCRtpScriptTransformerContext.idl
r270293 r270294 24 24 */ 25 25 26 enum RTCRtpScriptTransformerContextSide { "receiver", "sender" }; 27 enum RTCRtpScriptTransformerContextMediaType { "audio", "video" }; 28 26 29 [ 27 30 Conditional=WEB_RTC, 28 31 Exposed=DedicatedWorker, 29 32 ImplementationLacksVTable, 30 ] interface RTC EncodedVideoFrame{31 // readonly attribute RTCEncodedVideoFrameType type;32 // readonly attribute unsigned long long timestamp;33 attribute ArrayBuffer data; 34 // RTCVideoFrameMetadata getMetadata();33 ] interface RTCRtpScriptTransformerContext { 34 readonly attribute RTCRtpScriptTransformerContextSide side; 35 readonly attribute RTCRtpScriptTransformerContextMediaType mediaType; 36 37 [MayThrowException] undefined requestKeyFrame(); 35 38 }; -
trunk/Source/WebCore/Modules/mediastream/RTCRtpTransformBackend.h
r270290 r270294 47 47 enum class Side { Receiver, Sender }; 48 48 virtual Side side() const = 0; 49 50 virtual void requestKeyFrame() = 0; 49 51 }; 50 52 -
trunk/Source/WebCore/Modules/mediastream/RTCRtpTransformableFrame.h
r270290 r270294 41 41 virtual Data data() const = 0; 42 42 virtual void setData(Data) = 0; 43 44 virtual bool isKeyFrame() const = 0; 43 45 }; 44 46 -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.cpp
r269764 r270294 53 53 } 54 54 55 void LibWebRTCRtpReceiverTransformBackend::requestKeyFrame() 56 { 57 ASSERT(mediaType() == MediaType::Video); 58 m_rtcReceiver->GenerateKeyFrame(); 59 } 60 55 61 } // namespace WebCore 56 62 -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.h
r269789 r270294 54 54 // RTCRtpTransformBackend 55 55 void setTransformableFrameCallback(Callback&&) final; 56 void requestKeyFrame() final; 56 57 57 58 rtc::scoped_refptr<webrtc::RtpReceiverInterface> m_rtcReceiver; -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.cpp
r270290 r270294 53 53 } 54 54 55 void LibWebRTCRtpSenderTransformBackend::requestKeyFrame() 56 { 57 ASSERT(mediaType() == MediaType::Video); 58 m_rtcSender->GenerateKeyFrame(); 59 } 60 55 61 } // namespace WebCore 56 62 -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.h
r269789 r270294 57 57 // RTCRtpTransformBackend 58 58 void setTransformableFrameCallback(Callback&&) final; 59 void requestKeyFrame() final; 59 60 60 61 rtc::scoped_refptr<webrtc::RtpSenderInterface> m_rtcSender; -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.cpp
r270290 r270294 66 66 } 67 67 68 bool LibWebRTCRtpTransformableFrame::isKeyFrame() const 69 { 70 ASSERT(m_rtcFrame); 71 auto* videoFrame = static_cast<webrtc::TransformableVideoFrameInterface*>(m_rtcFrame.get()); 72 return videoFrame && videoFrame->IsKeyFrame(); 73 } 74 68 75 } // namespace WebCore 69 76 -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.h
r270290 r270294 47 47 explicit LibWebRTCRtpTransformableFrame(std::unique_ptr<webrtc::TransformableFrameInterface>&&); 48 48 49 // RTCRtpTransformableFrame 49 50 Data data() const final; 50 51 void setData(Data) final; 52 bool isKeyFrame() const final; 51 53 52 54 std::unique_ptr<webrtc::TransformableFrameInterface> m_rtcFrame; -
trunk/Source/WebCore/Sources.txt
r270290 r270294 3348 3348 JSRTCRtpScriptTransformer.cpp 3349 3349 JSRTCRtpScriptTransformerConstructor.cpp 3350 JSRTCRtpScriptTransformerContext.cpp 3350 3351 JSRTCRtpSendParameters.cpp 3351 3352 JSRTCRtpSender.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r270290 r270294 7796 7796 419E6EC62566D213002B5010 /* RTCPeerConnectionIceErrorEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RTCPeerConnectionIceErrorEvent.cpp; sourceTree = "<group>"; }; 7797 7797 419E6EC72566D214002B5010 /* RTCPeerConnectionIceErrorEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionIceErrorEvent.h; sourceTree = "<group>"; }; 7798 419E6ED22567BF69002B5010 /* RTCRtpScriptTransformerContext.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCRtpScriptTransformerContext.idl; sourceTree = "<group>"; }; 7799 419E6ED52567BF6A002B5010 /* RTCRtpScriptTransformerContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCRtpScriptTransformerContext.h; sourceTree = "<group>"; }; 7800 419E6ED82567D8D9002B5010 /* LibWebRTCRtpTransformableFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibWebRTCRtpTransformableFrame.cpp; path = libwebrtc/LibWebRTCRtpTransformableFrame.cpp; sourceTree = "<group>"; }; 7798 7801 419FAFAD1ABABCD5005B3572 /* ReadableStreamBYOBReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamBYOBReader.idl; sourceTree = "<group>"; }; 7799 7802 419FAFAD1ABABCD5005B828B /* ReadableStreamDefaultReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamDefaultReader.idl; sourceTree = "<group>"; }; … … 17187 17190 414189F62562E67A00363417 /* RTCRtpScriptTransformerConstructor.h */, 17188 17191 414189F72562E67A00363417 /* RTCRtpScriptTransformerConstructor.idl */, 17192 419E6ED52567BF6A002B5010 /* RTCRtpScriptTransformerContext.h */, 17193 419E6ED22567BF69002B5010 /* RTCRtpScriptTransformerContext.idl */, 17189 17194 414189EF2562DF0C00363417 /* RTCRtpScriptTransformProvider.idl */, 17190 17195 413C8B262552EEA900E65055 /* RTCRtpSender+Transform.idl */,
Note: See TracChangeset
for help on using the changeset viewer.