aboutsummaryrefslogtreecommitdiffstats
path: root/util/zap/zap_ca.h
blob: 5df45fd8fc377c6eae9f2c182cd3304e66f62155 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
	ZAP utility CA functions

	Copyright (C) 2004, 2005 Manu Abraham <abraham.manu@gmail.com>
	Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as
	published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public
	License along with this library; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
*/

#ifndef ZAP_CA_H
#define ZAP_CA_H 1

struct zap_ca_params {
	int adapter_id;
	int caslot_num;
	int moveca;
};

extern void zap_ca_start(struct zap_ca_params *params);
extern void zap_ca_stop(void);

extern int zap_ca_new_pmt(struct mpeg_pmt_section *pmt);
extern void zap_ca_new_dvbtime(time_t dvb_time);

#endif
audio_pid) { int vfd, afd; struct dmx_pes_filter_params pesfilter; printf ("video_pid == 0x%04x\n", video_pid); printf ("audio_pid == 0x%04x\n", audio_pid); if ((vfd = open (dmxdev, O_RDWR)) < 0) { perror("open 1"); return -1; } pesfilter.pid = video_pid; pesfilter.input = DMX_IN_FRONTEND; pesfilter.output = DMX_OUT_DECODER; pesfilter.pes_type = DMX_PES_VIDEO; pesfilter.flags = DMX_IMMEDIATE_START; if (ioctl (vfd, DMX_SET_PES_FILTER, &pesfilter) < 0) { perror("ioctl DMX_SET_PES_FILTER (video)"); return -1; } close (vfd); if ((afd = open (dmxdev, O_RDWR)) < 0) { perror("open 1"); return -1; } pesfilter.pid = audio_pid; pesfilter.input = DMX_IN_FRONTEND; pesfilter.output = DMX_OUT_DECODER; pesfilter.pes_type = DMX_PES_AUDIO; pesfilter.flags = DMX_IMMEDIATE_START; if (ioctl (afd, DMX_SET_PES_FILTER, &pesfilter) < 0) { perror("ioctl DMX_SET_PES_FILTER (audio)"); return -1; } close (afd); return 0; } int main (int argc, char **argv) { char *dmxdev = "/dev/dvb/adapter0/demux0"; int video_pid, audio_pid; if (argc != 3) { printf ("\nusage: %s <video pid> <audio pid>\n\n" USAGE, argv[0]); exit (1); } if (getenv("DEMUX")) dmxdev = getenv("DEMUX"); printf("setpid: using '%s'\n", dmxdev); video_pid = strtol(argv[1], NULL, 0); audio_pid = strtol(argv[2], NULL, 0); if (setup_demux (dmxdev, video_pid, audio_pid) < 0) return 1; return 0; }