Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dvblast
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
dvblast
Commits
227d4e2d
Commit
227d4e2d
authored
Jan 03, 2010
by
Andy Gatward
Committed by
Christophe Massiot
Jan 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added IPv6 support for output and duplicate (-d) targets. See INSTALL file for usage info.
parent
f447c22a
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
303 additions
and
79 deletions
+303
-79
AUTHORS
AUTHORS
+3
-2
INSTALL
INSTALL
+19
-2
NEWS
NEWS
+7
-0
demux.c
demux.c
+3
-3
dvblast.c
dvblast.c
+198
-41
dvblast.h
dvblast.h
+15
-7
output.c
output.c
+58
-24
No files found.
AUTHORS
View file @
227d4e2d
...
...
@@ -7,14 +7,15 @@
# The fields are: name (N), email (E), web-address (W), CVS account login (C),
# PGP key ID and fingerprint (P), description (D), and snail-mail address (S).
N: Marian
Ďurkovič
N: Marian
Durkovic
E: md AT bts DOT sk
C: md
D: numerous bug fixes
N: Andy Gatward
E: a DOT j DOT gatward AT reading DOT ac DOT uk
D: EIT pass-through mode and misc fixes
C: gatty
D: EIT pass-through, IPv6 support, various bug fixes
N: Christophe Massiot
E: massiot AT via DOT ecp DOT fr
...
...
INSTALL
View file @
227d4e2d
...
...
@@ -40,6 +40,17 @@ For instance :
The configuration file can be reloaded by sending "HUP" to the program, or
via the dvblastctl program.
IPv6 is supported, the destination address must be specified in the format
described by RFC2732. When using link-local scope addresses, it is
mandatory to include the interface name in the address, as shown in the
example below. If you do not include the interface name, you will see an
"invalid argument" error. The interface name is optional for site-local and
global scope addresses.
For example :
[ff12::1%eth0]:1234 1 10750
[ff15::abcd]:1234 1 10750
The "always on" flag tells DVBlast whether the channel is expected to
be on at all times or if it may break. If set to "1", then DVBlast will
regularly reset the CAM module if it fails to descramble the service,
...
...
@@ -114,12 +125,18 @@ Advanced features
=================
DVBlast may handle several DVB adapters in the same machine with the -a switch:
-a 3 will use /dev/dvb/adapter3.
-a 3 will use /dev/dvb/adapter3. Additionally, selecting between frontends on
a single card is supported with the -n switch. This is useful for hybrid
DVB/S + DVB/T cards.
For better latency, run DVBlast in real-time priority (-i 1).
DVBlast can also stream the entire transponder to an address :
DVBlast can also stream the entire transponder to an
IPv4 or IPv6
address :
dvblast -u -d 172.16.42.42:1235 -f 11570000 -s 27500000 -v 18
dvblast -u -d [fe80::0ca:feff:fec0:ffee]:1235 -f 11570000 -s 27500000 -v 18
Note that IPv6 addresses specified on command line may need to have the square
brackets escaped (\[ and \]), depending on your shell.
The -u switch disables the PID filters, so that all PIDs, even the
unused ones, can be output. With -e, dvblast also streams EIT and SDT packets
...
...
NEWS
View file @
227d4e2d
$Id$
Changes between 1.1 and 1.2-svn:
--------------------------------
* Support for IPv6 output and duplicate
* Support input from ASI card
* Support input from (IPv4) RTP / UDP stream
* Miscellaneous CAM and demux fixes
Changes between 1.0 and 1.1:
----------------------------
...
...
demux.c
View file @
227d4e2d
...
...
@@ -6,7 +6,7 @@
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Andy Gatward <a.j.gatward@reading.ac.uk>
* Marian
Ďurkovič
<md@bts.sk>
* Marian
Durkovic
<md@bts.sk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -280,8 +280,8 @@ static void demux_Handle( block_t *p_ts )
pp_outputs
[
j
]
->
i_nb_errors
=
0
;
msg_Warn
(
NULL
,
"too many errors for stream %s
:%d
, resetting"
,
inet_ntoa
(
p_output
->
maddr
.
sin_addr
),
p_output
->
maddr
.
sin_port
);
"too many errors for stream %s, resetting"
,
p_output
->
psz_displayname
);
en50221_Reset
();
}
}
...
...
dvblast.c
View file @
227d4e2d
This diff is collapsed.
Click to expand it.
dvblast.h
View file @
227d4e2d
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Andy Gatward <a.j.gatward@reading.ac.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -25,9 +26,13 @@
#include <dvbpsi/descriptor.h>
#include <dvbpsi/pmt.h>
#include "netdb.h"
#include "sys/socket.h"
#define DEFAULT_PORT 3001
#define TS_SIZE 188
#define NB_BLOCKS 7
#define NB_BLOCKS_IPV6 6 // assume MTU of 1280 bytes for IPv6
#define RTP_SIZE 12
#define EMPTY_PID 8192
#define PADDING_PID 8191
...
...
@@ -41,16 +46,14 @@
* Bit 1 : Set output still present
* Bit 2 : Set if output is valid (replaces m_addr != 0 tests)
* Bit 3 : Set for UDP, otherwise use RTP if a network stream
* Bit 4 : Set for IPv6, unset for IPv4 (future use)
* Bit 5 : Set for file / FIFO output, unset for network (future use)
* Bit 4 : Set for file / FIFO output, unset for network (future use)
*****************************************************************************/
#define OUTPUT_WATCH 0x01
#define OUTPUT_STILL_PRESENT 0x02
#define OUTPUT_VALID 0x04
#define OUTPUT_UDP 0x08
#define OUTPUT_IPV6 0x10
#define OUTPUT_FILE 0x20
#define OUTPUT_FILE 0x10
typedef
int64_t
mtime_t
;
...
...
@@ -63,7 +66,12 @@ typedef struct block_t
typedef
struct
output_t
{
struct
sockaddr_in
maddr
;
/* address information, protocol agnostic */
struct
sockaddr_storage
*
p_addr
;
socklen_t
i_addrlen
;
/* display string */
char
*
psz_displayname
;
/* output */
int
i_handle
;
...
...
@@ -161,8 +169,8 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
void
demux_ResendCAPMTs
(
void
);
int
PIDIsSelected
(
uint16_t
i_pid
);
output_t
*
output_Create
(
in_addr_t
i_maddr
,
uint16_t
i_port
);
int
output_Init
(
output_t
*
p_output
,
in_addr_t
i_maddr
,
uint16_t
i_port
);
output_t
*
output_Create
(
uint8_t
i_config
,
char
*
psz_displayname
,
void
*
p_init_data
);
int
output_Init
(
output_t
*
p_output
,
uint8_t
i_config
,
char
*
psz_displayname
,
void
*
p_init_data
);
void
output_Close
(
output_t
*
p_output
);
void
output_Put
(
output_t
*
p_output
,
block_t
*
p_block
);
...
...
output.c
View file @
227d4e2d
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Andy Gatward <a.j.gatward@reading.ac.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -25,6 +26,7 @@
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
...
...
@@ -44,7 +46,7 @@ static void rtp_SetHdr( output_t *p_output, uint8_t *p_hdr );
/*****************************************************************************
* output_Create : called from main thread
*****************************************************************************/
output_t
*
output_Create
(
in_addr_t
i_maddr
,
uint16_t
i_port
)
output_t
*
output_Create
(
uint8_t
i_config
,
char
*
psz_displayname
,
void
*
p_init_data
)
{
int
i
;
output_t
*
p_output
=
NULL
;
...
...
@@ -67,7 +69,7 @@ output_t *output_Create( in_addr_t i_maddr, uint16_t i_port )
pp_outputs
[
i
]
=
p_output
;
}
if
(
output_Init
(
p_output
,
i_
maddr
,
i_port
)
<
0
)
if
(
output_Init
(
p_output
,
i_
config
,
psz_displayname
,
p_init_data
)
<
0
)
return
NULL
;
return
p_output
;
...
...
@@ -76,7 +78,7 @@ output_t *output_Create( in_addr_t i_maddr, uint16_t i_port )
/*****************************************************************************
* output_Init
*****************************************************************************/
int
output_Init
(
output_t
*
p_output
,
in_addr_t
i_maddr
,
uint16_t
i_port
)
int
output_Init
(
output_t
*
p_output
,
uint8_t
i_config
,
char
*
psz_displayname
,
void
*
p_init_data
)
{
p_output
->
i_sid
=
0
;
p_output
->
i_depth
=
0
;
...
...
@@ -100,10 +102,16 @@ int output_Init( output_t *p_output, in_addr_t i_maddr, uint16_t i_port )
p_output
->
i_ref_timestamp
=
0
;
p_output
->
i_ref_wallclock
=
0
;
p_output
->
maddr
.
sin_family
=
AF_INET
;
p_output
->
maddr
.
sin_addr
.
s_addr
=
i_maddr
;
p_output
->
maddr
.
sin_port
=
htons
(
i_port
);
if
(
(
p_output
->
i_handle
=
net_Open
(
p_output
))
<
0
)
p_output
->
i_config
=
i_config
;
p_output
->
psz_displayname
=
psz_displayname
;
struct
addrinfo
*
p_ai
=
(
struct
addrinfo
*
)
p_init_data
;
p_output
->
i_addrlen
=
p_ai
->
ai_addrlen
;
p_output
->
p_addr
=
malloc
(
p_output
->
i_addrlen
);
memcpy
(
p_output
->
p_addr
,
p_ai
->
ai_addr
,
p_output
->
i_addrlen
);
if
(
(
p_output
->
i_handle
=
net_Open
(
p_output
)
)
<
0
)
{
p_output
->
i_config
&=
~
OUTPUT_VALID
;
return
-
1
;
...
...
@@ -141,7 +149,9 @@ static void output_Flush( output_t *p_output )
struct
iovec
p_iov
[
NB_BLOCKS
+
1
];
uint8_t
p_rtp_hdr
[
RTP_SIZE
];
int
i
;
int
i_outblocks
=
NB_BLOCKS
;
int
i_block_cnt
=
(
p_output
->
p_addr
->
ss_family
==
AF_INET6
)
?
NB_BLOCKS_IPV6
:
NB_BLOCKS
;
int
i_outblocks
=
i_block_cnt
;
if
(
!
b_output_udp
&&
!
(
p_output
->
i_config
&
OUTPUT_UDP
)
)
{
...
...
@@ -149,7 +159,7 @@ static void output_Flush( output_t *p_output )
p_iov
[
0
].
iov_len
=
sizeof
(
p_rtp_hdr
);
rtp_SetHdr
(
p_output
,
p_rtp_hdr
);
for
(
i
=
1
;
i
<
NB_BLOCKS
+
1
;
i
++
)
for
(
i
=
1
;
i
<
i_block_cnt
+
1
;
i
++
)
{
p_iov
[
i
].
iov_base
=
p_output
->
pp_blocks
[
i
-
1
]
->
p_ts
;
p_iov
[
i
].
iov_len
=
TS_SIZE
;
...
...
@@ -159,7 +169,7 @@ static void output_Flush( output_t *p_output )
}
else
{
for
(
i
=
0
;
i
<
NB_BLOCKS
;
i
++
)
for
(
i
=
0
;
i
<
i_block_cnt
;
i
++
)
{
p_iov
[
i
].
iov_base
=
p_output
->
pp_blocks
[
i
]
->
p_ts
;
p_iov
[
i
].
iov_len
=
TS_SIZE
;
...
...
@@ -168,11 +178,11 @@ static void output_Flush( output_t *p_output )
if
(
writev
(
p_output
->
i_handle
,
p_iov
,
i_outblocks
)
<
0
)
{
msg_Err
(
NULL
,
"couldn't writev to %s
:%u (%s)"
,
inet_ntoa
(
p_output
->
maddr
.
sin_addr
),
p_output
->
maddr
.
sin_port
,
strerror
(
errno
)
);
msg_Err
(
NULL
,
"couldn't writev to %s
(%s)"
,
p_output
->
psz_displayname
,
strerror
(
errno
)
);
}
for
(
i
=
0
;
i
<
NB_BLOCKS
;
i
++
)
for
(
i
=
0
;
i
<
i_block_cnt
;
i
++
)
{
p_output
->
pp_blocks
[
i
]
->
i_refcount
--
;
if
(
!
p_output
->
pp_blocks
[
i
]
->
i_refcount
)
...
...
@@ -191,7 +201,10 @@ void output_Put( output_t *p_output, block_t *p_block )
p_output
->
pp_blocks
[
p_output
->
i_depth
]
=
p_block
;
p_output
->
i_depth
++
;
if
(
p_output
->
i_depth
>=
NB_BLOCKS
)
if
(
(
(
p_output
->
p_addr
->
ss_family
==
AF_INET6
)
&&
(
p_output
->
i_depth
>=
NB_BLOCKS_IPV6
)
)
||
(
(
p_output
->
p_addr
->
ss_family
==
AF_INET
)
&&
(
p_output
->
i_depth
>=
NB_BLOCKS
)
)
)
output_Flush
(
p_output
);
}
...
...
@@ -200,22 +213,43 @@ void output_Put( output_t *p_output, block_t *p_block )
*****************************************************************************/
static
int
net_Open
(
output_t
*
p_output
)
{
int
i_handle
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
int
i_handle
=
socket
(
p_output
->
p_addr
->
ss_family
,
SOCK_DGRAM
,
IPPROTO_UDP
);
if
(
connect
(
i_handle
,
(
struct
sockaddr
*
)
&
p_output
->
maddr
,
sizeof
(
p_output
->
maddr
)
)
<
0
)
if
(
i_handle
<
0
)
{
msg_Err
(
NULL
,
"couldn't connect to %s:%u (%s)"
,
inet_ntoa
(
p_output
->
maddr
.
sin_addr
),
p_output
->
maddr
.
sin_port
,
strerror
(
errno
)
);
close
(
i_handle
);
return
-
1
;
msg_Err
(
NULL
,
"couldn't create socket for %s (%s)"
,
p_output
->
psz_displayname
,
strerror
(
errno
)
);
return
-
errno
;
}
if
(
IN_MULTICAST
(
ntohl
(
p_output
->
maddr
.
sin_addr
.
s_addr
)
)
)
if
(
p_output
->
p_addr
->
ss_family
==
AF_INET6
)
{
struct
sockaddr_in6
*
addr
=
(
struct
sockaddr_in6
*
)
p_output
->
p_addr
;
if
(
IN6_IS_ADDR_MULTICAST
(
addr
->
sin6_addr
.
s6_addr
)
)
{
int
i
=
i_ttl
;
setsockopt
(
i_handle
,
IPPROTO_IPV6
,
IPV6_MULTICAST_HOPS
,
(
void
*
)
&
i
,
sizeof
(
i
)
);
}
}
else
if
(
p_output
->
p_addr
->
ss_family
==
AF_INET
)
{
struct
sockaddr_in
*
addr
=
(
struct
sockaddr_in
*
)
p_output
->
p_addr
;
if
(
IN_MULTICAST
(
ntohl
(
addr
->
sin_addr
.
s_addr
)
)
)
{
int
i
=
i_ttl
;
setsockopt
(
i_handle
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
(
void
*
)
&
i
,
sizeof
(
i
)
);
}
}
if
(
connect
(
i_handle
,
(
struct
sockaddr
*
)
p_output
->
p_addr
,
p_output
->
i_addrlen
)
<
0
)
{
msg_Err
(
NULL
,
"couldn't connect socket to %s (%s)"
,
p_output
->
psz_displayname
,
strerror
(
errno
)
);
close
(
i_handle
);
return
-
errno
;
}
return
i_handle
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment