Add Alpha fading mode to media player timeline

Fading color (to black) is not useful for media with transparency; there fading of alpha is necessary; the fading mode allows to select fade color or fade alpha. Also the source control window had to be adapted, with a checkerboard to show the alpha effect. The cropping of the image in control window was also fixed.
This commit is contained in:
Bruno Herbelin
2023-12-26 10:57:26 +01:00
parent b3245c967b
commit f610e8ba1e
6 changed files with 70 additions and 10 deletions

View File

@@ -206,8 +206,19 @@ public:
*/
Timeline *timeline();
void setTimeline(const Timeline &tl);
/**
* Get fading value at current time
* */
float currentTimelineFading();
/**
* Get fading mode
* */
typedef enum { FADING_COLOR = 0, FADING_ALPHA = 1 } FadingMode;
FadingMode timelineFadingMode() { return fading_mode_; }
/**
* Set fading mode
* */
void setTimelineFadingMode(FadingMode m) { fading_mode_ = m; }
/**
* Get framerate of the media
* */
@@ -314,6 +325,7 @@ private:
// general properties of media
MediaInfo media_;
Timeline timeline_;
FadingMode fading_mode_;
std::future<MediaInfo> discoverer_;
// GST & Play status