New MediaPlayer image with timeline

Enable playing and seeking into a timeline on a media player that loaded an image. Timeline sets a duration (end) and is saved/loaded. Add a gstreamer imagefreeze element in the pipeline to simulate a playable stream. Distinction must be made between 'isImage' (what was loaded) and 'singleFrame' (what is in the pipeline). GUI is added and customized with menu and dialog.
This commit is contained in:
Bruno Herbelin
2023-08-10 00:46:48 +02:00
parent 1d329600af
commit 4efaa1f350
13 changed files with 299 additions and 105 deletions

View File

@@ -410,7 +410,7 @@ void SessionVisitor::visit(MediaPlayer &n)
XMLElement *newelement = xmlDoc_->NewElement("MediaPlayer");
newelement->SetAttribute("id", n.id());
if (!n.isImage()) {
if (!n.singleFrame()) {
newelement->SetAttribute("play", n.isPlaying());
newelement->SetAttribute("loop", (int) n.loop());
newelement->SetAttribute("speed", n.playSpeed());
@@ -421,6 +421,9 @@ void SessionVisitor::visit(MediaPlayer &n)
// timeline
XMLElement *timelineelement = xmlDoc_->NewElement("Timeline");
timelineelement->SetAttribute("begin", n.timeline()->begin());
timelineelement->SetAttribute("end", n.timeline()->end());
timelineelement->SetAttribute("step", n.timeline()->step());
// gaps in timeline
XMLElement *gapselement = xmlDoc_->NewElement("Gaps");