summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2011-05-10 01:28:59 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2011-05-10 01:28:59 (GMT)
commitc65b5334b4056cc2ea05f3844e0009370fe15efe (patch)
treef95f7f6262f6a6cfe1a16a38e31845d4335720c0
parent5be1e5590a59707c0684e269755211110c2ce2c7 (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
-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.h4
6 files changed, 42 insertions, 31 deletions
diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index c0e648d..3ef5fa1 100644
--- a/mythtv/libs/libmythtv/tv_play.cpp
+++ b/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)
diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
index 2935e6d..643260c 100644
--- a/mythtv/libs/libmythtv/tv_play.h
+++ b/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);
diff --git a/mythtv/libs/libmythtv/videoout_d3d.h b/mythtv/libs/libmythtv/videoout_d3d.h
index c240900..297fc24 100644
--- a/mythtv/libs/libmythtv/videoout_d3d.h
+++ b/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;
diff --git a/mythtv/libs/libmythtv/videoout_opengl.h b/mythtv/libs/libmythtv/videoout_opengl.h
index bb8e7e9..626b54a 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 ApproveDeintFilter(const QString& filtername) const;
virtual MythPainter *GetOSDPainter(void) { return (MythPainter*)gl_painter; }
diff --git a/mythtv/libs/libmythtv/videoout_vdpau.h b/mythtv/libs/libmythtv/videoout_vdpau.h
index 52d1f09..0c31610 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 0df4bef..d203a6f 100644
--- a/mythtv/libs/libmythtv/videoout_xv.h
+++ b/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,