fast-slow-dcop.patch, generic_tr.patch and scandialog.patch have already been applied in the code. terminate.patch has not been applied but contains no explanation on what problem it was trying to fix. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>pull/25/head
parent
b0c0b8a905
commit
37d17c45c8
@ -1,54 +0,0 @@
|
|||||||
Index: src/player-parts/xine-part/xine_part.h
|
|
||||||
===================================================================
|
|
||||||
--- src/player-parts/xine-part/xine_part.h (revision 746328)
|
|
||||||
+++ src/player-parts/xine-part/xine_part.h (working copy)
|
|
||||||
@@ -108,6 +108,8 @@
|
|
||||||
TQString screenShot();
|
|
||||||
void nextAudioChannel();
|
|
||||||
void nextSubtitleChannel();
|
|
||||||
+ void speedFaster();
|
|
||||||
+ void speedSlower();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
/*
|
|
||||||
Index: src/player-parts/xine-part/xine_part_iface.h
|
|
||||||
===================================================================
|
|
||||||
--- src/player-parts/xine-part/xine_part_iface.h (revision 746328)
|
|
||||||
+++ src/player-parts/xine-part/xine_part_iface.h (working copy)
|
|
||||||
@@ -128,6 +128,8 @@
|
|
||||||
|
|
||||||
virtual void nextAudioChannel() = 0;
|
|
||||||
virtual void nextSubtitleChannel() = 0;
|
|
||||||
+ virtual void speedFaster() = 0;
|
|
||||||
+ virtual void speedSlower() = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* XINE_PART_IFACE_H */
|
|
||||||
Index: src/player-parts/xine-part/xine_part.cpp
|
|
||||||
===================================================================
|
|
||||||
--- src/player-parts/xine-part/xine_part.cpp (revision 746328)
|
|
||||||
+++ src/player-parts/xine-part/xine_part.cpp (working copy)
|
|
||||||
@@ -449,6 +449,11 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+void XinePart::speedFaster()
|
|
||||||
+{
|
|
||||||
+ slotFastForward();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void XinePart::slotFastForward()
|
|
||||||
{
|
|
||||||
if (m_xine->getSpeed() == KXineWidget::Pause)
|
|
||||||
@@ -459,6 +464,11 @@
|
|
||||||
m_xine->slotSpeedFaster();
|
|
||||||
}
|
|
||||||
|
|
||||||
+void XinePart::speedSlower()
|
|
||||||
+{
|
|
||||||
+ slotSlowMotion();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void XinePart::slotSlowMotion()
|
|
||||||
{
|
|
||||||
if (m_xine->getSpeed() == KXineWidget::Pause)
|
|
@ -1,53 +0,0 @@
|
|||||||
--- scandialog.cpp 2007-12-21 21:21:22.000000000 +0000
|
|
||||||
+++ newscandialog.cpp 2007-12-21 21:23:26.000000000 +0000
|
|
||||||
@@ -109,13 +109,15 @@
|
|
||||||
foundList->clear();
|
|
||||||
foundList->setAllColumnsShowFocus( true );
|
|
||||||
foundList->setSelectionMode( QListView::Extended );
|
|
||||||
- channelsList->setSorting( 0 );
|
|
||||||
+ channelsList->setSorting( 1 ); // sort by source 1st than channel name
|
|
||||||
+ channelsList->setAllColumnsShowFocus( true );
|
|
||||||
+ channelsList->setSelectionMode( QListView::Extended );
|
|
||||||
|
|
||||||
ChannelDesc *chan;
|
|
||||||
QListViewItem *it;
|
|
||||||
for ( int i=0; i<(int)chandesc->count(); i++ ) {
|
|
||||||
chan = chandesc->at(i);
|
|
||||||
- it = new QListViewItem( channelsList, chan->name );
|
|
||||||
+ it = new QListViewItem( channelsList, chan->name, chan->tp.source );
|
|
||||||
if ( !chan->pix.isNull() )
|
|
||||||
it->setPixmap( 0, chan->pix );
|
|
||||||
else {
|
|
||||||
|
|
||||||
--- scandialogui.ui 2007-12-21 21:21:22.000000000 +0000
|
|
||||||
+++ newscandialogui.ui 2007-12-12 18:59:16.000000000 +0000
|
|
||||||
@@ -66,9 +66,28 @@
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
+ <column>
|
|
||||||
+ <property name="text">
|
|
||||||
+ <string>Source</string>
|
|
||||||
+ </property>
|
|
||||||
+ <property name="clickable">
|
|
||||||
+ <bool>true</bool>
|
|
||||||
+ </property>
|
|
||||||
+ <property name="resizable">
|
|
||||||
+ <bool>true</bool>
|
|
||||||
+ </property>
|
|
||||||
+ </column>
|
|
||||||
<property name="name">
|
|
||||||
<cstring>channelsList</cstring>
|
|
||||||
</property>
|
|
||||||
+ <property name="sizePolicy">
|
|
||||||
+ <sizepolicy>
|
|
||||||
+ <hsizetype>7</hsizetype>
|
|
||||||
+ <vsizetype>3</vsizetype>
|
|
||||||
+ <horstretch>0</horstretch>
|
|
||||||
+ <verstretch>0</verstretch>
|
|
||||||
+ </sizepolicy>
|
|
||||||
+ </property>
|
|
||||||
<property name="rootIsDecorated">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
|
|
@ -1,269 +0,0 @@
|
|||||||
diff -ru kaffeine-0.8.4.cvs.orig/kaffeine/src/input/dvb/dvbout.cpp kaffeine-0.8.4.cvs/kaffeine/src/input/dvb/dvbout.cpp
|
|
||||||
--- kaffeine-0.8.4.cvs.orig/kaffeine/src/input/dvb/dvbout.cpp 2007-11-25 12:57:46.000000000 +0200
|
|
||||||
+++ kaffeine-0.8.4.cvs/kaffeine/src/input/dvb/dvbout.cpp 2007-11-26 00:35:52.000000000 +0200
|
|
||||||
@@ -19,6 +19,7 @@
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <fcntl.h>
|
|
||||||
+#include <errno.h>
|
|
||||||
|
|
||||||
#include <kstandarddirs.h>
|
|
||||||
|
|
||||||
@@ -47,7 +48,6 @@
|
|
||||||
plugHandle = plug->init( chan.sid, anum, tnum, chan.fta );
|
|
||||||
}
|
|
||||||
|
|
||||||
- fdPipe=0;
|
|
||||||
channel = chan;
|
|
||||||
thWrite = 0;
|
|
||||||
rtp = 0;
|
|
||||||
@@ -58,7 +58,7 @@
|
|
||||||
for ( i=0; i<channel.nsubpid && i<MAX_DVBSUB; i++ )
|
|
||||||
pids.append( channel.subpid[i].pid );
|
|
||||||
wBuf = NULL;
|
|
||||||
- timeShifting = beginLive = false;
|
|
||||||
+ timeShifting = false;
|
|
||||||
haveRec = haveLive = instantRec = haveBroadcast = false;
|
|
||||||
patpmt = wpatpmt = false;
|
|
||||||
connect( &stopRecTimer, SIGNAL(timeout()), this, SLOT(stopRec()) );
|
|
||||||
@@ -232,7 +232,7 @@
|
|
||||||
|
|
||||||
bool DVBout::hasLive() const
|
|
||||||
{
|
|
||||||
- if ( haveLive || fdPipe || timeShifting )
|
|
||||||
+ if ( haveLive || timeShifting )
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@@ -248,6 +248,7 @@
|
|
||||||
|
|
||||||
bool DVBout::doPause( const TQString &name ) // called from dvbstream::run()
|
|
||||||
{
|
|
||||||
+ fprintf(stderr,"DVBout::doPause\n");
|
|
||||||
if ( !haveLive )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
@@ -255,23 +256,13 @@
|
|
||||||
liveFile.setName( name );
|
|
||||||
liveFile.open( IO_WriteOnly|IO_Truncate );
|
|
||||||
liveFile.writeBlock( (char*)tspat, TS_SIZE );
|
|
||||||
- liveFile.writeBlock( (char*)tspmt, TS_SIZE );
|
|
||||||
+ liveFile.writeBlock( (char*)tspmt, TS_SIZE );
|
|
||||||
mutex.lock();
|
|
||||||
haveLive = false;
|
|
||||||
- mutex.unlock();
|
|
||||||
- if ( !wait(100) ) {
|
|
||||||
- terminate();
|
|
||||||
- wait();
|
|
||||||
- }
|
|
||||||
- mutex.lock();
|
|
||||||
- haveLive = true;
|
|
||||||
- if ( close( fdPipe )<0 )
|
|
||||||
- perror("close out pipe: ");
|
|
||||||
- else
|
|
||||||
- fprintf(stderr,"out pipe closed\n");
|
|
||||||
- fdPipe = 0;
|
|
||||||
- mutex.unlock();
|
|
||||||
timeShifting = true;
|
|
||||||
+ mutex.unlock();
|
|
||||||
+ fprintf(stderr,"doPause: starting timeshift, waiting live thread to finish\n");
|
|
||||||
+ wait();
|
|
||||||
//emit shifting( timeShifting );
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
@@ -288,11 +279,10 @@
|
|
||||||
|
|
||||||
bool DVBout::goLive( const TQString &name )
|
|
||||||
{
|
|
||||||
- if ( fdPipe ) return false;
|
|
||||||
-
|
|
||||||
+ fprintf(stderr,"goLive\n");
|
|
||||||
+ if (haveLive) return false;
|
|
||||||
haveLive = true;
|
|
||||||
pipeName = name;
|
|
||||||
- beginLive = true;
|
|
||||||
//activeApid = napid;
|
|
||||||
|
|
||||||
writePat();
|
|
||||||
@@ -310,31 +300,26 @@
|
|
||||||
|
|
||||||
void DVBout::preStopLive()
|
|
||||||
{
|
|
||||||
- mutex.lock();
|
|
||||||
- haveLive = false;
|
|
||||||
- mutex.unlock();
|
|
||||||
+ // FIXME: maybe some way to tell the thread that it can stop?
|
|
||||||
+ // or maybe not. It won't make things much faster.
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-
|
|
||||||
void DVBout::stopLive()
|
|
||||||
{
|
|
||||||
+ fprintf(stderr,"stopLive\n");
|
|
||||||
mutex.lock();
|
|
||||||
if ( timeShifting ) {
|
|
||||||
liveFile.close();
|
|
||||||
timeShifting = false;
|
|
||||||
emit shifting( timeShifting );
|
|
||||||
}
|
|
||||||
- mutex.unlock();
|
|
||||||
- if ( !wait(500) ) {
|
|
||||||
- terminate();
|
|
||||||
- wait();
|
|
||||||
- }
|
|
||||||
- if ( fdPipe ) {
|
|
||||||
- close( fdPipe );
|
|
||||||
- fprintf( stderr, "pipe closed\n" );
|
|
||||||
- fdPipe = 0;
|
|
||||||
- }
|
|
||||||
+ if (haveLive) {
|
|
||||||
+ haveLive=false;
|
|
||||||
+ mutex.unlock();
|
|
||||||
+ fprintf(stderr,"stopLive: Waiting live thread to finish\n");
|
|
||||||
+ wait();
|
|
||||||
+ } else mutex.unlock();
|
|
||||||
delete [] wBuf;
|
|
||||||
wBuf = NULL;
|
|
||||||
}
|
|
||||||
@@ -464,11 +449,7 @@
|
|
||||||
if ( plug && plugHandle )
|
|
||||||
plug->process( plugHandle, thBuf, TS_SIZE*NTS );
|
|
||||||
mutex.lock();
|
|
||||||
- if ( haveLive && fdPipe ) {
|
|
||||||
- if ( beginLive ) {
|
|
||||||
- beginLive = !beginLive;
|
|
||||||
- start();
|
|
||||||
- }
|
|
||||||
+ if ( haveLive ) {
|
|
||||||
if ( wDist<95 ) {
|
|
||||||
memcpy( wBuf+(wWrite*TS_SIZE*NTS), thBuf, TS_SIZE*NTS );
|
|
||||||
wpatpmt = patpmt;
|
|
||||||
@@ -525,40 +506,67 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-
|
|
||||||
+bool DVBout::writeBytes(int fd, const unsigned char *buf, int bytes) {
|
|
||||||
+ int w=0;
|
|
||||||
+ mutex.lock();
|
|
||||||
+ while (haveLive && w<bytes) {
|
|
||||||
+ mutex.unlock();
|
|
||||||
+ int r=write(fd, buf+w, bytes-w);
|
|
||||||
+ if (r>=0) w+=r;
|
|
||||||
+ else {
|
|
||||||
+ if ( errno != EAGAIN ) {
|
|
||||||
+ perror("DVBout: pipe writeBytes");
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+ usleep( 100 );
|
|
||||||
+ }
|
|
||||||
+ mutex.lock();
|
|
||||||
+ }
|
|
||||||
+ mutex.unlock();
|
|
||||||
+ return haveLive;
|
|
||||||
+}
|
|
||||||
|
|
||||||
void DVBout::run()
|
|
||||||
{
|
|
||||||
- if ( haveLive && fdPipe ) {
|
|
||||||
- while ( haveLive && fdPipe ) {
|
|
||||||
- if ( wDist>0 ) {
|
|
||||||
- if ( wpatpmt ) {
|
|
||||||
- write( fdPipe, tspat, TS_SIZE );
|
|
||||||
- write( fdPipe, tspmt, TS_SIZE );
|
|
||||||
- wpatpmt = false;
|
|
||||||
- }
|
|
||||||
- write( fdPipe, wBuf+(wRead*TS_SIZE*NTS), TS_SIZE*NTS );
|
|
||||||
- --wDist;
|
|
||||||
- ++wRead;
|
|
||||||
- if ( wRead>99 )
|
|
||||||
- wRead = 0;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- usleep( 100 );
|
|
||||||
+ int fd=-1;
|
|
||||||
+ fprintf(stderr,"DVBout::run started\n");
|
|
||||||
+
|
|
||||||
+ while (haveLive && (fd=open( pipeName.ascii(), O_WRONLY | O_NONBLOCK )) == -1 ) {
|
|
||||||
+ if (errno!=ENXIO) {
|
|
||||||
+ perror("DVBout::run open pipe");
|
|
||||||
+ return;
|
|
||||||
}
|
|
||||||
- return;
|
|
||||||
+ usleep ( 100 );
|
|
||||||
}
|
|
||||||
+ fprintf(stderr,"DVBout::run write pipe %s opened\n",pipeName.ascii());
|
|
||||||
+ emit playDvb();
|
|
||||||
+ fprintf(stderr,"DVBout::run signal emitted\n");
|
|
||||||
|
|
||||||
- if ( (fdPipe=open( pipeName.ascii(), O_WRONLY))<0 ) {
|
|
||||||
- perror("PIPE FILE: ");
|
|
||||||
- return;
|
|
||||||
+ mutex.lock();
|
|
||||||
+ while (haveLive) {
|
|
||||||
+ mutex.unlock();
|
|
||||||
+ if (wpatpmt) {
|
|
||||||
+ if (writeBytes(fd, tspat, TS_SIZE) && writeBytes(fd, tspmt, TS_SIZE) ) {
|
|
||||||
+ wpatpmt = false;
|
|
||||||
+ } else goto fail;
|
|
||||||
+ }
|
|
||||||
+ if (wDist>0) {
|
|
||||||
+ if ( writeBytes (fd, wBuf+(wRead*TS_SIZE*NTS), TS_SIZE*NTS ) ) {
|
|
||||||
+ mutex.lock();
|
|
||||||
+ --wDist;
|
|
||||||
+ ++wRead;
|
|
||||||
+ if (wRead>99) wRead=0;
|
|
||||||
+ mutex.unlock();
|
|
||||||
+ } else goto fail;
|
|
||||||
+ } else usleep ( 100 );
|
|
||||||
+ mutex.lock();
|
|
||||||
}
|
|
||||||
- fprintf(stderr,"pipe opened\n");
|
|
||||||
- emit playDvb();
|
|
||||||
+ mutex.unlock();
|
|
||||||
+fail:
|
|
||||||
+ if(fd>=0) close(fd);
|
|
||||||
+ fprintf(stderr,"DVBout::run finished\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
-
|
|
||||||
-
|
|
||||||
DVBout::~DVBout()
|
|
||||||
{
|
|
||||||
if ( plug )
|
|
||||||
diff -ru kaffeine-0.8.4.cvs.orig/kaffeine/src/input/dvb/dvbout.h kaffeine-0.8.4.cvs/kaffeine/src/input/dvb/dvbout.h
|
|
||||||
--- kaffeine-0.8.4.cvs.orig/kaffeine/src/input/dvb/dvbout.h 2007-11-25 12:57:46.000000000 +0200
|
|
||||||
+++ kaffeine-0.8.4.cvs/kaffeine/src/input/dvb/dvbout.h 2007-11-25 23:09:58.000000000 +0200
|
|
||||||
@@ -35,7 +35,7 @@
|
|
||||||
|
|
||||||
class KaffeineDvbPlugin;
|
|
||||||
|
|
||||||
-class DVBout : public TQObject, public QThread
|
|
||||||
+class DVBout : public TQObject, private QThread
|
|
||||||
{
|
|
||||||
TQ_OBJECT
|
|
||||||
|
|
||||||
@@ -77,13 +77,13 @@
|
|
||||||
void writePat();
|
|
||||||
void calculateCRC( unsigned char *p_begin, unsigned char *p_end );
|
|
||||||
void renameFile( TQString &name, const TQString &ext );
|
|
||||||
+ bool writeBytes(int fd, const unsigned char *buf, int bytes);
|
|
||||||
|
|
||||||
int pmtpid;
|
|
||||||
bool patpmt, wpatpmt;
|
|
||||||
bool timeShifting;
|
|
||||||
TQString pipeName;
|
|
||||||
QFile outFile, liveFile;
|
|
||||||
- int fdPipe;
|
|
||||||
Ts2Rtp *rtp;
|
|
||||||
unsigned char thBuf[188*100];
|
|
||||||
unsigned char *wBuf;
|
|
||||||
@@ -92,7 +92,6 @@
|
|
||||||
unsigned char tspmt[188];
|
|
||||||
unsigned int CRC32[256];
|
|
||||||
int thWrite;
|
|
||||||
- bool beginLive;
|
|
||||||
bool haveRec, haveLive, instantRec, haveBroadcast;
|
|
||||||
QTimer stopRecTimer, timerPatPmt;
|
|
||||||
QMutex mutex;
|
|
Loading…
Reference in new issue