mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 15:02:43 +02:00
Origin commit data
------------------
Branch: master
Commit: 4dc1171253
Author: max_10 <max_10@gmx.de>
Date: 2014-04-27 (Sun, 27 Apr 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#include <stdio.h>
|
|
|
|
#include "init_lib.h"
|
|
#include <fcntl.h>
|
|
#include <sys/ioctl.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
#include <linux/dvb/dmx.h>
|
|
|
|
#include "pwrmngr.h"
|
|
|
|
#include "lt_debug.h"
|
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_INIT, NULL, args)
|
|
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_INIT, NULL, args)
|
|
|
|
static bool initialized = false;
|
|
|
|
void init_td_api()
|
|
{
|
|
if (!initialized)
|
|
lt_debug_init();
|
|
lt_info("%s begin, initialized=%d, debug=0x%02x\n", __FUNCTION__, (int)initialized, debuglevel);
|
|
if (!initialized)
|
|
{
|
|
/* this is a strange hack: the drivers seem to only work correctly after
|
|
* demux0 has been used once. After that, we can use demux1,2,... */
|
|
struct dmx_pes_filter_params p;
|
|
int dmx = open("/dev/dvb/adapter0/demux0", O_RDWR|O_CLOEXEC);
|
|
if (dmx < 0)
|
|
lt_info("%s: ERROR open /dev/dvb/adapter0/demux0 (%m)\n", __func__);
|
|
else
|
|
{
|
|
memset(&p, 0, sizeof(p));
|
|
p.output = DMX_OUT_DECODER;
|
|
p.input = DMX_IN_FRONTEND;
|
|
p.flags = DMX_IMMEDIATE_START;
|
|
p.pes_type = DMX_PES_VIDEO;
|
|
ioctl(dmx, DMX_SET_PES_FILTER, &p);
|
|
ioctl(dmx, DMX_STOP);
|
|
close(dmx);
|
|
}
|
|
}
|
|
initialized = true;
|
|
lt_info("%s end\n", __FUNCTION__);
|
|
}
|
|
|
|
void shutdown_td_api()
|
|
{
|
|
lt_info("%s, initialized = %d\n", __FUNCTION__, (int)initialized);
|
|
initialized = false;
|
|
}
|