Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Re-enable Picture in Picture and Picture By Picture.

There is still a lot of work to be done to clean this up properly but I
realised my obvious mistake when I broke PiP in the first place.

Refs #9543
  • Loading branch information...
commit c65b5334b4056cc2ea05f3844e0009370fe15efe 1 parent 5be1e55
Mark Kendall authored
View
62 mythtv/libs/libmythtv/tv_play.cpp
@@ -297,32 +297,7 @@ bool TV::StartTV(ProgramInfo *tvrec, uint flags)
// Process Events
VERBOSE(VB_GENERAL, LOC + "Entering main playback loop.");
-
- while (true)
- {
- qApp->processEvents();
-
- TVState state = tv->GetState(0);
- if ((kState_Error == state) || (kState_None == state))
- break;
-
- if (kState_ChangingState == state)
- continue;
-
- const PlayerContext *mctx = tv->GetPlayerReadLock(0, __FILE__, __LINE__);
- if (mctx)
- {
- mctx->LockDeletePlayer(__FILE__, __LINE__);
- if (mctx->player && !mctx->player->IsErrored())
- {
- mctx->player->EventLoop();
- mctx->player->VideoLoop();
- }
- mctx->UnlockDeletePlayer(__FILE__, __LINE__);
- }
- tv->ReturnPlayerLock(mctx);
- }
-
+ tv->PlaybackLoop();
VERBOSE(VB_GENERAL, LOC + "Exiting main playback loop.");
if (tv->getJumpToProgram())
@@ -1221,6 +1196,41 @@ TV::~TV(void)
}
/**
+ * \brief The main playback loop
+ */
+void TV::PlaybackLoop(void)
+{
+ while (true)
+ {
+ qApp->processEvents();
+
+ TVState state = GetState(0);
+ if ((kState_Error == state) || (kState_None == state))
+ return;
+
+ if (kState_ChangingState == state)
+ continue;
+
+ int count = player.size();
+ for (int i = 0; i < count; i++)
+ {
+ const PlayerContext *mctx = GetPlayerReadLock(i, __FILE__, __LINE__);
+ if (mctx)
+ {
+ mctx->LockDeletePlayer(__FILE__, __LINE__);
+ if (mctx->player && !mctx->player->IsErrored())
+ {
+ mctx->player->EventLoop();
+ mctx->player->VideoLoop();
+ }
+ mctx->UnlockDeletePlayer(__FILE__, __LINE__);
+ }
+ ReturnPlayerLock(mctx);
+ }
+ }
+}
+
+/**
* \brief update the channel list with channels from the selected channel group
*/
void TV::UpdateChannelList(int groupID)
View
1  mythtv/libs/libmythtv/tv_play.h
@@ -313,6 +313,7 @@ class MTV_PUBLIC TV : public QObject
static EMBEDRETURNVOIDSCHEDIT RunScheduleEditorPtr;
private:
+ void PlaybackLoop(void);
bool ContextIsPaused(PlayerContext *ctx, const char *file, int location);
void SetActive(PlayerContext *lctx, int index, bool osd_msg);
View
2  mythtv/libs/libmythtv/videoout_d3d.h
@@ -52,7 +52,7 @@ class VideoOutputD3D : public VideoOutput
MythPlayer *pipplayer,
PIPLocation loc);
void RemovePIP(MythPlayer *pipplayer);
- bool IsPIPSupported(void) const { return false; /*true*/}
+ bool IsPIPSupported(void) const { return true; }
virtual MythPainter *GetOSDPainter(void) { return (MythPainter*)m_osd_painter; }
bool hasHWAcceleration(void) const { return !codec_is_std(video_codec_id); }
virtual bool ApproveDeintFilter(const QString& filtername) const;
View
2  mythtv/libs/libmythtv/videoout_opengl.h
@@ -46,7 +46,7 @@ class VideoOutputOpenGL : public VideoOutput
void MoveResizeWindow(QRect new_rect);
virtual void RemovePIP(MythPlayer *pipplayer);
- virtual bool IsPIPSupported(void) const { return false/*true*/; }
+ virtual bool IsPIPSupported(void) const { return true; }
virtual bool hasFullScreenOSD(void) const { return true; }
virtual bool ApproveDeintFilter(const QString& filtername) const;
virtual MythPainter *GetOSDPainter(void) { return (MythPainter*)gl_painter; }
View
2  mythtv/libs/libmythtv/videoout_vdpau.h
@@ -55,7 +55,7 @@ class VideoOutputVDPAU : public VideoOutput
static MythCodecID GetBestSupportedCodec(uint width, uint height,
uint stream_type,
bool no_acceleration);
- virtual bool IsPIPSupported(void) const { return false;/*true; */}
+ virtual bool IsPIPSupported(void) const { return true; }
virtual bool IsPBPSupported(void) const { return false; }
virtual bool NeedExtraAudioDecode(void) const
{ return codec_is_vdpau(video_codec_id); }
View
4 mythtv/libs/libmythtv/videoout_xv.h
@@ -70,9 +70,9 @@ class VideoOutputXv : public VideoOutput
void InitPictureAttributes(void);
virtual bool IsPIPSupported(void) const
- { return false; /*XVideo == VideoOutputSubType(); */}
+ { return XVideo == VideoOutputSubType(); }
virtual bool IsPBPSupported(void) const
- { return false; /*return XVideo == VideoOutputSubType(); */}
+ { return XVideo == VideoOutputSubType(); }
virtual bool NeedExtraAudioDecode(void) const { return false; }
virtual QRect GetPIPRect(PIPLocation location,
Please sign in to comment.
Something went wrong with that request. Please try again.