summaryrefslogtreecommitdiff
path: root/liboutput/stillimage.c
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2008-01-02 11:08:47 +0000
committerAndreas Brachold <vdr07@deltab.de>2008-01-02 11:08:47 +0000
commit6a26a396ee4aa7be91967050cdc30d5c10bfb55c (patch)
tree9cecb7516f8baa5804ea8f12a64109d9abe0fcdf /liboutput/stillimage.c
parent943932297e9f6e15119a2ff1178635b43df14cbf (diff)
downloadvdr-plugin-image-6a26a396ee4aa7be91967050cdc30d5c10bfb55c.tar.gz
vdr-plugin-image-6a26a396ee4aa7be91967050cdc30d5c10bfb55c.tar.bz2
- Reimplement 'Playback mode via DeviceStillPicture'
Diffstat (limited to 'liboutput/stillimage.c')
-rw-r--r--liboutput/stillimage.c82
1 files changed, 44 insertions, 38 deletions
diff --git a/liboutput/stillimage.c b/liboutput/stillimage.c
index 6cefd44..0dd7eff 100644
--- a/liboutput/stillimage.c
+++ b/liboutput/stillimage.c
@@ -1,28 +1,27 @@
-/***************************************************************************
- * stillimage.c
- * (C) Copyright 2004 <anbr at users.berlios.de>
+/*
+ * Image plugin to VDR (C++)
+ *
+ * (C) 2004-2008 Andreas Brachold <anbr at users.berlios.de>
* Created: Thu Aug 5 2004
*
* parts of the code (c) Peter Seyringer
* (c) Marcel Wiesweg
- ****************************************************************************/
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
+ * This code is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This code is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
*/
-
#include <string.h>
#include <unistd.h>
@@ -32,10 +31,13 @@
-cStillImage::cStillImage(cStillImagePlayer *pl)
+cStillImage::cStillImage(cStillImagePlayer *pl,bool bUseDeviceStillPicture)
+: cEncode(bUseDeviceStillPicture ? 2 : 4)
+, player(pl)
+, m_bEncodeRequired(false)
+, m_bUseDeviceStillPicture(bUseDeviceStillPicture)
{
- m_bEncodeRequired = false;
- player=pl;
+
}
cStillImage::~cStillImage()
@@ -53,7 +55,6 @@ void cStillImage::Action(void)
bool bMPEGValid = false;
bool bQueueEmpty = false;
bool bFreeze = true;
-
unsigned int nFrame = 0,nFrameOff=0;
int nMircoSekWait;
while (Running()) {
@@ -114,23 +115,28 @@ void cStillImage::Action(void)
/* Methode C ************************************************************/
//BuildPesPacket(Data(), Size(),1);
- /* Methode D ************************************************************/
- //player->DeviceStillPicture(Data(), Size());
-
- /* Methode E ************************************************************/
-
-
- unsigned int nFrameSize = GetFrameSize(nFrame);
- if(nFrameSize) // Skip empty Frames
- {
- BuildPesPacket(Data() + nFrameOff, nFrameSize,1);
- nFrameOff += nFrameSize;
+ if(m_bUseDeviceStillPicture) {
+ player->DeviceStillPicture(Data(), Size());
+ if(!bFreeze)
+ {
+ player->DeviceFreeze();
+ bFreeze = true;
+ }
+ bMPEGValid = false;
+ } else {
+
+ unsigned int nFrameSize = GetFrameSize(nFrame);
+ if(nFrameSize) // Skip empty Frames
+ {
+ BuildPesPacket(Data() + nFrameOff, nFrameSize,1);
+ nFrameOff += nFrameSize;
+ }
+ if(++nFrame>=GetFrames())
+ {
+ nFrame = 0;
+ nFrameOff = 0;
+ }
}
- if(++nFrame>=GetFrames())
- {
- nFrame = 0;
- nFrameOff = 0;
- }
nMircoSekWait = (1000000/(GetFrameRate()*4)); // Wait duration off 1/4 frame