New support for AUDIO

Allows looking for audio streams in media files (settings) and enabling  / disabling audio for each MediaPlayer individually. Control of volume per media, saving in session file.
This commit is contained in:
Bruno Herbelin
2023-10-28 12:58:17 +02:00
parent f19b18d806
commit 5a1a88bf33
9 changed files with 142 additions and 6 deletions

View File

@@ -37,6 +37,7 @@ struct MediaInfo {
GstClockTime dt;
GstClockTime end;
std::string log;
bool hasaudio;
MediaInfo() {
width = par_width = 1;
@@ -49,6 +50,7 @@ struct MediaInfo {
interlaced = false;
seekable = false;
valid = false;
hasaudio = false;
dt = GST_CLOCK_TIME_NONE;
end = GST_CLOCK_TIME_NONE;
log = "";
@@ -264,6 +266,15 @@ public:
void setVideoEffect(const std::string &pipeline_element);
inline std::string videoEffect() { return video_filter_; }
inline bool videoEffectAvailable() { return video_filter_available_; }
/**
* Enables or disables audio
* NB: setAudioEnabled reopens the video
* */
void setAudioEnabled(bool on);
void setAudioVolume(int vol);
inline bool audioEnabled() const { return audio_enabled_; }
inline int audioVolume() const { return audio_volume_; }
inline bool audioAvailable() const { return media_.hasaudio; }
/**
* Accept visitors
* */
@@ -309,6 +320,8 @@ private:
bool enabled_;
bool rewind_on_disable_;
bool force_software_decoding_;
bool audio_enabled_;
int audio_volume_;
std::string decoder_name_;
bool video_filter_available_;
std::string video_filter_;