Re-instance signalStatus HTSP message using new streaming message.
This commit is contained in:
parent
30a3896520
commit
b9f5ba6dfc
8 changed files with 68 additions and 0 deletions
|
@ -39,6 +39,8 @@
|
|||
#include "diseqc.h"
|
||||
#include "notify.h"
|
||||
#include "dvr/dvr.h"
|
||||
#include "service.h"
|
||||
#include "streaming.h"
|
||||
|
||||
#include "epggrab.h"
|
||||
|
||||
|
@ -91,6 +93,9 @@ dvb_fe_monitor(void *aux)
|
|||
int status, v, update = 0, vv, i, fec, q;
|
||||
th_dvb_mux_instance_t *tdmi = tda->tda_mux_current;
|
||||
char buf[50];
|
||||
signal_status_t sigstat;
|
||||
streaming_message_t sm;
|
||||
struct service *t;
|
||||
|
||||
gtimer_arm(&tda->tda_fe_monitor_timer, dvb_fe_monitor, tda, 1);
|
||||
|
||||
|
@ -194,6 +199,22 @@ dvb_fe_monitor(void *aux)
|
|||
|
||||
dvb_mux_save(tdmi);
|
||||
}
|
||||
|
||||
/* Streaming message */
|
||||
sigstat.status_text = dvb_mux_status(tdmi);
|
||||
sigstat.snr = tdmi->tdmi_snr;
|
||||
sigstat.signal = tdmi->tdmi_signal;
|
||||
sigstat.ber = tdmi->tdmi_ber;
|
||||
sigstat.unc = tdmi->tdmi_uncorrected_blocks;
|
||||
sm.sm_type = SMT_SIGNAL_STATUS;
|
||||
sm.sm_data = &sigstat;
|
||||
LIST_FOREACH(t, &tda->tda_transports, s_active_link)
|
||||
if(t->s_dvb_mux_instance == tda->tda_mux_current && t->s_status == SERVICE_RUNNING ) {
|
||||
pthread_mutex_lock(&t->s_stream_mutex);
|
||||
streaming_pad_deliver(&t->s_streaming_pad, &sm);
|
||||
pthread_mutex_unlock(&t->s_stream_mutex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -516,6 +516,9 @@ dvr_thread(void *aux)
|
|||
}
|
||||
break;
|
||||
|
||||
case SMT_SIGNAL_STATUS:
|
||||
break;
|
||||
|
||||
case SMT_EXIT:
|
||||
run = 0;
|
||||
break;
|
||||
|
|
25
src/htsp.c
25
src/htsp.c
|
@ -1915,6 +1915,27 @@ htsp_subscription_service_status(htsp_subscription_t *hs, int status)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
static void
|
||||
htsp_subscription_signal_status(htsp_subscription_t *hs, signal_status_t *sig)
|
||||
{
|
||||
htsmsg_t *m = htsmsg_create_map();
|
||||
htsmsg_add_str(m, "method", "signalStatus");
|
||||
htsmsg_add_u32(m, "subscriptionId", hs->hs_sid);
|
||||
htsmsg_add_str(m, "feStatus", sig->status_text);
|
||||
if(sig->snr != -2)
|
||||
htsmsg_add_u32(m, "feSNR", sig->snr);
|
||||
if(sig->signal != -2)
|
||||
htsmsg_add_u32(m, "feSignal", sig->signal);
|
||||
if(sig->ber != -2)
|
||||
htsmsg_add_u32(m, "feBER", sig->ber);
|
||||
if(sig->unc != -2)
|
||||
htsmsg_add_u32(m, "feUNC", sig->unc);
|
||||
htsp_send_message(hs->hs_htsp, m, &hs->hs_htsp->htsp_hmq_qstatus);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -1941,6 +1962,10 @@ htsp_streaming_input(void *opaque, streaming_message_t *sm)
|
|||
htsp_subscription_service_status(hs, sm->sm_code);
|
||||
break;
|
||||
|
||||
case SMT_SIGNAL_STATUS:
|
||||
htsp_subscription_signal_status(hs, sm->sm_data);
|
||||
break;
|
||||
|
||||
case SMT_NOSTART:
|
||||
htsp_subscription_status(hs, streaming_code2txt(sm->sm_code));
|
||||
break;
|
||||
|
|
|
@ -252,6 +252,7 @@ gh_hold(globalheaders_t *gh, streaming_message_t *sm)
|
|||
|
||||
case SMT_EXIT:
|
||||
case SMT_SERVICE_STATUS:
|
||||
case SMT_SIGNAL_STATUS:
|
||||
case SMT_NOSTART:
|
||||
case SMT_MPEGTS:
|
||||
streaming_target_deliver2(gh->gh_output, sm);
|
||||
|
@ -279,6 +280,7 @@ gh_pass(globalheaders_t *gh, streaming_message_t *sm)
|
|||
// FALLTHRU
|
||||
case SMT_EXIT:
|
||||
case SMT_SERVICE_STATUS:
|
||||
case SMT_SIGNAL_STATUS:
|
||||
case SMT_NOSTART:
|
||||
case SMT_MPEGTS:
|
||||
streaming_target_deliver2(gh->gh_output, sm);
|
||||
|
|
|
@ -363,6 +363,7 @@ tsfix_input(void *opaque, streaming_message_t *sm)
|
|||
|
||||
case SMT_EXIT:
|
||||
case SMT_SERVICE_STATUS:
|
||||
case SMT_SIGNAL_STATUS:
|
||||
case SMT_NOSTART:
|
||||
case SMT_MPEGTS:
|
||||
break;
|
||||
|
|
|
@ -182,6 +182,11 @@ streaming_msg_clone(streaming_message_t *src)
|
|||
atomic_add(&ss->ss_refcount, 1);
|
||||
break;
|
||||
|
||||
case SMT_SIGNAL_STATUS:
|
||||
dst->sm_data = malloc(sizeof(signal_status_t));
|
||||
memcpy(dst->sm_data, src->sm_data, sizeof(signal_status_t));
|
||||
break;
|
||||
|
||||
case SMT_STOP:
|
||||
case SMT_SERVICE_STATUS:
|
||||
case SMT_NOSTART:
|
||||
|
@ -250,6 +255,7 @@ streaming_msg_free(streaming_message_t *sm)
|
|||
case SMT_NOSTART:
|
||||
break;
|
||||
|
||||
case SMT_SIGNAL_STATUS:
|
||||
case SMT_MPEGTS:
|
||||
free(sm->sm_data);
|
||||
break;
|
||||
|
|
|
@ -235,6 +235,13 @@ typedef enum {
|
|||
*/
|
||||
SMT_SERVICE_STATUS,
|
||||
|
||||
/**
|
||||
* Signal status
|
||||
*
|
||||
* Notification about frontend signal status
|
||||
*/
|
||||
SMT_SIGNAL_STATUS,
|
||||
|
||||
/**
|
||||
* Streaming stop.
|
||||
*
|
||||
|
|
|
@ -222,6 +222,9 @@ http_stream_run(http_connection_t *hc, streaming_queue_t *sq,
|
|||
}
|
||||
break;
|
||||
|
||||
case SMT_SIGNAL_STATUS:
|
||||
break;
|
||||
|
||||
case SMT_NOSTART:
|
||||
tvhlog(LOG_DEBUG, "webui", "Couldn't start stream for %s", hc->hc_url_orig);
|
||||
run = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue