]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
profile: added unique id (service or channel) to profile chains
authorJaroslav Kysela <perex@perex.cz>
Wed, 22 Oct 2014 12:48:57 +0000 (14:48 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 22 Oct 2014 12:48:57 +0000 (14:48 +0200)
src/dvr/dvr_rec.c
src/htsp_server.c
src/profile.c
src/profile.h
src/webui/webui.c

index f9e41b12e7d5c7ab60b85129d5f7794142d267eb..cde75a6ab838221bd0e29df419bf69146151adc6 100644 (file)
@@ -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;
index 2d71827e8cc37517876ce3f5ff76c67d6f0c6141..013b8765315cbf4515ce191809661363bbc990c3 100644 (file)
@@ -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");
index b6c3edf07fbe087d0ff80e334fe0e49445cb5b5e..aa6f62eb6b0bd37fcacb53e55e90087d71e7bde9 100644 (file)
@@ -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;
index 00a1ed3651daf4de285deab8a472d306479f44e0..5fc715772a4562e1f1b44571a26265f1a2a9f21c 100644 (file)
@@ -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);
 
index 45428d0a22140d288d4f66591cba9dea44f7d759..32cee231f04b499044288bc1f3f336c7bb7dfc8d 100644 (file)
@@ -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);