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 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#include "getstream.h"
static void input_init_pnr(struct input_s *input) {
input->pnr.program=pmt_join_pnr(input->stream->adapter,
input->pnr.pnr,
stream_send,
input->stream);
}
/*
* Static PID input - Just add a callback to the dvr demux (e.g. adapter pidtable)
* and direct it to the stream input callback
*
*/
static void input_init_pid(struct input_s *input) {
input->pid.cbkey=dvr_add_pcb(input->stream->adapter,
input->pid.pid,
DVRCB_TS,
PID_STATIC,
stream_send,
input->stream);
}
static void input_init_full(struct input_s *input) {
input->pid.cbkey=dvr_add_pcb(input->stream->adapter,
PID_MAX+1,
DVRCB_TS,
PID_STATIC,
stream_send,
input->stream);
}
void input_init(struct input_s *input) {
switch(input->type) {
case(INPUT_PNR):
input_init_pnr(input);
break;
case(INPUT_PID):
input_init_pid(input);
break;
case(INPUT_FULL):
input_init_full(input);
break;
default:
logwrite(LOG_ERROR, "input: Unknown input type %d", input->type);
break;
}
}
|