summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2011-05-10 03:44:33 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2011-05-10 03:44:33 (GMT)
commit406269554c7b28763a2091e1368690244f320dc5 (patch)
tree16c104b5b823e76fa2c1a2c551e5dfbe41be6471
parent5461754cd439d9ed188b9a028678cc1b5dc72b7b (diff)
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 Cherry picked from c65b5334b4056cc2ea05
-rw-r--r--mythtv/libs/libmythtv/tv_play.cpp62
-rw-r--r--mythtv/libs/libmythtv/tv_play.h1
-rw-r--r--mythtv/libs/libmythtv/videoout_d3d.h2
-rw-r--r--mythtv/libs/libmythtv/videoout_opengl.h2
-rw-r--r--mythtv/libs/libmythtv/videoout_vdpau.h2
-rw-r--r--mythtv/libs/libmythtv/videoout_xv.h6
6 files changed, 44 insertions, 31 deletions
diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index f17fd37..e8d0c2d 100644
--- a/mythtv/libs/libmythtv/tv_play.cpp
+++ b/mythtv/libs/libmythtv/tv_play.cpp
@@ -365,32 +365,7 @@ bool TV::StartTV(ProgramInfo *tvrec, uint flags)
// Process Events
VERBOSE(VB_PLAYBACK, LOC + "StartTV -- process events begin");
-
- 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_PLAYBACK, LOC + "StartTV -- process events end");
if (tv->getJumpToProgram())
@@ -1281,6 +1256,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)
diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
index 205cd7a..cece539 100644
--- a/mythtv/libs/libmythtv/tv_play.h
+++ b/mythtv/libs/libmythtv/tv_play.h
@@ -307,6 +307,7 @@ class MPUBLIC 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);
diff --git a/mythtv/libs/libmythtv/videoout_d3d.h b/mythtv/libs/libmythtv/videoout_d3d.h
index e58961d..7731c3b 100644
--- a/mythtv/libs/libmythtv/videoout_d3d.h
+++ b/mythtv/libs/libmythtv/videoout_d3d.h
@@ -43,7 +43,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; }
private:
diff --git a/mythtv/libs/libmythtv/videoout_opengl.h b/mythtv/libs/libmythtv/videoout_opengl.h
index a67bd0b..e728da7 100644
--- a/mythtv/libs/libmythtv/videoout_opengl.h
+++ b/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 IsSyncLocked(void) const { return true; }
virtual bool ApproveDeintFilter(const QString& filtername) const;
diff --git a/mythtv/libs/libmythtv/videoout_vdpau.h b/mythtv/libs/libmythtv/videoout_vdpau.h
index e46789a..edc7dce 100644
--- a/mythtv/libs/libmythtv/videoout_vdpau.h
+++ b/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); }
diff --git a/mythtv/libs/libmythtv/videoout_xv.h b/mythtv/libs/libmythtv/videoout_xv.h
index b5a4447..945be25 100644
--- a/mythtv/libs/libmythtv/videoout_xv.h
+++ b/mythtv/libs/libmythtv/videoout_xv.h
@@ -91,8 +91,10 @@ class VideoOutputXv : public VideoOutput
int SetPictureAttribute(PictureAttribute attribute, int newValue);
void InitPictureAttributes(void);
- virtual bool IsPIPSupported(void) const { return false; }
- virtual bool IsPBPSupported(void) const { return false; }
+ virtual bool IsPIPSupported(void) const
+ { return XVideo == VideoOutputSubType(); }
+ virtual bool IsPBPSupported(void) const
+ { return XVideo == VideoOutputSubType(); }
virtual bool NeedExtraAudioDecode(void) const
{ return XVideoMC <= VideoOutputSubType(); }
virtual bool hasHWAcceleration(void) const