*
*/
profile_t *
-profile_find_by_name(const char *name)
+profile_find_by_name(const char *name, const char *alt)
{
profile_t *pro;
lock_assert(&global_lock);
+ if (!name && alt) {
+ name = alt;
+ alt = NULL;
+ }
+
if (!name)
return profile_default;
return pro;
}
+ if (alt) {
+ TAILQ_FOREACH(pro, &profiles, pro_link) {
+ if (!strcmp(pro->pro_name, alt))
+ return pro;
+ }
+ }
+
return profile_default;
}
streaming_queue_deinit(&prch->prch_sq);
}
+/*
+ * HTSP Profile Class
+ */
+const idclass_t profile_htsp_class =
+{
+ .ic_super = &profile_class,
+ .ic_class = "profile-htsp",
+ .ic_caption = "HTSP Stream Profile",
+ .ic_properties = (const property_t[]){
+ /* Ready for future extensions */
+ { }
+ }
+};
+
+static muxer_container_type_t
+profile_htsp_get_mc(profile_t *_pro)
+{
+ return MC_UNKNOWN;
+}
+
+static profile_t *
+profile_htsp_builder(void)
+{
+ profile_t *pro = calloc(1, sizeof(*pro));
+ pro->pro_open = NULL;
+ pro->pro_get_mc = profile_htsp_get_mc;
+ return pro;
+}
+
/*
* MPEG-TS passthrough muxer
*/
const idclass_t profile_mpegts_pass_class =
{
- .ic_super = &profile_class,
+ .ic_super = &profile_class,
.ic_class = "profile-mpegts",
.ic_caption = "MPEG-TS Pass-through",
.ic_properties = (const property_t[]){
const idclass_t profile_matroska_class =
{
- .ic_super = &profile_class,
+ .ic_super = &profile_class,
.ic_class = "profile-matroska",
.ic_caption = "Matroska (mkv)",
.ic_properties = (const property_t[]){
const idclass_t profile_transcode_class =
{
- .ic_super = &profile_class,
+ .ic_super = &profile_class,
.ic_class = "profile-transcode",
.ic_caption = "Transcode",
.ic_properties = (const property_t[]){
{
htsmsg_t *c, *e;
htsmsg_field_t *f;
+ profile_t *pro;
+ const char *name;
LIST_INIT(&profile_builders);
TAILQ_INIT(&profiles);
profile_register(&profile_mpegts_pass_class, profile_mpegts_pass_builder);
profile_register(&profile_matroska_class, profile_matroska_builder);
+ profile_register(&profile_htsp_class, profile_htsp_builder);
#if ENABLE_LIBAV
profile_transcode_experimental_codecs =
getenv("TVHEADEND_LIBAV_NO_EXPERIMENTAL_CODECS") ? 0 : 1;
htsmsg_destroy(c);
}
- if (TAILQ_EMPTY(&profiles)) {
+ name = "pass";
+ pro = profile_find_by_name(name, NULL);
+ if (pro == NULL || strcmp(pro->pro_name, name)) {
htsmsg_t *conf;
conf = htsmsg_create_map();
htsmsg_add_str (conf, "class", "profile-mpegts");
htsmsg_add_bool(conf, "enabled", 1);
htsmsg_add_bool(conf, "default", 1);
- htsmsg_add_str (conf, "name", "pass");
+ htsmsg_add_str (conf, "name", name);
htsmsg_add_str (conf, "comment", "MPEG-TS Pass-through");
htsmsg_add_bool(conf, "rewrite_pmt", 1);
htsmsg_add_bool(conf, "rewrite_pat", 1);
htsmsg_add_bool(conf, "shield", 1);
(void)profile_create(NULL, conf, 1);
htsmsg_destroy(conf);
+ }
+
+ name = "matroska";
+ pro = profile_find_by_name(name, NULL);
+ if (pro == NULL || strcmp(pro->pro_name, name)) {
+ htsmsg_t *conf;
conf = htsmsg_create_map();
htsmsg_add_str (conf, "class", "profile-matroska");
htsmsg_add_bool(conf, "enabled", 1);
- htsmsg_add_str (conf, "name", "matroska");
+ htsmsg_add_str (conf, "name", name);
htsmsg_add_str (conf, "comment", "Matroska");
htsmsg_add_bool(conf, "shield", 1);
(void)profile_create(NULL, conf, 1);
htsmsg_destroy(conf);
}
+ name = "htsp";
+ pro = profile_find_by_name(name, NULL);
+ if (pro == NULL || strcmp(pro->pro_name, name)) {
+ htsmsg_t *conf;
+
+ conf = htsmsg_create_map();
+ htsmsg_add_str (conf, "class", "profile-htsp");
+ htsmsg_add_bool(conf, "enabled", 1);
+ htsmsg_add_str (conf, "name", name);
+ htsmsg_add_str (conf, "comment", "HTSP Default Stream Settings");
+ htsmsg_add_bool(conf, "shield", 1);
+ (void)profile_create(NULL, conf, 1);
+ htsmsg_destroy(conf);
+ }
+
#if ENABLE_LIBAV
- profile_t *pro;
- const char *name;
name = "webtv-vp8-vorbis-webm";
- pro = profile_find_by_name(name);
+ pro = profile_find_by_name(name, NULL);
if (pro == NULL || strcmp(pro->pro_name, name)) {
htsmsg_t *conf;
htsmsg_destroy(conf);
}
name = "webtv-h264-aac-mpegts";
- pro = profile_find_by_name(name);
+ pro = profile_find_by_name(name, NULL);
if (pro == NULL || strcmp(pro->pro_name, name)) {
htsmsg_t *conf;
htsmsg_destroy(conf);
}
name = "webtv-h264-aac-matroska";
- pro = profile_find_by_name(name);
+ pro = profile_find_by_name(name, NULL);
if (pro == NULL || strcmp(pro->pro_name, name)) {
htsmsg_t *conf;