summaryrefslogtreecommitdiff
path: root/ci.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-12-24 10:30:35 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2003-12-24 10:30:35 +0100
commit6c4e6cc666da440c2f09e4cab9ab9b8ca99e5213 (patch)
tree318631b1603be9c5ae92d6a5338f72ec797c3f47 /ci.c
parent1d32f7c0597da0d773a8eb718a171ac6dacc73ad (diff)
downloadvdr-6c4e6cc666da440c2f09e4cab9ab9b8ca99e5213.tar.gz
vdr-6c4e6cc666da440c2f09e4cab9ab9b8ca99e5213.tar.bz2
Now the CA descriptors are sent to the CAM in the 'program' or 'ES level' sections
Diffstat (limited to 'ci.c')
-rw-r--r--ci.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/ci.c b/ci.c
index d4477d55..a6f60562 100644
--- a/ci.c
+++ b/ci.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: ci.c 1.19 2003/12/23 10:19:56 kls Exp $
+ * $Id: ci.c 1.20 2003/12/24 10:23:24 kls Exp $
*/
/* XXX TODO
@@ -22,6 +22,7 @@ XXX*/
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
+#include "pat.h"
#include "tools.h"
/* these might come in handy in case you want to use this code without VDR's other files:
@@ -1266,8 +1267,9 @@ bool cCiEnquiry::Cancel(void)
#define CPCI_QUERY 0x03
#define CPCI_NOT_SELECTED 0x04
-cCiCaPmt::cCiCaPmt(int ProgramNumber)
+cCiCaPmt::cCiCaPmt(int Source, int Transponder, int ProgramNumber, const unsigned short *CaSystemIds)
{
+ caDescriptorsLength = GetCaDescriptors(Source, Transponder, ProgramNumber, CaSystemIds, sizeof(caDescriptors), caDescriptors, streamFlag);
length = 0;
capmt[length++] = CPLM_ONLY;
capmt[length++] = (ProgramNumber >> 8) & 0xFF;
@@ -1276,20 +1278,31 @@ cCiCaPmt::cCiCaPmt(int ProgramNumber)
esInfoLengthPos = length;
capmt[length++] = 0x00; // program_info_length H (at program level)
capmt[length++] = 0x00; // program_info_length L
+ if (!streamFlag)
+ AddCaDescriptors(caDescriptorsLength, caDescriptors);
+}
+
+bool cCiCaPmt::Valid(void)
+{
+ return caDescriptorsLength > 0;
}
void cCiCaPmt::AddPid(int Pid, uint8_t StreamType)
{
- //XXX buffer overflow check???
- capmt[length++] = StreamType;
- capmt[length++] = (Pid >> 8) & 0xFF;
- capmt[length++] = Pid & 0xFF;
- esInfoLengthPos = length;
- capmt[length++] = 0x00; // ES_info_length H (at ES level)
- capmt[length++] = 0x00; // ES_info_length L
+ if (Pid) {
+ //XXX buffer overflow check???
+ capmt[length++] = StreamType;
+ capmt[length++] = (Pid >> 8) & 0xFF;
+ capmt[length++] = Pid & 0xFF;
+ esInfoLengthPos = length;
+ capmt[length++] = 0x00; // ES_info_length H (at ES level)
+ capmt[length++] = 0x00; // ES_info_length L
+ if (streamFlag)
+ AddCaDescriptors(caDescriptorsLength, caDescriptors);
+ }
}
-void cCiCaPmt::AddCaDescriptor(int Length, uint8_t *Data)
+void cCiCaPmt::AddCaDescriptors(int Length, const uint8_t *Data)
{
if (esInfoLengthPos) {
if (length + Length < int(sizeof(capmt))) {