9#define LOC QString("PlayerVideo: ")
15 qRegisterMetaType<MythVideoBoundsState>();
16 qRegisterMetaType<MythVideoColourState>();
47 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Couldn't create VideoOutput instance. Exiting..");
48 SetErrored(tr(
"Failed to initialize video output"));
53 auto toggleDetectLetterbox = [&]()
136 void* Opaque1,
void* Opaque2)
144 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Queuing callback for %1").arg(Debug));
148 LOG(VB_GENERAL, LOG_WARNING, QString(
"Waited %1ms for %2").arg(count).arg(Debug));
160 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Executing %1").arg(it->m_debug));
161 it->m_function(it->m_opaque1, it->m_opaque2, it->m_opaque3);
192 int stretch =
static_cast<int>(lroundf(aspect * 100));
230 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Video Aspect ratio changed from %1 to %2")
virtual QString GetCodecDecoderName(void) const =0
virtual MythCodecID GetVideoCodecID(void) const =0
void(*)(void *, void *, void *) Callback
void UpdateOSD(uint64_t frame, double frame_rate, OSD *osd)
Show and update the edit mode On Screen Display.
void SetChanged(bool changed=true)
bool IsEditing(void) const
bool IsChanged(void) const
void SetDetectLetterbox(bool Detect, AdjustFillMode Mode)
bool GetDetectLetterbox() const
std::map< VideoFrameType, InteropTypes > InteropMap
static InteropMap GetTypes(MythRender *Render)
InteractiveTV * GetInteractiveTV() override
void ToggleCaptionsByType(uint Type)
MythCaptionsOverlay m_captionsOverlay
MythCaptionsState m_captionsState
void ResizeForInteractiveTV(const QRect &Rect)
InteractiveTV * m_interactiveTV
virtual void EnableCaptions(uint Mode, bool UpdateOSD=true)
void ChangeOSDPositionUpdates(bool Enable)
void UpdateOSDMessage(const QString &Message)
void UpdateOSDStatus(osdInfo &Info, int Type, OSDTimeout Timeout)
QRecursiveMutex m_osdLock
MythMainWindow * m_mainWindow
DetectLetterbox m_detectLetterBox
void VideoColourStateChanged(const MythVideoColourState &ColourState)
void CheckAspectRatio(MythVideoFrame *Frame)
MythInteropGPU::InteropMap m_interopTypes
QMutex m_decoderCallbackLock
void PictureAttributeChanged(PictureAttribute Attribute, int Value)
QVector< DecoderCallback > m_decoderCallbacks
MythPlayerVideoUI(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags)
void ToggleAdjustFill(AdjustFillMode Mode=kAdjustFill_Toggle)
void HandleDecoderCallback(const QString &Debug, DecoderCallback::Callback Function, void *Opaque1, void *Opaque2)
Convenience function to request and wait for a callback into the main thread.
void PictureAttributesUpdated(const std::map< PictureAttribute, int > &Values)
const MythInteropGPU::InteropMap & GetInteropTypes() const
Return a list of interop types supported by the current render device.
bool InitVideo() override
MythVideoColourState m_colourState
void SupportedAttributesChanged(PictureAttributeSupported Supported)
const VideoFrameTypes * m_renderFormats
void SetErrored(const QString &reason)
PlayerFlags m_playerFlags
int m_maxReferenceFrames
Number of reference frames used in the video stream.
QSize m_videoDispDim
Video (input) width & height.
QSize m_videoDim
Video (input) buffer width & height.
float m_videoAspect
Video (input) Apect Ratio.
double m_videoFrameRate
Video (input) Frame Rate (often inaccurate)
PlayerContext * m_playerCtx
MythVideoOutput * m_videoOutput
QString m_codecName
Codec Name - used by playback profile.
void SetITVResize(QRect Rect)
virtual void EmbedPlayback(bool Embed, QRect Rect)
AdjustFillMode GetAdjustFill(void) const
void SaveBottomLine(void)
void UpdateOSDMessage(const QString &Message)
void VideoBoundsStateChanged(MythVideoBoundsState VideoState)
void ToggleAdjustFill(AdjustFillMode AdjustFillMode=kAdjustFill_Toggle)
Sets up letterboxing for various standard video frame and monitor dimensions, then calls MoveResize()...
void ToggleAspectOverride(AspectOverrideMode AspectMode=kAspect_Toggle)
Enforce different aspect ratio than detected, then calls VideoAspectRatioChanged(float) to apply them...
void ToggleMoveBottomLine(void)
void VideoAspectRatioChanged(float Aspect)
Calls SetVideoAspectRatio(float aspect), then calls MoveResize() to apply changes.
void Zoom(ZoomDirection Direction)
Sets up zooming into to different parts of the video.
void SetStereoOverride(StereoscopicMode Mode)
PictureAttributeSupported m_supportedAttributes
std::map< PictureAttribute, int > m_attributeValues
void WindowResized(QSize Size)
void PictureAttributesUpdated(const std::map< PictureAttribute, int > &Values)
static MythVideoOutputGPU * Create(MythMainWindow *MainWindow, MythRender *Render, MythPainter *Painter, MythDisplay *Display, const QString &Decoder, MythCodecID CodecID, QSize VideoDim, QSize VideoDispDim, float VideoAspect, float FrameRate, uint PlayerFlags, const QString &Codec, int ReferenceFrames, const VideoFrameTypes *&RenderFormats)
void ChangePictureAttribute(PictureAttribute Attribute, bool Direction, int Value)
void ResizeForVideo(QSize Size=QSize())
void PictureAttributeChanged(PictureAttribute Attribute, int Value)
void SupportedAttributesChanged(PictureAttributeSupported Supported)
virtual void GetOSDBounds(QRect &Total, QRect &Visible, float &VisibleAspect, float &FontScaling, float ThemeAspect) const
bool Init(QRect Rect, float FontAspect) override
void ChangeAspectOverride(AspectOverrideMode AspectMode=kAspect_Toggle)
void ChangeZoom(ZoomDirection Zoom)
void ResizeScreenForVideo(QSize Size={})
void EmbedPlayback(bool Embed, const QRect &Rect={})
void ChangeStereoOverride(StereoscopicMode Mode)
void ChangeAdjustFill(AdjustFillMode FillMode=kAdjustFill_Toggle)
void WindowResized(const QSize &Size)
void ChangeOSDPositionUpdates(bool Enable)
void ToggleDetectLetterBox()
void ToggleMoveBottomLine()
void VideoBoundsStateChanged(const MythVideoBoundsState &VideoBoundsState)
void ChangePictureAttribute(PictureAttribute Attribute, bool Direction, int Value)
void VideoColourStateChanged(const MythVideoColourState &ColourState)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
@ kOSDFunctionalType_PictureAdjust
QString toTypeString(PictureAdjustType type)
QString toTitleString(PictureAdjustType type)
@ kAdjustingPicture_Playback
PictureAttributeSupported