Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bouquet,fastscan: initial implementation
  • Loading branch information
perexg committed Nov 8, 2014
1 parent a9b1d17 commit 7134315
Show file tree
Hide file tree
Showing 21 changed files with 899 additions and 24 deletions.
7 changes: 5 additions & 2 deletions Makefile
Expand Up @@ -152,7 +152,8 @@ SRCS = src/version.c \
src/cron.c \
src/esfilter.c \
src/intlconv.c \
src/profile.c
src/profile.c \
src/bouquet.c

SRCS-${CONFIG_UPNP} += \
src/upnp.c
Expand All @@ -173,7 +174,8 @@ SRCS += \
src/api/api_access.c \
src/api/api_dvr.c \
src/api/api_caclient.c \
src/api/api_profile.c
src/api/api_profile.c \
src/api/api_bouquet.c

SRCS += \
src/parsers/parsers.c \
Expand Down Expand Up @@ -229,6 +231,7 @@ SRCS-$(CONFIG_MPEGTS) += \
src/input/mpegts/dvb_support.c \
src/input/mpegts/dvb_charset.c \
src/input/mpegts/dvb_psi.c \
src/input/mpegts/fastscan.c \
src/input/mpegts/tsdemux.c \
src/input/mpegts/mpegts_mux_sched.c \
src/input/mpegts/mpegts_network_scan.c \
Expand Down
50 changes: 50 additions & 0 deletions data/conf/fastscan
@@ -0,0 +1,50 @@
[
{
"name": "Canal Digitaal",
"position": 192,
"frequency": 12515000,
"pid": 900
},
{
"name": "TV Vlaanderen",
"position": 192,
"frequency": 12515000,
"pid": 901
},
{
"name": "TéléSAT",
"position": 192,
"frequency": 12515000,
"pid": 920
},
{
"name": "Mobistar NL",
"position": 192,
"frequency": 12515000,
"pid": 930
},
{
"name": "Mobistar FR",
"position": 192,
"frequency": 12515000,
"pid": 940
},
{
"name": "AustriaSat",
"position": 192,
"frequency": 12515000,
"pid": 950
},
{
"name": "Skylink: Czech Republic",
"position": 235,
"frequency": 12070000,
"pid": 30
},
{
"name": "Skylink: Slovak Republic",
"position": 235,
"frequency": 12070000,
"pid": 31
}
]
1 change: 1 addition & 0 deletions src/api.c
Expand Up @@ -125,6 +125,7 @@ void api_init ( void )
api_mpegts_init();
api_service_init();
api_channel_init();
api_bouquet_init();
api_epg_init();
api_epggrab_init();
api_status_init();
Expand Down
1 change: 1 addition & 0 deletions src/api.h
Expand Up @@ -64,6 +64,7 @@ void api_idnode_init ( void );
void api_input_init ( void );
void api_service_init ( void );
void api_channel_init ( void );
void api_bouquet_init ( void );
void api_mpegts_init ( void );
void api_epg_init ( void );
void api_epggrab_init ( void );
Expand Down
70 changes: 70 additions & 0 deletions src/api/api_bouquet.c
@@ -0,0 +1,70 @@
/*
* API - bouquet calls
*
* Copyright (C) 2014 Jaroslav Kysela
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __TVH_API_BOUQUET_H__
#define __TVH_API_BOUQUET_H__

#include "tvheadend.h"
#include "bouquet.h"
#include "access.h"
#include "api.h"

static void
api_bouquet_grid
( access_t *perm, idnode_set_t *ins, api_idnode_grid_conf_t *conf )
{
bouquet_t *bq;

RB_FOREACH(bq, &bouquets, bq_link)
idnode_set_add(ins, (idnode_t*)bq, &conf->filter);
}

static int
api_bouquet_create
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
htsmsg_t *conf;
bouquet_t *bq;

if (!(conf = htsmsg_get_map(args, "conf")))
return EINVAL;

pthread_mutex_lock(&global_lock);
bq = bouquet_create(NULL, conf, NULL, NULL);
if (bq)
bouquet_save(bq, 0);
pthread_mutex_unlock(&global_lock);

return 0;
}

void api_bouquet_init ( void )
{
static api_hook_t ah[] = {
{ "bouquet/class", ACCESS_ADMIN, api_idnode_class, (void*)&bouquet_class },
{ "bouquet/grid", ACCESS_ADMIN, api_idnode_grid, api_bouquet_grid },
{ "bouquet/create", ACCESS_ADMIN, api_bouquet_create, NULL },

{ NULL },
};

api_register_all(ah);
}

#endif /* __TVH_API_BOUQUET_H__ */
6 changes: 3 additions & 3 deletions src/api/api_channel.c
Expand Up @@ -17,8 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __TVH_API_SERVICE_H__
#define __TVH_API_SERVICE_H__
#ifndef __TVH_API_CHANNEL_H__
#define __TVH_API_CHANNEL_H__

#include "tvheadend.h"
#include "channels.h"
Expand Down Expand Up @@ -145,4 +145,4 @@ void api_channel_init ( void )
}


#endif /* __TVH_API_IDNODE_H__ */
#endif /* __TVH_API_CHANNEL_H__ */
2 changes: 1 addition & 1 deletion src/api/api_service.c
Expand Up @@ -199,4 +199,4 @@ void api_service_init ( void )
}


#endif /* __TVH_API_IDNODE_H__ */
#endif /* __TVH_API_SERVICE_H__ */

0 comments on commit 7134315

Please sign in to comment.