From 48f0a4e1d9896036100385b3a9c1f8254e8e74bb Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 18 Sep 2005 19:05:15 +0000 Subject: [PATCH] *** empty log message *** --- player.h | 2 +- playerradio.h | 2 +- playervideo.cc | 121 ++++++++++++++++--------------------------------- playervideo.h | 3 +- vvideorec.cc | 11 +---- 5 files changed, 45 insertions(+), 94 deletions(-) diff --git a/player.h b/player.h index 991d49c..e0ac06c 100644 --- a/player.h +++ b/player.h @@ -45,7 +45,7 @@ class Player : public Thread, public Callback virtual void setPosition(ULLONG position)=0; virtual void setLength(ULLONG length)=0; #ifdef DEV - virtual void test()=0; + virtual void test1()=0; virtual void test2()=0; #endif diff --git a/playerradio.h b/playerradio.h index f1fa756..c396976 100644 --- a/playerradio.h +++ b/playerradio.h @@ -58,7 +58,7 @@ class PlayerRadio : public Player void skipForward(int) {}; void skipBackward(int) {}; - void test() {}; + void test1() {}; void test2() {}; private: diff --git a/playervideo.cc b/playervideo.cc index bfb7331..71764b6 100644 --- a/playervideo.cc +++ b/playervideo.cc @@ -25,6 +25,7 @@ PlayerVideo::PlayerVideo(MessageQueue* messageQueue, UCHAR tIsRecording) { commandMessageQueue = messageQueue; + logger = Log::getInstance(); paused = 0; playing = 0; ffwd = 0; @@ -49,7 +50,7 @@ int PlayerVideo::init() if (!demuxer.init(this)) { - Log::getInstance()->log("Player", Log::ERR, "Demuxer failed to init"); + logger->log("Player", Log::ERR, "Demuxer failed to init"); shutdown(); return 0; } @@ -71,7 +72,7 @@ int PlayerVideo::shutdown() if (!initted) return 0; initted = 0; - Log::getInstance()->log("Player", Log::DEBUG, "Player shutdown..."); + logger->log("Player", Log::DEBUG, "Player shutdown..."); // copy of stop if (playing) @@ -87,7 +88,7 @@ int PlayerVideo::shutdown() demuxer.reset(); feedPosition = 0; } - Log::getInstance()->log("Player", Log::DEBUG, "Player shutdown done"); + logger->log("Player", Log::DEBUG, "Player shutdown done"); return 1; } @@ -120,7 +121,7 @@ int PlayerVideo::play() // If we are already playing, bail // FIXME - resync? if (playing) { - Log::getInstance()->log("Player", Log::DEBUG, "DOING RESYNC"); + logger->log("Player", Log::DEBUG, "DOING RESYNC"); /* vfeed.stop(); @@ -216,26 +217,25 @@ void PlayerVideo::stop() playing = 0; paused = 0; - Log* templog = Log::getInstance(); - templog->log("PlayerVideo", Log::DEBUG, "Temp 1"); + logger->log("PlayerVideo", Log::DEBUG, "Temp 1"); threadStop(); - templog->log("PlayerVideo", Log::DEBUG, "Temp 2"); + logger->log("PlayerVideo", Log::DEBUG, "Temp 2"); video->stop(); - templog->log("PlayerVideo", Log::DEBUG, "Temp 3"); + logger->log("PlayerVideo", Log::DEBUG, "Temp 3"); video->blank(); - templog->log("PlayerVideo", Log::DEBUG, "Temp 4"); + logger->log("PlayerVideo", Log::DEBUG, "Temp 4"); audio->stop(); - templog->log("PlayerVideo", Log::DEBUG, "Temp 5"); + logger->log("PlayerVideo", Log::DEBUG, "Temp 5"); audio->unPause(); - templog->log("PlayerVideo", Log::DEBUG, "Temp 6"); + logger->log("PlayerVideo", Log::DEBUG, "Temp 6"); vfeed.stop(); - templog->log("PlayerVideo", Log::DEBUG, "Temp 7"); + logger->log("PlayerVideo", Log::DEBUG, "Temp 7"); afeed.stop(); - templog->log("PlayerVideo", Log::DEBUG, "Temp 8"); + logger->log("PlayerVideo", Log::DEBUG, "Temp 8"); video->reset(); - templog->log("PlayerVideo", Log::DEBUG, "Temp 9"); + logger->log("PlayerVideo", Log::DEBUG, "Temp 9"); demuxer.reset(); - templog->log("PlayerVideo", Log::DEBUG, "Temp 10"); + logger->log("PlayerVideo", Log::DEBUG, "Temp 10"); feedPosition = 0; } @@ -262,64 +262,6 @@ void PlayerVideo::togglePause() } } -#ifdef DEV -void PlayerVideo::test() -{ - -/* - -// video->test(); -*/ - -/* - static int flipflop = 0; - - int a; - if (flipflop) a = video->setAspectRatio(Video::ASPECT16X9); - else a = video->setAspectRatio(Video::ASPECT4X3); - - flipflop = !flipflop; - - printf("A = %i\n", a); commented out -*/ - - Log::getInstance()->log("Player", Log::DEBUG, "PLAYER TEST 1 4X3"); - video->setAspectRatio(Video::ASPECT4X3); -} - -void PlayerVideo::test2() -{ - Log::getInstance()->log("Player", Log::DEBUG, "PLAYER TEST 2 16X9"); - video->setAspectRatio(Video::ASPECT16X9); -} - -void PlayerVideo::test3() -{ - Log::getInstance()->log("Player", Log::DEBUG, "PLAYER TEST 3 NORMAL"); - video->setMode(Video::NORMAL); -} - -void PlayerVideo::test4() -{ - Log::getInstance()->log("Player", Log::DEBUG, "PLAYER TEST 4 LETTERBOX"); - video->setMode(Video::LETTERBOX); -} - -void PlayerVideo::test5() -{ - Log::getInstance()->log("Player", Log::DEBUG, "PLAYER TEST 5 REINIT"); - - video->stop(); -// video->reset(); - vfeed.stop(); -// video->reinit(); - vfeed.start(); - video->play(); - video->sync(); - -} -#endif - void PlayerVideo::setPosition(ULLONG position) { feedPosition = position; @@ -329,13 +271,13 @@ void PlayerVideo::setLength(ULLONG length) { lastRescan = time(NULL); streamLength = length; - Log::getInstance()->log("PlayerVideo", Log::DEBUG, "Player has received length of %llu", streamLength); + logger->log("PlayerVideo", Log::DEBUG, "Player has received length of %llu", streamLength); } void PlayerVideo::skipForward(int seconds) { // skip forward 1 minute - Log::getInstance()->log("Player", Log::DEBUG, "SKIP FORWARD %i SECONDS", seconds); + logger->log("Player", Log::DEBUG, "SKIP FORWARD %i SECONDS", seconds); if (paused) togglePause(); @@ -372,7 +314,7 @@ void PlayerVideo::skipForward(int seconds) void PlayerVideo::skipBackward(int seconds) { // skip forward 1 minute - Log::getInstance()->log("Player", Log::DEBUG, "SKIP BACKWARD %i SECONDS", seconds); + logger->log("Player", Log::DEBUG, "SKIP BACKWARD %i SECONDS", seconds); if (paused) togglePause(); @@ -530,23 +472,28 @@ void PlayerVideo::call(void* caller) { if (caller == &demuxer) { - Log* temp = Log::getInstance(); - temp->log("Player", Log::DEBUG, "Callback from demuxer"); + logger->log("Player", Log::DEBUG, "Callback from demuxer"); + + if (video->getTVsize() == Video::ASPECT4X3) + { + logger->log("Player", Log::DEBUG, "TV is 4:3, ignoring aspect switching"); + return; + } int dxCurrentAspect = demuxer.getAspectRatio(); if (dxCurrentAspect == Demuxer::ASPECT_4_3) { - temp->log("Player", Log::DEBUG, "Demuxer said video is 4:3 aspect, switching TV"); + logger->log("Player", Log::DEBUG, "Demuxer said video is 4:3 aspect, switching TV"); video->setAspectRatio(Video::ASPECT4X3); } else if (dxCurrentAspect == Demuxer::ASPECT_16_9) { - temp->log("Player", Log::DEBUG, "Demuxer said video is 16:9 aspect, switching TV"); + logger->log("Player", Log::DEBUG, "Demuxer said video is 16:9 aspect, switching TV"); video->setAspectRatio(Video::ASPECT16X9); } else { - temp->log("Player", Log::DEBUG, "Demuxer said video is something else... ignoring"); + logger->log("Player", Log::DEBUG, "Demuxer said video is something else... ignoring"); } } @@ -682,3 +629,15 @@ void PlayerVideo::threadPostStopCleanup() threadBuffer = NULL; } } + +#ifdef DEV +void PlayerVideo::test1() +{ + Log::getInstance()->log("Player", Log::DEBUG, "PLAYER TEST 1"); +} + +void PlayerVideo::test2() +{ + Log::getInstance()->log("Player", Log::DEBUG, "PLAYER TEST 2"); +} +#endif diff --git a/playervideo.h b/playervideo.h index 6cb0f5f..ed8f109 100644 --- a/playervideo.h +++ b/playervideo.h @@ -57,7 +57,7 @@ class PlayerVideo : public Player void setPosition(ULLONG position); void setLength(ULLONG length); #ifdef DEV - void test(); + void test1(); void test2(); void test3(); void test4(); @@ -69,6 +69,7 @@ class PlayerVideo : public Player private: MessageQueue* commandMessageQueue; + Log* logger; Video* video; Demuxer demuxer; int startup; diff --git a/vvideorec.cc b/vvideorec.cc index 7f13392..113a853 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -99,23 +99,14 @@ int VVideoRec::handleCommand(int command) case Remote::YELLOW: { player->skipBackward(10); -// ((PlayerVideo*)player)->test3(); return 2; } case Remote::BLUE: { player->skipForward(10); -// ((PlayerVideo*)player)->test4(); return 2; } -// case Remote::RADIO: -// { -// ((PlayerVideo*)player)->test5(); -// return 2; -// } - - // case Remote::REVERSE: // { // player->toggleFastBackward(); @@ -125,7 +116,7 @@ int VVideoRec::handleCommand(int command) #ifdef DEV case Remote::RED: { - player->test(); + player->test1(); return 2; } case Remote::GREEN: -- 2.39.5