profile: added unique id (service or channel) to profile chains
This commit is contained in:
parent
aa53af579a
commit
97e7f1a86d
5 changed files with 16 additions and 16 deletions
|
@ -78,7 +78,7 @@ dvr_rec_subscribe(dvr_entry_t *de)
|
|||
|
||||
pro = de->de_config->dvr_profile;
|
||||
prch = malloc(sizeof(*prch));
|
||||
if (profile_chain_open(pro, prch, &de->de_config->dvr_muxcnf, 0, 0)) {
|
||||
if (profile_chain_open(pro, prch, de->de_channel, &de->de_config->dvr_muxcnf, 0, 0)) {
|
||||
tvherror("dvr", "unable to create new channel streaming chain for '%s'",
|
||||
channel_get_name(de->de_channel));
|
||||
return;
|
||||
|
|
|
@ -1762,7 +1762,7 @@ htsp_method_subscribe(htsp_connection_t *htsp, htsmsg_t *in)
|
|||
#endif
|
||||
|
||||
pro = profile_find_by_list(htsp->htsp_granted_access->aa_profiles, profile_id, "htsp");
|
||||
if (!profile_work(pro, &hs->hs_prch, &hs->hs_input, timeshiftPeriod, pflags)) {
|
||||
if (!profile_work(pro, &hs->hs_prch, ch, &hs->hs_input, timeshiftPeriod, pflags)) {
|
||||
tvhlog(LOG_ERR, "htsp", "unable to create profile chain '%s'", pro->pro_name);
|
||||
free(hs);
|
||||
return htsp_error("Stream setup error");
|
||||
|
|
|
@ -485,7 +485,7 @@ const idclass_t profile_htsp_class =
|
|||
|
||||
static int
|
||||
profile_htsp_work(profile_t *_pro, profile_chain_t *prch,
|
||||
streaming_target_t *dst,
|
||||
void *id, streaming_target_t *dst,
|
||||
uint32_t timeshift_period, int flags)
|
||||
{
|
||||
if (!(flags & PRCH_FLAG_SKIPZEROING))
|
||||
|
@ -548,7 +548,7 @@ const idclass_t profile_mpegts_pass_class =
|
|||
};
|
||||
|
||||
static int
|
||||
profile_mpegts_pass_open(profile_t *_pro, profile_chain_t *prch,
|
||||
profile_mpegts_pass_open(profile_t *_pro, profile_chain_t *prch, void *id,
|
||||
muxer_config_t *m_cfg, int flags, size_t qsize)
|
||||
{
|
||||
profile_mpegts_t *pro = (profile_mpegts_t *)_pro;
|
||||
|
@ -612,7 +612,7 @@ const idclass_t profile_matroska_class =
|
|||
};
|
||||
|
||||
static int
|
||||
profile_matroska_open(profile_t *_pro, profile_chain_t *prch,
|
||||
profile_matroska_open(profile_t *_pro, profile_chain_t *prch, void *id,
|
||||
muxer_config_t *m_cfg, int flags, size_t qsize)
|
||||
{
|
||||
profile_matroska_t *pro = (profile_matroska_t *)_pro;
|
||||
|
@ -884,7 +884,7 @@ const idclass_t profile_transcode_class =
|
|||
|
||||
static int
|
||||
profile_transcode_work(profile_t *_pro, profile_chain_t *prch,
|
||||
streaming_target_t *dst,
|
||||
void *id, streaming_target_t *dst,
|
||||
uint32_t timeshift_period, int flags)
|
||||
{
|
||||
profile_transcode_t *pro = (profile_transcode_t *)_pro;
|
||||
|
@ -935,7 +935,7 @@ profile_transcode_mc_valid(int mc)
|
|||
}
|
||||
|
||||
static int
|
||||
profile_transcode_open(profile_t *_pro, profile_chain_t *prch,
|
||||
profile_transcode_open(profile_t *_pro, profile_chain_t *prch, void *id,
|
||||
muxer_config_t *m_cfg, int flags, size_t qsize)
|
||||
{
|
||||
profile_transcode_t *pro = (profile_transcode_t *)_pro;
|
||||
|
@ -957,7 +957,7 @@ profile_transcode_open(profile_t *_pro, profile_chain_t *prch,
|
|||
streaming_queue_init(&prch->prch_sq, 0, qsize);
|
||||
prch->prch_gh = globalheaders_create(&prch->prch_sq.sq_st);
|
||||
|
||||
r = profile_transcode_work(_pro, prch, prch->prch_gh, 0,
|
||||
r = profile_transcode_work(_pro, prch, prch->prch_gh, id, 0,
|
||||
PRCH_FLAG_SKIPZEROING | PRCH_FLAG_TSFIX);
|
||||
if (r)
|
||||
return r;
|
||||
|
|
|
@ -84,9 +84,9 @@ typedef struct profile {
|
|||
muxer_container_type_t (*pro_get_mc)(struct profile *pro);
|
||||
|
||||
int (*pro_work)(struct profile *pro, profile_chain_t *prch,
|
||||
struct streaming_target *dst,
|
||||
void *id, struct streaming_target *dst,
|
||||
uint32_t timeshift_period, int flags);
|
||||
int (*pro_open)(struct profile *pro, profile_chain_t *prch,
|
||||
int (*pro_open)(struct profile *pro, profile_chain_t *prch, void *id,
|
||||
muxer_config_t *m_cfg, int flags, size_t qsize);
|
||||
} profile_t;
|
||||
|
||||
|
@ -97,14 +97,14 @@ profile_t *profile_create
|
|||
|
||||
static inline int
|
||||
profile_work(profile_t *pro, profile_chain_t *prch,
|
||||
struct streaming_target *dst,
|
||||
void *id, struct streaming_target *dst,
|
||||
uint32_t timeshift_period, int flags)
|
||||
{ return pro && pro->pro_work ? pro->pro_work(pro, prch, dst, timeshift_period, flags) : -1; }
|
||||
{ return pro && pro->pro_work ? pro->pro_work(pro, prch, id, dst, timeshift_period, flags) : -1; }
|
||||
|
||||
static inline int
|
||||
profile_chain_open(profile_t *pro, profile_chain_t *prch,
|
||||
profile_chain_open(profile_t *pro, profile_chain_t *prch, void *id,
|
||||
muxer_config_t *m_cfg, int flags, size_t qsize)
|
||||
{ return pro && pro->pro_open ? pro->pro_open(pro, prch, m_cfg, flags, qsize) : -1; }
|
||||
{ return pro && pro->pro_open ? pro->pro_open(pro, prch, id, m_cfg, flags, qsize) : -1; }
|
||||
int profile_chain_raw_open(profile_chain_t *prch, size_t qsize);
|
||||
void profile_chain_close(profile_chain_t *prch);
|
||||
|
||||
|
|
|
@ -732,7 +732,7 @@ http_stream_service(http_connection_t *hc, service_t *service, int weight)
|
|||
else
|
||||
qsize = 1500000;
|
||||
|
||||
if (!profile_chain_open(pro, &prch, NULL, 0, qsize)) {
|
||||
if (!profile_chain_open(pro, &prch, service, NULL, 0, qsize)) {
|
||||
|
||||
tcp_get_ip_str((struct sockaddr*)hc->hc_peer, addrbuf, 50);
|
||||
|
||||
|
@ -846,7 +846,7 @@ http_stream_channel(http_connection_t *hc, channel_t *ch, int weight)
|
|||
else
|
||||
qsize = 1500000;
|
||||
|
||||
if (!profile_chain_open(pro, &prch, NULL, 0, qsize)) {
|
||||
if (!profile_chain_open(pro, &prch, ch, NULL, 0, qsize)) {
|
||||
|
||||
tcp_get_ip_str((struct sockaddr*)hc->hc_peer, addrbuf, 50);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue