aboutsummaryrefslogtreecommitdiffstats
path: root/web/streamlib
diff options
context:
space:
mode:
authorJoachim Tingvold <joachim@tingvold.com>2014-04-06 03:11:04 +0200
committerJoachim Tingvold <joachim@tingvold.com>2014-04-06 03:11:04 +0200
commit2a0c0a3dbbdf7fa5040953c0b0d88ad6f62c011e (patch)
tree92c7cbf54272466b46f64e5dc8d1ddb429858836 /web/streamlib
parentfe0be5960aac1f9bb600dbf853d862a9f4e60de8 (diff)
Initial commit. Source; TG13-goodiebag.
Diffstat (limited to 'web/streamlib')
-rw-r--r--web/streamlib/stream.pm36
-rw-r--r--web/streamlib/stream/config.pm160
2 files changed, 196 insertions, 0 deletions
diff --git a/web/streamlib/stream.pm b/web/streamlib/stream.pm
new file mode 100644
index 0000000..c28136e
--- /dev/null
+++ b/web/streamlib/stream.pm
@@ -0,0 +1,36 @@
+package stream;
+use strict;
+use warnings;
+
+BEGIN {
+ use Exporter();
+
+ our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
+
+ @ISA = qw(Exporter);
+ $VERSION = 1.00;
+ @EXPORT = qw(&is_ip_local);
+
+}
+
+sub is_ip_local($$$) {
+ my $clip = shift;
+ my $v4net = shift;
+ my $v6net = shift;
+ return 0 unless defined($clip);
+
+ my $is_local = 0;
+ if ($clip =~ m/\:/){
+ if (NetAddr::IP->new($clip)->within($v6net)){
+ $is_local = 1;
+ }
+ } else {
+ if (NetAddr::IP->new($clip)->within($v4net)){
+ $is_local = 1;
+ }
+ }
+ return $is_local;
+}
+
+
+1;
diff --git a/web/streamlib/stream/config.pm b/web/streamlib/stream/config.pm
new file mode 100644
index 0000000..7c488b6
--- /dev/null
+++ b/web/streamlib/stream/config.pm
@@ -0,0 +1,160 @@
+package stream::config;
+use strict;
+use warnings;
+use NetAddr::IP;
+
+our $v4net = NetAddr::IP->new("151.216.0.0/17");
+our $v6net = NetAddr::IP->new("2a02:ed02::/32");
+our $multicast = "udp://\@233.191.12.1";
+our $vlc_base_host = "http://stream.tg13.gathering.org";
+our $tg = 13;
+our $tg_full = 2013;
+
+
+# priority = sorting order in streaming list
+# port , "post port number"
+# has_external , shows on OVH/.fr reflector if set
+# external , replaces static url link
+# source , video source pew pew
+# title , title doh \:D/
+our %streams = (
+# Deaktivert 31.mars kl 05.30 iush
+# 'event-ios' => {
+# 'type' => 'event',
+# 'quality' => 'hd',
+# 'priority' => 26,
+# 'external' => 1,
+# 'url' => "$vlc_base_host/ios/event.m3u8",
+# 'source' => 'Event',
+# 'title' => 'Event HD Stream for iOS devices (Apple)',
+# },
+# 'event-hd' => {
+# 'type' => 'event',
+# 'quality' => 'hd',
+# 'priority' => 20,
+# 'port' => 13,
+# 'interlaced' => 0,
+# 'has_multicast' => 1,
+# 'multicast_ip' => 'udp://@[ff7e:a40:2a02:ed02:ffff::13]',
+# 'source' => 'Event',
+# 'title' => 'Event HD (720p50)'
+# },
+# 'event-sd' => {
+# 'type' => 'event',
+# 'quality' => 'sd',
+# 'priority' => 24,
+# 'port' => 14,
+# 'interlaced' => 0,
+# 'has_multicast' => 1,
+# 'multicast_ip' => 'udp://@[ff7e:a40:2a02:ed02:ffff::14]',
+# 'source' => 'Event',
+# 'title' => 'Event SD (576p) (2mbps)'
+# },
+# 'event-flash' => {
+# 'type' => 'event',
+# 'quality' => 'sd',
+# 'priority' => 25,
+# 'interlaced' => 0,
+# 'external' => 1,
+# 'url' => 'http://www.gathering.org/tg13/no/live-tv/',
+# 'source' => 'Event',
+# 'title' => 'Event SD (gathering.org flash player)',
+# },
+#
+
+
+ 'south-raw' => {
+ 'type' => 'camera',
+ 'location' => 3,
+ 'quality' => 'hd',
+ 'priority' => 40,
+ 'port' => 16,
+ 'interlaced' => 1,
+ 'has_multicast' => 0,
+# 'multicast_ip' => "udp://@[ff7e:a40:2a02:ed02:ffff::16]",
+ 'source' => 'Tech',
+ 'title' => 'Webcam South (HD) (1080i25)',
+ },
+
+ 'south-transcode' => {
+ 'type' => 'camera',
+ 'location' => 3,
+ 'quality' => 'hd',
+ 'priority' => 50,
+ 'port' => 17,
+ 'interlaced' => 0,
+ 'has_multicast' => 1,
+ 'multicast_ip' => "udp://@[ff7e:a40:2a02:ed02:ffff::17]",
+ 'source' => 'Tech',
+ 'title' => 'Webcam South (HD) (720p50)',
+ },
+
+
+ 'fuglecam' => {
+ 'type' => 'camera',
+ 'location' => 2,
+ 'quality' => 'hd',
+ 'priority' => 118,
+ 'port' => 15,
+ 'interlaced' => 1,
+ 'has_multicast' => 1,
+ 'multicast_ip' => "udp://\@[ff7e:a40:2a02:ed02:ffff::15]",
+ 'source' => 'Tech',
+ 'title' => 'Webcam Fugleberget (HD) (1080i50)',
+ },
+
+
+
+ 'fuglecam-flv-sd' => {
+ 'location' => 2,
+ 'type' => 'camera',
+ 'quality' => 'sd',
+ 'priority' => 121,
+ 'interlaced' => 1,
+ 'external' => 1,
+ 'url' => 'http://www.gathering.org/tg13/no/webcam/',
+ 'title' => 'Webcam Fugleberget (SD) (gathering.org flash player)',
+ },
+
+ 'noc-fisheye' => {
+ 'type' => 'camera',
+ 'location' => 1,
+ 'quality' => 'hd',
+ 'priority' => 130,
+ 'port' => 18,
+ 'has_multicast' => 1,
+ 'interlaced' => 0,
+ 'multicast_ip' => "udp://@[ff7e:a40:2a02:ed02:ffff::18]:2018",
+ 'source' => "Tech",
+ 'title' => "Webcam NOC Fisheye (HD)"
+ },
+ 'noc-fisheye-transcode' => {
+ 'type' => 'camera',
+ 'location' => 1,
+ 'quality' => 'hd',
+ 'priority' => 131,
+ 'port' => 19,
+ 'has_multicast' => 1,
+ 'interlaced' => 0,
+ 'multicast_ip' => "udp://@[ff7e:a40:2a02:ed02:ffff::19]:2019",
+ 'source' => "Tech",
+ 'title' => "Webcam NOC Fisheye (HD transcoded)"
+ },
+
+
+ 'south-still' => {
+ 'location' => 3,
+ 'type' => 'camera',
+ 'quality' => 'hd',
+ 'priority' => 110,
+ 'external' => 1,
+ 'url' => 'http://stillcam.tg13.gathering.org/',
+ 'title' => 'Webcam South (Image)',
+ 'source' => 'Tech'
+ },
+
+
+ );
+
+
+1;