mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
add tools
This commit is contained in:
parent
de95bf74b1
commit
3515af9dff
4 changed files with 36 additions and 6 deletions
17
trunk/3rdparty/tools/build_ccache.sh
vendored
Normal file
17
trunk/3rdparty/tools/build_ccache.sh
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# check exists.
|
||||||
|
if [[ -f /usr/local/bin/ccache ]]; then
|
||||||
|
echo "ccache is ok";
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check sudoer.
|
||||||
|
sudo echo "ok" > /dev/null 2>&1;
|
||||||
|
ret=$?; if [[ 0 -ne ${ret} ]]; then echo "you must be sudoer"; exit 1; fi
|
||||||
|
|
||||||
|
unzip ccache-3.1.9.zip && cd ccache-3.1.9 && ./configure && make
|
||||||
|
ret=$?; if [[ $ret -ne 0 ]]; then echo "build ccache failed."; exit $ret; fi
|
||||||
|
|
||||||
|
sudo cp ccache /usr/local/bin && sudo ln -s ccache /usr/local/bin/gcc && sudo ln -s ccache /usr/local/bin/g++ && sudo ln -s ccache /usr/local/bin/cc && sudo ln -s ccache /usr/local/bin/c++
|
||||||
|
ret=$?; if [[ $ret -ne 0 ]]; then echo "install ccache failed."; exit $ret; fi
|
BIN
trunk/3rdparty/tools/ccache-3.1.9.zip
vendored
Normal file
BIN
trunk/3rdparty/tools/ccache-3.1.9.zip
vendored
Normal file
Binary file not shown.
|
@ -364,12 +364,23 @@ SrsSource::SrsSource(std::string _stream_url)
|
||||||
|
|
||||||
SrsSource::~SrsSource()
|
SrsSource::~SrsSource()
|
||||||
{
|
{
|
||||||
|
if (true) {
|
||||||
std::vector<SrsConsumer*>::iterator it;
|
std::vector<SrsConsumer*>::iterator it;
|
||||||
for (it = consumers.begin(); it != consumers.end(); ++it) {
|
for (it = consumers.begin(); it != consumers.end(); ++it) {
|
||||||
SrsConsumer* consumer = *it;
|
SrsConsumer* consumer = *it;
|
||||||
srs_freep(consumer);
|
srs_freep(consumer);
|
||||||
}
|
}
|
||||||
consumers.clear();
|
consumers.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
std::vector<SrsForwarder*>::iterator it;
|
||||||
|
for (it = forwarders.begin(); it != forwarders.end(); ++it) {
|
||||||
|
SrsForwarder* forwarder = *it;
|
||||||
|
srs_freep(forwarder);
|
||||||
|
}
|
||||||
|
forwarders.clear();
|
||||||
|
}
|
||||||
|
|
||||||
srs_freep(cache_metadata);
|
srs_freep(cache_metadata);
|
||||||
srs_freep(cache_sh_video);
|
srs_freep(cache_sh_video);
|
||||||
|
|
|
@ -166,14 +166,16 @@ public:
|
||||||
static SrsSource* find(std::string stream_url);
|
static SrsSource* find(std::string stream_url);
|
||||||
private:
|
private:
|
||||||
std::string stream_url;
|
std::string stream_url;
|
||||||
|
// to delivery stream to clients.
|
||||||
std::vector<SrsConsumer*> consumers;
|
std::vector<SrsConsumer*> consumers;
|
||||||
private:
|
|
||||||
// hls handler.
|
// hls handler.
|
||||||
#ifdef SRS_HLS
|
#ifdef SRS_HLS
|
||||||
SrsHls* hls;
|
SrsHls* hls;
|
||||||
#endif
|
#endif
|
||||||
// gop cache for client fast startup.
|
// gop cache for client fast startup.
|
||||||
SrsGopCache* gop_cache;
|
SrsGopCache* gop_cache;
|
||||||
|
// to forward stream to other servers
|
||||||
|
std::vector<SrsForwarder*> forwarders;
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* the sample rate of audio in metadata.
|
* the sample rate of audio in metadata.
|
||||||
|
|
Loading…
Reference in a new issue