Skip to content

Commit

Permalink
Add F-MST model, resolve issue #17
Browse files Browse the repository at this point in the history
Create call for DMX_STOP, resolve issue #22
  • Loading branch information
harlequin committed Jul 8, 2016
1 parent ae80480 commit 37334ac
Show file tree
Hide file tree
Showing 5 changed files with 386 additions and 7 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ ifeq ($(PLATFORM), F)
CFLAGS +=
endif

ifeq ($(PLATFORM), F-MST)
LIB_TV_MODEL=${PLATFORM}
APP_OBJ += models/serie_f.o
CFLAGS +=
endif

OBJS = $(APP_OBJ)
LIB:=libdvbapi-${PLATFORM}-${TAG}.so

Expand Down
12 changes: 5 additions & 7 deletions dvbapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,11 @@ static void *socket_handler(void *ptr){
}

else if (*request == DVBAPI_DMX_STOP) {
log("<< DVBAPI_DMX_STOP request ...\n");
// stopMonitors();
// unsigned char demux_index = buf[4];
// unsigned char filter_num = buf[5];
// u16 *pid_ptr = (u16 *) &buf[6];
// u16 pid = ntohs(*pid_ptr);
// log("<< DMX_STOP request, adapter_index=%d, pid=%X, demux_idx=%d, filter_num=%d\n", __FUNCTION__, adapter_index, pid, demux_index, filter_num);
u8 demux_index = buf[4];
u8 filter_num = buf[5];
u16 *pid_ptr = (u16 *) &buf[6];
u16 pid = ntohs(*pid_ptr);
dvbapi_dmx_stop(demux_index, filter_num, pid);
}


Expand Down
1 change: 1 addition & 0 deletions models.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ int dvbapi_server_info(void);
int dvbapi_set_descriptor(ca_descr_t ca_descr);
int dvbapi_start_filter(u8 demux_index, u8 filter_num, struct dmx_sct_filter_params params);

void dvbapi_dmx_stop(u8 demux_index, u8 filter_num, u16 pid);

#endif /* MODELS_H_ */
10 changes: 10 additions & 0 deletions models/serie_d_mst.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,16 @@ int dvbapi_set_descriptor(ca_descr_t ca_descr) {
return g_fltDscmb;
}

void dvbapi_dmx_stop(u8 demux_index, u8 filter_num, u16 pid) {
demux_filter_t *filter;
log("DVBAPI_DMX_STOP request, pid=%X, demux_idx=%d, filter_num=%d\n", pid, demux_index, filter_num);
LL_SEARCH_SCALAR(g_demux_filter, filter, filterId, filter_num);
if(filter) {
u32 res = api_callbacks.SdTSData_StopMonitor( g_dmxHandle, filter->monHandle & 0x7FFFFFFF );
log("Monitor stopped, idx=0x%02X, flt=0x%02X, dmxHandle=0x%08X, monHandle=0x%08X, ret=0x%08X\n", demux_index, filter_num, g_dmxHandle, filter->monHandle & 0x7FFFFFFF, res);
}
}

int dvbapi_start_filter(u8 demux_index, u8 filter_num, struct dmx_sct_filter_params params){
/* This pid zero still occurs because the pmt is not send correctly */
if ( ntohs(params.pid) != 0x00 ) {
Expand Down
Loading

0 comments on commit 37334ac

Please sign in to comment.