mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 15:33:00 +02:00
libtriple: add getPesPids() and removePid() to cDemux
This commit is contained in:
@@ -426,6 +426,28 @@ void cDemux::addPid(unsigned short Pid)
|
||||
return;
|
||||
}
|
||||
|
||||
void cDemux::removePid(unsigned short Pid)
|
||||
{
|
||||
if (dmx_type != DMX_TP_CHANNEL)
|
||||
{
|
||||
fprintf(stderr, "cDemux::%s pes_type!=DMX_TP_CHANNEL (%s) not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
|
||||
return;
|
||||
}
|
||||
for (std::vector<pes_pids>::iterator i = pesfds.begin(); i != pesfds.end(); ++i)
|
||||
{
|
||||
if ((*i).pid == Pid) {
|
||||
lt_debug("cDemux::removePid: removing demux fd %d pid 0x%04x\n", (*i).fd, Pid);
|
||||
if (ioctl((*i).fd, DEMUX_STOP) < 0)
|
||||
perror("DEMUX_STOP");
|
||||
if (close((*i).fd) < 0)
|
||||
perror("close");
|
||||
pesfds.erase(i);
|
||||
return; /* TODO: what if the same PID is there multiple times */
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "cDemux::removePid: pid 0x%04x not found\n", Pid);
|
||||
}
|
||||
|
||||
void cDemux::getSTC(int64_t * STC)
|
||||
{
|
||||
lt_debug("cDemux::%s #%d\n", __FUNCTION__, num);
|
||||
|
@@ -54,7 +54,10 @@ class cDemux
|
||||
void addPid(unsigned short pid);
|
||||
void getSTC(int64_t * STC);
|
||||
int getUnit(void);
|
||||
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
||||
// TD only functions
|
||||
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
||||
void removePid(unsigned short Pid); /* needed by cRecord class */
|
||||
std::vector<pes_pids> getPesPids(void) { return pesfds; };
|
||||
//
|
||||
cDemux(int num = 0);
|
||||
~cDemux();
|
||||
|
Reference in New Issue
Block a user