libtriple: add cRecord::AddPid

This commit is contained in:
Stefan Seyfried
2011-10-01 20:30:14 +02:00
parent 776f4ba518
commit 1ba4e043c2
2 changed files with 17 additions and 0 deletions

View File

@@ -158,6 +158,22 @@ bool cRecord::ChangePids(unsigned short /*vpid*/, unsigned short *apids, int num
return true;
}
bool cRecord::AddPid(unsigned short pid)
{
std::vector<pes_pids> pids;
INFO("\n");
if (!dmx) {
INFO("DMX = NULL\n");
return false;
}
pids = dmx->getPesPids();
for (std::vector<pes_pids>::const_iterator i = pids.begin(); i != pids.end(); ++i) {
if ((*i).pid == pid)
return true; /* or is it an error to try to add the same PID twice? */
}
return dmx->addPid(pid);
}
void cRecord::RecordThread()
{
INFO("begin\n");

View File

@@ -28,6 +28,7 @@ class cRecord
bool Open();
bool Start(int fd, unsigned short vpid, unsigned short *apids, int numapids);
bool Stop(void);
bool AddPid(unsigned short pid);
bool ChangePids(unsigned short vpid, unsigned short *apids, int numapids);
void RecordThread();