MythTV
master
|
Common code shared between GPU accelerated sub-classes (e.g. OpenGL) More...
#include <mythvideooutgpu.h>
Public Slots | |
void | WindowResized (QSize Size) |
void | ResizeForVideo (QSize Size=QSize()) |
![]() | |
void | RefreshVideoBoundsState () |
Send out latest state to listeners. More... | |
void | ScreenChanged (QScreen *screen) |
void | PhysicalDPIChanged (qreal) |
void | SourceChanged (QSize VideoDim, QSize VideoDispDim, float Aspect) |
Update for new source video dimensions and aspect ratio. More... | |
void | VideoAspectRatioChanged (float Aspect) |
Calls SetVideoAspectRatio(float aspect), then calls MoveResize() to apply changes. More... | |
virtual void | EmbedPlayback (bool Embed, QRect Rect) |
void | ToggleAdjustFill (AdjustFillMode AdjustFillMode=kAdjustFill_Toggle) |
Sets up letterboxing for various standard video frame and monitor dimensions, then calls MoveResize() to apply them. More... | |
void | ToggleAspectOverride (AspectOverrideMode AspectMode=kAspect_Toggle) |
Enforce different aspect ratio than detected, then calls VideoAspectRatioChanged(float) to apply them. More... | |
void | ResizeDisplayWindow (QRect Rect, bool SaveVisibleRect) |
Resize Display Window. More... | |
void | MoveResize (void) |
performs all the calculations for video framing and any resizing. More... | |
void | Zoom (ZoomDirection Direction) |
Sets up zooming into to different parts of the video. More... | |
void | ToggleMoveBottomLine (void) |
void | SaveBottomLine (void) |
void | SetVideoScalingAllowed (bool Change) |
Disable or enable underscan/overscan. More... | |
void | SetDisplayAspect (float DisplayAspect) |
void | SetWindowSize (QSize Size) |
void | SetITVResize (QRect Rect) |
void | SetRotation (int Rotation) |
Set the rotation in degrees. More... | |
void | SetStereoOverride (StereoscopicMode Mode) |
Signals | |
void | ChangePictureAttribute (PictureAttribute Attribute, bool Direction, int Value) |
void | PictureAttributeChanged (PictureAttribute Attribute, int Value) |
void | SupportedAttributesChanged (PictureAttributeSupported Supported) |
void | PictureAttributesUpdated (const std::map< PictureAttribute, int > &Values) |
void | RefreshState () |
void | DoRefreshState () |
![]() | |
void | UpdateOSDMessage (const QString &Message) |
void | VideoSizeChanged (const QSize &VideoDim, const QSize &VideoDispDim) |
void | VideoRectsChanged (const QRect &DisplayVideoRect, const QRect &VideoRect) |
void | VisibleRectChanged (const QRect &DisplayVisibleRect) |
void | WindowRectChanged (const QRect &WindowRect) |
void | VideoBoundsStateChanged (MythVideoBoundsState VideoState) |
Public Member Functions | |
~MythVideoOutputGPU () override | |
void | InitPictureAttributes () override |
void | SetVideoFrameRate (float NewRate) override |
void | DiscardFrames (bool KeyFrame, bool Flushed) override |
Discard video frames. More... | |
void | DoneDisplayingFrame (MythVideoFrame *Frame) override |
Release a video frame back into the decoder pool. More... | |
void | UpdatePauseFrame (std::chrono::milliseconds &DisplayTimecode, FrameScanType Scan=kScan_Progressive) override |
bool | InputChanged (QSize VideoDim, QSize VideoDispDim, float VideoAspect, MythCodecID CodecId, bool &AspectOnly, int ReferenceFrames, bool ForceChange) override |
Tells video output to discard decoded frames and wait for new ones. More... | |
void | EndFrame () override |
void | ClearAfterSeek () override |
Tells video output to toss decoded buffers due to a seek. More... | |
![]() | |
~MythVideoOutput () override=default | |
virtual void | SetDeinterlacing (bool Enable, bool DoubleRate, MythDeintType Force=DEINT_NONE) |
virtual void | RenderEnd ()=0 |
virtual void | GetOSDBounds (QRect &Total, QRect &Visible, float &VisibleAspect, float &FontScaling, float ThemeAspect) const |
virtual void | SetFramesPlayed (long long FramesPlayed) |
virtual long long | GetFramesPlayed () |
bool | IsErrored () const |
VideoErrorState | GetError () const |
void | SetPrebuffering (bool Normal) |
Sets whether to use a normal number of buffers or fewer buffers. More... | |
virtual int | ValidVideoFrames () const |
Returns number of frames that are fully decoded. More... | |
int | FreeVideoFrames () |
Returns number of frames available for decoding onto. More... | |
bool | EnoughFreeFrames () |
Returns true iff enough frames are available to decode onto. More... | |
bool | EnoughDecodedFrames () |
Returns true iff there are plenty of decoded frames ready for display. More... | |
virtual MythVideoFrame * | GetNextFreeFrame () |
Blocks until it is possible to return a frame for decoding onto. More... | |
virtual void | ReleaseFrame (MythVideoFrame *Frame) |
Releases a frame from the ready for decoding queue onto the queue of frames ready for display. More... | |
virtual void | DeLimboFrame (MythVideoFrame *Frame) |
Releases a frame for reuse if it is in limbo. More... | |
virtual void | StartDisplayingFrame () |
Tell GetLastShownFrame() to return the next frame from the head of the queue of frames to display. More... | |
virtual void | DiscardFrame (MythVideoFrame *Frame) |
Releases frame from any queue onto the queue of frames ready for decoding onto. More... | |
virtual void | CheckFrameStates () |
virtual MythVideoFrame * | GetLastDecodedFrame () |
virtual MythVideoFrame * | GetLastShownFrame () |
Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been called. More... | |
QString | GetFrameStatus () const |
Returns string with status of each frame for debugging. More... | |
QRect | GetImageRect (QRect Rect, QRect *DisplayRect=nullptr) |
translates caption/dvd button rectangle into 'screen' space More... | |
QRect | GetSafeRect () |
Returns a QRect describing an area of the screen on which it is 'safe' to render the On Screen Display. More... | |
PictureAttributeSupported | GetSupportedPictureAttributes () |
bool | HasSoftwareFrames () const |
![]() | |
MythVideoBounds () | |
~MythVideoBounds () override=default | |
bool | InitBounds (QSize VideoDim, QSize VideoDispDim, float Aspect, QRect WindowRect) |
void | SetDisplay (MythDisplay *mDisplay) |
bool | IsEmbedding (void) const |
bool | IsEmbeddingAndHidden () const |
QSize | GetVideoDim (void) const |
QSize | GetVideoDispDim (void) const |
float | GetOverridenVideoAspect (void) const |
QRect | GetDisplayVisibleRect (void) const |
QRect | GetWindowRect (void) const |
QRect | GetRawWindowRect (void) const |
QRect | GetVideoRect (void) const |
QRect | GetDisplayVideoRect (void) const |
QRect | GetEmbeddingRect (void) const |
bool | UsingGuiSize (void) const |
AdjustFillMode | GetAdjustFill (void) const |
float | GetVideoAspect (void) const |
float | GetDisplayAspect (void) const |
StereoscopicMode | GetStereoOverride () const |
bool | VideoIsFullScreen (void) const |
Check whether the video display rect covers the entire window/framebuffer. More... | |
QRegion | GetBoundingRegion (void) const |
Return the region of DisplayVisibleRect that lies outside of DisplayVideoRect. More... | |
Static Public Member Functions | |
static void | GetRenderOptions (RenderOptions &Options, MythRender *Render) |
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) |
static VideoFrameType | FrameTypeForCodec (MythCodecID CodecId) |
![]() | |
static void | GetRenderOptions (RenderOptions &Options, MythRender *Render) |
Protected Member Functions | |
MythVideoOutputGPU (MythMainWindow *MainWindow, MythRender *Render, MythPainterGPU *Painter, MythDisplay *Display, MythVideoProfilePtr VideoProfile, QString &Profile) | |
virtual QRect | GetDisplayVisibleRectAdj () |
bool | Init (QSize VideoDim, QSize VideoDispDim, float Aspect, QRect DisplayVisibleRect, MythCodecID CodecId) override |
void | PrepareFrame (MythVideoFrame *Frame, FrameScanType Scan) override |
void | RenderFrame (MythVideoFrame *Frame, FrameScanType Scan) override |
bool | CreateBuffers (MythCodecID CodecID, QSize Size) |
void | DestroyBuffers () |
bool | ProcessInputChange () |
void | InitDisplayMeasurements () |
Initialise display measurement. More... | |
void | SetReferenceFrames (int ReferenceFrames) |
![]() | |
MythVideoOutput () | |
QRect | GetVisibleOSDBounds (float &VisibleAspect, float &FontScaling, float ThemeAspect) const |
Returns visible portions of total OSD bounds. More... | |
Common code shared between GPU accelerated sub-classes (e.g. OpenGL)
MythVideoOutputGPU is a pure virtual class that contains code shared between the differing hardware accelerated MythVideoOutput subclasses.
Definition at line 12 of file mythvideooutgpu.h.
|
override |
Definition at line 245 of file mythvideooutgpu.cpp.
|
protected |
Definition at line 201 of file mythvideooutgpu.cpp.
|
static |
Definition at line 21 of file mythvideooutgpu.cpp.
Referenced by MythVideoOutput::GetRenderOptions().
|
static |
Definition at line 34 of file mythvideooutgpu.cpp.
Referenced by MythPlayerVideoUI::InitVideo().
|
static |
Definition at line 177 of file mythvideooutgpu.cpp.
Referenced by MythVideoOutputOpenGL::GetAllowedRenderers().
|
signal |
Referenced by MythPlayerVideoUI::InitVideo(), and MythVideoOutputGPU().
|
signal |
Referenced by MythPlayerVideoUI::InitVideo(), and MythVideoOutputGPU().
|
signal |
Referenced by MythPlayerVideoUI::InitVideo(), and MythVideoOutputGPU().
|
signal |
Referenced by MythPlayerVideoUI::InitVideo(), and MythVideoOutputGPU().
|
signal |
Referenced by MythPlayerVideoUI::InitVideo(), and MythVideoOutputGPU().
|
signal |
Referenced by MythVideoOutputGPU().
|
slot |
Definition at line 267 of file mythvideooutgpu.cpp.
Referenced by MythPlayerVideoUI::InitVideo().
|
slot |
Definition at line 708 of file mythvideooutgpu.cpp.
Referenced by Init(), MythPlayerVideoUI::InitVideo(), and ProcessInputChange().
|
overridevirtual |
Reimplemented from MythVideoOutput.
Definition at line 262 of file mythvideooutgpu.cpp.
Referenced by Init().
|
overridevirtual |
Reimplemented from MythVideoOutput.
Definition at line 273 of file mythvideooutgpu.cpp.
Referenced by Create().
Discard video frames.
If Flushed is true, the decoder will probably reset the hardware decoder in use and we need to release any hardware pause frames so the decoder is released before a new one is created.
Reimplemented from MythVideoOutput.
Definition at line 340 of file mythvideooutgpu.cpp.
Referenced by DestroyBuffers().
|
overridevirtual |
Release a video frame back into the decoder pool.
Software frames do not need a pause frame as the MythVideo subclass holds a copy of the last frame in its input textures. So just release the frame.
Hardware frames hold the underlying interop class and hence access to the video texture. We cannot access them without a frame so retain the most recent frame by removing it from the 'used' queue and adding it to the 'pause' queue.
Reimplemented from MythVideoOutput.
Definition at line 361 of file mythvideooutgpu.cpp.
Referenced by UpdatePauseFrame().
|
overridevirtual |
Reimplemented from MythVideoOutput.
Definition at line 653 of file mythvideooutgpu.cpp.
|
overridevirtual |
Tells video output to discard decoded frames and wait for new ones.
Reimplemented from MythVideoOutput.
Definition at line 434 of file mythvideooutgpu.cpp.
|
overridevirtual |
Implements MythVideoOutput.
Reimplemented in MythVideoOutputOpenGL, and MythVideoOutputVulkan.
Definition at line 683 of file mythvideooutgpu.cpp.
|
overridevirtual |
Tells video output to toss decoded buffers due to a seek.
Reimplemented from MythVideoOutput.
Definition at line 688 of file mythvideooutgpu.cpp.
|
protectedvirtual |
Reimplemented in MythVideoOutputOpenGL.
Definition at line 257 of file mythvideooutgpu.cpp.
Referenced by Init().
|
overrideprotectedvirtual |
Reimplemented from MythVideoOutput.
Reimplemented in MythVideoOutputOpenGL, and MythVideoOutputVulkan.
Definition at line 287 of file mythvideooutgpu.cpp.
Referenced by Create(), MythVideoOutputVulkan::Init(), MythVideoOutputOpenGL::Init(), and ProcessInputChange().
|
overrideprotectedvirtual |
Implements MythVideoOutput.
Reimplemented in MythVideoOutputOpenGL, and MythVideoOutputVulkan.
Definition at line 587 of file mythvideooutgpu.cpp.
Referenced by MythVideoOutputVulkan::PrepareFrame(), and MythVideoOutputOpenGL::PrepareFrame().
|
overrideprotectedvirtual |
Implements MythVideoOutput.
Reimplemented in MythVideoOutputOpenGL, and MythVideoOutputVulkan.
Definition at line 612 of file mythvideooutgpu.cpp.
Referenced by MythVideoOutputVulkan::RenderFrame(), and MythVideoOutputOpenGL::RenderFrame().
|
protected |
Definition at line 393 of file mythvideooutgpu.cpp.
Referenced by Init().
|
protected |
Definition at line 422 of file mythvideooutgpu.cpp.
Referenced by ~MythVideoOutputGPU().
|
protected |
Definition at line 492 of file mythvideooutgpu.cpp.
Referenced by PrepareFrame().
|
protected |
Initialise display measurement.
The sole intent here is to ensure that MythVideoBounds has the correct aspect ratio when it calculates the video display rectangle.
Definition at line 552 of file mythvideooutgpu.cpp.
Referenced by Init(), and WindowResized().
|
protected |
Definition at line 429 of file mythvideooutgpu.cpp.
Referenced by Create().
|
protected |
Definition at line 68 of file mythvideooutgpu.h.
Referenced by MythVideoOutputOpenGL::GetDisplayVisibleRectAdj(), MythVideoOutputGPU(), RenderFrame(), and ResizeForVideo().
|
protected |
Definition at line 69 of file mythvideooutgpu.h.
Referenced by Init(), MythVideoOutputGPU(), RenderFrame(), and ~MythVideoOutputGPU().
|
protected |
Definition at line 70 of file mythvideooutgpu.h.
Referenced by ClearAfterSeek(), MythVideoOutputVulkan::EndFrame(), EndFrame(), MythVideoOutputVulkan::Init(), MythVideoOutputOpenGL::Init(), Init(), MythVideoOutputOpenGL::MythVideoOutputOpenGL(), MythVideoOutputVulkan::MythVideoOutputVulkan(), PrepareFrame(), MythVideoOutputVulkan::RenderFrame(), RenderFrame(), UpdatePauseFrame(), and ~MythVideoOutputGPU().
|
protected |
Definition at line 71 of file mythvideooutgpu.h.
Referenced by MythVideoOutputVulkan::Init(), MythVideoOutputOpenGL::Init(), Init(), MythVideoOutputGPU(), MythVideoOutputOpenGL::MythVideoOutputOpenGL(), MythVideoOutputVulkan::MythVideoOutputVulkan(), RenderFrame(), and ~MythVideoOutputGPU().
|
protected |
Definition at line 72 of file mythvideooutgpu.h.
Referenced by Init(), InputChanged(), ProcessInputChange(), MythVideoOutputVulkan::RenderFrame(), and MythVideoOutputOpenGL::RenderFrame().
|
protected |
Definition at line 73 of file mythvideooutgpu.h.
Referenced by InputChanged(), and ProcessInputChange().
|
protected |
Definition at line 74 of file mythvideooutgpu.h.
Referenced by InputChanged(), and ProcessInputChange().
|
protected |
Definition at line 75 of file mythvideooutgpu.h.
Referenced by InputChanged(), and ProcessInputChange().
Definition at line 76 of file mythvideooutgpu.h.
Referenced by ProcessInputChange(), and SetVideoFrameRate().
Definition at line 77 of file mythvideooutgpu.h.
Referenced by CreateBuffers(), DestroyBuffers(), Init(), and InputChanged().
|
protected |
Definition at line 78 of file mythvideooutgpu.h.
Referenced by MythVideoOutputOpenGL::MythVideoOutputOpenGL().
Definition at line 79 of file mythvideooutgpu.h.
Referenced by MythVideoOutputGPU(), and MythVideoOutputOpenGL::RenderFrame().
|
protected |
Definition at line 80 of file mythvideooutgpu.h.
Referenced by MythVideoOutputGPU(), PrepareFrame(), and ~MythVideoOutputGPU().