Include source adapter and DVB network in subscription start message.
This commit is contained in:
parent
b47bc31d97
commit
1c2168f754
5 changed files with 27 additions and 10 deletions
|
@ -242,7 +242,7 @@ dvr_rec_fatal_error(dvr_entry_t *de, const char *fmt, ...)
|
|||
*
|
||||
*/
|
||||
static void
|
||||
dvr_rec_start(dvr_entry_t *de, htsmsg_t *streams)
|
||||
dvr_rec_start(dvr_entry_t *de, htsmsg_t *m)
|
||||
{
|
||||
dvr_rec_stream_t *drs;
|
||||
AVOutputFormat *fmt;
|
||||
|
@ -255,10 +255,13 @@ dvr_rec_start(dvr_entry_t *de, htsmsg_t *streams)
|
|||
char urlname[512];
|
||||
int err;
|
||||
htsmsg_field_t *f;
|
||||
htsmsg_t *sub;
|
||||
htsmsg_t *sub, *streams;
|
||||
const char *type, *lang;
|
||||
uint32_t idx;
|
||||
|
||||
if((streams = htsmsg_get_list(m, "streams")) == NULL)
|
||||
abort();
|
||||
|
||||
if(pvr_generate_filename(de) != 0) {
|
||||
dvr_rec_fatal_error(de, "Unable to create directories");
|
||||
return;
|
||||
|
@ -301,6 +304,7 @@ dvr_rec_start(dvr_entry_t *de, htsmsg_t *streams)
|
|||
|
||||
av_set_parameters(fctx, NULL);
|
||||
|
||||
|
||||
/**
|
||||
* Setup each stream
|
||||
*/
|
||||
|
@ -368,6 +372,12 @@ dvr_rec_start(dvr_entry_t *de, htsmsg_t *streams)
|
|||
|
||||
de->de_fctx = fctx;
|
||||
de->de_ts_offset = AV_NOPTS_VALUE;
|
||||
|
||||
tvhlog(LOG_INFO, "dvr",
|
||||
"%s - Recording from %s (%s)",
|
||||
de->de_ititle,
|
||||
htsmsg_get_str(m, "source"), htsmsg_get_str(m, "network"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1113,12 +1113,10 @@ htsp_stream_deliver(htsp_subscription_t *hs, th_pkt_t *pkt)
|
|||
* delivery start and all components.
|
||||
*/
|
||||
static void
|
||||
htsp_subscription_start(htsp_subscription_t *hs, htsmsg_t *streams)
|
||||
htsp_subscription_start(htsp_subscription_t *hs, htsmsg_t *m)
|
||||
{
|
||||
htsmsg_t *m = htsmsg_create_map();
|
||||
htsmsg_add_str(m, "method", "subscriptionStart");
|
||||
htsmsg_add_u32(m, "subscriptionId", hs->hs_sid);
|
||||
htsmsg_add_msg(m, "streams", streams);
|
||||
htsp_send(hs->hs_htsp, m, NULL, &hs->hs_q, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,9 @@ subscription_link_transport(th_subscription_t *s, th_transport_t *t)
|
|||
streaming_target_connect(&t->tht_streaming_pad, &s->ths_input);
|
||||
|
||||
// Send a START message to the subscription client
|
||||
sm = streaming_msg_create_msg(SMT_START, transport_build_stream_msg(t));
|
||||
sm = streaming_msg_create_msg(SMT_START,
|
||||
transport_build_stream_start_msg(t));
|
||||
|
||||
streaming_target_deliver(s->ths_output, sm);
|
||||
|
||||
// Send a TRANSPORT_STATUS message to the subscription client
|
||||
|
|
|
@ -687,15 +687,18 @@ transport_status_to_text(int status)
|
|||
* great care if you change anying. (Just adding is fine)
|
||||
*/
|
||||
htsmsg_t *
|
||||
transport_build_stream_msg(th_transport_t *t)
|
||||
transport_build_stream_start_msg(th_transport_t *t)
|
||||
{
|
||||
htsmsg_t *streams, *c;
|
||||
htsmsg_t *m, *streams, *c;
|
||||
th_stream_t *st;
|
||||
|
||||
lock_assert(&t->tht_stream_mutex);
|
||||
|
||||
m = htsmsg_create_map();
|
||||
|
||||
/* Setup each stream */
|
||||
streams = htsmsg_create_list();
|
||||
|
||||
LIST_FOREACH(st, &t->tht_components, st_link) {
|
||||
c = htsmsg_create_map();
|
||||
htsmsg_add_u32(c, "index", st->st_index);
|
||||
|
@ -704,7 +707,11 @@ transport_build_stream_msg(th_transport_t *t)
|
|||
htsmsg_add_str(c, "language", st->st_lang);
|
||||
htsmsg_add_msg(streams, NULL, c);
|
||||
}
|
||||
return streams;
|
||||
|
||||
htsmsg_add_msg(m, "streams", streams);
|
||||
htsmsg_add_str(m, "network", t->tht_networkname(t));
|
||||
htsmsg_add_str(m, "source", t->tht_sourcename(t));
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ transport_find_stream_by_pid(th_transport_t *t, int pid)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
htsmsg_t *transport_build_stream_msg(th_transport_t *t);
|
||||
htsmsg_t *transport_build_stream_start_msg(th_transport_t *t);
|
||||
|
||||
|
||||
#endif /* TRANSPORTS_H */
|
||||
|
|
Loading…
Add table
Reference in a new issue