mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-13 19:29:58 +01:00
New Generalize option to restart on deactivation to any StreamSource
StreamSource now have the option 'restart on deactivation' like MediaPlayer. This option is saved in XML (added Visitors for Stream and StreamSource). The GUI is added as sub-menu in play bar (like for MediaPlayer). Some StreamSource subclasses needed to be fixed to allow this feature (e.g. MultiFileSource).
This commit is contained in:
@@ -53,6 +53,7 @@ Stream::Stream()
|
||||
single_frame_ = false;
|
||||
live_ = false;
|
||||
failed_ = false;
|
||||
rewind_on_disable_ = false;
|
||||
decoder_name_ = "";
|
||||
|
||||
// start index in frame_ stack
|
||||
@@ -216,6 +217,15 @@ void Stream::open(const std::string &gstreamer_description, guint w, guint h)
|
||||
|
||||
}
|
||||
|
||||
void Stream::reopen()
|
||||
{
|
||||
// re-openning is meaningfull only if it was already open
|
||||
if (pipeline_ != nullptr) {
|
||||
// reload : terminate pipeline and re-create it
|
||||
close();
|
||||
execute_open();
|
||||
}
|
||||
}
|
||||
|
||||
std::string Stream::description() const
|
||||
{
|
||||
@@ -407,6 +417,10 @@ void Stream::enable(bool on)
|
||||
|
||||
if ( enabled_ != on ) {
|
||||
|
||||
// option to automatically rewind each time the player is disabled
|
||||
if (!on && rewind_on_disable_ && desired_state_ == GST_STATE_PLAYING)
|
||||
rewind();
|
||||
|
||||
enabled_ = on;
|
||||
|
||||
// default to pause
|
||||
|
||||
Reference in New Issue
Block a user