mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-17 02:13:35 +02:00
Adapt neutrino-mp for CST hardware part #2
- libtuxtxt: Add extra directory libtuxtxt_mp for neutrino-mp
- Workaround, tuxtxt neutrino-hd incompatible to
framebuffer_ng from neutrino-mp
Origin commit data
------------------
Branch: ni/coolstream
Commit: 9d18316676
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-01-15 (Fri, 15 Jan 2016)
Origin message was:
------------------
Adapt neutrino-mp for CST hardware part #2
- libtuxtxt: Add extra directory libtuxtxt_mp for neutrino-mp
- Workaround, tuxtxt neutrino-hd incompatible to
framebuffer_ng from neutrino-mp
------------------
This commit was generated by Migit
This commit is contained in:
100
lib/libtuxtxt_mp/libtuxtxt.cpp
Normal file
100
lib/libtuxtxt_mp/libtuxtxt.cpp
Normal file
@@ -0,0 +1,100 @@
|
||||
/******************************************************************************
|
||||
* <<< 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"
|
||||
int tuxtxt_stop();
|
||||
/******************************************************************************
|
||||
* Initialize *
|
||||
******************************************************************************/
|
||||
|
||||
static int tuxtxt_initialized=0;
|
||||
|
||||
int tuxtxt_init()
|
||||
{
|
||||
if ( tuxtxt_initialized )
|
||||
return 0;
|
||||
|
||||
tuxtxt_initialized=1;
|
||||
|
||||
/* init data */
|
||||
tuxtxt_stop();
|
||||
tuxtxt_clear_cache();
|
||||
tuxtxt_cache.thread_starting = 0;
|
||||
tuxtxt_cache.vtxtpid = -1;
|
||||
tuxtxt_cache.thread_id = 0;
|
||||
tuxtxt_cache.dmx = -1;
|
||||
/* not sure if this is correct here... */
|
||||
tuxtxt_cache.page = 0x100;
|
||||
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 (tpid == -1)
|
||||
{
|
||||
printf("tuxtxt: invalid PID!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
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: */
|
Reference in New Issue
Block a user