[dvblast-devel] streaming pid to ip address

Georgi Chorbadzhiyski gf at unixsol.org
Fri Dec 2 12:45:54 CET 2011


Around 12/02/2011 01:32 PM, Georgi Chorbadzhiyski scribbled:
> Around 12/02/2011 12:16 AM, JULIAN GARDNER scribbled:
>> Thanks for the help the other day but I have another problem
>>
>> 224.10.10.10:1234 1 0 18
>>
>> This is supposed to stream the EIT data to 224.10.10.10:1234 but if i grab this data and look at the file i see the TS headers
>>
>> 47 40 c0 ...
>> 47 40 f0 ...
>> 47 40 c0 ....
>>
>> but i only see maybe 10 in 1000 of the "47 40 12 ..." packets, any ideas
> 
> Hmm, may be something is wrong with your setup, because it sort of works for me.
> See I tried:
> 
> ./dvblast -D 239.127.127.1:5000/udp -e -c dvblast.conf
> 
> with the following dvblast.conf:
> 239.78.78.78:5000/udp/ecm/emm   1   0   18
> 
> When I dump dvblast output from 239.127.127.1:5000 I see only pids
> 0x00    /0/  (pat)
> 0x10    /16/ (nit)
> 0x12    /18/ (eit)
> 0x1fff (null)
> 
> arguably I should be seeing only pid 0x12 (18) but that is not a big problem.
> It seems that setting pid in the conf file sort of works.
> 
> when I apply the following hack:
> 
> diff --git a/demux.c b/demux.c
> index ee0e827..a1276e6 100644
> --- a/demux.c
> +++ b/demux.c
> @@ -159,8 +159,8 @@ void demux_Open( void )
> 
>      psi_table_init( pp_current_pat_sections );
>      psi_table_init( pp_next_pat_sections );
> -    SetPID(PAT_PID);
> -    p_pids[PAT_PID].i_psi_refcount++;
> +//    SetPID(PAT_PID);
> +//    p_pids[PAT_PID].i_psi_refcount++;
> 
>      if ( b_enable_emm ) {
>          psi_table_init( pp_current_cat_sections );
> @@ -169,8 +169,8 @@ void demux_Open( void )
>          p_pids[CAT_PID].i_psi_refcount++;
>      }
> 
> -    SetPID(NIT_PID);
> -    p_pids[NIT_PID].i_psi_refcount++;
> +//    SetPID(NIT_PID);
> +//    p_pids[NIT_PID].i_psi_refcount++;
> 
>      psi_table_init( pp_current_sdt_sections );
>      psi_table_init( pp_next_sdt_sections );
> 
> I start seeing only eit and null packets on the output. I can cook a patch
> to add nopat and nonit options to output config. Thoughts?

The attached hack works but it is not a good idea. Better way will be to add
output option that instructs dvblast to output ONLY the pids mentioned in
output config and not add anything from him (pat, nit). Hmmm...

-- 
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
-------------- next part --------------
diff --git a/README b/README
index 296df5e..1e681cd 100644
--- a/README
+++ b/README
@@ -146,6 +146,8 @@ Available options include :
  /mtu=XXXX (sets the maximum UDP packet size)
  /ecm or /noecm (pass-through ECM packets or not)
  /emm or /noemm (pass-through EMM packets or not)
+ /skip_pat (Do not write PAT packets into output)
+ /skip_nit (Do not write NIT packets into output)
  /srvname=Some_Channel (set service name in SDT)
  /srvprovider=Some_Provider (set provider name in SDT)
 
diff --git a/dvblast.c b/dvblast.c
index a0e6a5d..7d223b2 100644
--- a/dvblast.c
+++ b/dvblast.c
@@ -230,6 +230,10 @@ bool config_ParseHost( output_config_t *p_config, char *psz_string )
             p_config->i_config |= OUTPUT_ECM;
         else if ( IS_OPTION("noecm") )
             p_config->i_config &= ~OUTPUT_ECM;
+        else if ( IS_OPTION("skip_pat") )
+            p_config->i_config |= OUTPUT_SKIP_PAT;
+        else if ( IS_OPTION("skip_nit") )
+            p_config->i_config |= OUTPUT_SKIP_NIT;
         else if ( IS_OPTION("tsid=") )
             p_config->i_tsid = strtol( ARG_OPTION("tsid="), NULL, 0 );
         else if ( IS_OPTION("retention=") )
diff --git a/dvblast.h b/dvblast.h
index 40ce4c4..04836c0 100644
--- a/dvblast.h
+++ b/dvblast.h
@@ -65,6 +65,8 @@
 #define OUTPUT_EPG           0x40
 #define OUTPUT_EMM           (1 << 7)
 #define OUTPUT_ECM           (1 << 8)
+#define OUTPUT_SKIP_PAT      (1 << 9)
+#define OUTPUT_SKIP_NIT      (1 << 10)
 
 typedef int64_t mtime_t;
 
diff --git a/output.c b/output.c
index 0cc5bf7..f31799a 100644
--- a/output.c
+++ b/output.c
@@ -38,6 +38,8 @@
 #include "dvblast.h"
 
 #include <bitstream/mpeg/ts.h>
+#include <bitstream/mpeg/psi.h>
+#include <bitstream/dvb/si.h>
 #include <bitstream/ietf/rtp.h>
 
 /*****************************************************************************
@@ -312,6 +314,13 @@ void output_Put( output_t *p_output, block_t *p_block )
 {
     int i_block_cnt = output_BlockCount( p_output );
     packet_t *p_packet;
+    uint16_t i_pid = ts_get_pid(p_block->p_ts);
+
+    if ( i_pid == PAT_PID && p_output->config.i_config & OUTPUT_SKIP_PAT )
+        return;
+
+    if ( i_pid == NIT_PID && p_output->config.i_config & OUTPUT_SKIP_NIT )
+        return;
 
     p_block->i_refcount++;
 


More information about the dvblast-devel mailing list