2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "DVDCodecs/Overlay/DVDOverlay.h"
12 #include "threads/CriticalSection.h"
16 class CDVDInputStreamNavigator
;
19 class CDVDOverlayContainer
: public CCriticalSection
22 virtual ~CDVDOverlayContainer();
25 * \brief Adds an overlay into the container by processing the existing overlay collection first
27 * \details Processes the overlay collection whenever a new overlay is added. Useful to change
28 * the overlay's PTS values of previously added overlays if the collection itself is sequential. This
29 * is, for example, the case of ASS subtitles in which a single call to ass_render_frame generates all
30 * the subtitle images on a single call even if two subtitles exist at the same time frame. Other cases
31 * might exist where an overlay shouldn't be added to the collection if completely contained in another
34 * \param pPicture pointer to the overlay to be evaluated and possibly added to the collection
36 void ProcessAndAddOverlayIfValid(const std::shared_ptr
<CDVDOverlay
>& pPicture
);
38 VecOverlays
* GetOverlays(); // get the first overlay in this fifo
39 bool ContainsOverlayType(DVDOverlayType type
);
41 void Clear(); // clear the fifo and delete all overlays
44 * \brief Flush the overlays.
48 void CleanUp(double pts
); // validates all overlays against current pts
51 void UpdateOverlayInfo(const std::shared_ptr
<CDVDInputStreamNavigator
>& pStream
,
56 VecOverlays::iterator
Remove(VecOverlays::iterator itOverlay
); // removes a specific overlay
58 VecOverlays m_overlays
;