mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
sync with seife
Origin commit data
------------------
Branch: master
Commit: 94b05dbdc0
Author: martii <m4rtii@gmx.de>
Date: 2013-02-24 (Sun, 24 Feb 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1,3 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* cDemux implementation for azbox receivers (tested on azbox me and minime)
|
||||||
|
*
|
||||||
|
* derived from libtriple/dmx_td.cpp
|
||||||
|
*
|
||||||
|
* (C) 2010-2013 Stefan Seyfried
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -141,14 +162,6 @@ void cDemux::Close(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::vector<pes_pids>::const_iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
|
||||||
{
|
|
||||||
lt_debug("%s stopping and closing demux fd %d pid 0x%04x\n", __FUNCTION__, (*i).fd, (*i).pid);
|
|
||||||
if (ioctl((*i).fd, DMX_STOP) < 0)
|
|
||||||
perror("DEMUX_STOP");
|
|
||||||
if (close((*i).fd) < 0)
|
|
||||||
perror("close");
|
|
||||||
}
|
|
||||||
pesfds.clear();
|
pesfds.clear();
|
||||||
ioctl(fd, DMX_STOP);
|
ioctl(fd, DMX_STOP);
|
||||||
close(fd);
|
close(fd);
|
||||||
@@ -174,13 +187,6 @@ bool cDemux::Start(bool)
|
|||||||
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::vector<pes_pids>::const_iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
|
||||||
{
|
|
||||||
lt_debug("%s starting demux fd %d pid 0x%04x\n", __FUNCTION__, (*i).fd, (*i).pid);
|
|
||||||
if (ioctl((*i).fd, DMX_START) < 0)
|
|
||||||
perror("DMX_START");
|
|
||||||
}
|
|
||||||
ioctl(fd, DMX_START);
|
ioctl(fd, DMX_START);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -193,12 +199,6 @@ bool cDemux::Stop(void)
|
|||||||
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (std::vector<pes_pids>::const_iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
|
||||||
{
|
|
||||||
lt_debug("%s stopping demux fd %d pid 0x%04x\n", __FUNCTION__, (*i).fd, (*i).pid);
|
|
||||||
if (ioctl((*i).fd, DMX_STOP) < 0)
|
|
||||||
perror("DMX_STOP");
|
|
||||||
}
|
|
||||||
ioctl(fd, DMX_STOP);
|
ioctl(fd, DMX_STOP);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -277,13 +277,12 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte
|
|||||||
const unsigned char * const mask, int len, int timeout,
|
const unsigned char * const mask, int len, int timeout,
|
||||||
const unsigned char * const negmask)
|
const unsigned char * const negmask)
|
||||||
{
|
{
|
||||||
int length = len;
|
|
||||||
memset(&s_flt, 0, sizeof(s_flt));
|
memset(&s_flt, 0, sizeof(s_flt));
|
||||||
|
|
||||||
if (len > DMX_FILTER_SIZE)
|
if (len > DMX_FILTER_SIZE)
|
||||||
{
|
{
|
||||||
lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
|
lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
|
||||||
length = DMX_FILTER_SIZE;
|
len = DMX_FILTER_SIZE;
|
||||||
}
|
}
|
||||||
s_flt.pid = pid;
|
s_flt.pid = pid;
|
||||||
s_flt.timeout = timeout;
|
s_flt.timeout = timeout;
|
||||||
@@ -454,7 +453,6 @@ bool cDemux::addPid(unsigned short Pid)
|
|||||||
lt_debug("%s: pid 0x%04hx\n", __func__, Pid);
|
lt_debug("%s: pid 0x%04hx\n", __func__, Pid);
|
||||||
pes_pids pfd;
|
pes_pids pfd;
|
||||||
int ret;
|
int ret;
|
||||||
struct dmx_pes_filter_params p;
|
|
||||||
if (dmx_type != DMX_TP_CHANNEL)
|
if (dmx_type != DMX_TP_CHANNEL)
|
||||||
{
|
{
|
||||||
lt_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
lt_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
||||||
@@ -462,6 +460,9 @@ bool cDemux::addPid(unsigned short Pid)
|
|||||||
}
|
}
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
lt_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
|
lt_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
|
||||||
|
pfd.fd = fd; /* dummy */
|
||||||
|
pfd.pid = Pid;
|
||||||
|
pesfds.push_back(pfd);
|
||||||
ret = (ioctl(fd, DMX_ADD_PID, &Pid));
|
ret = (ioctl(fd, DMX_ADD_PID, &Pid));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
lt_info("%s: DMX_ADD_PID (%m)\n", __func__);
|
lt_info("%s: DMX_ADD_PID (%m)\n", __func__);
|
||||||
@@ -478,11 +479,9 @@ void cDemux::removePid(unsigned short Pid)
|
|||||||
for (std::vector<pes_pids>::iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
for (std::vector<pes_pids>::iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
||||||
{
|
{
|
||||||
if ((*i).pid == Pid) {
|
if ((*i).pid == Pid) {
|
||||||
lt_debug("removePid: removing demux fd %d pid 0x%04x\n", (*i).fd, Pid);
|
lt_debug("removePid: removing demux fd %d pid 0x%04x\n", fd, Pid);
|
||||||
if (ioctl((*i).fd, DMX_STOP) < 0)
|
if (ioctl(fd, DMX_REMOVE_PID, Pid) < 0)
|
||||||
perror("DMX_STOP");
|
lt_info("%s: (DMX_REMOVE_PID, 0x%04hx): %m\n", __func__, Pid);
|
||||||
if (close((*i).fd) < 0)
|
|
||||||
perror("close");
|
|
||||||
pesfds.erase(i);
|
pesfds.erase(i);
|
||||||
return; /* TODO: what if the same PID is there multiple times */
|
return; /* TODO: what if the same PID is there multiple times */
|
||||||
}
|
}
|
||||||
@@ -515,3 +514,9 @@ bool cDemux::SetSource(int unit, int source)
|
|||||||
lt_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source);
|
lt_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cDemux::GetSource(int unit)
|
||||||
|
{
|
||||||
|
lt_info_c("%s(%d): not implemented yet\n", __func__, unit);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -55,6 +55,7 @@ class cDemux
|
|||||||
void getSTC(int64_t * STC);
|
void getSTC(int64_t * STC);
|
||||||
int getUnit(void);
|
int getUnit(void);
|
||||||
static bool SetSource(int unit, int source);
|
static bool SetSource(int unit, int source);
|
||||||
|
static int GetSource(int unit);
|
||||||
// TD only functions
|
// TD only functions
|
||||||
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
||||||
void removePid(unsigned short Pid); /* needed by cRecord class */
|
void removePid(unsigned short Pid); /* needed by cRecord class */
|
||||||
|
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* cDemux implementation for generic dvbapi
|
||||||
|
*
|
||||||
|
* derived from libtriple/dmx_td.cpp
|
||||||
|
*
|
||||||
|
* (C) 2010-2013 Stefan Seyfried
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -124,15 +146,6 @@ void cDemux::Close(void)
|
|||||||
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::vector<pes_pids>::const_iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
|
||||||
{
|
|
||||||
lt_debug("%s stopping and closing demux fd %d pid 0x%04x\n", __FUNCTION__, (*i).fd, (*i).pid);
|
|
||||||
if (ioctl((*i).fd, DMX_STOP) < 0)
|
|
||||||
perror("DEMUX_STOP");
|
|
||||||
if (close((*i).fd) < 0)
|
|
||||||
perror("close");
|
|
||||||
}
|
|
||||||
pesfds.clear();
|
pesfds.clear();
|
||||||
ioctl(fd, DMX_STOP);
|
ioctl(fd, DMX_STOP);
|
||||||
close(fd);
|
close(fd);
|
||||||
@@ -158,13 +171,6 @@ bool cDemux::Start(bool)
|
|||||||
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::vector<pes_pids>::const_iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
|
||||||
{
|
|
||||||
lt_debug("%s starting demux fd %d pid 0x%04x\n", __FUNCTION__, (*i).fd, (*i).pid);
|
|
||||||
if (ioctl((*i).fd, DMX_START) < 0)
|
|
||||||
perror("DMX_START");
|
|
||||||
}
|
|
||||||
ioctl(fd, DMX_START);
|
ioctl(fd, DMX_START);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -177,12 +183,6 @@ bool cDemux::Stop(void)
|
|||||||
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (std::vector<pes_pids>::const_iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
|
||||||
{
|
|
||||||
lt_debug("%s stopping demux fd %d pid 0x%04x\n", __FUNCTION__, (*i).fd, (*i).pid);
|
|
||||||
if (ioctl((*i).fd, DMX_STOP) < 0)
|
|
||||||
perror("DMX_STOP");
|
|
||||||
}
|
|
||||||
ioctl(fd, DMX_STOP);
|
ioctl(fd, DMX_STOP);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -247,13 +247,12 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte
|
|||||||
const unsigned char * const mask, int len, int timeout,
|
const unsigned char * const mask, int len, int timeout,
|
||||||
const unsigned char * const negmask)
|
const unsigned char * const negmask)
|
||||||
{
|
{
|
||||||
int length = len;
|
|
||||||
memset(&s_flt, 0, sizeof(s_flt));
|
memset(&s_flt, 0, sizeof(s_flt));
|
||||||
|
|
||||||
if (len > DMX_FILTER_SIZE)
|
if (len > DMX_FILTER_SIZE)
|
||||||
{
|
{
|
||||||
lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
|
lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
|
||||||
length = DMX_FILTER_SIZE;
|
len = DMX_FILTER_SIZE;
|
||||||
}
|
}
|
||||||
s_flt.pid = pid;
|
s_flt.pid = pid;
|
||||||
s_flt.timeout = timeout;
|
s_flt.timeout = timeout;
|
||||||
@@ -422,7 +421,6 @@ bool cDemux::addPid(unsigned short Pid)
|
|||||||
lt_debug("%s: pid 0x%04hx\n", __func__, Pid);
|
lt_debug("%s: pid 0x%04hx\n", __func__, Pid);
|
||||||
pes_pids pfd;
|
pes_pids pfd;
|
||||||
int ret;
|
int ret;
|
||||||
struct dmx_pes_filter_params p;
|
|
||||||
if (dmx_type != DMX_TP_CHANNEL)
|
if (dmx_type != DMX_TP_CHANNEL)
|
||||||
{
|
{
|
||||||
lt_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
lt_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
||||||
@@ -430,6 +428,9 @@ bool cDemux::addPid(unsigned short Pid)
|
|||||||
}
|
}
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
lt_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
|
lt_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
|
||||||
|
pfd.fd = fd; /* dummy */
|
||||||
|
pfd.pid = Pid;
|
||||||
|
pesfds.push_back(pfd);
|
||||||
ret = (ioctl(fd, DMX_ADD_PID, &Pid));
|
ret = (ioctl(fd, DMX_ADD_PID, &Pid));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
lt_info("%s: DMX_ADD_PID (%m)\n", __func__);
|
lt_info("%s: DMX_ADD_PID (%m)\n", __func__);
|
||||||
@@ -446,11 +447,9 @@ void cDemux::removePid(unsigned short Pid)
|
|||||||
for (std::vector<pes_pids>::iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
for (std::vector<pes_pids>::iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
||||||
{
|
{
|
||||||
if ((*i).pid == Pid) {
|
if ((*i).pid == Pid) {
|
||||||
lt_debug("removePid: removing demux fd %d pid 0x%04x\n", (*i).fd, Pid);
|
lt_debug("removePid: removing demux fd %d pid 0x%04x\n", fd, Pid);
|
||||||
if (ioctl((*i).fd, DMX_STOP) < 0)
|
if (ioctl(fd, DMX_REMOVE_PID, Pid) < 0)
|
||||||
perror("DMX_STOP");
|
lt_info("%s: (DMX_REMOVE_PID, 0x%04hx): %m\n", __func__, Pid);
|
||||||
if (close((*i).fd) < 0)
|
|
||||||
perror("close");
|
|
||||||
pesfds.erase(i);
|
pesfds.erase(i);
|
||||||
return; /* TODO: what if the same PID is there multiple times */
|
return; /* TODO: what if the same PID is there multiple times */
|
||||||
}
|
}
|
||||||
@@ -478,3 +477,9 @@ bool cDemux::SetSource(int unit, int source)
|
|||||||
lt_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source);
|
lt_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cDemux::GetSource(int unit)
|
||||||
|
{
|
||||||
|
lt_info_c("%s(%d): not implemented yet\n", __func__, unit);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -55,6 +55,7 @@ class cDemux
|
|||||||
void getSTC(int64_t * STC);
|
void getSTC(int64_t * STC);
|
||||||
int getUnit(void);
|
int getUnit(void);
|
||||||
static bool SetSource(int unit, int source);
|
static bool SetSource(int unit, int source);
|
||||||
|
static int GetSource(int unit);
|
||||||
// TD only functions
|
// TD only functions
|
||||||
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
||||||
void removePid(unsigned short Pid); /* needed by cRecord class */
|
void removePid(unsigned short Pid); /* needed by cRecord class */
|
||||||
|
@@ -1,15 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
* cDemux implementation for SH4 receivers (tested on fulan spark and
|
* cDemux implementation for SH4 receivers (tested on fulan spark and
|
||||||
* fulan spark7162 hardware
|
* fulan spark7162 hardware)
|
||||||
*
|
*
|
||||||
* derived from libtriple/dmx_td.cpp
|
* derived from libtriple/dmx_td.cpp
|
||||||
*
|
*
|
||||||
* (C) 2010-2012 Stefan Seyfried
|
* (C) 2010-2013 Stefan Seyfried
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -227,14 +235,6 @@ void cDemux::Close(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::vector<pes_pids>::const_iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
|
||||||
{
|
|
||||||
lt_debug("%s stopping and closing demux fd %d pid 0x%04x\n", __FUNCTION__, (*i).fd, (*i).pid);
|
|
||||||
if (ioctl((*i).fd, DMX_STOP) < 0)
|
|
||||||
perror("DEMUX_STOP");
|
|
||||||
if (close((*i).fd) < 0)
|
|
||||||
perror("close");
|
|
||||||
}
|
|
||||||
pesfds.clear();
|
pesfds.clear();
|
||||||
ioctl(fd, DMX_STOP);
|
ioctl(fd, DMX_STOP);
|
||||||
close(fd);
|
close(fd);
|
||||||
@@ -259,16 +259,7 @@ bool cDemux::Start(bool)
|
|||||||
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MARTII
|
|
||||||
for (std::vector<pes_pids>::const_iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
|
||||||
{
|
|
||||||
lt_debug("%s starting demux fd %d pid 0x%04x\n", __FUNCTION__, (*i).fd, (*i).pid);
|
|
||||||
if (ioctl((*i).fd, DMX_START) < 0)
|
|
||||||
perror("DMX_START");
|
|
||||||
}
|
|
||||||
ioctl(fd, DMX_START);
|
ioctl(fd, DMX_START);
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,12 +270,6 @@ bool cDemux::Stop(void)
|
|||||||
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (std::vector<pes_pids>::const_iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
|
||||||
{
|
|
||||||
lt_debug("%s stopping demux fd %d pid 0x%04x\n", __FUNCTION__, (*i).fd, (*i).pid);
|
|
||||||
if (ioctl((*i).fd, DMX_STOP) < 0)
|
|
||||||
perror("DMX_STOP");
|
|
||||||
}
|
|
||||||
ioctl(fd, DMX_STOP);
|
ioctl(fd, DMX_STOP);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -368,9 +353,6 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte
|
|||||||
const unsigned char * const mask, int len, int timeout,
|
const unsigned char * const mask, int len, int timeout,
|
||||||
const unsigned char * const negmask)
|
const unsigned char * const negmask)
|
||||||
{
|
{
|
||||||
#ifndef MARTII
|
|
||||||
int length = len;
|
|
||||||
#endif
|
|
||||||
memset(&s_flt, 0, sizeof(s_flt));
|
memset(&s_flt, 0, sizeof(s_flt));
|
||||||
|
|
||||||
_open();
|
_open();
|
||||||
@@ -378,11 +360,7 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte
|
|||||||
if (len > DMX_FILTER_SIZE)
|
if (len > DMX_FILTER_SIZE)
|
||||||
{
|
{
|
||||||
lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
|
lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
|
||||||
#ifdef MARTII
|
|
||||||
len = DMX_FILTER_SIZE;
|
len = DMX_FILTER_SIZE;
|
||||||
#else
|
|
||||||
length = DMX_FILTER_SIZE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
s_flt.pid = pid;
|
s_flt.pid = pid;
|
||||||
s_flt.timeout = timeout;
|
s_flt.timeout = timeout;
|
||||||
@@ -554,13 +532,8 @@ void *cDemux::getChannel()
|
|||||||
bool cDemux::addPid(unsigned short Pid)
|
bool cDemux::addPid(unsigned short Pid)
|
||||||
{
|
{
|
||||||
lt_debug("%s: pid 0x%04hx\n", __func__, Pid);
|
lt_debug("%s: pid 0x%04hx\n", __func__, Pid);
|
||||||
#ifndef MARTII
|
|
||||||
pes_pids pfd;
|
pes_pids pfd;
|
||||||
#endif
|
|
||||||
int ret;
|
int ret;
|
||||||
#ifndef MARTII
|
|
||||||
struct dmx_pes_filter_params p;
|
|
||||||
#endif
|
|
||||||
if (dmx_type != DMX_TP_CHANNEL)
|
if (dmx_type != DMX_TP_CHANNEL)
|
||||||
{
|
{
|
||||||
lt_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
lt_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
||||||
@@ -569,39 +542,9 @@ bool cDemux::addPid(unsigned short Pid)
|
|||||||
_open();
|
_open();
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
lt_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
|
lt_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
|
||||||
#if 0
|
pfd.fd = fd; /* dummy */
|
||||||
pfd.fd = open(devname[num], O_RDWR);
|
|
||||||
if (pfd.fd < 0)
|
|
||||||
{
|
|
||||||
lt_info("%s #%d Pid = %hx open failed (%m)\n", __FUNCTION__, num, Pid);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
fcntl(pfd.fd, F_SETFD, FD_CLOEXEC);
|
|
||||||
lt_debug("%s #%d Pid = %hx pfd = %d\n", __FUNCTION__, num, Pid, pfd.fd);
|
|
||||||
|
|
||||||
p.pid = Pid;
|
|
||||||
p.input = DMX_IN_FRONTEND;
|
|
||||||
p.pes_type = DMX_PES_OTHER;
|
|
||||||
p.output = DMX_OUT_TS_TAP;
|
|
||||||
p.flags = 0;
|
|
||||||
|
|
||||||
ret = ioctl(pfd.fd, DMX_SET_BUFFER_SIZE, 0x10000); // 64k
|
|
||||||
if (ret == -1)
|
|
||||||
perror("DMX_SET_BUFFER_SIZE");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ret = ioctl(pfd.fd, DMX_SET_PES_FILTER, &p);
|
|
||||||
if (ret == -1)
|
|
||||||
perror("DEMUX_FILTER_PES_SET");
|
|
||||||
}
|
|
||||||
pfd.pid = Pid;
|
pfd.pid = Pid;
|
||||||
if (ret != -1)
|
pesfds.push_back(pfd);
|
||||||
/* success! */
|
|
||||||
pesfds.push_back(pfd);
|
|
||||||
else
|
|
||||||
/* error! */
|
|
||||||
close(pfd.fd);
|
|
||||||
#endif
|
|
||||||
ret = (ioctl(fd, DMX_ADD_PID, &Pid));
|
ret = (ioctl(fd, DMX_ADD_PID, &Pid));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
lt_info("%s: DMX_ADD_PID (%m)\n", __func__);
|
lt_info("%s: DMX_ADD_PID (%m)\n", __func__);
|
||||||
@@ -618,11 +561,9 @@ void cDemux::removePid(unsigned short Pid)
|
|||||||
for (std::vector<pes_pids>::iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
for (std::vector<pes_pids>::iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
||||||
{
|
{
|
||||||
if ((*i).pid == Pid) {
|
if ((*i).pid == Pid) {
|
||||||
lt_debug("removePid: removing demux fd %d pid 0x%04x\n", (*i).fd, Pid);
|
lt_debug("removePid: removing demux fd %d pid 0x%04x\n", fd, Pid);
|
||||||
if (ioctl((*i).fd, DMX_STOP) < 0)
|
if (ioctl(fd, DMX_REMOVE_PID, Pid) < 0)
|
||||||
perror("DMX_STOP");
|
lt_info("%s: (DMX_REMOVE_PID, 0x%04hx): %m\n", __func__, Pid);
|
||||||
if (close((*i).fd) < 0)
|
|
||||||
perror("close");
|
|
||||||
pesfds.erase(i);
|
pesfds.erase(i);
|
||||||
return; /* TODO: what if the same PID is there multiple times */
|
return; /* TODO: what if the same PID is there multiple times */
|
||||||
}
|
}
|
||||||
@@ -663,3 +604,13 @@ bool cDemux::SetSource(int unit, int source)
|
|||||||
dmx_source[unit] = source;
|
dmx_source[unit] = source;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cDemux::GetSource(int unit)
|
||||||
|
{
|
||||||
|
if (unit >= NUM_DEMUX || unit < 0) {
|
||||||
|
lt_info_c("%s: unit (%d) out of range, NUM_DEMUX %d\n", __func__, unit, NUM_DEMUX);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
lt_info_c("%s(%d) => %d\n", __func__, unit, dmx_source[unit]);
|
||||||
|
return dmx_source[unit];
|
||||||
|
}
|
||||||
|
@@ -57,6 +57,7 @@ class cDemux
|
|||||||
void getSTC(int64_t * STC);
|
void getSTC(int64_t * STC);
|
||||||
int getUnit(void);
|
int getUnit(void);
|
||||||
static bool SetSource(int unit, int source);
|
static bool SetSource(int unit, int source);
|
||||||
|
static int GetSource(int unit);
|
||||||
// TD only functions
|
// TD only functions
|
||||||
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
||||||
void removePid(unsigned short Pid); /* needed by cRecord class */
|
void removePid(unsigned short Pid); /* needed by cRecord class */
|
||||||
|
@@ -53,12 +53,10 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
if (p && sscanf(p, "STB_ID=%x:%x:%x:", &h0, &h1, &h2) == 3) {
|
if (p && sscanf(p, "STB_ID=%x:%x:%x:", &h0, &h1, &h2) == 3) {
|
||||||
int sys_id = (h0 << 16) | (h1 << 8) | h2;
|
int sys_id = (h0 << 16) | (h1 << 8) | h2;
|
||||||
switch (sys_id) {
|
switch (sys_id) {
|
||||||
#ifdef MARTII
|
|
||||||
case 0x090003:
|
case 0x090003:
|
||||||
tmp = "Truman Premier 1+";
|
tmp = "Truman Premier 1+";
|
||||||
caps.has_SCART = 1;
|
caps.has_SCART = 1;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case 0x090007:
|
case 0x090007:
|
||||||
tmp = "GoldenMedia GM990";
|
tmp = "GoldenMedia GM990";
|
||||||
caps.has_SCART = 1;
|
caps.has_SCART = 1;
|
||||||
@@ -74,7 +72,6 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
tmp = "GalaxyInnovations S8120";
|
tmp = "GalaxyInnovations S8120";
|
||||||
caps.has_SCART = 1;
|
caps.has_SCART = 1;
|
||||||
break;
|
break;
|
||||||
#ifdef MARTII
|
|
||||||
case 0x09000d:
|
case 0x09000d:
|
||||||
tmp = "Dynavision Spark";
|
tmp = "Dynavision Spark";
|
||||||
caps.has_SCART = 1;
|
caps.has_SCART = 1;
|
||||||
@@ -103,12 +100,10 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
tmp = "Truman Top Box 2";
|
tmp = "Truman Top Box 2";
|
||||||
caps.has_SCART = 1;
|
caps.has_SCART = 1;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case 0x0c0007:
|
case 0x0c0007:
|
||||||
tmp = "GoldenMedia Triplex";
|
tmp = "GoldenMedia Triplex";
|
||||||
caps.has_SCART = 1;
|
caps.has_SCART = 1;
|
||||||
break;
|
break;
|
||||||
#ifdef MARTII
|
|
||||||
case 0x0c000a:
|
case 0x0c000a:
|
||||||
tmp = "Amiko Alien 2";
|
tmp = "Amiko Alien 2";
|
||||||
caps.has_SCART = 1;
|
caps.has_SCART = 1;
|
||||||
@@ -141,7 +136,6 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
tmp = "Icecrypt S3700 CHD";
|
tmp = "Icecrypt S3700 CHD";
|
||||||
caps.has_SCART = 1;
|
caps.has_SCART = 1;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
tmp = p;
|
tmp = p;
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* (C) 2002-2003 Andreas Oberritter <obi@tuxbox.org>
|
* (C) 2002-2003 Andreas Oberritter <obi@tuxbox.org>
|
||||||
* (C) 2010-2011 Stefan Seyfried
|
* (C) 2010-2013 Stefan Seyfried
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
@@ -13,8 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, 51 Franklin Street, Suite 500 Boston, MA 02110-1335 USA
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -499,9 +498,6 @@ int cVideo::getBlank(void)
|
|||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
ssize_t r;
|
ssize_t r;
|
||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
#ifndef MARTII
|
|
||||||
char *p;
|
|
||||||
#endif
|
|
||||||
/* hack: the "mailbox" irq is not increasing if
|
/* hack: the "mailbox" irq is not increasing if
|
||||||
* no audio or video is decoded... */
|
* no audio or video is decoded... */
|
||||||
FILE *f = fopen("/proc/interrupts", "r");
|
FILE *f = fopen("/proc/interrupts", "r");
|
||||||
|
@@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* cDemux implementation for the Tripledragon dbs3000 receiver
|
||||||
|
*
|
||||||
|
* (C) 2010-2013 Stefan Seyfried
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -349,12 +368,12 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte
|
|||||||
s_flt.filter[0] = filter[0];
|
s_flt.filter[0] = filter[0];
|
||||||
s_flt.mask[0] = mask[0];
|
s_flt.mask[0] = mask[0];
|
||||||
s_flt.timeout = timeout;
|
s_flt.timeout = timeout;
|
||||||
memcpy(&s_flt.filter[3], &filter[1], len - 1);
|
memcpy(&s_flt.filter[3], &filter[1], length - 1);
|
||||||
memcpy(&s_flt.mask[3], &mask[1], len - 1);
|
memcpy(&s_flt.mask[3], &mask[1], length - 1);
|
||||||
if (negmask != NULL)
|
if (negmask != NULL)
|
||||||
{
|
{
|
||||||
s_flt.positive[0] = negmask[0];
|
s_flt.positive[0] = negmask[0];
|
||||||
memcpy(&s_flt.positive[3], &negmask[1], len - 1);
|
memcpy(&s_flt.positive[3], &negmask[1], length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
s_flt.flags = XPDF_IMMEDIATE_START;
|
s_flt.flags = XPDF_IMMEDIATE_START;
|
||||||
|
@@ -63,6 +63,7 @@ class cDemux
|
|||||||
int getUnit(void);
|
int getUnit(void);
|
||||||
/* tripledragon is unlikely to get a second tuner, so stub it out right here */
|
/* tripledragon is unlikely to get a second tuner, so stub it out right here */
|
||||||
static bool SetSource(int /*unit*/, int /*source*/) { return true; };
|
static bool SetSource(int /*unit*/, int /*source*/) { return true; };
|
||||||
|
static int GetSource(int /*unit*/) { return 0; };
|
||||||
// TD only functions
|
// TD only functions
|
||||||
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
||||||
void removePid(unsigned short Pid); /* needed by cRecord class */
|
void removePid(unsigned short Pid); /* needed by cRecord class */
|
||||||
|
@@ -44,8 +44,6 @@ void usage()
|
|||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
printf("\t-w <time>: set FP wakeup time (time = 1: no wakeup)\n");
|
printf("\t-w <time>: set FP wakeup time (time = 1: no wakeup)\n");
|
||||||
printf("\t-P: power down\n");
|
printf("\t-P: power down\n");
|
||||||
printf("\t-l <n>: set LED <n> on\n");
|
|
||||||
printf("\t-L <n>: set LED <n> off\n");
|
|
||||||
printf("\t-B <n>: show blue RC code (n = 0..4 or \"all\")\n");
|
printf("\t-B <n>: show blue RC code (n = 0..4 or \"all\")\n");
|
||||||
printf("\t-S <n>: show standby RC code (n = 0..4 or \"all\")\n");
|
printf("\t-S <n>: show standby RC code (n = 0..4 or \"all\")\n");
|
||||||
printf("\t-B <n>:<predata><code>: set blue RC code (n = 0..4)\n");
|
printf("\t-B <n>:<predata><code>: set blue RC code (n = 0..4)\n");
|
||||||
@@ -53,6 +51,8 @@ void usage()
|
|||||||
#else
|
#else
|
||||||
printf("\t-w <time>: set FP wakeup time and power down (time = 1: no wakeup)\n");
|
printf("\t-w <time>: set FP wakeup time and power down (time = 1: no wakeup)\n");
|
||||||
#endif
|
#endif
|
||||||
|
printf("\t-l <n>: set LED <n> on\n");
|
||||||
|
printf("\t-L <n>: set LED <n> off\n");
|
||||||
printf("times are given in unix time (UTC, seconds since 1970-01-01 00:00:00)\n");
|
printf("times are given in unix time (UTC, seconds since 1970-01-01 00:00:00)\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@ int main(int argc, char **argv)
|
|||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
while ((c = getopt (argc, argv, "gs:tw:Tl:L:P:S:B:")) != -1)
|
while ((c = getopt (argc, argv, "gs:tw:Tl:L:P:S:B:")) != -1)
|
||||||
#else
|
#else
|
||||||
while ((c = getopt (argc, argv, "gs:tw:T")) != -1)
|
while ((c = getopt (argc, argv, "gs:tw:Tl:L:")) != -1)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (c)
|
||||||
@@ -244,7 +244,6 @@ int main(int argc, char **argv)
|
|||||||
sleep(2); /* not reached... */
|
sleep(2); /* not reached... */
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
#ifdef MARTII
|
|
||||||
case 'l': /* LED on */
|
case 'l': /* LED on */
|
||||||
aotom.u.led.on = LOG_ON;
|
aotom.u.led.on = LOG_ON;
|
||||||
aotom.u.led.led_nr = atoi(optarg);
|
aotom.u.led.led_nr = atoi(optarg);
|
||||||
@@ -255,7 +254,6 @@ int main(int argc, char **argv)
|
|||||||
aotom.u.led.led_nr = atoi(optarg);
|
aotom.u.led.led_nr = atoi(optarg);
|
||||||
ioctl(fd, VFDSETLED, &aotom);
|
ioctl(fd, VFDSETLED, &aotom);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case 'T':
|
case 'T':
|
||||||
ret = ioctl(fd, VFDGETVERSION, &val);
|
ret = ioctl(fd, VFDGETVERSION, &val);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Reference in New Issue
Block a user