Dont stop playback when record started. Experimental, for testing

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@756 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
focus
2010-09-08 16:55:31 +00:00
parent 90f180c595
commit 3ff201e9f5
8 changed files with 181 additions and 126 deletions

View File

@@ -78,8 +78,9 @@ extern bool autoshift_delete;
extern "C" { extern "C" {
#include <driver/genpsi.h> #include <driver/genpsi.h>
} }
CMovieInfo * g_cMovieInfo;
MI_MOVIE_INFO * g_movieInfo; static CMovieInfo * g_cMovieInfo;
static MI_MOVIE_INFO * g_movieInfo;
t_channel_id rec_channel_id; t_channel_id rec_channel_id;
int safe_mkdir(char * path); int safe_mkdir(char * path);
@@ -118,6 +119,8 @@ void CVCRControl::registerDevice(CDevice * const device)
unregisterDevice(); unregisterDevice();
Device = device; Device = device;
if(CNeutrinoApp::getInstance()->recordingstatus)
Device->deviceState = CMD_VCR_RECORD;
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
@@ -322,7 +325,8 @@ void CVCRControl::CFileAndServerDevice::RestoreNeutrino(void)
if(CNeutrinoApp::getInstance()->getMode() != last_mode && if(CNeutrinoApp::getInstance()->getMode() != last_mode &&
CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_standby && CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_standby &&
last_mode != NeutrinoMessages::mode_standby) last_mode != NeutrinoMessages::mode_standby)
if(!autoshift) g_RCInput->postMsg( NeutrinoMessages::CHANGEMODE , last_mode); if(!autoshift)
g_RCInput->postMsg( NeutrinoMessages::CHANGEMODE , last_mode);
if(last_mode == NeutrinoMessages::mode_standby && if(last_mode == NeutrinoMessages::mode_standby &&
CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_standby ) CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_standby )
@@ -495,7 +499,7 @@ bool CVCRControl::CFileDevice::Stop()
//printf("[direct] Stop recording, g_movieInfo %lx\n", g_movieInfo); fflush(stdout); //printf("[direct] Stop recording, g_movieInfo %lx\n", g_movieInfo); fflush(stdout);
//FIXME why not save info if shift ? //FIXME why not save info if shift ?
//if(!autoshift || autoshift_delete) //if(!autoshift || autoshift_delete)
{ if(g_movieInfo && g_cMovieInfo) {
// g_movieInfo->length = (end_time - start_time) / 60; // g_movieInfo->length = (end_time - start_time) / 60;
g_movieInfo->length = (int) round((double) (end_time - start_time) / (double) 60); g_movieInfo->length = (int) round((double) (end_time - start_time) / (double) 60);
//printf("[direct] stop recording 1\n"); fflush(stdout); //printf("[direct] stop recording 1\n"); fflush(stdout);
@@ -509,11 +513,15 @@ bool CVCRControl::CFileDevice::Stop()
deviceState = CMD_VCR_STOP; deviceState = CMD_VCR_STOP;
g_movieInfo->audioPids.clear(); if(g_movieInfo) {
delete g_movieInfo; g_movieInfo->audioPids.clear();
g_movieInfo = NULL; delete g_movieInfo;
delete g_cMovieInfo; g_movieInfo = NULL;
g_cMovieInfo = NULL; }
if(g_cMovieInfo) {
delete g_cMovieInfo;
g_cMovieInfo = NULL;
}
return return_value; return return_value;
} }
@@ -832,12 +840,12 @@ bool CVCRControl::CServerDevice::serverConnect()
return true; return true;
} }
extern unsigned short g_vpid; unsigned short rec_vpid;
extern unsigned short g_vtype; unsigned short rec_vtype;
extern unsigned short g_apids[10]; unsigned short rec_apids[10];
extern unsigned short g_ac3flags[10]; unsigned short rec_ac3flags[10];
extern unsigned short g_numpida; unsigned short rec_numpida;
extern unsigned int g_currentapid, g_currentac3; unsigned int rec_currentapid, rec_currentac3;
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
std::string CVCRControl::CFileAndServerDevice::getMovieInfoString(const CVCRCommand /*command*/, const t_channel_id channel_id, const event_id_t epgid, const std::string& epgTitle, APIDList apid_list, const time_t epg_time) std::string CVCRControl::CFileAndServerDevice::getMovieInfoString(const CVCRCommand /*command*/, const t_channel_id channel_id, const event_id_t epgid, const std::string& epgTitle, APIDList apid_list, const time_t epg_time)
@@ -891,12 +899,12 @@ std::string CVCRControl::CFileAndServerDevice::getMovieInfoString(const CVCRComm
g_movieInfo->epgVideoPid = si.vpid; g_movieInfo->epgVideoPid = si.vpid;
g_movieInfo->VideoType = si.vtype; g_movieInfo->VideoType = si.vtype;
g_vpid = si.vpid; rec_vpid = si.vpid;
g_vtype = si.vtype; rec_vtype = si.vtype;
g_currentapid = si.apid; rec_currentapid = si.apid;
memset(g_apids, 0, sizeof(unsigned short)*10); memset(rec_apids, 0, sizeof(unsigned short)*10);
memset(g_ac3flags, 0, sizeof(unsigned short)*10); memset(rec_ac3flags, 0, sizeof(unsigned short)*10);
g_numpida = 0; rec_numpida = 0;
EPG_AUDIO_PIDS audio_pids; EPG_AUDIO_PIDS audio_pids;
// super hack :-), der einfachste weg an die apid descriptions ranzukommen // super hack :-), der einfachste weg an die apid descriptions ranzukommen
@@ -910,18 +918,18 @@ std::string CVCRControl::CFileAndServerDevice::getMovieInfoString(const CVCRComm
audio_pids.epgAudioPid = pids.APIDs[i].pid; audio_pids.epgAudioPid = pids.APIDs[i].pid;
audio_pids.epgAudioPidName = ZapitTools::UTF8_to_UTF8XML(g_RemoteControl->current_PIDs.APIDs[i].desc); audio_pids.epgAudioPidName = ZapitTools::UTF8_to_UTF8XML(g_RemoteControl->current_PIDs.APIDs[i].desc);
audio_pids.atype = pids.APIDs[i].is_ac3 ? 1 : pids.APIDs[i].is_aac ? 5 : 0; audio_pids.atype = pids.APIDs[i].is_ac3 ? 1 : pids.APIDs[i].is_aac ? 5 : 0;
audio_pids.selected = (audio_pids.epgAudioPid == (int) g_currentapid) ? 1 : 0; audio_pids.selected = (audio_pids.epgAudioPid == (int) rec_currentapid) ? 1 : 0;
g_movieInfo->audioPids.push_back(audio_pids); g_movieInfo->audioPids.push_back(audio_pids);
if(pids.APIDs[i].is_ac3) if(pids.APIDs[i].is_ac3)
g_ac3flags[i] = 1; rec_ac3flags[i] = 1;
if(pids.APIDs[i].is_aac) if(pids.APIDs[i].is_aac)
g_ac3flags[i] = 5; rec_ac3flags[i] = 5;
g_apids[i] = pids.APIDs[i].pid; rec_apids[i] = pids.APIDs[i].pid;
if(g_apids[i] == g_currentapid) if(rec_apids[i] == rec_currentapid)
g_currentac3 = pids.APIDs[i].is_ac3 ? 1 : pids.APIDs[i].is_aac ? 5 : 0; rec_currentac3 = pids.APIDs[i].is_ac3 ? 1 : pids.APIDs[i].is_aac ? 5 : 0;
g_numpida++; rec_numpida++;
} }
} }
} }

View File

@@ -322,13 +322,16 @@ void CInfoViewer::showRecordIcon (const bool show)
frameBuffer->paintBoxRel (ChanName_X + SHADOW_OFFSET, BoxStartY + box_pos + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0); frameBuffer->paintBoxRel (ChanName_X + SHADOW_OFFSET, BoxStartY + box_pos + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0);
frameBuffer->paintBoxRel (ChanName_X , BoxStartY + box_pos , box_len, chanH, COL_INFOBAR_PLUS_0); frameBuffer->paintBoxRel (ChanName_X , BoxStartY + box_pos , box_len, chanH, COL_INFOBAR_PLUS_0);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (ChanName_X +icon_w + (icon_space*2), BoxStartY + box_pos + chanH, box_len, ext_channel_name.c_str (), COL_INFOBAR, 0, true); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (ChanName_X +icon_w + (icon_space*2), BoxStartY + box_pos + chanH, box_len, ext_channel_name.c_str (), COL_INFOBAR, 0, true);
} else{ } else {
frameBuffer->paintBackgroundBoxRel (ChanName_X , BoxStartY + box_pos, box_len + SHADOW_OFFSET, chanH + SHADOW_OFFSET); frameBuffer->paintBackgroundBoxRel (ChanName_X , BoxStartY + box_pos, box_len + SHADOW_OFFSET, chanH + SHADOW_OFFSET);
} }
frameBuffer->paintIcon (autoshift ? NEUTRINO_ICON_AUTO_SHIFT : NEUTRINO_ICON_REC, ChanName_X + icon_space, BoxStartY + box_pos + (chanH - icon_h)/2); frameBuffer->paintIcon (autoshift ? NEUTRINO_ICON_AUTO_SHIFT : NEUTRINO_ICON_REC, ChanName_X + icon_space, BoxStartY + box_pos + (chanH - icon_h)/2);
} else { } else {
frameBuffer->paintBoxRel (ChanName_X + icon_space, BoxStartY + box_pos + (chanH - icon_h)/2, icon_w, icon_h,COL_INFOBAR_PLUS_0); if (!autoshift && !shift_timer)
frameBuffer->paintBoxRel (ChanName_X + icon_space, BoxStartY + box_pos + (chanH - icon_h)/2, icon_w, icon_h,COL_INFOBAR_PLUS_0);
else
frameBuffer->paintBackgroundBoxRel (ChanName_X + icon_space, BoxStartY + box_pos + (chanH - icon_h)/2, icon_w, icon_h);
} }
} }
} }

