-CC = /opt/crosstool/powerpc-405-linux-gnu/gcc-2.95.3-glibc-2.2.5/bin/powerpc-405-linux-gnu-g++
+CC=/home/chris/mvp/vomp/compiler/crosstool/gcc-3.4.5-glibc-2.2.5/powerpc-405-linux-gnu/bin/powerpc-405-linux-gnu-g++
+#CC = /opt/crosstool/powerpc-405-linux-gnu/gcc-2.95.3-glibc-2.2.5/bin/powerpc-405-linux-gnu-g++
STRIP = /opt/crosstool/powerpc-405-linux-gnu/gcc-2.95.3-glibc-2.2.5/bin/powerpc-405-linux-gnu-strip
CXX = $(CC)
INCLUDES = -I../jpeg-6b
-CXXFLAGS_DEV = -g -O0 -Wall -Woverloaded-virtual -Wshadow -Werror -DDEV -D_GNU_SOURCE $(INCLUDES)
-CXXFLAGS_REL = -O3 -Wall -Woverloaded-virtual -Wshadow -Werror -D_GNU_SOURCE $(INCLUDES)
+CXXFLAGS_DEV = -g -O0 -Wall -Wshadow -Werror -DDEV -D_GNU_SOURCE $(INCLUDES)
+CXXFLAGS_REL = -O3 -Wall -Wshadow -Werror -D_GNU_SOURCE $(INCLUDES)
LDFLAGS = -Wall -static
LIBPATHS =
default: dev
fresh: clean default
-vompclient: $(OBJECTS)
+vompclient: $(OBJECTS) $(CROSSLIBS)
$(CC) $(LDFLAGS) $(LIBPATHS) $(RELEASE) -o vompclient $(OBJECTS) $(CROSSLIBS) $(LIBS)
strip:
cp vompclient /diskless/nfs/mvp
rm -f /diskless/nfs/wmvp/vompclient
cp vompclient /diskless/nfs/wmvp
-
+
debug:
../../gdb/gdb-6.3-target-ppc/gdb/gdb /diskless/nfs/mvp/vompclient /diskless/nfs/mvp/core.*
+
+###############################
+
+# ! Chris - WRONG FILE !
+
+###############################
+
+
CXXFLAGS_DEV = -g -O0 -Wall -Woverloaded-virtual -Wshadow -Werror -DDEV -D_GNU_SOURCE $(INCLUDES)
CXXFLAGS_REL = /I"$(DXSDK_DIR)\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "NEW_DEMUXER" /nologo /EHsc /MD /GS /W3 /c /TP
LDFLAGS = /INCREMENTAL:NO /NOLOGO /NODEFAULTLIB /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LIBPATH:"$(DXSDK_DIR)\Lib\x86"
ULONG DatagramSocket::getIPNumber(ULONG num)
{
+#ifndef WIN32
+ return INADDR_ANY;
+
+ // gcc 3.4 says:
+ // warning: Using 'gethostbyname' in statically linked applications requires at runtime
+ // the shared libraries from the glibc version used for linking
+
+#else
+
char buffer[100];
ULONG returnaddress;
int get_ip=(num%num_ip);//Just wrap around, if no interface are present any more
memcpy(&returnaddress, hosts->h_addr_list[get_ip], sizeof(ULONG));
return returnaddress;
+
+#endif
}
shutdown(1);
}
- success = mtd->init("/dev/mtd1");
+ success = mtd->init();
if (success)
{
logger->log("Core", Log::INFO, "Mtd module initialised");
virtual ~Mtd();
static Mtd* getInstance();
- virtual int init(char* device)=0;
+ virtual int init()=0;
virtual int shutdown()=0;
virtual short getPALorNTSC()=0;
{
}
-int MtdMVP::init(char* device)
+int MtdMVP::init()
{
if (initted) return 0;
initted = 1;
+ FILE* fp = fopen("/proc/mtd", "r");
+ if (!fp)
+ {
+ Log::getInstance()->log("MTD", Log::DEBUG, "Could not open /proc/mtd");
+ initted = 0;
+ return 0;
+ }
+
+ char buffer[1024];
+ char mtdNumberChar = '\0';
+
+ while(!feof(fp))
+ {
+ fgets(buffer, 1023, fp);
+ if (strstr(buffer, "HCW MediaMVP VPD"))
+ {
+ mtdNumberChar = buffer[3];
+ }
+ }
+ fclose(fp);
+
+ if (mtdNumberChar == '\0')
+ {
+ Log::getInstance()->log("MTD", Log::DEBUG, "Failed to find correct /dev/mtdX device");
+ initted = 0;
+ return 0;
+ }
+
+ strcpy(buffer, "/dev/mtd");
+ strncat(buffer, &mtdNumberChar, 1);
+ Log::getInstance()->log("MTD", Log::DEBUG, "Located MTD device: %s", buffer);
+
+
int fd;
- if ((fd = open("/dev/mtd1", O_RDONLY)) < 0)
+ if ((fd = open(buffer, O_RDONLY)) < 0)
{
Log::getInstance()->log("MTD", Log::DEBUG, "Open fail");
initted = 0;
MtdMVP();
~MtdMVP();
- int init(char* device);
+ int init();
int shutdown();
short getPALorNTSC();
{
}
-int MtdWin::init(char* device)
+int MtdWin::init()
{
if (initted) return 0;
initted = 1;
MtdWin();
~MtdWin();
- virtual int init(char* device);
+ virtual int init();
virtual int shutdown();
virtual short getPALorNTSC();
unLock();
}
-void Player::jumpToPercent(int percent)
+void Player::jumpToPercent(double percent)
{
lock();
logger->log("Player", Log::DEBUG, "JUMP TO %i%%", percent);
- ULONG newFrame = percent * lengthFrames / 100;
+ ULONG newFrame = (ULONG)(percent * lengthFrames / 100);
switchState(S_JUMP, newFrame);
// unLock(); - let thread unlock this
}
// scan has got to the end of what we knew to be there before we started scanning
baseFrameNumber = iframeNumber;
- frameTimeOffset = abs(iframeNumber - currentFrameNumber) * 1000 / (video->getFPS() * ifactor);
+ frameTimeOffset = abs((int)iframeNumber - (int)currentFrameNumber) * 1000 / (video->getFPS() * ifactor);
#ifndef WIN32
gettimeofday(&clock0, NULL);
#else
void pause();
void fastForward();
void fastBackward();
- void jumpToPercent(int percent);
+ void jumpToPercent(double percent);
void skipForward(int seconds);
void skipBackward(int seconds);
void jumpToMark(int mark);
unLock();
}
-void PlayerRadio::jumpToPercent(int percent)
+void PlayerRadio::jumpToPercent(double percent)
{
lock();
logger->log("PlayerRadio", Log::DEBUG, "JUMP TO %i%%", percent);
- ULONG newPacket = percent * lengthPackets / 100;
+ ULONG newPacket = (ULONG)(percent * lengthPackets / 100);
switchState(S_JUMP, newPacket);
unLock();
}
void play(ULONG apid); // Live radio
void stop();
void pause();
- void jumpToPercent(int percent);
+ void jumpToPercent(double percent);
void skipForward(int seconds);
void skipBackward(int seconds);
}
}
}
-}
\ No newline at end of file
+}
case Player::CONNECTION_LOST: // connection lost detected
{
// I can't handle this, send it to command
- Message* m = new Message();
- m->to = Command::getInstance();
- m->message = Message::CONNECTION_LOST;
- Command::getInstance()->postMessageNoLock(m);
+ Message* m2 = new Message();
+ m2->to = Command::getInstance();
+ m2->message = Message::CONNECTION_LOST;
+ Command::getInstance()->postMessageNoLock(m2);
break;
}
case Player::STOP_PLAYBACK:
{
// FIXME Obselete ish - improve this
- Message* m = new Message(); // Must be done after this thread finishes, and must break into master mutex
- m->to = Command::getInstance();
- m->message = Message::STOP_PLAYBACK;
- Command::getInstance()->postMessageNoLock(m);
+ Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
+ m2->to = Command::getInstance();
+ m2->message = Message::STOP_PLAYBACK;
+ Command::getInstance()->postMessageNoLock(m2);
break;
}
}
{
Log::getInstance()->log("VVideoLive", Log::DEBUG, "Received connection lost from player");
// I can't handle this, send it to command
- Message* m = new Message();
- m->to = Command::getInstance();
- m->message = Message::CONNECTION_LOST;
- Command::getInstance()->postMessageNoLock(m);
+ Message* m2 = new Message();
+ m2->to = Command::getInstance();
+ m2->message = Message::CONNECTION_LOST;
+ Command::getInstance()->postMessageNoLock(m2);
break;
}
case Player::STREAM_END:
{
// I can't handle this, send it to command - improve this
- Message* m = new Message(); // Must be done after this thread finishes, and must break into master mutex
- m->to = Command::getInstance();
- m->message = Message::STREAM_END;
- Command::getInstance()->postMessageNoLock(m);
+ Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
+ m2->to = Command::getInstance();
+ m2->message = Message::STREAM_END;
+ Command::getInstance()->postMessageNoLock(m2);
break;
}
case Player::ASPECT43:
case Player::CONNECTION_LOST: // connection lost detected
{
// I can't handle this, send it to command
- Message* m = new Message();
- m->to = Command::getInstance();
- m->message = Message::CONNECTION_LOST;
- Command::getInstance()->postMessageNoLock(m);
+ Message* m2 = new Message();
+ m2->to = Command::getInstance();
+ m2->message = Message::CONNECTION_LOST;
+ Command::getInstance()->postMessageNoLock(m2);
break;
}
case Player::STOP_PLAYBACK:
{
// FIXME Obselete ish - improve this
- Message* m = new Message(); // Must be done after this thread finishes, and must break into master mutex
- m->to = Command::getInstance();
- m->message = Message::STOP_PLAYBACK;
- Command::getInstance()->postMessageNoLock(m);
+ Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
+ m2->to = Command::getInstance();
+ m2->message = Message::STOP_PLAYBACK;
+ Command::getInstance()->postMessageNoLock(m2);
break;
}
case Player::ASPECT43: