feedPosition = 0;
feedMode = MODE_NORMAL;
lastRescan = 0;
- startTS = 0;
- endTS = 0;
+// startTS = 0;
+// endTS = 0;
videoStartup = false;
preBuffering = false;
logger->log("Player", Log::DEBUG, "Player has received length frames of %lu", lengthFrames);
}
+/*
ULLONG Player::getEndTS() // FIXME delme - used only by bar clocks until current frame code is done
{
long long rendTS = endTS - startTS;
if (rendTS < 0) rendTS += 8589934592ULL;
return (ULLONG)rendTS;
}
+*/
+/*
hmsf Player::getEndHMSF()
{
return video->framesToHMSF(lengthFrames);
}
+*/
-ULLONG Player::getPositionTS() // used internall (skip fw/bw)
+ULONG Player::getLengthFrames()
{
- if (startup) return 0ULL;
- long long currentTS = video->getCurrentTimestamp() - startTS;
- if (currentTS < 0) currentTS += 8589934592ULL;
- return (ULLONG)currentTS;
+ return lengthFrames;
+}
+
+ULONG Player::getCurrentFrameNum()
+{
+ if (startup) return 0;
+ return demuxer->getFrameNumFromPTS(video->getCurrentTimestamp());
}
// ----------------------------------- Externally called events
void Player::skipForwardInt(int seconds)
{
logger->log("Player", Log::DEBUG, "SKIP FORWARD %i SECONDS", seconds);
- restartAt(getPositionTS() + (seconds * 90000));
+ restartAtFrame(getCurrentFrameNum() + (seconds * video->getFPS()));
}
void Player::skipBackwardInt(int seconds)
{
logger->log("Player", Log::DEBUG, "SKIP BACKWARD %i SECONDS", seconds);
- long long newTimeCode = getPositionTS() - (seconds * 90000);
- if (newTimeCode < 0) newTimeCode = 0;
- restartAt(newTimeCode);
+ long newFrameNum = getCurrentFrameNum() + (seconds * video->getFPS());
+ if (newFrameNum < 0) newFrameNum = 0;
+ restartAt(newFrameNum);
}
void Player::jumpToPercentInt(int percent)
{
logger->log("Player", Log::DEBUG, "JUMP TO %i%%", percent);
- ULONG newFrame = (ULONG)(((float)percent / 100) * lengthFrames);
+ ULONG newFrame = percent * lengthFrames / 100;
restartAtFrame(newFrame);
}
fbwd = false;
}
+/*
void Player::setStartTS(UINT dataInBuffer)
{
#ifndef NEW_DEMUXER
startTS=0;
#endif
}
+*/
+/*
void Player::setEndTS()
{
logger->log("Player", Log::DEBUG, "Setting end TS");
#endif
logger->log("Player", Log::DEBUG, "Set end TS");
}
+*/
void Player::doConnectionLost()
{
if (!vdr->isConnected()) { doConnectionLost(); return; }
logger->log("Player", Log::DEBUG, "Rescanned and reset length: %llu", lengthBytes);
lastRescan = time(NULL);
- setEndTS();
+// setEndTS();
}
if (lengthBytes) // is playing a recording
demuxer->setAudioStream(a_stream);
logger->log("Player", Log::DEBUG, "Startup Audio stream chosen %x", a_stream);
- setStartTS(thisRead);
+// setStartTS(thisRead);
- if (isRecording) setEndTS();
+// if (isRecording) setEndTS();
startup = false;
}
bool isPaused() { return paused; }
bool isFfwd() { return ffwd; }
bool isFbwd() { return fbwd; }
- ULLONG getPositionTS();
- ULLONG getEndTS();
- hmsf getEndHMSF();
+ ULONG getCurrentFrameNum();
+ ULONG getLengthFrames();
+// ULLONG getEndTS();
+// hmsf getEndHMSF();
void call(void*); // for callback interface
void skipForwardInt(int seconds);
void skipBackwardInt(int seconds);
- void setStartTS(UINT dataInBuffer);
void setEndTS();
void doConnectionLost();
void restartAt(ULLONG timeCode);
void lock();
void unLock();
- ULLONG startTS;
- ULLONG endTS;
+// ULLONG endTS;
ULLONG lengthBytes;
ULONG lengthFrames;
ULLONG feedPosition;
--- /dev/null
+Readme For Windows Port of Vomp-Client\r
+======================================\r
+\r
+This file contains notes regarding the Windows port of Vomp.\r
+Please read it carefully.\r
+\r
+License and Homepage\r
+====================\r
+\r
+The source code of vomp client is released under the General Public License (GPL).\r
+For further information consult the vomp homepage:\r
+http://www.loggytronic.com\r
+or vomp on SourceForge (including the source code on cvs):\r
+http://sourceforge.net/projects/vomp\r
+\r
+Requirements\r
+============\r
+\r
+The vomp client on Windows requires:\r
+\r
+* Windows 2000 or later\r
+* A DirectShow MPEG2 decoder, which supports Video Mixing Renderer 9 (VMR-9),\r
+ mostly included within DVD software player\r
+* A network connection to the vompserver computer\r
+\r
+Compatibility List for MPEG2 Decoders\r
+=====================================\r
+\r
+Compatible MPEG2 decoders:\r
+* Cyberlink PowerDVD 6\r
+\r
+Incompatible MPEG2 decoders:\r
+* Cyperlink PowerDVD 4\r
+\r
+This list will be extended, please report success or failure with your decoder\r
+at the forum at http://www.loggytronic.com .\r
+\r
+Remote Control Buttons Reference\r
+================================\r
+\r
+This table shows the Hauppauge MediaMVP remote control buttons and their\r
+corresponding Windows keyboard assignments:\r
+\r
+MediaMVP Button | Keyboard Shortcut\r
+----------------*------------------\r
+VOLUMEUP | F10\r
+VOLUMEDOWN | F9\r
+CHANNELUP | "+", Ctrl+"+", Page down\r
+CHANNELDOWN | Insert, Ctrl+Insert, Page up\r
+0 | 0\r
+1 | 1\r
+2 | 2\r
+3 | 3\r
+4 | 4\r
+5 | 5\r
+6 | 6\r
+7 | 7\r
+8 | 8\r
+9 | 9\r
+POWER | Esc, Alt+F4\r
+GO | j\r
+BACK | Backspace\r
+MENU | m\r
+RED | r\r
+GREEN | g\r
+YELLOW | y\r
+BLUE | b\r
+MUTE | F8\r
+RADIO | Not implemented\r
+REVERSE | Not implemented (Can work on Remote Controls)\r
+PLAY | Shift + P\r
+FORWARD | Shift + F\r
+RECORD | Ctrl + R\r
+STOP | Ctrl + S\r
+PAUSE | Ctrl + P\r
+SKIPBACK | Ctrl + B\r
+SKIPFORWARD | Ctrl + F\r
+OK | Space, Return\r
+FULL | Not implemented\r
+TV | Not implemented\r
+VIDEOS | Not implemented\r
+MUSIC | Not implemented\r
+PICTURES | Not implemented\r
+GUIDE | Not implemented\r
+UP | UP\r
+DOWN | DOWN\r
+LEFT | LEFT\r
+RIGHT | RIGHT\r
+PREVCHANNEL | Not implemented\r
+STAR | *\r
+HASH | Not implemented\r
+\r
+(Note: Remote Controls for Windows should work also for most buttons,\r
+but this is an yet untested feature.)\r
+\r
+Usage\r
+=====\r
+Start the client executable and enjoy, you should not have to configure\r
+anything if you met the requirements above.\r
+\r
+Firewall\r
+========\r
+If vomp for Windows stops at "Locating server" or "Connecting to VDR",\r
+please configure your firewall so that vomp for windows can communicate\r
+with the vompserver on port 3024 (UDP and TCP).\r
}
return ret;
}
+
+UINT Video::getFPS()
+{
+ if (format == NTSC) return 30;
+ else return 25;
+}
UCHAR getTVsize() { return tvsize; }
hmsf framesToHMSF(ULONG frames);
+ UINT getFPS();
// Video formats - AV_SET_VID_DISP_FMT
const static UCHAR NTSC = 0;
VVideoRec::~VVideoRec()
{
if (playing) stopPlay();
- Video::getInstance()->setDefaultAspect();
+ video->setDefaultAspect();
timers->cancelTimer(this, 1);
timers->cancelTimer(this, 2);
VInfo* vi = new VInfo();
vi->create(400, 150);
- if (Video::getInstance()->getFormat() == Video::PAL)
+ if (video->getFormat() == Video::PAL)
vi->setScreenPos(170, 200);
else
vi->setScreenPos(160, 150);
rectangle(clocksRegion, barBlue);
- ULONG currentTS = (player->getPositionTS() / 90000);
- int chours = currentTS / 3600;
- int cminutes = (currentTS - (chours * 3600)) / 60;
- int cseconds = currentTS - (chours * 3600) - (cminutes * 60);
+ ULONG currentFrameNum = player->getCurrentFrameNum();
+ ULONG lengthFrames = player->getLengthFrames();
- ULONG endTS = (player->getEndTS() / 90000);
-// int ehours = endTS / 3600;
-// int eminutes = (endTS - (ehours * 3600)) / 60;
-// int eseconds = endTS - (ehours * 3600) - (eminutes * 60);
-
- hmsf endHMSF = player->getEndHMSF();
+ hmsf currentFrameHMSF = video->framesToHMSF(currentFrameNum);
+ hmsf lengthHMSF = video->framesToHMSF(lengthFrames);
char buffer[100];
- if ((currentTS > 95441) // it's at the 33bit rollover point where the calc doesn't work because of the 1s diff
- // between demuxer values and video chip return values ... ?
- || (!endTS) ) // No values yet
- {
- strcpy(buffer, "-:--:-- / -:--:--");
- }
- else
- {
- SNPRINTF(buffer, 99, "%01i:%02i:%02i / %01i:%02i:%02i", chours, cminutes, cseconds, endHMSF.hours, endHMSF.minutes, endHMSF.seconds);
+// strcpy(buffer, "-:--:-- / -:--:--");
+// else
+// {
+ SNPRINTF(buffer, 99, "%01i:%02i:%02i / %01i:%02i:%02i", currentFrameHMSF.hours, currentFrameHMSF.minutes, currentFrameHMSF.seconds, lengthHMSF.hours, lengthHMSF.minutes, lengthHMSF.seconds);
logger->log("VVideoRec", Log::DEBUG, buffer);
- }
+// }
drawText(buffer, clocksRegion.x, clocksRegion.y, Colour::LIGHTTEXT);
rectangle(barRegion.x + 350, barRegion.y + 12, 310, 24, Colour::LIGHTTEXT);
rectangle(barRegion.x + 352, barRegion.y + 14, 306, 20, barBlue);
- if ((currentTS > 95441) || (!endTS)) return; // No values yet
+// if ((currentTS > 95441) || (!endTS)) return; // No values yet
- double progress01 = (double)currentTS / (double)endTS;
+ double progress01 = (double)currentFrameNum / (double)lengthFrames;
// total width of bar = 302
int progressWidth = (int)(302 * progress01);
double pos01;
int posPix;
- pos01 = (double)startMargin / (double)endTS;
+ pos01 = ((double)startMargin * video->getFPS()) / lengthFrames;
posPix = (int)(302 * pos01);
rectangle(barRegion.x + 352 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT);
rectangle(barRegion.x + 352 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT);
- pos01 = (double)(endTS - endMargin) / (double)endTS;
+ pos01 = lengthFrames - (endMargin * video->getFPS()) / lengthFrames;
posPix = (int)(302 * pos01);
rectangle(barRegion.x + 352 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT);