Files
recycled-ni-neutrino/lib/libtuxtxt/libtuxtxt.cpp
[CST] Focus 6e8d329918 Remove some globals from vcrcontrol
- Allow ttx/epg keys for timeshift
- Fix record+live streaming
- Live stream code changes for testing
- Changes to handle internal CA multi-decoding
- hack for -Werror compiling



git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1040 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Commit: ab0f7f731c
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2011-01-25 (Tue, 25 Jan 2011)

Origin message was:
------------------
- Remove some globals from vcrcontrol
- Allow ttx/epg keys for timeshift
- Fix record+live streaming
- Live stream code changes for testing
- Changes to handle internal CA multi-decoding
- hack for -Werror compiling



git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1040 e54a6e83-5905-42d5-8d5c-058d10e6a962
2011-01-25 17:22:38 +00:00

96 lines
2.7 KiB
C++

/******************************************************************************
* <<< TuxTxt - Teletext Plugin >>> *
* *
* (c) Thomas "LazyT" Loewe 2002-2003 (LazyT@gmx.net) *
* *
* TOP-Text Support 2004 by Roland Meier <RolandMeier@Siemens.com> *
* Info entnommen aus videotext-0.6.19991029, *
* Copyright (c) 1994-96 Martin Buck <martin-2.buck@student.uni-ulm.de> *
* *
******************************************************************************/
#define TUXTXT_DEBUG 0
#include <sys/ioctl.h>
#include <fcntl.h>
#include "tuxtxt_def.h"
#include "tuxtxt_common.h"
/******************************************************************************
* Initialize *
******************************************************************************/
static int tuxtxt_initialized=0;
int tuxtxt_init()
{
if ( tuxtxt_initialized )
return 0;
tuxtxt_initialized=1;
/* init data */
memset(&tuxtxt_cache.astCachetable, 0, sizeof(tuxtxt_cache.astCachetable));
memset(&tuxtxt_cache.astP29, 0, sizeof(tuxtxt_cache.astP29));
tuxtxt_clear_cache();
tuxtxt_cache.receiving = 0;
tuxtxt_cache.thread_starting = 0;
tuxtxt_cache.vtxtpid = -1;
tuxtxt_cache.thread_id = 0;
tuxtxt_cache.dmx = -1;
return 1;//tuxtxt_init_demuxer();
}
/******************************************************************************
* Interface to caller *
******************************************************************************/
int tuxtxt_stop()
{
if (!tuxtxt_cache.receiving) return 1;
tuxtxt_cache.receiving = 0;
return tuxtxt_stop_thread();
}
void tuxtxt_start(int tpid, int source)
{
if (tuxtxt_cache.vtxtpid != tpid)
{
tuxtxt_stop();
tuxtxt_clear_cache();
tuxtxt_cache.page = 0x100;
tuxtxt_cache.vtxtpid = tpid;
tuxtxt_start_thread(source);
}
else if (!tuxtxt_cache.thread_starting && !tuxtxt_cache.receiving)
{
tuxtxt_start_thread(source);
}
}
void tuxtxt_close()
{
#if TUXTXT_DEBUG
printf ("libtuxtxt: cleaning up\n");
#endif
tuxtxt_stop();
#if 0
if (tuxtxt_cache.dmx != -1)
close(tuxtxt_cache.dmx);
#endif
tuxtxt_cache.dmx = -1;
tuxtxt_clear_cache();
tuxtxt_initialized=0;
}
/* Local Variables: */
/* indent-tabs-mode:t */
/* tab-width:3 */
/* c-basic-offset:3 */
/* comment-column:0 */
/* fill-column:120 */
/* End: */