View File

@@ -24,6 +24,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
@@ -95,43 +96,30 @@ extern char rec_filename[512];
extern off64_t glob_limit; extern off64_t glob_limit;
extern int glob_splits; extern int glob_splits;
static CMoviePlayerGui::state playstate;
static bool isBookmark;
static bool isMovieBrowser = false;
int speed = 1;
int slow = 0;
static off64_t fullposition; // cur. position including all parts played
//static off64_t fulllength = 0; // len of all parts
int startposition;
int timeshift;
off64_t minuteoffset;
off64_t secondoffset;
int file_prozent;
#ifndef __USE_FILE_OFFSET64 #ifndef __USE_FILE_OFFSET64
#error not using 64 bit file offsets #error not using 64 bit file offsets
#endif /* __USE_FILE__OFFSET64 */ #endif /* __USE_FILE__OFFSET64 */
int streamingrunning; static unsigned short g_apids[10];
CHintBox *hintBox; static unsigned short g_ac3flags[10];
std::string startfilename; static unsigned short g_numpida = 0;
std::string skipvalue; static unsigned short g_vpid = 0;
static unsigned short g_vtype = 0;
static std::string g_language[10];
int jumpminutes = 1; extern unsigned short rec_vpid;
static int g_jumpseconds = 0; extern unsigned short rec_vtype;
int buffer_time = 0; extern unsigned short rec_apids[10];
unsigned short g_apids[10]; extern unsigned short rec_ac3flags[10];
unsigned short g_ac3flags[10]; extern unsigned short rec_numpida;
unsigned short g_numpida = 0; extern unsigned int rec_currentapid, rec_currentac3;
unsigned short g_vpid = 0;
unsigned short g_vtype = 0; static unsigned int g_currentapid = 0, g_currentac3 = 0, apidchanged = 0;
std::string g_language[10];
unsigned int g_currentapid = 0, g_currentac3 = 0, apidchanged = 0;
std::string g_file_epg; std::string g_file_epg;
std::string g_file_epg1; std::string g_file_epg1;
bool showaudioselectdialog = false; int file_prozent;
int timeshift;
bool get_movie_info_apid_name(int apid, MI_MOVIE_INFO * movie_info, std::string * apidtitle) bool get_movie_info_apid_name(int apid, MI_MOVIE_INFO * movie_info, std::string * apidtitle)
{ {
@@ -214,6 +202,10 @@ void CMoviePlayerGui::Init(void)
pesfilefilter.addFilter("mpv"); pesfilefilter.addFilter("mpv");
filebrowser->Filter = &tsfilefilter; filebrowser->Filter = &tsfilefilter;
rct = 0; rct = 0;
speed = 1;
slow = 0;
jumpseconds = 0;
showaudioselectdialog = false;
} }
CMoviePlayerGui::~CMoviePlayerGui() CMoviePlayerGui::~CMoviePlayerGui()
@@ -231,18 +223,23 @@ CMoviePlayerGui::~CMoviePlayerGui()
delete playback; delete playback;
} }
bool CMoviePlayerGui::Playing(void)
{
return stopped;
}
void CMoviePlayerGui::cutNeutrino() void CMoviePlayerGui::cutNeutrino()
{ {
if (stopped) if (stopped)
return; return;
g_Zapit->setStandby(true); stopped = true;
//g_Zapit->setStandby(true);
g_Zapit->lockPlayBack();
g_Sectionsd->setPauseScanning(true); g_Sectionsd->setPauseScanning(true);
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts);
m_LastMode = (CNeutrinoApp::getInstance()->getLastMode() | NeutrinoMessages::norezap); m_LastMode = (CNeutrinoApp::getInstance()->getLastMode() | NeutrinoMessages::norezap);
stopped = true;
} }
void CMoviePlayerGui::restoreNeutrino() void CMoviePlayerGui::restoreNeutrino()
@@ -250,13 +247,14 @@ void CMoviePlayerGui::restoreNeutrino()
if (!stopped) if (!stopped)
return; return;
g_Zapit->setStandby(false); stopped = false;
//g_Zapit->setStandby(false);
g_Zapit->unlockPlayBack();
g_Sectionsd->setPauseScanning(false); g_Sectionsd->setPauseScanning(false);
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, m_LastMode); CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, m_LastMode);
//CVFD::getInstance()->showServicename(g_RemoteControl->getCurrentChannelName()); //CVFD::getInstance()->showServicename(g_RemoteControl->getCurrentChannelName());
stopped = false;
} }
int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
@@ -315,12 +313,11 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
} else } else
#endif #endif
if (actionKey == "tsmoviebrowser") { if (actionKey == "tsmoviebrowser") {
isMovieBrowser = true;// TESTTTTTTTTTTTTTTT isMovieBrowser = true;
timeshift = 0; timeshift = 0;
PlayFile(); PlayFile();
} }
else if (actionKey == "fileplayback") { else if (actionKey == "fileplayback") {
isMovieBrowser = false;
timeshift = 0; timeshift = 0;
PlayFile(); PlayFile();
} }
@@ -380,7 +377,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
//return menu_return::RETURN_EXIT_ALL; //return menu_return::RETURN_EXIT_ALL;
} }
void updateLcd(const std::string & sel_filename) void CMoviePlayerGui::updateLcd(const std::string & sel_filename)
{ {
char tmp[20]; char tmp[20];
std::string lcd; std::string lcd;
@@ -439,12 +436,21 @@ void CMoviePlayerGui::PlayFile(void)
bool time_forced = false; bool time_forced = false;
playstate = CMoviePlayerGui::STOPPED; playstate = CMoviePlayerGui::STOPPED;
bool is_file_player = false; bool is_file_player = false;
//unsigned short apid = 0, vpid = 0;
//int vtype = 0, atype = 0;
if (has_hdd) if (has_hdd)
system("(rm /hdd/.wakeup; touch /hdd/.wakeup; sync) > /dev/null 2> /dev/null &"); system("(rm /hdd/.wakeup; touch /hdd/.wakeup; sync) > /dev/null 2> /dev/null &");
if (timeshift) {
g_vpid = rec_vpid;
g_vtype = rec_vtype;
g_numpida = rec_numpida;
g_currentapid = rec_currentapid;
g_currentac3 = rec_currentac3;
for (int i = 0; i < g_numpida; i++) {
g_apids[i] = rec_apids[i];
g_ac3flags[i] = rec_ac3flags[i];
}
}
timeb current_time; timeb current_time;
CMovieInfo cMovieInfo; // funktions to save and load movie info CMovieInfo cMovieInfo; // funktions to save and load movie info
MI_MOVIE_INFO *p_movie_info = NULL; // movie info handle which comes from the MovieBrowser, if not NULL MoviePla yer is able to save new bookmarks MI_MOVIE_INFO *p_movie_info = NULL; // movie info handle which comes from the MovieBrowser, if not NULL MoviePla yer is able to save new bookmarks
@@ -589,27 +595,27 @@ void CMoviePlayerGui::PlayFile(void)
if (play_sec >= p_movie_info->bookmarks.user[book_nr].pos && play_sec <= p_movie_info->bookmarks.user[book_nr].pos + 2 && play_sec > jump_not_until) // if (play_sec >= p_movie_info->bookmarks.user[book_nr].pos && play_sec <= p_movie_info->bookmarks.user[book_nr].pos + 2 && play_sec > jump_not_until) //
{ {
//for plain bookmark, the following calc shall result in 0 (no jump) //for plain bookmark, the following calc shall result in 0 (no jump)
g_jumpseconds = p_movie_info->bookmarks.user[book_nr].length; jumpseconds = p_movie_info->bookmarks.user[book_nr].length;
// we are close behind the bookmark, do bookmark activity (if any) // we are close behind the bookmark, do bookmark activity (if any)
if (p_movie_info->bookmarks.user[book_nr].length < 0) { if (p_movie_info->bookmarks.user[book_nr].length < 0) {
// if the jump back time is to less, it does sometimes cause problems (it does probably jump only 5 sec which will cause the next jump, and so on) // if the jump back time is to less, it does sometimes cause problems (it does probably jump only 5 sec which will cause the next jump, and so on)
if (g_jumpseconds > -15) if (jumpseconds > -15)
g_jumpseconds = -15; jumpseconds = -15;
g_jumpseconds = g_jumpseconds + p_movie_info->bookmarks.user[book_nr].pos; jumpseconds = jumpseconds + p_movie_info->bookmarks.user[book_nr].pos;
//playstate = CMoviePlayerGui::JPOS; // bookmark is of type loop, jump backward //playstate = CMoviePlayerGui::JPOS; // bookmark is of type loop, jump backward
playback->SetPosition(g_jumpseconds * 1000); playback->SetPosition(jumpseconds * 1000);
} else if (p_movie_info->bookmarks.user[book_nr].length > 0) { } else if (p_movie_info->bookmarks.user[book_nr].length > 0) {
// jump at least 15 seconds // jump at least 15 seconds
if (g_jumpseconds < 15) if (jumpseconds < 15)
g_jumpseconds = 15; jumpseconds = 15;
g_jumpseconds = g_jumpseconds + p_movie_info->bookmarks.user[book_nr].pos; jumpseconds = jumpseconds + p_movie_info->bookmarks.user[book_nr].pos;
//playstate = CMoviePlayerGui::JPOS; // bookmark is of type loop, jump backward //playstate = CMoviePlayerGui::JPOS; // bookmark is of type loop, jump backward
playback->SetPosition(g_jumpseconds * 1000); playback->SetPosition(jumpseconds * 1000);
} }
TRACE("[mp] do jump %d sec\r\n", g_jumpseconds); TRACE("[mp] do jump %d sec\r\n", jumpseconds);
update_lcd = true; update_lcd = true;
loop = false; // do no further bookmark checks loop = false; // do no further bookmark checks
} }
@@ -1218,7 +1224,13 @@ void CMoviePlayerGui::PlayFile(void)
} }
else if (msg == CRCInput::RC_timeout) { else if (msg == CRCInput::RC_timeout) {
// nothing // nothing
} else if ((msg == NeutrinoMessages::ANNOUNCE_RECORD) || msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::ZAPTO || msg == NeutrinoMessages::STANDBY_ON || msg == NeutrinoMessages::SHUTDOWN || msg == NeutrinoMessages::SLEEPTIMER) { // Exit for Record/Zapto Timers } else if ( msg == NeutrinoMessages::ANNOUNCE_RECORD ||
msg == NeutrinoMessages::RECORD_START) {
CNeutrinoApp::getInstance()->handleMsg(msg, data);
} else if ( msg == NeutrinoMessages::ZAPTO ||
msg == NeutrinoMessages::STANDBY_ON ||
msg == NeutrinoMessages::SHUTDOWN ||
msg == NeutrinoMessages::SLEEPTIMER) { // Exit for Record/Zapto Timers
exit = true; exit = true;
g_RCInput->postMsg(msg, data); g_RCInput->postMsg(msg, data);
} else { } else {
@@ -1231,7 +1243,7 @@ void CMoviePlayerGui::PlayFile(void)
} }
if (exit) { if (exit) {
//printf("Exit, isMovieBrowser %d p_movie_info %x\n", isMovieBrowser, p_movie_info); printf("CMoviePlayerGui::PlayFile: exit, isMovieBrowser %d p_movie_info %x\n", isMovieBrowser, (int) p_movie_info);
if (isMovieBrowser == true && p_movie_info != NULL) { if (isMovieBrowser == true && p_movie_info != NULL) {
// if we have a movie information, try to save the stop position // if we have a movie information, try to save the stop position
ftime(&current_time); ftime(&current_time);

View File

@@ -41,6 +41,7 @@
#include "gui/widget/menue.h" #include "gui/widget/menue.h"
#include "gui/moviebrowser.h" #include "gui/moviebrowser.h"
#include "gui/movieinfo.h" #include "gui/movieinfo.h"
#include <gui/widget/hintbox.h>
extern "C" { extern "C" {
#include <driver/ringbuffer.h> #include <driver/ringbuffer.h>
@@ -78,6 +79,18 @@ class CMoviePlayerGui : public CMenuTarget
int m_LastMode; int m_LastMode;
const char *filename; const char *filename;
bool stopped; bool stopped;
CMoviePlayerGui::state playstate;
bool isBookmark;
bool isMovieBrowser;
int speed;
int slow;
off64_t fullposition;
int startposition;
int jumpseconds;
bool showaudioselectdialog;
off64_t minuteoffset;
off64_t secondoffset;
std::string startfilename;
std::string Path_local; std::string Path_local;
std::string Path_vlc; std::string Path_vlc;
@@ -85,6 +98,7 @@ class CMoviePlayerGui : public CMenuTarget
CFileBrowser * filebrowser; CFileBrowser * filebrowser;
CMovieBrowser* moviebrowser; CMovieBrowser* moviebrowser;
CHintBox *hintBox;
CBookmarkManager * bookmarkmanager; CBookmarkManager * bookmarkmanager;
@@ -103,6 +117,8 @@ class CMoviePlayerGui : public CMenuTarget
CMoviePlayerGui(); CMoviePlayerGui();
~CMoviePlayerGui(); ~CMoviePlayerGui();
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget* parent, const std::string & actionKey);
void updateLcd(const std::string & sel_filename);
bool Playing();
}; };

View File

@@ -3023,7 +3023,6 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
{ {
int res = 0; int res = 0;
neutrino_msg_t msg = _msg; neutrino_msg_t msg = _msg;
//printf("[neutrino] handleMsg %X data %X\n", msg, data); fflush(stdout);
if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) {
g_Zapit->getAudioMode(&g_settings.audio_AnalogMode); g_Zapit->getAudioMode(&g_settings.audio_AnalogMode);
@@ -3103,7 +3102,6 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
res = res | g_InfoViewer->handleMsg(msg, data); res = res | g_InfoViewer->handleMsg(msg, data);
res = res | channelList->handleMsg(msg, data); res = res | channelList->handleMsg(msg, data);
//printf("[neutrino] handleMsg %X unhandled by others\n", msg); fflush(stdout);
if( res != messages_return::unhandled ) { if( res != messages_return::unhandled ) {
if( ( msg>= CRCInput::RC_WithData ) && ( msg< CRCInput::RC_WithData+ 0x10000000 ) ) if( ( msg>= CRCInput::RC_WithData ) && ( msg< CRCInput::RC_WithData+ 0x10000000 ) )
delete (unsigned char*) data; delete (unsigned char*) data;
@@ -3383,15 +3381,16 @@ printf("NeutrinoMessages::EVT_BOUQUETSCHANGED\n");fflush(stdout);
{ // passendes stop zur Aufnahme { // passendes stop zur Aufnahme
//CVCRControl * vcr_control = CVCRControl::getInstance(); //CVCRControl * vcr_control = CVCRControl::getInstance();
if (CVCRControl::getInstance()->isDeviceRegistered()) { if (CVCRControl::getInstance()->isDeviceRegistered()) {
if ((CVCRControl::getInstance()->getDeviceState() == CVCRControl::CMD_VCR_RECORD) || CVCRControl::CVCRStates state = CVCRControl::getInstance()->getDeviceState();
(CVCRControl::getInstance()->getDeviceState() == CVCRControl::CMD_VCR_PAUSE )) if ((state == CVCRControl::CMD_VCR_RECORD) ||
(state == CVCRControl::CMD_VCR_PAUSE ))
{ {
CVCRControl::getInstance()->Stop(); CVCRControl::getInstance()->Stop();
recordingstatus = 0; recordingstatus = 0;
autoshift = 0; autoshift = 0;
} }
else else
printf("falscher state\n"); printf("NeutrinoMessages::RECORD_STOP: false state %d\n", state);
} }
else else
puts("[neutrino.cpp] no recording devices"); puts("[neutrino.cpp] no recording devices");
@@ -3633,33 +3632,39 @@ skip_message:
if((data & mode_mask)== mode_radio) { if((data & mode_mask)== mode_radio) {
if( mode != mode_radio ) { if( mode != mode_radio ) {
if((data & norezap)==norezap) radioMode((data & norezap) != norezap);
#if 0
if((data & norezap) == norezap)
radioMode(false); radioMode(false);
else else
radioMode(true); radioMode(true);
#endif
} }
} }
if((data & mode_mask)== mode_tv) { if((data & mode_mask)== mode_tv) {
if( mode != mode_tv ) { if( mode != mode_tv ) {
if((data & norezap)==norezap) tvMode((data & norezap) != norezap);
#if 0
if((data & norezap) == norezap)
tvMode(false); tvMode(false);
else else
tvMode(true); tvMode(true);
#endif
} }
} }
if((data &mode_mask)== mode_standby) { if((data & mode_mask)== mode_standby) {
if(mode != mode_standby) if(mode != mode_standby)
standbyMode( true ); standbyMode( true );
} }
if((data &mode_mask)== mode_audio) { if((data & mode_mask)== mode_audio) {
lastMode=mode; lastMode=mode;
mode=mode_audio; mode=mode_audio;
} }
if((data &mode_mask)== mode_pic) { if((data & mode_mask)== mode_pic) {
lastMode=mode; lastMode=mode;
mode=mode_pic; mode=mode_pic;
} }
if((data &mode_mask)== mode_ts) { if((data & mode_mask)== mode_ts && moviePlayerGui->Playing()) {
if(mode == mode_radio) if(mode == mode_radio)
videoDecoder->StopPicture(); videoDecoder->StopPicture();
lastMode=mode; lastMode=mode;

View File

@@ -24,7 +24,7 @@ void internalSendChannels(int connfd, ZapitChannelList* channels, bool nonames);
void sendBouquetChannels (int connfd, const unsigned int bouquet, CZapitClient::channelsMode mode = CZapitClient::MODE_CURRENT, bool nonames = false); void sendBouquetChannels (int connfd, const unsigned int bouquet, CZapitClient::channelsMode mode = CZapitClient::MODE_CURRENT, bool nonames = false);
void sendChannels (int connfd, const CZapitClient::channelsMode mode = CZapitClient::MODE_CURRENT, const CZapitClient::channelsOrder order = CZapitClient::SORT_BOUQUET); void sendChannels (int connfd, const CZapitClient::channelsMode mode = CZapitClient::MODE_CURRENT, const CZapitClient::channelsOrder order = CZapitClient::SORT_BOUQUET);
int startPlayBack(CZapitChannel *); int startPlayBack(CZapitChannel *);
int stopPlayBack(bool stopemu); int stopPlayBack(bool stop_camd);
unsigned int zapTo(const unsigned int channel); unsigned int zapTo(const unsigned int channel);
unsigned int zapTo(const unsigned int bouquet, const unsigned int channel); unsigned int zapTo(const unsigned int bouquet, const unsigned int channel);
unsigned int zapTo_ChannelID(const t_channel_id channel_id, const bool isSubService); unsigned int zapTo_ChannelID(const t_channel_id channel_id, const bool isSubService);

View File

@@ -935,11 +935,15 @@ void CZapitClient::stopPlayBack()
void CZapitClient::lockPlayBack() void CZapitClient::lockPlayBack()
{ {
send(CZapitMessages::CMD_SB_LOCK_PLAYBACK); send(CZapitMessages::CMD_SB_LOCK_PLAYBACK);
CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection(); close_connection();
} }
void CZapitClient::unlockPlayBack() void CZapitClient::unlockPlayBack()
{ {
send(CZapitMessages::CMD_SB_UNLOCK_PLAYBACK); send(CZapitMessages::CMD_SB_UNLOCK_PLAYBACK);
CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection(); close_connection();
} }
bool CZapitClient::isPlayBackActive() bool CZapitClient::isPlayBackActive()

View File

@@ -329,19 +329,29 @@ CZapitClient::responseGetLastChannel load_settings(void)
return lastchannel; return lastchannel;
} }
static int camask = 1; // demux 0
void start_camd(bool forupdate = false)
{
if(currentMode & RECORD_MODE) {
if(rec_channel_id != live_channel_id) {
/* zap from rec. channel */
camask = 1;
cam1->setCaPmt(channel->getCaPmt(), 0, 1); // demux 0
} else if(forupdate) { //FIXME broken!
/* forupdate means pmt update for live channel, using old camask */
cam0->setCaPmt(channel->getCaPmt(), 0, camask, true);// update
} else {
/* zap back to rec. channel */
camask = 5; // demux 0 + 2
cam0->setCaPmt(channel->getCaPmt(), 0, camask, true); // update
cam1->sendMessage(0,0); // stop/close
}
} else {
camask = 1;
cam0->setCaPmt(channel->getCaPmt(), 0, camask);
}
}
/*
* - find transponder
* - stop teletext, video, audio, pcr
* - tune
* - set up pids
* - start pcr, audio, video, teletext
* - start descrambler
*
* return 0 on success
* return -1 otherwise
*
*/
static int pmt_update_fd = -1; static int pmt_update_fd = -1;
static bool update_pmt = true; static bool update_pmt = true;
@@ -554,6 +564,8 @@ printf("[zapit] saving channel, apid %x sub pid %x mode %d volume %d\n", channel
* if to recording channel, we must stop cam1 and update cam0 with live+rec camask. * if to recording channel, we must stop cam1 and update cam0 with live+rec camask.
*/ */
start_camd(forupdate);
#if 0
static int camask = 1; // demux 0 static int camask = 1; // demux 0
if(currentMode & RECORD_MODE) { if(currentMode & RECORD_MODE) {
if(rec_channel_id != live_channel_id) { if(rec_channel_id != live_channel_id) {
@@ -573,6 +585,7 @@ printf("[zapit] saving channel, apid %x sub pid %x mode %d volume %d\n", channel
camask = 1; camask = 1;
cam0->setCaPmt(channel->getCaPmt(), 0, camask); cam0->setCaPmt(channel->getCaPmt(), 0, camask);
} }
#endif
//play: //play:
send_ca_id(1); send_ca_id(1);
if (update_pmt) if (update_pmt)
@@ -657,6 +670,9 @@ void setTVMode(void)
int getMode(void) int getMode(void)
{ {
int mode = currentMode & (~RECORD_MODE);
return mode;
if (currentMode & TV_MODE) if (currentMode & TV_MODE)
return CZapitClient::MODE_TV; return CZapitClient::MODE_TV;
if (currentMode & RADIO_MODE) if (currentMode & RADIO_MODE)
@@ -734,10 +750,6 @@ void parseScanInputXml(void)
} }
} }
/*
* return 0 on success
* return -1 otherwise
*/
int start_scan(int scan_mode) int start_scan(int scan_mode)
{ {
if (!scanInputParser) { if (!scanInputParser) {
@@ -760,7 +772,6 @@ int start_scan(int scan_mode)
scan_runs = 0; scan_runs = 0;
return -1; return -1;
} }
//pthread_detach(scan_thread);
return 0; return 0;
} }
@@ -787,6 +798,7 @@ int start_fast_scan(int scan_mode, int opid)
bool zapit_parse_command(CBasicMessage::Header &rmsg, int connfd) bool zapit_parse_command(CBasicMessage::Header &rmsg, int connfd)
{ {
CZapitMessages::responseCmd response;
DBG("cmd %d (version %d) received\n", rmsg.cmd, rmsg.version); DBG("cmd %d (version %d) received\n", rmsg.cmd, rmsg.version);
if ((standby) && ((rmsg.cmd != CZapitMessages::CMD_SET_VOLUME) if ((standby) && ((rmsg.cmd != CZapitMessages::CMD_SET_VOLUME)
@@ -998,7 +1010,6 @@ bool zapit_parse_command(CBasicMessage::Header &rmsg, int connfd)
} }
case CZapitMessages::CMD_BQ_RESTORE: { case CZapitMessages::CMD_BQ_RESTORE: {
CZapitMessages::responseCmd response;
//2004.08.02 g_bouquetManager->restoreBouquets(); //2004.08.02 g_bouquetManager->restoreBouquets();
if(g_list_changed) { if(g_list_changed) {
prepare_channels(frontend->getInfo()->type, diseqcType); prepare_channels(frontend->getInfo()->type, diseqcType);
@@ -1013,7 +1024,6 @@ bool zapit_parse_command(CBasicMessage::Header &rmsg, int connfd)
} }
case CZapitMessages::CMD_REINIT_CHANNELS: { case CZapitMessages::CMD_REINIT_CHANNELS: {
CZapitMessages::responseCmd response;
// Houdini: save actual channel to restore it later, old version's channel was set to scans.conf initial channel // Houdini: save actual channel to restore it later, old version's channel was set to scans.conf initial channel
t_channel_id cid= channel ? channel->getChannelID() : 0; t_channel_id cid= channel ? channel->getChannelID() : 0;
@@ -1030,7 +1040,6 @@ bool zapit_parse_command(CBasicMessage::Header &rmsg, int connfd)
} }
case CZapitMessages::CMD_RELOAD_CURRENTSERVICES: { case CZapitMessages::CMD_RELOAD_CURRENTSERVICES: {
CZapitMessages::responseCmd response;
response.cmd = CZapitMessages::CMD_READY; response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response)); CBasicServer::send_data(connfd, &response, sizeof(response));
DBG("[zapit] sending EVT_SERVICES_CHANGED\n"); DBG("[zapit] sending EVT_SERVICES_CHANGED\n");
@@ -1391,7 +1400,6 @@ printf("[zapit] recording mode: %d\n", msgSetRecordMode.activate);fflush(stdout)
CZapitMessages::commandBoolean msgBoolean; CZapitMessages::commandBoolean msgBoolean;
CBasicServer::receive_data(connfd, &msgBoolean, sizeof(msgBoolean)); CBasicServer::receive_data(connfd, &msgBoolean, sizeof(msgBoolean));
CZapitMessages::responseCmd response;
response.cmd = CZapitMessages::CMD_READY; response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response)); CBasicServer::send_data(connfd, &response, sizeof(response));
#if 0 #if 0
@@ -1432,7 +1440,6 @@ printf("[zapit] recording mode: %d\n", msgSetRecordMode.activate);fflush(stdout)
case CZapitMessages::CMD_SB_STOP_PLAYBACK: case CZapitMessages::CMD_SB_STOP_PLAYBACK:
stopPlayBack(false); stopPlayBack(false);
CZapitMessages::responseCmd response;
response.cmd = CZapitMessages::CMD_READY; response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response)); CBasicServer::send_data(connfd, &response, sizeof(response));
break; break;
@@ -1440,10 +1447,15 @@ printf("[zapit] recording mode: %d\n", msgSetRecordMode.activate);fflush(stdout)
case CZapitMessages::CMD_SB_LOCK_PLAYBACK: case CZapitMessages::CMD_SB_LOCK_PLAYBACK:
stopPlayBack(true); stopPlayBack(true);
playbackStopForced = true; playbackStopForced = true;
response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response));
break; break;
case CZapitMessages::CMD_SB_UNLOCK_PLAYBACK: case CZapitMessages::CMD_SB_UNLOCK_PLAYBACK:
playbackStopForced = false; playbackStopForced = false;
startPlayBack(channel); startPlayBack(channel);
start_camd();
response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response));
break; break;
case CZapitMessages::CMD_SET_DISPLAY_FORMAT: { case CZapitMessages::CMD_SET_DISPLAY_FORMAT: {
CZapitMessages::commandInt msg; CZapitMessages::commandInt msg;
@@ -1611,9 +1623,8 @@ DBG("NVOD insert %llx\n", CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPO
if (msgBoolean.truefalse) { if (msgBoolean.truefalse) {
// if(videoDecoder && (currentMode & RECORD_MODE)) videoDecoder->freeze(); // if(videoDecoder && (currentMode & RECORD_MODE)) videoDecoder->freeze();
enterStandby(); enterStandby();
CZapitMessages::responseCmd presponse; response.cmd = CZapitMessages::CMD_READY;
presponse.cmd = CZapitMessages::CMD_READY; CBasicServer::send_data(connfd, &response, sizeof(response));
CBasicServer::send_data(connfd, &presponse, sizeof(presponse));
} else } else
leaveStandby(); leaveStandby();
break; break;
@@ -1946,25 +1957,22 @@ int startPlayBack(CZapitChannel *thisChannel)
return 0; return 0;
} }
int stopPlayBack(bool stopemu) int stopPlayBack(bool stop_camd)
{ {
/* /*
in record mode we stop onle cam1, while cam continue to decrypt recording channel in record mode we stop onle cam1, while cam continue to decrypt recording channel
*/ */
if(stopemu) { if(stop_camd) {
if(currentMode & RECORD_MODE) { if(currentMode & RECORD_MODE) {
/* if we recording and rec == live, only update camask on cam0, /* if we recording and rec == live, only update camask on cam0,
* else stop cam1 * else stop cam1 */
*/
if(live_channel_id == rec_channel_id) if(live_channel_id == rec_channel_id)
cam0->setCaPmt(channel->getCaPmt(), 0, 4, true); // demux 2, update cam0->setCaPmt(channel->getCaPmt(), 0, 4, true); // demux 2, update
else else
cam1->sendMessage(0,0); cam1->sendMessage(0,0);
} else { } else {
cam0->sendMessage(0,0); cam0->sendMessage(0,0);
unlink("/tmp/pmt.tmp"); unlink("/tmp/pmt.tmp");
} }
} }
@@ -1998,7 +2006,6 @@ in record mode we stop onle cam1, while cam continue to decrypt recording channe
else else
dvbsub_stop(); dvbsub_stop();
return 0; return 0;
} }