Commit 5029c85a authored by Wim Taymans's avatar Wim Taymans Committed by Simon McVittie

Initial import

parents
Wim Taymans <wim.taymans@collabora.co.uk>
This diff is collapsed.
This diff is collapsed.
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
SUBDIRS = \
src \
m4 \
common
DIST_SUBDIRS = $(SUBDIRS)
EXTRA_DIST = \
ChangeLog autogen.sh depcomp \
AUTHORS COPYING NEWS README RELEASE REQUIREMENTS \
gst-rtsp.spec docs/design/gst-rtp-server-design
ACLOCAL_AMFLAGS = -I common/m4 -I m4
DISTCLEANFILES = _stdint.h gst-rtsp.spec
include $(top_srcdir)/common/release.mak
include $(top_srcdir)/common/po.mak
check-valgrind:
cd tests/check && make check-valgrind
if HAVE_CHECK
check-torture:
cd tests/check && make torture
else
check-torture:
true
endif
This is GstRTSP
GstRTSP is an RTSP server built on top of GStreamer (http://gstreamer.net).
Currently there is no configuration tools for this server so any streamed
files need to be hardcoded into the file:
src/rtsp-media.c
Edit in your sources after the examples found under the section headlines by
* STREAMING CONFIGURATION
Once the server is started you should be able to view the streams at:
rtsp://localhost:1554/@name_of_stream@
The replacement for @name_of_stream@ is from the rtsp-media.c editing you did above.
You should be able to get the http proxy link working without any editing of the rtsp-media.c file as it points to an online http file:
rtsp://localhost:1554/rtphttpproxy
You need to have GStreamer. You can use an installed version of
GStreamer or from its build dir.
- implement multicast and TCP transports
- use a config file to configure the server
- error recovery
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
DIE=0
package=gst-rtsp
srcfile=src/rtsp-server.c
# a quick cvs co to ease the transition
if test ! -d common;
then
echo "+ getting common/ from cvs"
if test -e CVS/Tag
then
TAG="-r `tail -c +2 CVS/Tag`"
fi
cvs co $TAG common
fi
# source helper functions
if test ! -f common/gst-autogen.sh;
then
echo There is something wrong with your source tree.
echo You are missing common/gst-autogen.sh
exit 1
fi
. common/gst-autogen.sh
CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
autogen_options $@
echo -n "+ check for build tools"
if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else echo; fi
version_check "autoconf" "$AUTOCONF autoconf autoconf259 autoconf257 autoconf-2.54 autoconf-2.53 autoconf253 autoconf-2.52 autoconf252" \
"ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
version_check "automake" "$AUTOMAKE automake automake-1.9 automake19 automake-1.8 automake18 automake-1.7 automake17 automake-1.6 automake16" \
"ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1
version_check "autopoint" "autopoint" \
"ftp://ftp.gnu.org/pub/gnu/gettext/" 0 11 5 || DIE=1
version_check "libtoolize" "libtoolize libtoolize15 glibtoolize" \
"ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
version_check "pkg-config" "" \
"http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
die_check $DIE
autoconf_2_52d_check || DIE=1
aclocal_check || DIE=1
autoheader_check || DIE=1
die_check $DIE
# if no arguments specified then this will be printed
if test -z "$*"; then
echo "+ checking for autogen.sh options"
echo " This autogen script will automatically run ./configure as:"
echo " ./configure $CONFIGURE_DEF_OPT"
echo " To pass any additional options, please specify them on the $0"
echo " command line."
fi
toplevel_check $srcfile
tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
tool_run "$libtoolize" "--copy --force"
tool_run "$autoheader"
# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
echo timestamp > stamp-h.in 2> /dev/null
tool_run "$autoconf"
tool_run "$automake" "-a -c"
# if enable exists, add an -enable option for each of the lines in that file
if test -f enable; then
for a in `cat enable`; do
CONFIGURE_FILE_OPT="--enable-$a"
done
fi
# if disable exists, add an -disable option for each of the lines in that file
if test -f disable; then
for a in `cat disable`; do
CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
done
fi
test -n "$NOCONFIGURE" && {
echo "+ skipping configure stage for package $package, as requested."
echo "+ autogen.sh done."
exit 0
}
echo "+ running configure ... "
test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT"
test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT"
test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
echo
./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
echo " configure failed"
exit 1
}
This diff is collapsed.
SUBDIRS = m4
EXTRA_DIST = \
ChangeLog \
gettext.patch \
glib-gen.mak gtk-doc.mak upload.mak release.mak \
gst-autogen.sh \
c-to-xml.py gst-xmlinspect.py mangle-tmpl.py scangobj-merge.py \
gtk-doc-plugins.mak \
plugins.xsl gstdoc-scangobj \
gst.supp check.mak \
coverage/lcov.mak \
coverage/coverage-report.pl \
coverage/coverage-report.xsl \
coverage/coverage-report-entry.pl
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
"""
Convert a C program to valid XML to be included in docbook
"""
import sys
import os
from xml.sax import saxutils
def main():
if len(sys.argv) == 1:
sys.stderr.write("Please specify a source file to convert")
sys.exit(1)
source = sys.argv[1]
if not os.path.exists(source):
sys.stderr.write("%s does not exist.\n" % source)
sys.exit(1)
content = open(source, "r").read()
# print header
print '<?xml version="1.0"?>'
print '<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">'
print
print '<programlisting>'
# print content
print saxutils.escape(content).encode('UTF-8')
print '</programlisting>'
main()
clean-local-check:
for i in `find . -name ".libs" -type d`; do \
rm -rf $$i; \
done
if HAVE_VALGRIND
# hangs spectacularly on some machines, so let's not do this by default yet
check-valgrind:
make valgrind
else
check-valgrind:
@true
endif
LOOPS = 10
# run any given test by running make test.check
# if the test fails, run it again at at least debug level 2
%.check: %
@$(TESTS_ENVIRONMENT) \
CK_DEFAULT_TIMEOUT=20 \
$* || \
$(TESTS_ENVIRONMENT) \
GST_DEBUG=$$GST_DEBUG,*:2 \
CK_DEFAULT_TIMEOUT=20 \
$*
# run any given test in a loop
%.torture: %
@for i in `seq 1 $(LOOPS)`; do \
$(TESTS_ENVIRONMENT) \
CK_DEFAULT_TIMEOUT=20 \
$*; done
# run any given test in an infinite loop
%.forever: %
@while true; do \
$(TESTS_ENVIRONMENT) \
CK_DEFAULT_TIMEOUT=20 \
$* || break; done
# valgrind any given test by running make test.valgrind
%.valgrind: %
$(TESTS_ENVIRONMENT) \
CK_DEFAULT_TIMEOUT=360 \
G_SLICE=always-malloc \
libtool --mode=execute \
$(VALGRIND_PATH) -q \
$(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \
--tool=memcheck --leak-check=full --trace-children=yes \
--leak-resolution=high --num-callers=20 \
./$* 2>&1 | tee valgrind.log
@if grep "==" valgrind.log > /dev/null 2>&1; then \
rm valgrind.log; \
exit 1; \
fi
@rm valgrind.log
# valgrind any given test and generate suppressions for it
%.valgrind.gen-suppressions: %
$(TESTS_ENVIRONMENT) \
CK_DEFAULT_TIMEOUT=360 \
G_SLICE=always-malloc \
libtool --mode=execute \
$(VALGRIND_PATH) -q \
$(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \
--tool=memcheck --leak-check=full --trace-children=yes \
--leak-resolution=high --num-callers=20 \
--gen-suppressions=all \
./$* 2>&1 | tee suppressions.log
# valgrind any given test until failure by running make test.valgrind-forever
%.valgrind-forever: %
@while make $*.valgrind; do \
true; done
# gdb any given test by running make test.gdb
%.gdb: %
$(TESTS_ENVIRONMENT) \
CK_FORK=no \
libtool --mode=execute \
gdb $*
# torture tests
torture: $(TESTS)
-rm test-registry.xml
@echo "Torturing tests ..."
for i in `seq 1 $(LOOPS)`; do \
make check || \
(echo "Failure after $$i runs"; exit 1) || \
exit 1; \
done
@banner="All $(LOOPS) loops passed"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo $$dashes; echo $$banner; echo $$dashes
# forever tests
forever: $(TESTS)
-rm test-registry.xml
@echo "Forever tests ..."
while true; do \
make check || \
(echo "Failure"; exit 1) || \
exit 1; \
done
# valgrind all tests
valgrind: $(TESTS)
@echo "Valgrinding tests ..."
@failed=0; \
for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \
make $$t.valgrind; \
if test "$$?" -ne 0; then \
echo "Valgrind error for test $$t"; \
failed=`expr $$failed + 1`; \
whicht="$$whicht $$t"; \
fi; \
done; \
if test "$$failed" -ne 0; then \
echo "$$failed tests had leaks or errors under valgrind:"; \
echo "$$whicht"; \
false; \
fi
# inspect every plugin feature
GST_INSPECT = $(GST_TOOLS_DIR)/gst-inspect-$(GST_MAJORMINOR)
inspect:
@echo "Inspecting features ..."
for e in `$(TESTS_ENVIRONMENT) $(GST_INSPECT) | head -n -2 \
| cut -d: -f2`; \
do echo Inspecting $$e; \
$(GST_INSPECT) $$e > /dev/null 2>&1; done
help:
@echo "make check -- run all checks"
@echo "make torture -- run all checks $(LOOPS) times"
@echo "make (dir)/(test).check -- run the given check once"
@echo "make (dir)/(test).forever -- run the given check forever"
@echo "make (dir)/(test).torture -- run the given check $(LOOPS) times"
@echo
@echo "make (dir)/(test).gdb -- start up gdb for the given test"
@echo
@echo "make valgrind -- valgrind all tests"
@echo "make (dir)/(test).valgrind -- valgrind the given test"
@echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever"
@echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions"
@echo " and save to suppressions.log"
@echo "make inspect -- inspect all plugin features"
#!/usr/bin/perl
#
# Copyright (C) 2006 Daniel Berrange
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
print <<EOF;
<html>
<head>
<title>Coverage report for $ARGV[0]</title>
<style type="text/css">
span.perfect {
background: rgb(0,255,0);
}
span.terrible {
background: rgb(255,0,0);
}
</style>
</head>
<body>
<h1>Coverage report for $ARGV[0]</h1>
<pre>
EOF
while (<>) {
s/&/&amp;/g;
s/</&lt;/g;
s/>/&gt;/g;
if (/^\s*function (\S+) called (\d+) returned \d+% blocks executed \d+%/) {
my $class = $2 > 0 ? "perfect" : "terrible";
$_ = "<span class=\"$class\" id=\"" . $1 . "\">$_</span>";
} elsif (/^\s*branch\s+\d+\s+taken\s+(\d+)%\s+.*$/) {
my $class = $1 > 0 ? "perfect" : "terrible";
$_ = "<span class=\"$class\">$_</span>";
} elsif (/^\s*branch\s+\d+\s+never executed.*$/) {
my $class = "terrible";
$_ = "<span class=\"$class\">$_</span>";
} elsif (/^\s*call\s+\d+\s+never executed.*$/) {
my $class = "terrible";
$_ = "<span class=\"$class\">$_</span>";
} elsif (/^\s*call\s+\d+\s+returned\s+(\d+)%.*$/) {
my $class = $1 > 0 ? "perfect" : "terrible";
$_ = "<span class=\"$class\">$_</span>";
}
print;
}
print <<EOF;
</pre>
</body>
</html>
EOF
#!/usr/bin/perl
#
# Copyright (C) 2006 Daniel Berrange
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
use warnings;
use strict;
my %coverage = ( functions => {}, files => {} );
my %filemap;
my $type;
my $name;
my @functions;
while (<>) {
if (/^Function '(.*)'\s*$/) {
$type = "function";
$name = $1;
$coverage{$type}->{$name} = {};
push @functions, $name;
} elsif (/^File '(.*?)'\s*$/) {
$type = "file";
$name = $1;
$coverage{$type}->{$name} = {};
foreach my $func (@functions) {
$coverage{"function"}->{$func}->{file} = $name;
}
@functions = ();
} elsif (/^Lines executed:(.*)%\s*of\s*(\d+)\s*$/) {
$coverage{$type}->{$name}->{lines} = $2;
$coverage{$type}->{$name}->{linesCoverage} = $1;
} elsif (/^Branches executed:(.*)%\s*of\s*(\d+)\s*$/) {
$coverage{$type}->{$name}->{branches} = $2;
$coverage{$type}->{$name}->{branchesCoverage} = $1;
} elsif (/^Taken at least once:(.*)%\s*of\s*(\d+)\s*$/) {
$coverage{$type}->{$name}->{conds} = $2;
$coverage{$type}->{$name}->{condsCoverage} = $1;
} elsif (/^Calls executed:(.*)%\s*of\s*(\d+)\s*$/) {
$coverage{$type}->{$name}->{calls} = $2;
$coverage{$type}->{$name}->{callsCoverage} = $1;
} elsif (/^No branches$/) {
$coverage{$type}->{$name}->{branches} = 0;
$coverage{$type}->{$name}->{branchesCoverage} = "100.00";
$coverage{$type}->{$name}->{conds} = 0;
$coverage{$type}->{$name}->{condsCoverage} = "100.00";
} elsif (/^No calls$/) {
$coverage{$type}->{$name}->{calls} = 0;
$coverage{$type}->{$name}->{callsCoverage} = "100.00";
} elsif (/^\s*(.*):creating '(.*)'\s*$/) {
$filemap{$1} = $2;
} elsif (/^\s*$/) {
# nada
} else {
warn "Shit [$_]\n";
}
}
my %summary;
foreach my $type ("function", "file") {
$summary{$type} = {};
foreach my $m ("lines", "branches", "conds", "calls") {
my $totalGot = 0;
my $totalMiss = 0;
my $count = 0;
foreach my $func (keys %{$coverage{function}}) {
$count++;
my $got = $coverage{function}->{$func}->{$m};
$totalGot += $got;
my $miss = $got * $coverage{function}->{$func}->{$m ."Coverage"} / 100;
$totalMiss += $miss;
}
$summary{$type}->{$m} = sprintf("%d", $totalGot);
$summary{$type}->{$m . "Coverage"} = sprintf("%.2f", $totalMiss / $totalGot * 100);
}
}
print "<coverage>\n";
foreach my $type ("function", "file") {
printf "<%ss>\n", $type;
foreach my $name (sort { $a cmp $b } keys %{$coverage{$type}}) {
my $rec = $coverage{$type}->{$name};
printf " <entry name=\"%s\" details=\"%s\">\n", $name, ($type eq "file" ? $filemap{$name} : $filemap{$rec->{file}});
printf " <lines count=\"%s\" coverage=\"%s\"/>\n", $rec->{lines}, $rec->{linesCoverage};
if (exists $rec->{branches}) {
printf " <branches count=\"%s\" coverage=\"%s\"/>\n", $rec->{branches}, $rec->{branchesCoverage};
}
if (exists $rec->{conds}) {
printf " <conditions count=\"%s\" coverage=\"%s\"/>\n", $rec->{conds}, $rec->{condsCoverage};
}
if (exists $rec->{calls}) {
printf " <calls count=\"%s\" coverage=\"%s\"/>\n", $rec->{calls}, $rec->{callsCoverage};
}
print " </entry>\n";
}
printf " <summary>\n";
printf " <lines count=\"%s\" coverage=\"%s\"/>\n", $summary{$type}->{lines}, $summary{$type}->{linesCoverage};
printf " <branches count=\"%s\" coverage=\"%s\"/>\n", $summary{$type}->{branches}, $summary{$type}->{branchesCoverage};
printf " <conditions count=\"%s\" coverage=\"%s\"/>\n", $summary{$type}->{conds}, $summary{$type}->{condsCoverage};
printf " <calls count=\"%s\" coverage=\"%s\"/>\n", $summary{$type}->{calls}, $summary{$type}->{callsCoverage};
printf " </summary>\n";
printf "</%ss>\n", $type;
}
print "</coverage>\n";
<?xml version="1.0" encoding="utf-8"?>
<!--
#
# Copyright (C) 2006 Daniel Berrange
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:template match="coverage">
<html>
<head>
<title>Coverage report</title>
<style type="text/css">
tbody tr.odd td.label {
border-top: 1px solid rgb(128,128,128);
border-bottom: 1px solid rgb(128,128,128);
}
tbody tr.odd td.label {
background: rgb(200,200,200);
}
thead, tfoot {
background: rgb(60,60,60);
color: white;
font-weight: bold;
}
tr td.perfect {
background: rgb(0,255,0);
color: black;
}
tr td.excellant {
background: rgb(140,255,140);
color: black;
}
tr td.good {
background: rgb(160,255,0);
color: black;
}
tr td.poor {
background: rgb(255,160,0);
color: black;
}
tr td.bad {
background: rgb(255,140,140);
color: black;
}
tr td.terrible {
background: rgb(255,0,0);
color: black;
}
</style>
</head>
<body>
<h1>Coverage report</h1>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="functions">
<h2>Function coverage</h2>
<xsl:call-template name="content">
<xsl:with-param name="type" select="'function'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="files">
<h2>File coverage</h2>
<xsl:call-template name="content">
<xsl:with-param name="type" select="'file'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="content">
<xsl:param name="type"/>
<table>
<thead>
<tr>
<th>Name</th>
<th>Lines</th>
<th>Branches</th>
<th>Conditions</th>
<th>Calls</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="entry">
<xsl:call-template name="entry">
<xsl:with-param name="type" select="$type"/>
<xsl:with-param name="class">
<xsl:choose>
<xsl:when test="position() mod 2">
<xsl:text>odd</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>even</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</tbody>
<tfoot>
<xsl:for-each select="summary">
<xsl:call-template name="entry">
<xsl:with-param name="type" select="'summary'"/>
<xsl:with-param name="class">
<xsl:choose>
<xsl:when test="position() mod 2">
<xsl:text>odd</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>even</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</tfoot>
</table>
</xsl:template>
<xsl:template name="entry">
<xsl:param name="type"/>
<xsl:param name="class"/>
<tr class="{$class}">
<xsl:choose>
<xsl:when test="$type = 'function'">
<td class="label"><a href="{@details}.html#{@name}"><xsl:value-of select="@name"/></a></td>
</xsl:when>
<xsl:when test="$type = 'file'">
<td class="label"><a href="{@details}.html"><xsl:value-of select="@name"/></a></td>
</xsl:when>
<xsl:otherwise>
<td class="label">Summary