[GStreamer] media/track/in-band/ layout tests introduced in r154908 are failing
https://bugs.webkit.org/show_bug.cgi?id=120665
Reviewed by Philippe Normand.
Source/WebCore:
Solved a deadlock when processing samples from a text track while the main thread is starting to play.
In those circumstances, the text sink is set by Playbin as non-async, so the main thread calling
MediaPlayerPrivateGStreamer::play() is blocked waiting for the preroll to finish. While prerolling,
a text sample is detected in a non-main thread and sent to the main thread for processing. The current
code waits in the non-main thread for the processing to finish, but that won't ever happen because
the main thread is busy in play() waiting for the preroll to complete. Since the non-main thread
doesn't need any result from the main thread, a simple change to avoid the wait is enough to solve the
deadlock.
There was also a bug preventing all the languages of the text tracks being detected on time. Sometimes
the tag event specifying the track language emitted by the demuxer arrives too late to the
webkittextcombiner sink pad (up to several seconds since sent!) and the language remains unset when
the test checks for it. As a result, the test fails because the second track isn't reported to be in
French language ("fr"). The solution to this is to find an earlier (more upstream) pad and listen
there for the (sticky) tag events. There can be multiple tag events, so all of them are checked until
one having the GST_TAG_LANGUAGE_CODE tag is found.
Covered by existing tests (now unskipped).
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkHandleSample): Don't wait for handleTextSample() to be completed in the main thread. This avoids the deadlock.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::findBestUpstreamPad): Find a pad more upstream than the current one.
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Call setPad() instead of setting it by hand here.
(WebCore::TrackPrivateBaseGStreamer::setPad): Also manage m_bestUpstreamPad in parallel to m_pad. Add a probe to listen to the tag events instead of checking the "tags" property (the property wasn't present in the best upstream pad).
(WebCore::TrackPrivateBaseGStreamer::disconnect): Remove the probe from m_bestUpstreamPad, instead of removing the old notify::tags listener from m_pad.
(WebCore::TrackPrivateBaseGStreamer::tagsChanged): Check the sticky tag events until the language one is found (or the last event if no language event is available).
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added m_bestUpstreamPad and m_eventProbe. Moved setPad() implementation to the cpp file.
Tools:
Fix media/track/in-band/tests
Add libkate as dependency, so gst-plugins-bad detects it and can build the GstKateDec element.
This isn't actually needed when using Flatpak (the dependency has been added there), but is still
useful when using jhbuild and is also coherent with the need of other multimedia dependencies
such as libvpx.
* gtk/install-dependencies:
* wpe/install-dependencies:
LayoutTests:
Removed track-in-band-mpegts-metadata.html because it relies on private streams on mpegts
and those won't ever be exposed by tsdemux. Made testCuesAddedOnce() test more robust
when finding text tracks.
* media/content/user-private-streams.ts: Removed.
* media/in-band-tracks.js:
(pollProgress): Make sure that the function repeated at intervals is properly stopped in all the cases.
(canplaythrough): More robust track detection.
(testCuesAddedOnce): Ditto.
* media/track/in-band/track-in-band-mpegts-metadata.html: Removed.
* platform/glib/TestExpectations: Unskip media/track/in-band tests.
Canonical link: https://commits.webkit.org/237022@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-26 11:59:51 +00:00
|
|
|
inbandTrack1 = null;
|
|
|
|
|
2013-11-01 16:30:03 +00:00
|
|
|
function testTrackListContainsTrack(listStr, trackStr)
|
|
|
|
{
|
|
|
|
var list = eval(listStr);
|
|
|
|
var track = eval(trackStr);
|
|
|
|
var found = false;
|
|
|
|
for (var i = 0; i < list.length; ++i) {
|
|
|
|
if (list[i] == track) {
|
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
reportExpected(found, listStr, " contains ", trackStr, list);
|
|
|
|
}
|
|
|
|
|
|
|
|
function compareTracks(track1, track2)
|
|
|
|
{
|
|
|
|
var equal = (eval(track1) == eval(track2));
|
|
|
|
reportExpected(equal, track1, "==", track2, track1);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testAddTrack(uri, type)
|
|
|
|
{
|
|
|
|
var addtrackEventCount = 0;
|
|
|
|
|
|
|
|
function trackAdded(event)
|
|
|
|
{
|
|
|
|
consoleWrite("EVENT(" + event.type + ")");
|
|
|
|
++addtrackEventCount;
|
|
|
|
|
|
|
|
/* Don't make assumptions about the order of track events. If you know
|
|
|
|
* the expected order, it should be tested separately. */
|
|
|
|
testTrackListContainsTrack("video." + type + "Tracks", "event.track");
|
|
|
|
consoleWrite("");
|
|
|
|
}
|
|
|
|
|
|
|
|
findMediaElement();
|
|
|
|
var tracks = eval("video." + type + "Tracks");
|
|
|
|
tracks.addEventListener("addtrack", trackAdded);
|
|
|
|
video.src = uri;
|
|
|
|
waitForEventAndEnd('canplaythrough');
|
|
|
|
}
|
|
|
|
|
|
|
|
function testAttribute(uri, type, attribute, values)
|
2013-08-30 20:17:27 +00:00
|
|
|
{
|
|
|
|
function canplaythrough()
|
|
|
|
{
|
|
|
|
consoleWrite("<br><i>** Check in-band kind attributes</i>");
|
2021-06-15 05:26:56 +00:00
|
|
|
|
|
|
|
if (values instanceof Array) {
|
|
|
|
testExpected(`video.${type}Tracks.length`, values.length);
|
|
|
|
for (let i = 0; i < values.length; ++i)
|
|
|
|
testExpected(`video.${type}Tracks[${i}].${attribute}`, values[i]);
|
|
|
|
} else {
|
|
|
|
testExpected(`video.${type}Tracks.length`, Object.keys(values).length);
|
|
|
|
for (let id in values)
|
|
|
|
testExpected(`video.${type}Tracks.getTrackById('${id}').${attribute}`, values[id]);
|
|
|
|
}
|
2013-08-30 20:17:27 +00:00
|
|
|
|
|
|
|
consoleWrite("");
|
|
|
|
endTest();
|
|
|
|
}
|
|
|
|
|
|
|
|
findMediaElement();
|
|
|
|
video.src = uri;
|
|
|
|
waitForEvent('canplaythrough', canplaythrough);
|
|
|
|
}
|
|
|
|
|
2013-10-01 16:26:52 +00:00
|
|
|
function testCuesAddedOnce(uri, kind)
|
2013-08-30 20:17:27 +00:00
|
|
|
{
|
[GStreamer] media/track/in-band/ layout tests introduced in r154908 are failing
https://bugs.webkit.org/show_bug.cgi?id=120665
Reviewed by Philippe Normand.
Source/WebCore:
Solved a deadlock when processing samples from a text track while the main thread is starting to play.
In those circumstances, the text sink is set by Playbin as non-async, so the main thread calling
MediaPlayerPrivateGStreamer::play() is blocked waiting for the preroll to finish. While prerolling,
a text sample is detected in a non-main thread and sent to the main thread for processing. The current
code waits in the non-main thread for the processing to finish, but that won't ever happen because
the main thread is busy in play() waiting for the preroll to complete. Since the non-main thread
doesn't need any result from the main thread, a simple change to avoid the wait is enough to solve the
deadlock.
There was also a bug preventing all the languages of the text tracks being detected on time. Sometimes
the tag event specifying the track language emitted by the demuxer arrives too late to the
webkittextcombiner sink pad (up to several seconds since sent!) and the language remains unset when
the test checks for it. As a result, the test fails because the second track isn't reported to be in
French language ("fr"). The solution to this is to find an earlier (more upstream) pad and listen
there for the (sticky) tag events. There can be multiple tag events, so all of them are checked until
one having the GST_TAG_LANGUAGE_CODE tag is found.
Covered by existing tests (now unskipped).
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkHandleSample): Don't wait for handleTextSample() to be completed in the main thread. This avoids the deadlock.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::findBestUpstreamPad): Find a pad more upstream than the current one.
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Call setPad() instead of setting it by hand here.
(WebCore::TrackPrivateBaseGStreamer::setPad): Also manage m_bestUpstreamPad in parallel to m_pad. Add a probe to listen to the tag events instead of checking the "tags" property (the property wasn't present in the best upstream pad).
(WebCore::TrackPrivateBaseGStreamer::disconnect): Remove the probe from m_bestUpstreamPad, instead of removing the old notify::tags listener from m_pad.
(WebCore::TrackPrivateBaseGStreamer::tagsChanged): Check the sticky tag events until the language one is found (or the last event if no language event is available).
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added m_bestUpstreamPad and m_eventProbe. Moved setPad() implementation to the cpp file.
Tools:
Fix media/track/in-band/tests
Add libkate as dependency, so gst-plugins-bad detects it and can build the GstKateDec element.
This isn't actually needed when using Flatpak (the dependency has been added there), but is still
useful when using jhbuild and is also coherent with the need of other multimedia dependencies
such as libvpx.
* gtk/install-dependencies:
* wpe/install-dependencies:
LayoutTests:
Removed track-in-band-mpegts-metadata.html because it relies on private streams on mpegts
and those won't ever be exposed by tsdemux. Made testCuesAddedOnce() test more robust
when finding text tracks.
* media/content/user-private-streams.ts: Removed.
* media/in-band-tracks.js:
(pollProgress): Make sure that the function repeated at intervals is properly stopped in all the cases.
(canplaythrough): More robust track detection.
(testCuesAddedOnce): Ditto.
* media/track/in-band/track-in-band-mpegts-metadata.html: Removed.
* platform/glib/TestExpectations: Unskip media/track/in-band tests.
Canonical link: https://commits.webkit.org/237022@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-26 11:59:51 +00:00
|
|
|
|
2013-08-30 20:17:27 +00:00
|
|
|
var seekedCount = 0;
|
|
|
|
var cuesStarts = [];
|
[GStreamer] media/track/in-band/ layout tests introduced in r154908 are failing
https://bugs.webkit.org/show_bug.cgi?id=120665
Reviewed by Philippe Normand.
Source/WebCore:
Solved a deadlock when processing samples from a text track while the main thread is starting to play.
In those circumstances, the text sink is set by Playbin as non-async, so the main thread calling
MediaPlayerPrivateGStreamer::play() is blocked waiting for the preroll to finish. While prerolling,
a text sample is detected in a non-main thread and sent to the main thread for processing. The current
code waits in the non-main thread for the processing to finish, but that won't ever happen because
the main thread is busy in play() waiting for the preroll to complete. Since the non-main thread
doesn't need any result from the main thread, a simple change to avoid the wait is enough to solve the
deadlock.
There was also a bug preventing all the languages of the text tracks being detected on time. Sometimes
the tag event specifying the track language emitted by the demuxer arrives too late to the
webkittextcombiner sink pad (up to several seconds since sent!) and the language remains unset when
the test checks for it. As a result, the test fails because the second track isn't reported to be in
French language ("fr"). The solution to this is to find an earlier (more upstream) pad and listen
there for the (sticky) tag events. There can be multiple tag events, so all of them are checked until
one having the GST_TAG_LANGUAGE_CODE tag is found.
Covered by existing tests (now unskipped).
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkHandleSample): Don't wait for handleTextSample() to be completed in the main thread. This avoids the deadlock.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::findBestUpstreamPad): Find a pad more upstream than the current one.
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Call setPad() instead of setting it by hand here.
(WebCore::TrackPrivateBaseGStreamer::setPad): Also manage m_bestUpstreamPad in parallel to m_pad. Add a probe to listen to the tag events instead of checking the "tags" property (the property wasn't present in the best upstream pad).
(WebCore::TrackPrivateBaseGStreamer::disconnect): Remove the probe from m_bestUpstreamPad, instead of removing the old notify::tags listener from m_pad.
(WebCore::TrackPrivateBaseGStreamer::tagsChanged): Check the sticky tag events until the language one is found (or the last event if no language event is available).
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added m_bestUpstreamPad and m_eventProbe. Moved setPad() implementation to the cpp file.
Tools:
Fix media/track/in-band/tests
Add libkate as dependency, so gst-plugins-bad detects it and can build the GstKateDec element.
This isn't actually needed when using Flatpak (the dependency has been added there), but is still
useful when using jhbuild and is also coherent with the need of other multimedia dependencies
such as libvpx.
* gtk/install-dependencies:
* wpe/install-dependencies:
LayoutTests:
Removed track-in-band-mpegts-metadata.html because it relies on private streams on mpegts
and those won't ever be exposed by tsdemux. Made testCuesAddedOnce() test more robust
when finding text tracks.
* media/content/user-private-streams.ts: Removed.
* media/in-band-tracks.js:
(pollProgress): Make sure that the function repeated at intervals is properly stopped in all the cases.
(canplaythrough): More robust track detection.
(testCuesAddedOnce): Ditto.
* media/track/in-band/track-in-band-mpegts-metadata.html: Removed.
* platform/glib/TestExpectations: Unskip media/track/in-band tests.
Canonical link: https://commits.webkit.org/237022@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-26 11:59:51 +00:00
|
|
|
var intervalId = null;
|
|
|
|
inbandTrack1 = null;
|
2013-08-30 20:17:27 +00:00
|
|
|
|
|
|
|
function pollProgress()
|
|
|
|
{
|
|
|
|
if (video.currentTime < 2)
|
|
|
|
return;
|
|
|
|
|
[GStreamer] media/track/in-band/ layout tests introduced in r154908 are failing
https://bugs.webkit.org/show_bug.cgi?id=120665
Reviewed by Philippe Normand.
Source/WebCore:
Solved a deadlock when processing samples from a text track while the main thread is starting to play.
In those circumstances, the text sink is set by Playbin as non-async, so the main thread calling
MediaPlayerPrivateGStreamer::play() is blocked waiting for the preroll to finish. While prerolling,
a text sample is detected in a non-main thread and sent to the main thread for processing. The current
code waits in the non-main thread for the processing to finish, but that won't ever happen because
the main thread is busy in play() waiting for the preroll to complete. Since the non-main thread
doesn't need any result from the main thread, a simple change to avoid the wait is enough to solve the
deadlock.
There was also a bug preventing all the languages of the text tracks being detected on time. Sometimes
the tag event specifying the track language emitted by the demuxer arrives too late to the
webkittextcombiner sink pad (up to several seconds since sent!) and the language remains unset when
the test checks for it. As a result, the test fails because the second track isn't reported to be in
French language ("fr"). The solution to this is to find an earlier (more upstream) pad and listen
there for the (sticky) tag events. There can be multiple tag events, so all of them are checked until
one having the GST_TAG_LANGUAGE_CODE tag is found.
Covered by existing tests (now unskipped).
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkHandleSample): Don't wait for handleTextSample() to be completed in the main thread. This avoids the deadlock.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::findBestUpstreamPad): Find a pad more upstream than the current one.
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Call setPad() instead of setting it by hand here.
(WebCore::TrackPrivateBaseGStreamer::setPad): Also manage m_bestUpstreamPad in parallel to m_pad. Add a probe to listen to the tag events instead of checking the "tags" property (the property wasn't present in the best upstream pad).
(WebCore::TrackPrivateBaseGStreamer::disconnect): Remove the probe from m_bestUpstreamPad, instead of removing the old notify::tags listener from m_pad.
(WebCore::TrackPrivateBaseGStreamer::tagsChanged): Check the sticky tag events until the language one is found (or the last event if no language event is available).
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added m_bestUpstreamPad and m_eventProbe. Moved setPad() implementation to the cpp file.
Tools:
Fix media/track/in-band/tests
Add libkate as dependency, so gst-plugins-bad detects it and can build the GstKateDec element.
This isn't actually needed when using Flatpak (the dependency has been added there), but is still
useful when using jhbuild and is also coherent with the need of other multimedia dependencies
such as libvpx.
* gtk/install-dependencies:
* wpe/install-dependencies:
LayoutTests:
Removed track-in-band-mpegts-metadata.html because it relies on private streams on mpegts
and those won't ever be exposed by tsdemux. Made testCuesAddedOnce() test more robust
when finding text tracks.
* media/content/user-private-streams.ts: Removed.
* media/in-band-tracks.js:
(pollProgress): Make sure that the function repeated at intervals is properly stopped in all the cases.
(canplaythrough): More robust track detection.
(testCuesAddedOnce): Ditto.
* media/track/in-band/track-in-band-mpegts-metadata.html: Removed.
* platform/glib/TestExpectations: Unskip media/track/in-band tests.
Canonical link: https://commits.webkit.org/237022@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-26 11:59:51 +00:00
|
|
|
if (!inbandTrack1) {
|
|
|
|
failTest("No text track of kind '" + kind + "'");
|
|
|
|
clearInterval(intervalId);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!inbandTrack1.cues) {
|
|
|
|
failTest("No text track of kind '" + kind + "'");
|
|
|
|
clearInterval(intervalId);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-08-30 20:17:27 +00:00
|
|
|
testExpected("inbandTrack1.cues.length", 0, ">");
|
|
|
|
|
|
|
|
if (!seekedCount) {
|
|
|
|
// Collect the start times of all cues, seek back to the\beginning and play
|
|
|
|
// the same segment of the video file.
|
|
|
|
run("video.pause()");
|
|
|
|
for (var i = 0; i < inbandTrack1.cues.length; ++i)
|
|
|
|
cuesStarts.push(inbandTrack1.cues[i].startTime);
|
|
|
|
run("video.currentTime = 0");
|
|
|
|
run("video.play()");
|
|
|
|
consoleWrite("");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
run("video.pause()");
|
|
|
|
try {
|
|
|
|
var success = true;
|
|
|
|
for (var i = 0; i < cuesStarts.length; ++i) {
|
|
|
|
if (inbandTrack1.cues[i].startTime != cuesStarts[i]) {
|
|
|
|
// Since we don't know the exact number of cues, only print
|
|
|
|
// output if the test fails.
|
|
|
|
testExpected("inbandTrack1.cues[" + i + "].startTime", cuesStarts[i]);
|
|
|
|
success = false;
|
|
|
|
}
|
|
|
|
}
|
[GStreamer] media/track/in-band/ layout tests introduced in r154908 are failing
https://bugs.webkit.org/show_bug.cgi?id=120665
Reviewed by Philippe Normand.
Source/WebCore:
Solved a deadlock when processing samples from a text track while the main thread is starting to play.
In those circumstances, the text sink is set by Playbin as non-async, so the main thread calling
MediaPlayerPrivateGStreamer::play() is blocked waiting for the preroll to finish. While prerolling,
a text sample is detected in a non-main thread and sent to the main thread for processing. The current
code waits in the non-main thread for the processing to finish, but that won't ever happen because
the main thread is busy in play() waiting for the preroll to complete. Since the non-main thread
doesn't need any result from the main thread, a simple change to avoid the wait is enough to solve the
deadlock.
There was also a bug preventing all the languages of the text tracks being detected on time. Sometimes
the tag event specifying the track language emitted by the demuxer arrives too late to the
webkittextcombiner sink pad (up to several seconds since sent!) and the language remains unset when
the test checks for it. As a result, the test fails because the second track isn't reported to be in
French language ("fr"). The solution to this is to find an earlier (more upstream) pad and listen
there for the (sticky) tag events. There can be multiple tag events, so all of them are checked until
one having the GST_TAG_LANGUAGE_CODE tag is found.
Covered by existing tests (now unskipped).
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkHandleSample): Don't wait for handleTextSample() to be completed in the main thread. This avoids the deadlock.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::findBestUpstreamPad): Find a pad more upstream than the current one.
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Call setPad() instead of setting it by hand here.
(WebCore::TrackPrivateBaseGStreamer::setPad): Also manage m_bestUpstreamPad in parallel to m_pad. Add a probe to listen to the tag events instead of checking the "tags" property (the property wasn't present in the best upstream pad).
(WebCore::TrackPrivateBaseGStreamer::disconnect): Remove the probe from m_bestUpstreamPad, instead of removing the old notify::tags listener from m_pad.
(WebCore::TrackPrivateBaseGStreamer::tagsChanged): Check the sticky tag events until the language one is found (or the last event if no language event is available).
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added m_bestUpstreamPad and m_eventProbe. Moved setPad() implementation to the cpp file.
Tools:
Fix media/track/in-band/tests
Add libkate as dependency, so gst-plugins-bad detects it and can build the GstKateDec element.
This isn't actually needed when using Flatpak (the dependency has been added there), but is still
useful when using jhbuild and is also coherent with the need of other multimedia dependencies
such as libvpx.
* gtk/install-dependencies:
* wpe/install-dependencies:
LayoutTests:
Removed track-in-band-mpegts-metadata.html because it relies on private streams on mpegts
and those won't ever be exposed by tsdemux. Made testCuesAddedOnce() test more robust
when finding text tracks.
* media/content/user-private-streams.ts: Removed.
* media/in-band-tracks.js:
(pollProgress): Make sure that the function repeated at intervals is properly stopped in all the cases.
(canplaythrough): More robust track detection.
(testCuesAddedOnce): Ditto.
* media/track/in-band/track-in-band-mpegts-metadata.html: Removed.
* platform/glib/TestExpectations: Unskip media/track/in-band tests.
Canonical link: https://commits.webkit.org/237022@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-26 11:59:51 +00:00
|
|
|
clearInterval(intervalId);
|
2013-08-30 20:17:27 +00:00
|
|
|
logResult(success, "Test all cues are equal");
|
|
|
|
endTest();
|
|
|
|
} catch (e) {
|
[GStreamer] media/track/in-band/ layout tests introduced in r154908 are failing
https://bugs.webkit.org/show_bug.cgi?id=120665
Reviewed by Philippe Normand.
Source/WebCore:
Solved a deadlock when processing samples from a text track while the main thread is starting to play.
In those circumstances, the text sink is set by Playbin as non-async, so the main thread calling
MediaPlayerPrivateGStreamer::play() is blocked waiting for the preroll to finish. While prerolling,
a text sample is detected in a non-main thread and sent to the main thread for processing. The current
code waits in the non-main thread for the processing to finish, but that won't ever happen because
the main thread is busy in play() waiting for the preroll to complete. Since the non-main thread
doesn't need any result from the main thread, a simple change to avoid the wait is enough to solve the
deadlock.
There was also a bug preventing all the languages of the text tracks being detected on time. Sometimes
the tag event specifying the track language emitted by the demuxer arrives too late to the
webkittextcombiner sink pad (up to several seconds since sent!) and the language remains unset when
the test checks for it. As a result, the test fails because the second track isn't reported to be in
French language ("fr"). The solution to this is to find an earlier (more upstream) pad and listen
there for the (sticky) tag events. There can be multiple tag events, so all of them are checked until
one having the GST_TAG_LANGUAGE_CODE tag is found.
Covered by existing tests (now unskipped).
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkHandleSample): Don't wait for handleTextSample() to be completed in the main thread. This avoids the deadlock.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::findBestUpstreamPad): Find a pad more upstream than the current one.
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Call setPad() instead of setting it by hand here.
(WebCore::TrackPrivateBaseGStreamer::setPad): Also manage m_bestUpstreamPad in parallel to m_pad. Add a probe to listen to the tag events instead of checking the "tags" property (the property wasn't present in the best upstream pad).
(WebCore::TrackPrivateBaseGStreamer::disconnect): Remove the probe from m_bestUpstreamPad, instead of removing the old notify::tags listener from m_pad.
(WebCore::TrackPrivateBaseGStreamer::tagsChanged): Check the sticky tag events until the language one is found (or the last event if no language event is available).
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added m_bestUpstreamPad and m_eventProbe. Moved setPad() implementation to the cpp file.
Tools:
Fix media/track/in-band/tests
Add libkate as dependency, so gst-plugins-bad detects it and can build the GstKateDec element.
This isn't actually needed when using Flatpak (the dependency has been added there), but is still
useful when using jhbuild and is also coherent with the need of other multimedia dependencies
such as libvpx.
* gtk/install-dependencies:
* wpe/install-dependencies:
LayoutTests:
Removed track-in-band-mpegts-metadata.html because it relies on private streams on mpegts
and those won't ever be exposed by tsdemux. Made testCuesAddedOnce() test more robust
when finding text tracks.
* media/content/user-private-streams.ts: Removed.
* media/in-band-tracks.js:
(pollProgress): Make sure that the function repeated at intervals is properly stopped in all the cases.
(canplaythrough): More robust track detection.
(testCuesAddedOnce): Ditto.
* media/track/in-band/track-in-band-mpegts-metadata.html: Removed.
* platform/glib/TestExpectations: Unskip media/track/in-band tests.
Canonical link: https://commits.webkit.org/237022@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-26 11:59:51 +00:00
|
|
|
clearInterval(intervalId);
|
2013-08-30 20:17:27 +00:00
|
|
|
failTest(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function canplaythrough()
|
|
|
|
{
|
|
|
|
waitForEvent('seeked', function() { ++seekedCount; });
|
[GStreamer] media/track/in-band/ layout tests introduced in r154908 are failing
https://bugs.webkit.org/show_bug.cgi?id=120665
Reviewed by Philippe Normand.
Source/WebCore:
Solved a deadlock when processing samples from a text track while the main thread is starting to play.
In those circumstances, the text sink is set by Playbin as non-async, so the main thread calling
MediaPlayerPrivateGStreamer::play() is blocked waiting for the preroll to finish. While prerolling,
a text sample is detected in a non-main thread and sent to the main thread for processing. The current
code waits in the non-main thread for the processing to finish, but that won't ever happen because
the main thread is busy in play() waiting for the preroll to complete. Since the non-main thread
doesn't need any result from the main thread, a simple change to avoid the wait is enough to solve the
deadlock.
There was also a bug preventing all the languages of the text tracks being detected on time. Sometimes
the tag event specifying the track language emitted by the demuxer arrives too late to the
webkittextcombiner sink pad (up to several seconds since sent!) and the language remains unset when
the test checks for it. As a result, the test fails because the second track isn't reported to be in
French language ("fr"). The solution to this is to find an earlier (more upstream) pad and listen
there for the (sticky) tag events. There can be multiple tag events, so all of them are checked until
one having the GST_TAG_LANGUAGE_CODE tag is found.
Covered by existing tests (now unskipped).
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkHandleSample): Don't wait for handleTextSample() to be completed in the main thread. This avoids the deadlock.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::findBestUpstreamPad): Find a pad more upstream than the current one.
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Call setPad() instead of setting it by hand here.
(WebCore::TrackPrivateBaseGStreamer::setPad): Also manage m_bestUpstreamPad in parallel to m_pad. Add a probe to listen to the tag events instead of checking the "tags" property (the property wasn't present in the best upstream pad).
(WebCore::TrackPrivateBaseGStreamer::disconnect): Remove the probe from m_bestUpstreamPad, instead of removing the old notify::tags listener from m_pad.
(WebCore::TrackPrivateBaseGStreamer::tagsChanged): Check the sticky tag events until the language one is found (or the last event if no language event is available).
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added m_bestUpstreamPad and m_eventProbe. Moved setPad() implementation to the cpp file.
Tools:
Fix media/track/in-band/tests
Add libkate as dependency, so gst-plugins-bad detects it and can build the GstKateDec element.
This isn't actually needed when using Flatpak (the dependency has been added there), but is still
useful when using jhbuild and is also coherent with the need of other multimedia dependencies
such as libvpx.
* gtk/install-dependencies:
* wpe/install-dependencies:
LayoutTests:
Removed track-in-band-mpegts-metadata.html because it relies on private streams on mpegts
and those won't ever be exposed by tsdemux. Made testCuesAddedOnce() test more robust
when finding text tracks.
* media/content/user-private-streams.ts: Removed.
* media/in-band-tracks.js:
(pollProgress): Make sure that the function repeated at intervals is properly stopped in all the cases.
(canplaythrough): More robust track detection.
(testCuesAddedOnce): Ditto.
* media/track/in-band/track-in-band-mpegts-metadata.html: Removed.
* platform/glib/TestExpectations: Unskip media/track/in-band tests.
Canonical link: https://commits.webkit.org/237022@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-26 11:59:51 +00:00
|
|
|
intervalId = setInterval(pollProgress, 100);
|
2013-08-30 20:17:27 +00:00
|
|
|
|
|
|
|
consoleWrite("<br><i>** Setting track 1 to showing</i>");
|
[GStreamer] media/track/in-band/ layout tests introduced in r154908 are failing
https://bugs.webkit.org/show_bug.cgi?id=120665
Reviewed by Philippe Normand.
Source/WebCore:
Solved a deadlock when processing samples from a text track while the main thread is starting to play.
In those circumstances, the text sink is set by Playbin as non-async, so the main thread calling
MediaPlayerPrivateGStreamer::play() is blocked waiting for the preroll to finish. While prerolling,
a text sample is detected in a non-main thread and sent to the main thread for processing. The current
code waits in the non-main thread for the processing to finish, but that won't ever happen because
the main thread is busy in play() waiting for the preroll to complete. Since the non-main thread
doesn't need any result from the main thread, a simple change to avoid the wait is enough to solve the
deadlock.
There was also a bug preventing all the languages of the text tracks being detected on time. Sometimes
the tag event specifying the track language emitted by the demuxer arrives too late to the
webkittextcombiner sink pad (up to several seconds since sent!) and the language remains unset when
the test checks for it. As a result, the test fails because the second track isn't reported to be in
French language ("fr"). The solution to this is to find an earlier (more upstream) pad and listen
there for the (sticky) tag events. There can be multiple tag events, so all of them are checked until
one having the GST_TAG_LANGUAGE_CODE tag is found.
Covered by existing tests (now unskipped).
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkHandleSample): Don't wait for handleTextSample() to be completed in the main thread. This avoids the deadlock.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::findBestUpstreamPad): Find a pad more upstream than the current one.
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Call setPad() instead of setting it by hand here.
(WebCore::TrackPrivateBaseGStreamer::setPad): Also manage m_bestUpstreamPad in parallel to m_pad. Add a probe to listen to the tag events instead of checking the "tags" property (the property wasn't present in the best upstream pad).
(WebCore::TrackPrivateBaseGStreamer::disconnect): Remove the probe from m_bestUpstreamPad, instead of removing the old notify::tags listener from m_pad.
(WebCore::TrackPrivateBaseGStreamer::tagsChanged): Check the sticky tag events until the language one is found (or the last event if no language event is available).
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added m_bestUpstreamPad and m_eventProbe. Moved setPad() implementation to the cpp file.
Tools:
Fix media/track/in-band/tests
Add libkate as dependency, so gst-plugins-bad detects it and can build the GstKateDec element.
This isn't actually needed when using Flatpak (the dependency has been added there), but is still
useful when using jhbuild and is also coherent with the need of other multimedia dependencies
such as libvpx.
* gtk/install-dependencies:
* wpe/install-dependencies:
LayoutTests:
Removed track-in-band-mpegts-metadata.html because it relies on private streams on mpegts
and those won't ever be exposed by tsdemux. Made testCuesAddedOnce() test more robust
when finding text tracks.
* media/content/user-private-streams.ts: Removed.
* media/in-band-tracks.js:
(pollProgress): Make sure that the function repeated at intervals is properly stopped in all the cases.
(canplaythrough): More robust track detection.
(testCuesAddedOnce): Ditto.
* media/track/in-band/track-in-band-mpegts-metadata.html: Removed.
* platform/glib/TestExpectations: Unskip media/track/in-band tests.
Canonical link: https://commits.webkit.org/237022@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-26 11:59:51 +00:00
|
|
|
inbandTrack1 = null;
|
2013-10-01 16:26:52 +00:00
|
|
|
for (var i = 0; i < video.textTracks.length; ++i) {
|
|
|
|
if (video.textTracks[i].kind == kind) {
|
|
|
|
inbandTrack1 = video.textTracks[i];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
[GStreamer] media/track/in-band/ layout tests introduced in r154908 are failing
https://bugs.webkit.org/show_bug.cgi?id=120665
Reviewed by Philippe Normand.
Source/WebCore:
Solved a deadlock when processing samples from a text track while the main thread is starting to play.
In those circumstances, the text sink is set by Playbin as non-async, so the main thread calling
MediaPlayerPrivateGStreamer::play() is blocked waiting for the preroll to finish. While prerolling,
a text sample is detected in a non-main thread and sent to the main thread for processing. The current
code waits in the non-main thread for the processing to finish, but that won't ever happen because
the main thread is busy in play() waiting for the preroll to complete. Since the non-main thread
doesn't need any result from the main thread, a simple change to avoid the wait is enough to solve the
deadlock.
There was also a bug preventing all the languages of the text tracks being detected on time. Sometimes
the tag event specifying the track language emitted by the demuxer arrives too late to the
webkittextcombiner sink pad (up to several seconds since sent!) and the language remains unset when
the test checks for it. As a result, the test fails because the second track isn't reported to be in
French language ("fr"). The solution to this is to find an earlier (more upstream) pad and listen
there for the (sticky) tag events. There can be multiple tag events, so all of them are checked until
one having the GST_TAG_LANGUAGE_CODE tag is found.
Covered by existing tests (now unskipped).
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkHandleSample): Don't wait for handleTextSample() to be completed in the main thread. This avoids the deadlock.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::findBestUpstreamPad): Find a pad more upstream than the current one.
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Call setPad() instead of setting it by hand here.
(WebCore::TrackPrivateBaseGStreamer::setPad): Also manage m_bestUpstreamPad in parallel to m_pad. Add a probe to listen to the tag events instead of checking the "tags" property (the property wasn't present in the best upstream pad).
(WebCore::TrackPrivateBaseGStreamer::disconnect): Remove the probe from m_bestUpstreamPad, instead of removing the old notify::tags listener from m_pad.
(WebCore::TrackPrivateBaseGStreamer::tagsChanged): Check the sticky tag events until the language one is found (or the last event if no language event is available).
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added m_bestUpstreamPad and m_eventProbe. Moved setPad() implementation to the cpp file.
Tools:
Fix media/track/in-band/tests
Add libkate as dependency, so gst-plugins-bad detects it and can build the GstKateDec element.
This isn't actually needed when using Flatpak (the dependency has been added there), but is still
useful when using jhbuild and is also coherent with the need of other multimedia dependencies
such as libvpx.
* gtk/install-dependencies:
* wpe/install-dependencies:
LayoutTests:
Removed track-in-band-mpegts-metadata.html because it relies on private streams on mpegts
and those won't ever be exposed by tsdemux. Made testCuesAddedOnce() test more robust
when finding text tracks.
* media/content/user-private-streams.ts: Removed.
* media/in-band-tracks.js:
(pollProgress): Make sure that the function repeated at intervals is properly stopped in all the cases.
(canplaythrough): More robust track detection.
(testCuesAddedOnce): Ditto.
* media/track/in-band/track-in-band-mpegts-metadata.html: Removed.
* platform/glib/TestExpectations: Unskip media/track/in-band tests.
Canonical link: https://commits.webkit.org/237022@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-26 11:59:51 +00:00
|
|
|
if (!inbandTrack1)
|
|
|
|
failTest("No text track of kind '" + kind + "'");
|
2013-08-30 20:17:27 +00:00
|
|
|
run("inbandTrack1.mode = 'showing'");
|
|
|
|
run("video.play()");
|
|
|
|
}
|
|
|
|
|
|
|
|
findMediaElement();
|
|
|
|
video.src = uri;
|
|
|
|
waitForEvent('canplaythrough', canplaythrough);
|
|
|
|
}
|
|
|
|
|
2013-11-01 16:30:03 +00:00
|
|
|
function testTextTrackOrder(uri, numInBandTracks)
|
|
|
|
{
|
2013-08-30 20:17:27 +00:00
|
|
|
function compareTracks(track1, track2)
|
|
|
|
{
|
|
|
|
var equal = (eval(track1) == eval(track2));
|
|
|
|
reportExpected(equal, track1, "==", track2, track1);
|
|
|
|
}
|
|
|
|
|
|
|
|
function canplaythrough()
|
|
|
|
{
|
|
|
|
consoleWrite("<br><i>** Check initial in-band track states</i>");
|
2013-10-01 16:26:52 +00:00
|
|
|
testExpected("video.textTracks.length", numInBandTracks);
|
|
|
|
for (var i = 0; i < numInBandTracks; ++i)
|
|
|
|
run("inbandTrack" + (i + 1) + " = video.textTracks[" + i + "]");
|
2013-08-30 20:17:27 +00:00
|
|
|
|
|
|
|
consoleWrite("<br><i>** Add two tracks, check sort order<" + "/i>");
|
|
|
|
run("addTrack = video.addTextTrack('captions', 'Caption Track', 'en')");
|
|
|
|
run("trackElement = document.createElement('track')");
|
|
|
|
trackElement.label = '<track>';
|
|
|
|
run("video.appendChild(trackElement)");
|
2013-10-01 16:26:52 +00:00
|
|
|
testExpected("video.textTracks.length", numInBandTracks + 2);
|
2013-08-30 20:17:27 +00:00
|
|
|
|
|
|
|
compareTracks("video.textTracks[0]", "trackElement.track");
|
|
|
|
compareTracks("video.textTracks[1]", "addTrack");
|
2013-10-01 16:26:52 +00:00
|
|
|
for (var i = 1; i < numInBandTracks + 1; ++i)
|
|
|
|
compareTracks("video.textTracks[" + (i + 1) + "]", "inbandTrack" + i);
|
2013-08-30 20:17:27 +00:00
|
|
|
|
|
|
|
consoleWrite("<br><i>** Unload video file, check track count<" + "/i>");
|
|
|
|
run("video.src = ''");
|
|
|
|
testExpected("video.textTracks.length", 2);
|
|
|
|
|
|
|
|
consoleWrite("");
|
|
|
|
endTest();
|
|
|
|
}
|
|
|
|
|
|
|
|
findMediaElement();
|
|
|
|
video.src = uri;
|
|
|
|
waitForEvent('canplaythrough', canplaythrough);
|
|
|
|
}
|