Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[GStreamer] Expose MPEG-TS metadata
https://bugs.webkit.org/show_bug.cgi?id=122001 Reviewed by Eric Carlson. .: * Source/cmake/FindGStreamer.cmake: Look for gstreamer-mpegts >= 1.3.0. * Source/cmake/OptionsEfl.cmake: Same. * Source/cmake/OptionsGTK.cmake: Same. Source/WebCore: Test: media/track/in-band/track-in-band-mpegts-metadata.html * CMakeLists.txt: Add InbandDataTextTrack. * PlatformGTK.cmake: Look for gstreamer-mpegts and use it if available. * WebCore.vcxproj/WebCore.vcxproj: Add InbandDataTextTrack. * WebCore.vcxproj/WebCore.vcxproj.filters: Same. * WebCore.xcodeproj/project.pbxproj: Same. * html/track/DataCue.cpp: (WebCore::DataCue::DataCue): Add a constructor using raw data. * html/track/DataCue.h: (WebCore::DataCue::create): Same. * html/track/InbandDataTextTrack.cpp: Added, InbandTextTrack which implements addDataCue(). * html/track/InbandDataTextTrack.h: * html/track/InbandGenericTextTrack.h: Move unimplemented methods to InbandTextTrack. * html/track/InbandWebVTTTextTrack.h: Same. * html/track/InbandTextTrack.h: Same, and add inBandMetadataTrackDispatchType. * html/track/InbandTextTrack.cpp: (WebCore::InbandTextTrack::create): Add constructor for InbandDataTextTrack. (WebCore::InbandTextTrack::inBandMetadataTrackDispatchType): Added. * html/track/TextTrack.h: (WebCore::TextTrack::inBandMetadataTrackDispatchType): Added (empty). * html/track/TextTrack.idl: Add inBandMetadataTrackDispatchType. * platform/graphics/InbandTextTrackPrivate.h: Add inBandMetadataTrackDispatchType and Data format. (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType): * platform/graphics/InbandTextTrackPrivateClient.h: Add addDataCue() method. * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: (WebCore::InbandMetadataTextTrackPrivateGStreamer::create): Allow specifying the cue format and id. (WebCore::InbandMetadataTextTrackPrivateGStreamer::InbandMetadataTextTrackPrivateGStreamer): Same. (WebCore::InbandMetadataTextTrackPrivateGStreamer::setInBandMetadataTrackDispatchType): Added. (WebCore::InbandMetadataTextTrackPrivateGStreamer::addDataCue): Added. (WebCore::InbandMetadataTextTrackPrivateGStreamer::addGenericCue): Added. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Check for MPEG-TS sections. (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): Add MPEG-TS section metadata, and get inBandMetadataTrackDispatchType from the PMT. (WebCore::MediaPlayerPrivateGStreamer::processTableOfContents): Explicitly use Generic CueFormat. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: LayoutTests: * media/content/user-private-streams.ts: Added. * media/track/in-band/track-in-band-mpegts-metadata-expected.txt: Added. * media/track/in-band/track-in-band-mpegts-metadata.html: Added. Canonical link: https://commits.webkit.org/149510@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
29 changed files
with
490 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,41 @@ | ||
|
||
Check for metadata tracks from MPEG-TS file. | ||
|
||
RUN(track0 = video.textTracks[0]) | ||
RUN(track0.mode = 'hidden') | ||
EXPECTED (track0.kind == 'metadata') OK | ||
EXPECTED (track0.id == '1770') OK | ||
EXPECTED (track0.inBandMetadataTrackDispatchType == 'C005044554') OK | ||
RUN(cues0 = track0.cues) | ||
EXPECTED (cues0.length == '2') OK | ||
EXPECTED (new Uint8Array(cues0[0].data).length == '139') OK | ||
EXPECTED (new Uint8Array(cues0[0].data) == '[227, 64, 136, 251, 251, 0, 59, 176, 126, 0, 1, 193, 0, 0, 17, 3, 16, 2, 128, 0, 0, 1, 255, 0, 0, 105, 0, 0, 0, 1, 3, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 12, 1, 60, 59, 67, 97, 98, 108, 101, 108, 97, 98, 115, 95, 78, 97, 116, 105, 111, 110, 97, 108, 95, 101, 116, 118, 95, 115, 116, 114, 101, 97, 109, 95, 99, 111, 110, 102, 105, 103, 47, 109, 97, 105, 110, 97, 112, 112, 47, 49, 46, 48, 47, 109, 97, 105, 110, 95, 112, 114, 46, 112, 114, 0, 15, 14, 105, 98, 46, 116, 118, 119, 111, 114, 107, 115, 46, 99, 111, 109, 225, 54, 136, 221, 188, 252, 142, 137]') OK | ||
EXPECTED (new Uint8Array(cues0[1].data).length == '564') OK | ||
EXPECTED (new Uint8Array(cues0[1].data) == '[228, 66, 49, 0, 1, 0, 60, 178, 39, 0, 1, 193, 0, 0, 17, 3, 16, 3, 0, 0, 0, 1, 255, 0, 2, 18, 0, 1, 1, 255, 0, 0, 69, 66, 73, 70, 4, 0, 1, 0, 0, 22, 11, 72, 207, 255, 0, 1, 254, 0, 1, 6, 0, 0, 248, 0, 0, 5, 1, 0, 0, 32, 2, 0, 0, 49, 0, 0, 0, 154, 4, 0, 0, 176, 3, 0, 0, 197, 0, 2, 0, 2, 0, 0, 0, 1, 255, 6, 2, 0, 0, 0, 111, 0, 171, 0, 16, 0, 5, 0, 0, 0, 4, 255, 10, 2, 0, 0, 9, 1, 0, 2, 9, 1, 0, 3, 9, 1, 0, 4, 128, 0, 0, 0, 0, 255, 255, 18, 18, 18, 255, 255, 153, 153, 153, 255, 255, 204, 204, 204, 255, 255, 181, 151, 29, 255, 255, 51, 51, 51, 127, 0, 17, 17, 17, 230, 255, 153, 153, 153, 230, 255, 204, 204, 204, 230, 255, 181, 151, 29, 230, 255, 51, 51, 51, 255, 255, 16, 16, 147, 255, 255, 158, 11, 14, 255, 255, 16, 147, 16, 255, 255, 102, 45, 145, 255, 255, 239, 106, 16, 0, 1, 0, 5, 0, 0, 0, 2, 255, 14, 3, 0, 0, 5, 2, 0, 3, 0, 0, 33, 0, 0, 0, 1, 0, 4, 0, 0, 0, 2, 255, 6, 2, 0, 0, 10, 2, 0, 2, 0, 101, 255, 255, 0, 4, 0, 7, 0, 0, 0, 7, 255, 9, 1, 0, 0, 9, 1, 0, 1, 9, 1, 0, 2, 9, 1, 0, 3, 9, 1, 0, 4, 9, 1, 0, 5, 9, 1, 0, 6, 8, 7, 0, 0, 187, 255, 255, 0, 7, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 8, 7, 0, 0, 189, 255, 255, 0, 1, 50, 0, 0, 6, 4, 15, 0, 4, 1, 2, 1, 15, 6, 6, 6, 6, 6, 255, 250, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 32, 255, 15, 2, 1, 3, 3, 3, 15, 2, 2, 2, 2, 2, 16, 0, 0, 255, 250, 255, 250, 255, 250, 255, 250, 0, 0, 0, 0, 0, 255, 196, 255, 212, 255, 200, 255, 228, 255, 200, 255, 240, 255, 251, 0, 0, 15, 1, 1, 1, 1, 1, 255, 174, 0, 0, 255, 250, 255, 206, 255, 250, 255, 218, 255, 229, 0, 0, 112, 255, 255, 0, 1, 0, 0, 33, 19, 31, 1, 31, 255, 255, 255, 208, 0, 0, 0, 0, 2, 192, 1, 224, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 255, 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 100, 0, 13, 187, 160, 10, 15, 0, 0, 255, 170, 0, 100, 1, 44, 2, 38, 0, 27, 0, 3, 0, 0, 0, 57, 84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 67, 97, 98, 108, 101, 108, 97, 98, 115, 32, 110, 97, 116, 105, 111, 110, 97, 108, 32, 69, 84, 86, 32, 65, 100, 32, 99, 114, 101, 97, 116, 101, 100, 32, 102, 114, 111, 109, 32, 84, 86, 87, 111, 114, 107, 115, 46, 189, 105, 252, 26, 5, 216, 230, 95]') OK | ||
|
||
RUN(track1 = video.textTracks[1]) | ||
RUN(track1.mode = 'hidden') | ||
EXPECTED (track1.kind == 'metadata') OK | ||
EXPECTED (track1.id == '1768') OK | ||
EXPECTED (track1.inBandMetadataTrackDispatchType == 'C005044554A2') OK | ||
RUN(cues1 = track1.cues) | ||
EXPECTED (cues1.length == '1') OK | ||
EXPECTED (new Uint8Array(cues1[0].data).length == '117') OK | ||
EXPECTED (new Uint8Array(cues1[0].data) == '[224, 0, 114, 0, 0, 0, 3, 0, 0, 8, 0, 255, 255, 255, 0, 1, 0, 224, 94, 1, 1, 0, 0, 0, 0, 0, 0, 0, 100, 16, 82, 0, 80, 108, 105, 100, 58, 47, 47, 105, 98, 46, 116, 118, 119, 111, 114, 107, 115, 46, 99, 111, 109, 47, 67, 97, 98, 108, 101, 108, 97, 98, 115, 95, 78, 97, 116, 105, 111, 110, 97, 108, 95, 101, 116, 118, 95, 115, 116, 114, 101, 97, 109, 95, 99, 111, 110, 102, 105, 103, 47, 109, 97, 105, 110, 97, 112, 112, 47, 49, 46, 48, 47, 109, 97, 105, 110, 95, 112, 114, 46, 112, 114, 90, 3, 153, 38]') OK | ||
|
||
RUN(track2 = video.textTracks[2]) | ||
RUN(track2.mode = 'hidden') | ||
EXPECTED (track2.kind == 'metadata') OK | ||
EXPECTED (track2.id == '45') OK | ||
EXPECTED (track2.inBandMetadataTrackDispatchType == '86') OK | ||
EXPECTED (track2.cues.length == '0') OK | ||
|
||
RUN(track3 = video.textTracks[3]) | ||
RUN(track3.mode = 'hidden') | ||
EXPECTED (track3.kind == 'metadata') OK | ||
EXPECTED (track3.id == '36') OK | ||
EXPECTED (track3.inBandMetadataTrackDispatchType == '81') OK | ||
EXPECTED (track3.cues.length == '0') OK | ||
|
||
END OF TEST | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,79 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
|
||
<script src=../../media-file.js></script> | ||
<script src=../../video-test.js></script> | ||
<script> | ||
|
||
// testArraysEqual() is way too slow to use here | ||
function testDataCue(cueStr, expected) | ||
{ | ||
try { | ||
var success = true; | ||
var cue = eval(cueStr); | ||
var data = new Uint8Array(cue.data); | ||
testExpected("new Uint8Array(" + cueStr + ".data).length", expected.length); | ||
for (var i = 0; i < data.length; ++i) { | ||
if (data[i] != expected[i]) { | ||
reportExpected(false, "new Uint8Array(" + cueStr + ".data)[" + i + "]", "==", expected[i], data[i]); | ||
success = false; | ||
} | ||
} | ||
reportExpected(success, "new Uint8Array(" + cueStr + ".data)", "==", "[" + expected.join(", ") + "]", "See above"); | ||
} catch (e) { | ||
logResult(false, "Testing cue " + cueStr + " threw exception " + e); | ||
} | ||
} | ||
|
||
function start() | ||
{ | ||
findMediaElement(); | ||
|
||
run("track0 = video.textTracks[0]"); | ||
run("track0.mode = 'hidden'"); | ||
testExpected("track0.kind", "metadata"); | ||
testExpected("track0.id", "1770"); | ||
testExpected("track0.inBandMetadataTrackDispatchType", "C005044554"); | ||
run("cues0 = track0.cues"); | ||
testExpected("cues0.length", "2"); | ||
testDataCue("cues0[0]", [227, 64, 136, 251, 251, 0, 59, 176, 126, 0, 1, 193, 0, 0, 17, 3, 16, 2, 128, 0, 0, 1, 255, 0, 0, 105, 0, 0, 0, 1, 3, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 12, 1, 60, 59, 67, 97, 98, 108, 101, 108, 97, 98, 115, 95, 78, 97, 116, 105, 111, 110, 97, 108, 95, 101, 116, 118, 95, 115, 116, 114, 101, 97, 109, 95, 99, 111, 110, 102, 105, 103, 47, 109, 97, 105, 110, 97, 112, 112, 47, 49, 46, 48, 47, 109, 97, 105, 110, 95, 112, 114, 46, 112, 114, 0, 15, 14, 105, 98, 46, 116, 118, 119, 111, 114, 107, 115, 46, 99, 111, 109, 225, 54, 136, 221, 188, 252, 142, 137]); | ||
testDataCue("cues0[1]", [228, 66, 49, 0, 1, 0, 60, 178, 39, 0, 1, 193, 0, 0, 17, 3, 16, 3, 0, 0, 0, 1, 255, 0, 2, 18, 0, 1, 1, 255, 0, 0, 69, 66, 73, 70, 4, 0, 1, 0, 0, 22, 11, 72, 207, 255, 0, 1, 254, 0, 1, 6, 0, 0, 248, 0, 0, 5, 1, 0, 0, 32, 2, 0, 0, 49, 0, 0, 0, 154, 4, 0, 0, 176, 3, 0, 0, 197, 0, 2, 0, 2, 0, 0, 0, 1, 255, 6, 2, 0, 0, 0, 111, 0, 171, 0, 16, 0, 5, 0, 0, 0, 4, 255, 10, 2, 0, 0, 9, 1, 0, 2, 9, 1, 0, 3, 9, 1, 0, 4, 128, 0, 0, 0, 0, 255, 255, 18, 18, 18, 255, 255, 153, 153, 153, 255, 255, 204, 204, 204, 255, 255, 181, 151, 29, 255, 255, 51, 51, 51, 127, 0, 17, 17, 17, 230, 255, 153, 153, 153, 230, 255, 204, 204, 204, 230, 255, 181, 151, 29, 230, 255, 51, 51, 51, 255, 255, 16, 16, 147, 255, 255, 158, 11, 14, 255, 255, 16, 147, 16, 255, 255, 102, 45, 145, 255, 255, 239, 106, 16, 0, 1, 0, 5, 0, 0, 0, 2, 255, 14, 3, 0, 0, 5, 2, 0, 3, 0, 0, 33, 0, 0, 0, 1, 0, 4, 0, 0, 0, 2, 255, 6, 2, 0, 0, 10, 2, 0, 2, 0, 101, 255, 255, 0, 4, 0, 7, 0, 0, 0, 7, 255, 9, 1, 0, 0, 9, 1, 0, 1, 9, 1, 0, 2, 9, 1, 0, 3, 9, 1, 0, 4, 9, 1, 0, 5, 9, 1, 0, 6, 8, 7, 0, 0, 187, 255, 255, 0, 7, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 8, 7, 0, 0, 189, 255, 255, 0, 1, 50, 0, 0, 6, 4, 15, 0, 4, 1, 2, 1, 15, 6, 6, 6, 6, 6, 255, 250, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 32, 255, 15, 2, 1, 3, 3, 3, 15, 2, 2, 2, 2, 2, 16, 0, 0, 255, 250, 255, 250, 255, 250, 255, 250, 0, 0, 0, 0, 0, 255, 196, 255, 212, 255, 200, 255, 228, 255, 200, 255, 240, 255, 251, 0, 0, 15, 1, 1, 1, 1, 1, 255, 174, 0, 0, 255, 250, 255, 206, 255, 250, 255, 218, 255, 229, 0, 0, 112, 255, 255, 0, 1, 0, 0, 33, 19, 31, 1, 31, 255, 255, 255, 208, 0, 0, 0, 0, 2, 192, 1, 224, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 255, 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 100, 0, 13, 187, 160, 10, 15, 0, 0, 255, 170, 0, 100, 1, 44, 2, 38, 0, 27, 0, 3, 0, 0, 0, 57, 84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 67, 97, 98, 108, 101, 108, 97, 98, 115, 32, 110, 97, 116, 105, 111, 110, 97, 108, 32, 69, 84, 86, 32, 65, 100, 32, 99, 114, 101, 97, 116, 101, 100, 32, 102, 114, 111, 109, 32, 84, 86, 87, 111, 114, 107, 115, 46, 189, 105, 252, 26, 5, 216, 230, 95]); | ||
consoleWrite(""); | ||
|
||
run("track1 = video.textTracks[1]"); | ||
run("track1.mode = 'hidden'"); | ||
testExpected("track1.kind", "metadata"); | ||
testExpected("track1.id", "1768"); | ||
testExpected("track1.inBandMetadataTrackDispatchType", "C005044554A2"); | ||
run("cues1 = track1.cues"); | ||
testExpected("cues1.length", "1"); | ||
testDataCue("cues1[0]", [224, 0, 114, 0, 0, 0, 3, 0, 0, 8, 0, 255, 255, 255, 0, 1, 0, 224, 94, 1, 1, 0, 0, 0, 0, 0, 0, 0, 100, 16, 82, 0, 80, 108, 105, 100, 58, 47, 47, 105, 98, 46, 116, 118, 119, 111, 114, 107, 115, 46, 99, 111, 109, 47, 67, 97, 98, 108, 101, 108, 97, 98, 115, 95, 78, 97, 116, 105, 111, 110, 97, 108, 95, 101, 116, 118, 95, 115, 116, 114, 101, 97, 109, 95, 99, 111, 110, 102, 105, 103, 47, 109, 97, 105, 110, 97, 112, 112, 47, 49, 46, 48, 47, 109, 97, 105, 110, 95, 112, 114, 46, 112, 114, 90, 3, 153, 38]); | ||
consoleWrite(""); | ||
|
||
run("track2 = video.textTracks[2]"); | ||
run("track2.mode = 'hidden'"); | ||
testExpected("track2.kind", "metadata"); | ||
testExpected("track2.id", "45"); | ||
testExpected("track2.inBandMetadataTrackDispatchType", "86"); | ||
testExpected("track2.cues.length", "0"); | ||
consoleWrite(""); | ||
|
||
run("track3 = video.textTracks[3]"); | ||
run("track3.mode = 'hidden'"); | ||
testExpected("track3.kind", "metadata"); | ||
testExpected("track3.id", "36"); | ||
testExpected("track3.inBandMetadataTrackDispatchType", "81"); | ||
testExpected("track3.cues.length", "0"); | ||
consoleWrite(""); | ||
|
||
endTest(); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<video src="../../content/user-private-streams.ts" oncanplaythrough="start()" controls></video> | ||
<p>Check for metadata tracks from MPEG-TS file.</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.