Skip to content

Commit f5a36f2

Browse files
committed
Quirks: Add quirk for sink clock sync'ing
1 parent 21ed252 commit f5a36f2

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,12 +1038,12 @@ static void setSyncOnClock(GstElement* element, bool sync)
10381038

10391039
void MediaPlayerPrivateGStreamer::syncOnClock(bool sync)
10401040
{
1041-
#if !USE(WESTEROS_SINK)
1041+
auto& quirksManager = GStreamerQuirksManager::singleton();
1042+
if (quirksManager.supportsVideoHolePunchRendering() && !quirksManager.sinksRequireClockSynchronization())
1043+
return;
1044+
10421045
setSyncOnClock(videoSink(), sync);
10431046
setSyncOnClock(audioSink(), sync);
1044-
#else
1045-
UNUSED_PARAM(sync);
1046-
#endif
10471047
}
10481048

10491049
template <typename TrackPrivateType>

Source/WebCore/platform/gstreamer/GStreamerHolePunchQuirkWesteros.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class GStreamerHolePunchQuirkWesteros final : public GStreamerHolePunchQuirk {
3232

3333
GstElement* createHolePunchVideoSink(bool, const MediaPlayer*) final;
3434
bool setHolePunchVideoRectangle(GstElement*, const IntRect&) final;
35+
bool requiresClockSynchronization() const final { return false; }
3536
};
3637

3738
} // namespace WebCore

Source/WebCore/platform/gstreamer/GStreamerQuirks.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ void GStreamerQuirksManager::setHolePunchVideoRectangle(GstElement* videoSink, c
192192
GST_WARNING("Hole punch video rectangle configuration failed.");
193193
}
194194

195+
bool GStreamerQuirksManager::sinksRequireClockSynchronization() const
196+
{
197+
if (!m_holePunchQuirk)
198+
return true;
199+
200+
return m_holePunchQuirk->requiresClockSynchronization();
201+
}
202+
195203
void GStreamerQuirksManager::configureElement(GstElement* element, OptionSet<ElementRuntimeCharacteristics>&& characteristics)
196204
{
197205
GST_DEBUG("Configuring element %" GST_PTR_FORMAT, element);

Source/WebCore/platform/gstreamer/GStreamerQuirks.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class GStreamerHolePunchQuirk : public GStreamerQuirkBase {
6969

7070
virtual GstElement* createHolePunchVideoSink(bool, const MediaPlayer*) { return nullptr; }
7171
virtual bool setHolePunchVideoRectangle(GstElement*, const IntRect&) { return false; }
72+
virtual bool requiresClockSynchronization() const { return true; }
7273
};
7374

7475
class GStreamerQuirksManager : public RefCounted<GStreamerQuirksManager> {
@@ -94,6 +95,7 @@ class GStreamerQuirksManager : public RefCounted<GStreamerQuirksManager> {
9495
bool supportsVideoHolePunchRendering() const;
9596
GstElement* createHolePunchVideoSink(bool isLegacyPlaybin, const MediaPlayer*);
9697
void setHolePunchVideoRectangle(GstElement*, const IntRect&);
98+
bool sinksRequireClockSynchronization() const;
9799

98100
void setHolePunchEnabledForTesting(bool);
99101

0 commit comments

Comments
 (0)