|
SASC-NG
DVBSoftCAM
|
00001 /* 00002 * Softcam plugin to VDR (C++) 00003 * 00004 * This code is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This code is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 00018 */ 00019 00020 #define SC_NAME "sc" 00021 #define SC_MAGIC { 0,'S','C',0xc4,0x5e,0xa2 } 00022 00023 #define OP_PROVIDES 0 00024 #define OP_ADDPID 1 00025 #define OP_DELPID 2 00026 #define OP_TUNE 3 00027 #define OP_ALLOWED 4 00028 00029 struct ScLink { 00030 char magic[6]; 00031 short op; 00032 const cDevice *dev; 00033 union { 00034 unsigned short *caids; 00035 struct { 00036 int pid; 00037 int type; 00038 } pids; 00039 struct { 00040 int source; 00041 int transponder; 00042 } tune; 00043 } data; 00044 int num; 00045 }; 00046 00047 static const char magic[] = SC_MAGIC; 00048 00049 void PrepareScLink(struct ScLink *link, const cDevice *dev, int op) 00050 { 00051 memcpy(link->magic,magic,sizeof(link->magic)); 00052 link->op=op; 00053 link->dev=dev; 00054 link->num=-1; 00055 } 00056 00057 int DoScLinkOp(cPlugin *p, struct ScLink *link) 00058 { 00059 if(p) { 00060 p->SetupParse((const char *)link,""); 00061 return link->num; 00062 } 00063 return -1; 00064 } 00065