1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #299, refine code.

This commit is contained in:
winlin 2017-03-25 17:21:39 +08:00
parent 62b7204514
commit f32aab3d92
175 changed files with 15529 additions and 15935 deletions

View file

@ -1,10 +1,10 @@
/* /*
# see: https://github.com/ossrs/srs/issues/190 # see: https://github.com/ossrs/srs/issues/190
# see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLinuxArm # see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLinuxArm
g++ -g -O0 -o jmp_sp jmp_sp.cpp g++ -g -O0 -o jmp_sp jmp_sp.cpp
arm-linux-gnueabi-g++ -g -o jmp_sp jmp_sp.cpp -static arm-linux-gnueabi-g++ -g -o jmp_sp jmp_sp.cpp -static
arm-linux-gnueabi-strip jmp_sp arm-linux-gnueabi-strip jmp_sp
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <setjmp.h> #include <setjmp.h>

View file

@ -1,6 +1,6 @@
/** /**
g++ memory.error.notcmalloc.cpp -g -O0 -o memory.error.notcmalloc g++ memory.error.notcmalloc.cpp -g -O0 -o memory.error.notcmalloc
*/ */
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>

View file

@ -1,6 +1,6 @@
/** /**
g++ memory.error.notcmalloc.cpp -g -O0 -o memory.error.notcmalloc g++ memory.error.notcmalloc.cpp -g -O0 -o memory.error.notcmalloc
*/ */
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>

View file

@ -164,10 +164,7 @@ int main(int argc, char** argv)
timestamp += time_delta; timestamp += time_delta;
int ret = 0; int ret = 0;
if ((ret = srs_audio_write_raw_frame(rtmp, if ((ret = srs_audio_write_raw_frame(rtmp, sound_format, sound_rate, sound_size, sound_type, data, size, timestamp)) != 0) {
sound_format, sound_rate, sound_size, sound_type,
data, size, timestamp)) != 0
) {
srs_human_trace("send audio raw data failed. ret=%d", ret); srs_human_trace("send audio raw data failed. ret=%d", ret);
goto rtmp_destroy; goto rtmp_destroy;
} }

View file

@ -43,8 +43,7 @@ int read_audio_frame(char* audio_raw, int file_size, char** pp, char** pdata, in
char* p = *pp; char* p = *pp;
if (file_size - (p - audio_raw) < 168) { if (file_size - (p - audio_raw) < 168) {
srs_human_trace("audio must be 160+8 bytes. left %d bytes.", srs_human_trace("audio must be 160+8 bytes. left %d bytes.", (int)(file_size - (p - audio_raw)));
(int)(file_size - (p - audio_raw)));
return - 1; return - 1;
} }
@ -161,10 +160,7 @@ int main(int argc, char** argv)
timestamp += time_delta; timestamp += time_delta;
if (srs_audio_write_raw_frame(rtmp, if (srs_audio_write_raw_frame(rtmp, sound_format, sound_rate, sound_size, sound_type, data, size, timestamp) != 0) {
sound_format, sound_rate, sound_size, sound_type,
data, size, timestamp) != 0
) {
srs_human_trace("send audio raw data failed."); srs_human_trace("send audio raw data failed.");
goto rtmp_destroy; goto rtmp_destroy;
} }

View file

@ -71,8 +71,8 @@ int do_check(srs_rtmp_t rtmp)
} }
if ((ret = srs_rtmp_bandwidth_check(rtmp, if ((ret = srs_rtmp_bandwidth_check(rtmp,
&start_time, &end_time, &play_kbps, &publish_kbps, &start_time, &end_time, &play_kbps, &publish_kbps, &play_bytes, &publish_bytes,
&play_bytes, &publish_bytes, &play_duration, &publish_duration)) != 0 &play_duration, &publish_duration)) != 0
) { ) {
srs_human_trace("bandwidth check/test failed."); srs_human_trace("bandwidth check/test failed.");
return ret; return ret;

View file

@ -164,8 +164,7 @@ int main(int argc, char** argv)
srs_human_trace("read packet failed. ret=%d", ret); srs_human_trace("read packet failed. ret=%d", ret);
goto rtmp_destroy; goto rtmp_destroy;
} }
srs_human_trace("got packet: type=%s, time=%d, size=%d", srs_human_trace("got packet: type=%s, time=%d, size=%d", srs_human_flv_tag_type2string(type), timestamp, size);
srs_human_flv_tag_type2string(type), timestamp, size);
if (SRS_RTMP_TYPE_VIDEO == type || SRS_RTMP_TYPE_AUDIO == type) { if (SRS_RTMP_TYPE_VIDEO == type || SRS_RTMP_TYPE_AUDIO == type) {
if (time_first_packet <= 0) { if (time_first_packet <= 0) {

View file

@ -168,8 +168,7 @@ int parse_flv(srs_flv_t flv)
char hbuf[48]; char tbuf[48]; char hbuf[48]; char tbuf[48];
parse_bytes(data, size, hbuf, sizeof(hbuf), tbuf, sizeof(tbuf), 16); parse_bytes(data, size, hbuf, sizeof(hbuf), tbuf, sizeof(tbuf), 16);
srs_human_raw("offset=%d, first and last 16 bytes:\n" srs_human_raw("offset=%d, first and last 16 bytes:\n[+00, +15] %s\n[-15, EOF] %s\n", (int)offset, hbuf, tbuf);
"[+00, +15] %s\n[-15, EOF] %s\n", (int)offset, hbuf, tbuf);
} else { } else {
srs_human_trace("print packet failed. ret=%d", ret); srs_human_trace("print packet failed. ret=%d", ret);
} }

View file

@ -1,25 +1,25 @@
/* /*
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2013-2017 SRS(ossrs) Copyright (c) 2013-2017 SRS(ossrs)
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -267,8 +267,7 @@ void re_cleanup(int64_t re, int32_t starttime, uint32_t time)
int64_t now = srs_utils_time_ms(); int64_t now = srs_utils_time_ms();
int64_t diff = time - starttime - (now -re); int64_t diff = time - starttime - (now -re);
if (diff > 0) { if (diff > 0) {
srs_human_trace("re_cleanup, diff=%d, start=%d, last=%d ms", srs_human_trace("re_cleanup, diff=%d, start=%d, last=%d ms", (int)diff, starttime, time);
(int)diff, starttime, time);
usleep((useconds_t)(diff * 1000)); usleep((useconds_t)(diff * 1000));
} }
} }

View file

@ -81,8 +81,7 @@ int main(int argc, char** argv)
if (srs_rtmp_write_packet(rtmp, type, timestamp, data, size) != 0) { if (srs_rtmp_write_packet(rtmp, type, timestamp, data, size) != 0) {
goto rtmp_destroy; goto rtmp_destroy;
} }
srs_human_trace("sent packet: type=%s, time=%d, size=%d", srs_human_trace("sent packet: type=%s, time=%d, size=%d", srs_human_flv_tag_type2string(type), timestamp, size);
srs_human_flv_tag_type2string(type), timestamp, size);
usleep(40 * 1000); usleep(40 * 1000);
} }

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_async_call.hpp> #include <srs_app_async_call.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_ASYNC_CALL_HPP #ifndef SRS_APP_ASYNC_CALL_HPP
#define SRS_APP_ASYNC_CALL_HPP #define SRS_APP_ASYNC_CALL_HPP
/*
#include <srs_app_async_call.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>

View file

@ -1,26 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
Copyright (c) 2013-2017 SRS(ossrs) *
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in
this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to
the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so,
the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions:
subject to the following conditions: *
* The above copyright notice and this permission notice shall be included in all
The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
copies or substantial portions of the Software. *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
*/
#include <srs_app_bandwidth.hpp> #include <srs_app_bandwidth.hpp>
@ -69,8 +68,8 @@ void SrsBandwidthSample::calc_kbps(int _bytes, int _duration)
} }
/** /**
* recv bandwidth helper. * recv bandwidth helper.
*/ */
typedef bool (*_CheckPacketType)(SrsBandwidthPacket* pkt); typedef bool (*_CheckPacketType)(SrsBandwidthPacket* pkt);
bool _bandwidth_is_final(SrsBandwidthPacket* pkt) bool _bandwidth_is_final(SrsBandwidthPacket* pkt)
{ {

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
Copyright (c) 2013-2017 SRS(ossrs) *
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in
this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to
the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so,
the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions:
subject to the following conditions: *
* The above copyright notice and this permission notice shall be included in all
The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
copies or substantial portions of the Software. *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
*/
#ifndef SRS_APP_BANDWIDTH_HPP #ifndef SRS_APP_BANDWIDTH_HPP
#define SRS_APP_BANDWIDTH_HPP #define SRS_APP_BANDWIDTH_HPP
/*
#include <srs_app_bandwidth.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
@ -41,8 +37,8 @@ class SrsKbpsLimit;
class ISrsProtocolStatistic; class ISrsProtocolStatistic;
/** /**
* bandwidth check/test sample. * bandwidth check/test sample.
*/ */
class SrsBandwidthSample class SrsBandwidthSample
{ {
public: public:
@ -81,44 +77,44 @@ public:
}; };
/** /**
* bandwidth test agent which provides the interfaces for bandwidth check. * bandwidth test agent which provides the interfaces for bandwidth check.
* 1. if vhost disabled bandwidth check, ignore. * 1. if vhost disabled bandwidth check, ignore.
* 2. otherwise, check the key, error if verify failed. * 2. otherwise, check the key, error if verify failed.
* 3. check the interval limit, error if bandwidth in the interval window. * 3. check the interval limit, error if bandwidth in the interval window.
* 4. check the bandwidth under the max kbps. * 4. check the bandwidth under the max kbps.
* 5. send the bandwidth data to client. * 5. send the bandwidth data to client.
* bandwidth workflow: * bandwidth workflow:
* +------------+ +----------+ * +------------+ +----------+
* | Client | | Server | * | Client | | Server |
* +-----+------+ +-----+----+ * +-----+------+ +-----+----+
* | | * | |
* | connect vhost------> | if vhost enable bandwidth, * | connect vhost------> | if vhost enable bandwidth,
* | <-----result(success) | do bandwidth check. * | <-----result(success) | do bandwidth check.
* | | * | |
* | <----call(start play) | onSrsBandCheckStartPlayBytes * | <----call(start play) | onSrsBandCheckStartPlayBytes
* | result(playing)-----> | onSrsBandCheckStartingPlayBytes * | result(playing)-----> | onSrsBandCheckStartingPlayBytes
* | <-------data(playing) | onSrsBandCheckStartingPlayBytes * | <-------data(playing) | onSrsBandCheckStartingPlayBytes
* | <-----call(stop play) | onSrsBandCheckStopPlayBytes * | <-----call(stop play) | onSrsBandCheckStopPlayBytes
* | result(stopped)-----> | onSrsBandCheckStoppedPlayBytes * | result(stopped)-----> | onSrsBandCheckStoppedPlayBytes
* | | * | |
* | <-call(start publish) | onSrsBandCheckStartPublishBytes * | <-call(start publish) | onSrsBandCheckStartPublishBytes
* | result(publishing)--> | onSrsBandCheckStartingPublishBytes * | result(publishing)--> | onSrsBandCheckStartingPublishBytes
* | data(publishing)(3)-> | onSrsBandCheckStartingPublishBytes * | data(publishing)(3)-> | onSrsBandCheckStartingPublishBytes
* | <--call(stop publish) | onSrsBandCheckStopPublishBytes * | <--call(stop publish) | onSrsBandCheckStopPublishBytes
* | result(stopped)(1)--> | onSrsBandCheckStoppedPublishBytes * | result(stopped)(1)--> | onSrsBandCheckStoppedPublishBytes
* | | * | |
* | <--------------report | * | <--------------report |
* | final(2)------------> | finalClientPacket * | final(2)------------> | finalClientPacket
* | <END> | * | <END> |
* *
* 1. when flash client, server never wait the stop publish response, * 1. when flash client, server never wait the stop publish response,
* for the flash client queue is fullfill with other packets. * for the flash client queue is fullfill with other packets.
* 2. when flash client, server never wait the final packet, * 2. when flash client, server never wait the final packet,
* for the flash client directly close when got report packet. * for the flash client directly close when got report packet.
* 3. for linux client, it will send the publish data then send a stop publish, * 3. for linux client, it will send the publish data then send a stop publish,
* for the linux client donot know when to stop the publish. * for the linux client donot know when to stop the publish.
* when server got publishing and stop publish, stop publish. * when server got publishing and stop publish, stop publish.
*/ */
class SrsBandwidth class SrsBandwidth
{ {
private: private:
@ -142,7 +138,7 @@ private:
* @param limit, the bandwidth limit object, to slowdown if exceed the kbps. * @param limit, the bandwidth limit object, to slowdown if exceed the kbps.
*/ */
virtual int do_bandwidth_check(SrsKbpsLimit* limit); virtual int do_bandwidth_check(SrsKbpsLimit* limit);
// play check/test, downloading bandwidth kbps. // play check/test, downloading bandwidth kbps.
private: private:
/** /**
* start play/download bandwidth check/test, * start play/download bandwidth check/test,
@ -162,7 +158,7 @@ private:
* to stop the test. * to stop the test.
*/ */
virtual int play_stop(SrsBandwidthSample* sample, SrsKbpsLimit* limit); virtual int play_stop(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
// publish check/test, publishing bandwidth kbps. // publish check/test, publishing bandwidth kbps.
private: private:
/** /**
* start publish/upload bandwidth check/test, * start publish/upload bandwidth check/test,

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_caster_flv.hpp> #include <srs_app_caster_flv.hpp>
@ -118,7 +118,7 @@ int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
} }
SrsDynamicHttpConn::SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, string cip) SrsDynamicHttpConn::SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, string cip)
: SrsHttpConn(cm, fd, m, cip) : SrsHttpConn(cm, fd, m, cip)
{ {
sdk = NULL; sdk = NULL;
pprint = SrsPithyPrint::create_caster(); pprint = SrsPithyPrint::create_caster();

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_CASTER_FLV_HPP #ifndef SRS_APP_CASTER_FLV_HPP
#define SRS_APP_CASTER_FLV_HPP #define SRS_APP_CASTER_FLV_HPP
/*
#include <srs_app_caster_flv.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
@ -56,7 +52,7 @@ class SrsSimpleRtmpClient;
* the stream caster for flv stream over HTTP POST. * the stream caster for flv stream over HTTP POST.
*/ */
class SrsAppCasterFlv : virtual public ISrsTcpHandler class SrsAppCasterFlv : virtual public ISrsTcpHandler
, virtual public IConnectionManager, virtual public ISrsHttpHandler , virtual public IConnectionManager, virtual public ISrsHttpHandler
{ {
private: private:
std::string output; std::string output;
@ -67,13 +63,13 @@ public:
virtual ~SrsAppCasterFlv(); virtual ~SrsAppCasterFlv();
public: public:
virtual int initialize(); virtual int initialize();
// ISrsTcpHandler // ISrsTcpHandler
public: public:
virtual int on_tcp_client(st_netfd_t stfd); virtual int on_tcp_client(st_netfd_t stfd);
// IConnectionManager // IConnectionManager
public: public:
virtual void remove(SrsConnection* c); virtual void remove(SrsConnection* c);
// ISrsHttpHandler // ISrsHttpHandler
public: public:
virtual int serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r); virtual int serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r);
}; };

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_config.hpp> #include <srs_app_config.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_CONFIG_HPP #ifndef SRS_APP_CONFIG_HPP
#define SRS_APP_CONFIG_HPP #define SRS_APP_CONFIG_HPP
/*
#include <srs_app_config.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <vector> #include <vector>
@ -128,10 +125,10 @@ extern int srs_config_transform_vhost(SrsConfDirective* root);
extern SrsConfig* _srs_config; extern SrsConfig* _srs_config;
/** /**
* the config directive. * the config directive.
* the config file is a group of directives, * the config file is a group of directives,
* all directive has name, args and child-directives. * all directive has name, args and child-directives.
* for example, the following config text: * for example, the following config text:
vhost vhost.ossrs.net { vhost vhost.ossrs.net {
enabled on; enabled on;
ingest livestream { ingest livestream {
@ -139,17 +136,17 @@ extern SrsConfig* _srs_config;
ffmpeg /bin/ffmpeg; ffmpeg /bin/ffmpeg;
} }
} }
* will be parsed to: * will be parsed to:
* SrsConfDirective: name="vhost", arg0="vhost.ossrs.net", child-directives=[ * SrsConfDirective: name="vhost", arg0="vhost.ossrs.net", child-directives=[
* SrsConfDirective: name="enabled", arg0="on", child-directives=[] * SrsConfDirective: name="enabled", arg0="on", child-directives=[]
* SrsConfDirective: name="ingest", arg0="livestream", child-directives=[ * SrsConfDirective: name="ingest", arg0="livestream", child-directives=[
* SrsConfDirective: name="enabled", arg0="on", child-directives=[] * SrsConfDirective: name="enabled", arg0="on", child-directives=[]
* SrsConfDirective: name="ffmpeg", arg0="/bin/ffmpeg", child-directives=[] * SrsConfDirective: name="ffmpeg", arg0="/bin/ffmpeg", child-directives=[]
* ] * ]
* ] * ]
* @remark, allow empty directive, for example: "dir0 {}" * @remark, allow empty directive, for example: "dir0 {}"
* @remark, don't allow empty name, for example: ";" or "{dir0 arg0;} * @remark, don't allow empty name, for example: ";" or "{dir0 arg0;}
*/ */
class SrsConfDirective class SrsConfDirective
{ {
public: public:
@ -193,7 +190,7 @@ public:
virtual SrsConfDirective* copy(); virtual SrsConfDirective* copy();
// @param except the name of sub directive. // @param except the name of sub directive.
virtual SrsConfDirective* copy(std::string except); virtual SrsConfDirective* copy(std::string except);
// args // args
public: public:
/** /**
* get the args0,1,2, if user want to get more args, * get the args0,1,2, if user want to get more args,
@ -203,7 +200,7 @@ public:
virtual std::string arg1(); virtual std::string arg1();
virtual std::string arg2(); virtual std::string arg2();
virtual std::string arg3(); virtual std::string arg3();
// directives // directives
public: public:
/** /**
* get the directive by index. * get the directive by index.
@ -218,7 +215,7 @@ public:
* get the directive by name and its arg0, return the first match. * get the directive by name and its arg0, return the first match.
*/ */
virtual SrsConfDirective* get(std::string _name, std::string _arg0); virtual SrsConfDirective* get(std::string _name, std::string _arg0);
// raw // raw
public: public:
virtual SrsConfDirective* get_or_create(std::string n); virtual SrsConfDirective* get_or_create(std::string n);
virtual SrsConfDirective* get_or_create(std::string n, std::string a0); virtual SrsConfDirective* get_or_create(std::string n, std::string a0);
@ -227,7 +224,7 @@ public:
* remove the v from sub directives, user must free the v. * remove the v from sub directives, user must free the v.
*/ */
virtual void remove(SrsConfDirective* v); virtual void remove(SrsConfDirective* v);
// help utilities // help utilities
public: public:
/** /**
* whether current directive is vhost. * whether current directive is vhost.
@ -237,7 +234,7 @@ public:
* whether current directive is stream_caster. * whether current directive is stream_caster.
*/ */
virtual bool is_stream_caster(); virtual bool is_stream_caster();
// parse utilities // parse utilities
public: public:
/** /**
* parse config directive from file buffer. * parse config directive from file buffer.
@ -259,7 +256,7 @@ public:
virtual SrsJsonAny* dumps_arg0_to_integer(); virtual SrsJsonAny* dumps_arg0_to_integer();
virtual SrsJsonAny* dumps_arg0_to_number(); virtual SrsJsonAny* dumps_arg0_to_number();
virtual SrsJsonAny* dumps_arg0_to_boolean(); virtual SrsJsonAny* dumps_arg0_to_boolean();
// private parse. // private parse.
private: private:
/** /**
* the directive parsing type. * the directive parsing type.
@ -292,15 +289,15 @@ private:
}; };
/** /**
* the config service provider. * the config service provider.
* for the config supports reload, so never keep the reference cross st-thread, * for the config supports reload, so never keep the reference cross st-thread,
* that is, never save the SrsConfDirective* get by any api of config, * that is, never save the SrsConfDirective* get by any api of config,
* for it maybe free in the reload st-thread cycle. * for it maybe free in the reload st-thread cycle.
* you can keep it before st-thread switch, or simply never keep it. * you can keep it before st-thread switch, or simply never keep it.
*/ */
class SrsConfig class SrsConfig
{ {
// user command // user command
private: private:
/** /**
* whether srs is run in dolphin mode. * whether srs is run in dolphin mode.
@ -325,7 +322,7 @@ private:
* whether show SRS signature and exit. * whether show SRS signature and exit.
*/ */
bool show_signature; bool show_signature;
// global env variables. // global env variables.
private: private:
/** /**
* the user parameters, the argc and argv. * the user parameters, the argc and argv.
@ -336,7 +333,7 @@ private:
* current working directory. * current working directory.
*/ */
std::string _cwd; std::string _cwd;
// config section // config section
private: private:
/** /**
* the last parsed config file. * the last parsed config file.
@ -348,7 +345,7 @@ protected:
* the directive root. * the directive root.
*/ */
SrsConfDirective* root; SrsConfDirective* root;
// reload section // reload section
private: private:
/** /**
* the reload subscribers, when reload, callback all handlers. * the reload subscribers, when reload, callback all handlers.
@ -357,7 +354,7 @@ private:
public: public:
SrsConfig(); SrsConfig();
virtual ~SrsConfig(); virtual ~SrsConfig();
// dolphin // dolphin
public: public:
/** /**
* whether srs is in dolphin mode. * whether srs is in dolphin mode.
@ -365,7 +362,7 @@ public:
virtual bool is_dolphin(); virtual bool is_dolphin();
private: private:
virtual void set_config_directive(SrsConfDirective* parent, std::string dir, std::string value); virtual void set_config_directive(SrsConfDirective* parent, std::string dir, std::string value);
// reload // reload
public: public:
/** /**
* for reload handler to register itself, * for reload handler to register itself,
@ -410,7 +407,7 @@ private:
* reload the ingest section of vhost of config. * reload the ingest section of vhost of config.
*/ */
virtual int reload_ingest(SrsConfDirective* new_vhost, SrsConfDirective* old_vhost); virtual int reload_ingest(SrsConfDirective* new_vhost, SrsConfDirective* old_vhost);
// parse options and file // parse options and file
public: public:
/** /**
* parse the cli, the main(argc,argv) function. * parse the cli, the main(argc,argv) function.
@ -554,7 +551,7 @@ protected:
* @remark, use protected for the utest to override with mock. * @remark, use protected for the utest to override with mock.
*/ */
virtual int parse_buffer(_srs_internal::SrsConfigBuffer* buffer); virtual int parse_buffer(_srs_internal::SrsConfigBuffer* buffer);
// global env // global env
public: public:
/** /**
* get the current work directory. * get the current work directory.
@ -564,7 +561,7 @@ public:
* get the cli, the main(argc,argv), program start command. * get the cli, the main(argc,argv), program start command.
*/ */
virtual std::string argv(); virtual std::string argv();
// global section // global section
public: public:
/** /**
* get the directive root, corresponding to the config file. * get the directive root, corresponding to the config file.
@ -619,7 +616,7 @@ public:
virtual std::string get_work_dir(); virtual std::string get_work_dir();
// whether use asprocess mode. // whether use asprocess mode.
virtual bool get_asprocess(); virtual bool get_asprocess();
// stream_caster section // stream_caster section
public: public:
/** /**
* get all stream_caster in config file. * get all stream_caster in config file.
@ -649,7 +646,7 @@ public:
* get the max udp port for rtp of stream caster rtsp. * get the max udp port for rtp of stream caster rtsp.
*/ */
virtual int get_stream_caster_rtp_port_max(SrsConfDirective* conf); virtual int get_stream_caster_rtp_port_max(SrsConfDirective* conf);
// kafka section. // kafka section.
public: public:
/** /**
* whether the kafka enabled. * whether the kafka enabled.
@ -663,7 +660,7 @@ public:
* get the kafka topic to use for srs. * get the kafka topic to use for srs.
*/ */
virtual std::string get_kafka_topic(); virtual std::string get_kafka_topic();
// vhost specified section // vhost specified section
public: public:
/** /**
* get the vhost directive by vhost name. * get the vhost directive by vhost name.
@ -816,7 +813,7 @@ private:
* get the global chunk size. * get the global chunk size.
*/ */
virtual int get_global_chunk_size(); virtual int get_global_chunk_size();
// forward section // forward section
public: public:
/** /**
* whether the forwarder enabled. * whether the forwarder enabled.
@ -826,7 +823,7 @@ public:
* get the forward directive of vhost. * get the forward directive of vhost.
*/ */
virtual SrsConfDirective* get_forwards(std::string vhost); virtual SrsConfDirective* get_forwards(std::string vhost);
// http_hooks section // http_hooks section
private: private:
/** /**
* get the http_hooks directive of vhost. * get the http_hooks directive of vhost.
@ -883,7 +880,7 @@ public:
* @return the on_hls_notify callback directive, the args is the url to callback. * @return the on_hls_notify callback directive, the args is the url to callback.
*/ */
virtual SrsConfDirective* get_vhost_on_hls_notify(std::string vhost); virtual SrsConfDirective* get_vhost_on_hls_notify(std::string vhost);
// bwct(bandwidth check tool) section // bwct(bandwidth check tool) section
public: public:
/** /**
* whether bw check enabled for vhost. * whether bw check enabled for vhost.
@ -908,7 +905,7 @@ public:
* @remark this is used to protect the service bandwidth. * @remark this is used to protect the service bandwidth.
*/ */
virtual int get_bw_check_limit_kbps(std::string vhost); virtual int get_bw_check_limit_kbps(std::string vhost);
// vhost cluster section // vhost cluster section
public: public:
/** /**
* whether vhost is edge mode. * whether vhost is edge mode.
@ -939,7 +936,7 @@ public:
* @see https://github.com/ossrs/srs/issues/372 * @see https://github.com/ossrs/srs/issues/372
*/ */
virtual std::string get_vhost_edge_transform_vhost(std::string vhost); virtual std::string get_vhost_edge_transform_vhost(std::string vhost);
// vhost security section // vhost security section
public: public:
/** /**
* whether the secrity of vhost enabled. * whether the secrity of vhost enabled.
@ -949,7 +946,7 @@ public:
* get the security rules. * get the security rules.
*/ */
virtual SrsConfDirective* get_security_rules(std::string vhost); virtual SrsConfDirective* get_security_rules(std::string vhost);
// vhost transcode section // vhost transcode section
public: public:
/** /**
* get the transcode directive of vhost in specified scope. * get the transcode directive of vhost in specified scope.
@ -1070,7 +1067,7 @@ public:
* @remark, we will use some variable, for instance, [vhost] to substitude with vhost. * @remark, we will use some variable, for instance, [vhost] to substitude with vhost.
*/ */
virtual std::string get_engine_output(SrsConfDirective* conf); virtual std::string get_engine_output(SrsConfDirective* conf);
// vhost exec secion // vhost exec secion
private: private:
/** /**
* get the exec directive of vhost. * get the exec directive of vhost.
@ -1085,7 +1082,7 @@ public:
* get all exec publish directives of vhost. * get all exec publish directives of vhost.
*/ */
virtual std::vector<SrsConfDirective*> get_exec_publishs(std::string vhost); virtual std::vector<SrsConfDirective*> get_exec_publishs(std::string vhost);
// vhost ingest section // vhost ingest section
public: public:
/** /**
* get the ingest directives of vhost. * get the ingest directives of vhost.
@ -1111,7 +1108,7 @@ public:
* get the ingest input url. * get the ingest input url.
*/ */
virtual std::string get_ingest_input_url(SrsConfDirective* conf); virtual std::string get_ingest_input_url(SrsConfDirective* conf);
// log section // log section
public: public:
/** /**
* whether log to file. * whether log to file.
@ -1134,7 +1131,7 @@ public:
* @remark, /dev/null to disable it. * @remark, /dev/null to disable it.
*/ */
virtual std::string get_ffmpeg_log_dir(); virtual std::string get_ffmpeg_log_dir();
// The MPEG-DASH section. // The MPEG-DASH section.
private: private:
virtual SrsConfDirective* get_dash(std::string vhost); virtual SrsConfDirective* get_dash(std::string vhost);
public: public:
@ -1150,7 +1147,7 @@ public:
virtual std::string get_dash_path(std::string vhost); virtual std::string get_dash_path(std::string vhost);
// Get the path for DASH MPD, to generate the MPD file. // Get the path for DASH MPD, to generate the MPD file.
virtual std::string get_dash_mpd_file(std::string vhost); virtual std::string get_dash_mpd_file(std::string vhost);
// hls section // hls section
private: private:
/** /**
* get the hls directive of vhost. * get the hls directive of vhost.
@ -1231,7 +1228,7 @@ public:
* that is, to read max bytes of the bytes from the callback, or timeout or error. * that is, to read max bytes of the bytes from the callback, or timeout or error.
*/ */
virtual int get_vhost_hls_nb_notify(std::string vhost); virtual int get_vhost_hls_nb_notify(std::string vhost);
// hds section // hds section
private: private:
/** /**
* get the hds directive of vhost. * get the hds directive of vhost.
@ -1256,7 +1253,7 @@ public:
*/ */
virtual double get_hds_window(const std::string &vhost); virtual double get_hds_window(const std::string &vhost);
// dvr section // dvr section
private: private:
/** /**
* get the dvr directive. * get the dvr directive.
@ -1292,7 +1289,7 @@ public:
* get the time_jitter algorithm for dvr. * get the time_jitter algorithm for dvr.
*/ */
virtual int get_dvr_time_jitter(std::string vhost); virtual int get_dvr_time_jitter(std::string vhost);
// http api section // http api section
private: private:
/** /**
* whether http api enabled * whether http api enabled
@ -1327,7 +1324,7 @@ public:
* whether allow rpc update. * whether allow rpc update.
*/ */
virtual bool get_raw_api_allow_update(); virtual bool get_raw_api_allow_update();
// http stream section // http stream section
private: private:
/** /**
* whether http stream enabled. * whether http stream enabled.
@ -1366,7 +1363,7 @@ public:
* the path on disk for mount root of http vhost. * the path on disk for mount root of http vhost.
*/ */
virtual std::string get_vhost_http_dir(std::string vhost); virtual std::string get_vhost_http_dir(std::string vhost);
// flv live streaming section // flv live streaming section
public: public:
/** /**
* get whether vhost enabled http flv live stream * get whether vhost enabled http flv live stream
@ -1381,7 +1378,7 @@ public:
* used to generate the flv stream mount path. * used to generate the flv stream mount path.
*/ */
virtual std::string get_vhost_http_remux_mount(std::string vhost); virtual std::string get_vhost_http_remux_mount(std::string vhost);
// http heartbeart section // http heartbeart section
private: private:
/** /**
* get the heartbeat directive. * get the heartbeat directive.
@ -1408,7 +1405,7 @@ public:
* whether report with summaries of http api: /api/v1/summaries. * whether report with summaries of http api: /api/v1/summaries.
*/ */
virtual bool get_heartbeat_summaries(); virtual bool get_heartbeat_summaries();
// stats section // stats section
private: private:
/** /**
* get the stats directive. * get the stats directive.

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_conn.hpp> #include <srs_app_conn.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_CONN_HPP #ifndef SRS_APP_CONN_HPP
#define SRS_APP_CONN_HPP #define SRS_APP_CONN_HPP
/*
#include <srs_app_conn.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
@ -55,10 +51,10 @@ public:
}; };
/** /**
* the basic connection of SRS, * the basic connection of SRS,
* all connections accept from listener must extends from this base class, * all connections accept from listener must extends from this base class,
* server will add the connection to manager, and delete it when remove. * server will add the connection to manager, and delete it when remove.
*/ */
class SrsConnection : virtual public ISrsOneCycleThreadHandler, virtual public IKbpsDelta, virtual public ISrsReloadHandler class SrsConnection : virtual public ISrsOneCycleThreadHandler, virtual public IKbpsDelta, virtual public ISrsReloadHandler
{ {
private: private:

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_dash.hpp> #include <srs_app_dash.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_DASH_HPP #ifndef SRS_APP_DASH_HPP
#define SRS_APP_DASH_HPP #define SRS_APP_DASH_HPP
/*
#include <srs_app_dash.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_dvr.hpp> #include <srs_app_dvr.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_DVR_HPP #ifndef SRS_APP_DVR_HPP
#define SRS_APP_DVR_HPP #define SRS_APP_DVR_HPP
/*
#include <srs_app_dvr.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
@ -166,8 +163,8 @@ protected:
}; };
/** /**
* the dvr async call. * the dvr async call.
*/ */
class SrsDvrAsyncCallOnDvr : public ISrsAsyncCallTask class SrsDvrAsyncCallOnDvr : public ISrsAsyncCallTask
{ {
private: private:
@ -184,7 +181,7 @@ public:
/** /**
* The DVR plan, when and how to reap segment. * The DVR plan, when and how to reap segment.
*/ */
class SrsDvrPlan : public ISrsReloadHandler class SrsDvrPlan : public ISrsReloadHandler
{ {
public: public:
@ -204,7 +201,7 @@ public:
virtual int on_meta_data(SrsSharedPtrMessage* shared_metadata); virtual int on_meta_data(SrsSharedPtrMessage* shared_metadata);
virtual int on_audio(SrsSharedPtrMessage* shared_audio); virtual int on_audio(SrsSharedPtrMessage* shared_audio);
virtual int on_video(SrsSharedPtrMessage* shared_video); virtual int on_video(SrsSharedPtrMessage* shared_video);
// Internal interface for segmenter. // Internal interface for segmenter.
public: public:
// When segmenter close a segment. // When segmenter close a segment.
virtual int on_reap_segment(); virtual int on_reap_segment();

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_edge.hpp> #include <srs_app_edge.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_EDGE_HPP #ifndef SRS_APP_EDGE_HPP
#define SRS_APP_EDGE_HPP #define SRS_APP_EDGE_HPP
/*
#include <srs_app_edge.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <srs_app_st.hpp> #include <srs_app_st.hpp>
@ -52,8 +48,8 @@ class SrsSimpleRtmpClient;
class SrsPacket; class SrsPacket;
/** /**
* the state of edge, auto machine * the state of edge, auto machine
*/ */
enum SrsEdgeState enum SrsEdgeState
{ {
SrsEdgeStateInit = 0, SrsEdgeStateInit = 0,
@ -68,8 +64,8 @@ enum SrsEdgeState
}; };
/** /**
* the state of edge from user, manual machine * the state of edge from user, manual machine
*/ */
enum SrsEdgeUserState enum SrsEdgeUserState
{ {
SrsEdgeUserStateInit = 0, SrsEdgeUserStateInit = 0,
@ -116,8 +112,8 @@ public:
}; };
/** /**
* edge used to ingest stream from origin. * edge used to ingest stream from origin.
*/ */
class SrsEdgeIngester : public ISrsReusableThread2Handler class SrsEdgeIngester : public ISrsReusableThread2Handler
{ {
private: private:
@ -146,8 +142,8 @@ private:
}; };
/** /**
* edge used to forward stream to origin. * edge used to forward stream to origin.
*/ */
class SrsEdgeForwarder : public ISrsReusableThread2Handler class SrsEdgeForwarder : public ISrsReusableThread2Handler
{ {
private: private:
@ -185,9 +181,9 @@ public:
}; };
/** /**
* play edge control service. * play edge control service.
* downloading edge speed-up. * downloading edge speed-up.
*/ */
class SrsPlayEdge class SrsPlayEdge
{ {
private: private:
@ -220,9 +216,9 @@ public:
}; };
/** /**
* publish edge control service. * publish edge control service.
* uploading edge speed-up. * uploading edge speed-up.
*/ */
class SrsPublishEdge class SrsPublishEdge
{ {
private: private:

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_empty.hpp> #include <srs_app_empty.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_EMPTY_HPP #ifndef SRS_APP_EMPTY_HPP
#define SRS_APP_EMPTY_HPP #define SRS_APP_EMPTY_HPP
/*
#include <srs_app_empty.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#endif #endif

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_encoder.hpp> #include <srs_app_encoder.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_ENCODER_HPP #ifndef SRS_APP_ENCODER_HPP
#define SRS_APP_ENCODER_HPP #define SRS_APP_ENCODER_HPP
/*
#include <srs_app_encoder.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_AUTO_TRANSCODE #ifdef SRS_AUTO_TRANSCODE
@ -42,9 +39,9 @@ class SrsPithyPrint;
class SrsFFMPEG; class SrsFFMPEG;
/** /**
* the encoder for a stream, * the encoder for a stream,
* may use multiple ffmpegs to transcode the specified stream. * may use multiple ffmpegs to transcode the specified stream.
*/ */
class SrsEncoder : public ISrsReusableThreadHandler class SrsEncoder : public ISrsReusableThreadHandler
{ {
private: private:

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_ffmpeg.hpp> #include <srs_app_ffmpeg.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_FFMPEG_HPP #ifndef SRS_APP_FFMPEG_HPP
#define SRS_APP_FFMPEG_HPP #define SRS_APP_FFMPEG_HPP
/*
#include <srs_app_ffmpeg.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_AUTO_FFMPEG_STUB #ifdef SRS_AUTO_FFMPEG_STUB
@ -39,9 +36,9 @@ class SrsPithyPrint;
class SrsProcess; class SrsProcess;
/** /**
* a transcode engine: ffmepg, * a transcode engine: ffmepg,
* used to transcode a stream to another. * used to transcode a stream to another.
*/ */
class SrsFFMPEG class SrsFFMPEG
{ {
private: private:

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_forward.hpp> #include <srs_app_forward.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_FORWARD_HPP #ifndef SRS_APP_FORWARD_HPP
#define SRS_APP_FORWARD_HPP #define SRS_APP_FORWARD_HPP
/*
#include <srs_app_forward.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
@ -47,8 +44,8 @@ class SrsKbps;
class SrsSimpleRtmpClient; class SrsSimpleRtmpClient;
/** /**
* forward the stream to other servers. * forward the stream to other servers.
*/ */
// TODO: FIXME: refine the error log, comments it. // TODO: FIXME: refine the error log, comments it.
class SrsForwarder : public ISrsReusableThread2Handler class SrsForwarder : public ISrsReusableThread2Handler
{ {

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_fragment.hpp> #include <srs_app_fragment.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_FRAGMENT_HPP #ifndef SRS_APP_FRAGMENT_HPP
#define SRS_APP_FRAGMENT_HPP #define SRS_APP_FRAGMENT_HPP
/*
#include <srs_app_fragment.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>

View file

@ -1,25 +1,26 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
* Copyright (c) 2013-2017 SRS(ossrs)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
Copyright (c) 2013-2017 SRS(ossrs)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <srs_app_hds.hpp> #include <srs_app_hds.hpp>
#ifdef SRS_AUTO_HDS #ifdef SRS_AUTO_HDS
@ -261,12 +262,12 @@ private:
}; };
SrsHds::SrsHds() SrsHds::SrsHds()
: currentSegment(NULL) : currentSegment(NULL)
, fragment_index(1) , fragment_index(1)
, video_sh(NULL) , video_sh(NULL)
, audio_sh(NULL) , audio_sh(NULL)
, hds_req(NULL) , hds_req(NULL)
, hds_enabled(false) , hds_enabled(false)
{ {
} }

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_HDS_HPP #ifndef SRS_APP_HDS_HPP
#define SRS_APP_HDS_HPP #define SRS_APP_HDS_HPP

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_heartbeat.hpp> #include <srs_app_heartbeat.hpp>

View file

@ -1,38 +1,35 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_HEARTBEAT_HPP #ifndef SRS_APP_HEARTBEAT_HPP
#define SRS_APP_HEARTBEAT_HPP #define SRS_APP_HEARTBEAT_HPP
/*
#include <srs_app_heartbeat.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
/** /**
* the http heartbeat to api-server to notice api * the http heartbeat to api-server to notice api
* that the information of SRS. * that the information of SRS.
*/ */
class SrsHttpHeartbeat class SrsHttpHeartbeat
{ {
public: public:

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_hls.hpp> #include <srs_app_hls.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_HLS_HPP #ifndef SRS_APP_HLS_HPP
#define SRS_APP_HLS_HPP #define SRS_APP_HLS_HPP
/*
#include <srs_app_hls.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
@ -54,11 +51,11 @@ class SrsHlsSegment;
class SrsTsContext; class SrsTsContext;
/** /**
* the wrapper of m3u8 segment from specification: * the wrapper of m3u8 segment from specification:
* *
* 3.3.2. EXTINF * 3.3.2. EXTINF
* The EXTINF tag specifies the duration of a media segment. * The EXTINF tag specifies the duration of a media segment.
*/ */
class SrsHlsSegment : public SrsFragment class SrsHlsSegment : public SrsFragment
{ {
public: public:
@ -116,13 +113,13 @@ public:
}; };
/** /**
* muxer the HLS stream(m3u8 and ts files). * muxer the HLS stream(m3u8 and ts files).
* generally, the m3u8 muxer only provides methods to open/close segments, * generally, the m3u8 muxer only provides methods to open/close segments,
* to flush video/audio, without any mechenisms. * to flush video/audio, without any mechenisms.
* *
* that is, user must use HlsCache, which will control the methods of muxer, * that is, user must use HlsCache, which will control the methods of muxer,
* and provides HLS mechenisms. * and provides HLS mechenisms.
*/ */
class SrsHlsMuxer class SrsHlsMuxer
{ {
private: private:
@ -223,22 +220,22 @@ private:
}; };
/** /**
* hls stream cache, * hls stream cache,
* use to cache hls stream and flush to hls muxer. * use to cache hls stream and flush to hls muxer.
* *
* when write stream to ts file: * when write stream to ts file:
* video frame will directly flush to M3u8Muxer, * video frame will directly flush to M3u8Muxer,
* audio frame need to cache, because it's small and flv tbn problem. * audio frame need to cache, because it's small and flv tbn problem.
* *
* whatever, the Hls cache used to cache video/audio, * whatever, the Hls cache used to cache video/audio,
* and flush video/audio to m3u8 muxer if needed. * and flush video/audio to m3u8 muxer if needed.
* *
* about the flv tbn problem: * about the flv tbn problem:
* flv tbn is 1/1000, ts tbn is 1/90000, * flv tbn is 1/1000, ts tbn is 1/90000,
* when timestamp convert to flv tbn, it will loose precise, * when timestamp convert to flv tbn, it will loose precise,
* so we must gather audio frame together, and recalc the timestamp @see SrsTsAacJitter, * so we must gather audio frame together, and recalc the timestamp @see SrsTsAacJitter,
* we use a aac jitter to correct the audio pts. * we use a aac jitter to correct the audio pts.
*/ */
class SrsHlsController class SrsHlsController
{ {
private: private:
@ -289,9 +286,9 @@ private:
}; };
/** /**
* Transmux RTMP stream to HLS(m3u8 and ts). * Transmux RTMP stream to HLS(m3u8 and ts).
* TODO: FIXME: add utest for hls. * TODO: FIXME: add utest for hls.
*/ */
class SrsHls class SrsHls
{ {
private: private:

View file

@ -1,24 +1,24 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_hourglass.hpp> #include <srs_app_hourglass.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_HOURGLASS_HPP #ifndef SRS_APP_HOURGLASS_HPP
#define SRS_APP_HOURGLASS_HPP #define SRS_APP_HOURGLASS_HPP
/*
#include <srs_app_hourglass.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <map> #include <map>

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_http_api.hpp> #include <srs_app_http_api.hpp>
@ -1291,7 +1291,7 @@ int SrsGoApiError::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
} }
SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, string cip) SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, string cip)
: SrsConnection(cm, fd, cip) : SrsConnection(cm, fd, cip)
{ {
mux = m; mux = m;
cors = new SrsHttpCorsMux(); cors = new SrsHttpCorsMux();

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_HTTP_API_HPP #ifndef SRS_APP_HTTP_API_HPP
#define SRS_APP_HTTP_API_HPP #define SRS_APP_HTTP_API_HPP
/*
#include <srs_app_http_api.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
class SrsStSocket; class SrsStSocket;

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_http_client.hpp> #include <srs_app_http_client.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_HTTP_CLIENT_HPP #ifndef SRS_APP_HTTP_CLIENT_HPP
#define SRS_APP_HTTP_CLIENT_HPP #define SRS_APP_HTTP_CLIENT_HPP
/*
#include <srs_app_http_client.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_http_conn.hpp> #include <srs_app_http_conn.hpp>
@ -1082,7 +1082,7 @@ int SrsHttpParser::on_body(http_parser* parser, const char* at, size_t length)
} }
SrsHttpConn::SrsHttpConn(IConnectionManager* cm, st_netfd_t fd, ISrsHttpServeMux* m, string cip) SrsHttpConn::SrsHttpConn(IConnectionManager* cm, st_netfd_t fd, ISrsHttpServeMux* m, string cip)
: SrsConnection(cm, fd, cip) : SrsConnection(cm, fd, cip)
{ {
parser = new SrsHttpParser(); parser = new SrsHttpParser();
cors = new SrsHttpCorsMux(); cors = new SrsHttpCorsMux();
@ -1227,7 +1227,7 @@ int SrsHttpConn::on_reload_http_stream_crossdomain()
} }
SrsResponseOnlyHttpConn::SrsResponseOnlyHttpConn(IConnectionManager* cm, st_netfd_t fd, ISrsHttpServeMux* m, string cip) SrsResponseOnlyHttpConn::SrsResponseOnlyHttpConn(IConnectionManager* cm, st_netfd_t fd, ISrsHttpServeMux* m, string cip)
: SrsHttpConn(cm, fd, m, cip) : SrsHttpConn(cm, fd, m, cip)
{ {
} }

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_HTTP_CONN_HPP #ifndef SRS_APP_HTTP_CONN_HPP
#define SRS_APP_HTTP_CONN_HPP #define SRS_APP_HTTP_CONN_HPP
/*
#include <srs_app_http_conn.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <map> #include <map>
@ -128,7 +124,7 @@ public:
* initialize the response reader with buffer. * initialize the response reader with buffer.
*/ */
virtual int initialize(SrsFastStream* buffer); virtual int initialize(SrsFastStream* buffer);
// interface ISrsHttpResponseReader // interface ISrsHttpResponseReader
public: public:
virtual bool eof(); virtual bool eof();
virtual int read(char* data, int nb_data, int* nb_read); virtual int read(char* data, int nb_data, int* nb_read);
@ -205,9 +201,7 @@ public:
/** /**
* set the original messages, then update the message. * set the original messages, then update the message.
*/ */
virtual int update(std::string url, bool allow_jsonp, http_parser* header, virtual int update(std::string url, bool allow_jsonp, http_parser* header, SrsFastStream* body, std::vector<SrsHttpHeaderField>& headers);
SrsFastStream* body, std::vector<SrsHttpHeaderField>& headers
);
public: public:
virtual SrsConnection* connection(); virtual SrsConnection* connection();
public: public:
@ -411,10 +405,10 @@ public:
virtual ~SrsHttpServer(); virtual ~SrsHttpServer();
public: public:
virtual int initialize(); virtual int initialize();
// ISrsHttpServeMux // ISrsHttpServeMux
public: public:
virtual int serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r); virtual int serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r);
// http flv/ts/mp3/aac stream // http flv/ts/mp3/aac stream
public: public:
virtual int http_mount(SrsSource* s, SrsRequest* r); virtual int http_mount(SrsSource* s, SrsRequest* r);
virtual void http_unmount(SrsSource* s, SrsRequest* r); virtual void http_unmount(SrsSource* s, SrsRequest* r);

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_http_hooks.hpp> #include <srs_app_http_hooks.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_HTTP_HOOKS_HPP #ifndef SRS_APP_HTTP_HOOKS_HPP
#define SRS_APP_HTTP_HOOKS_HPP #define SRS_APP_HTTP_HOOKS_HPP
/*
#include <srs_app_http_hooks.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
@ -38,10 +35,10 @@ class SrsHttpParser;
class SrsHttpClient; class SrsHttpClient;
/** /**
* the http hooks, http callback api, * the http hooks, http callback api,
* for some event, such as on_connect, call * for some event, such as on_connect, call
* a http api(hooks). * a http api(hooks).
*/ */
class SrsHttpHooks class SrsHttpHooks
{ {
private: private:

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_http_static.hpp> #include <srs_app_http_static.hpp>
@ -52,7 +52,7 @@ using namespace std;
#include <srs_app_server.hpp> #include <srs_app_server.hpp>
SrsVodStream::SrsVodStream(string root_dir) SrsVodStream::SrsVodStream(string root_dir)
: SrsHttpFileServer(root_dir) : SrsHttpFileServer(root_dir)
{ {
} }

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_HTTP_STATIC_HPP #ifndef SRS_APP_HTTP_STATIC_HPP
#define SRS_APP_HTTP_STATIC_HPP #define SRS_APP_HTTP_STATIC_HPP
/*
#include <srs_app_http_static.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <srs_app_http_conn.hpp> #include <srs_app_http_conn.hpp>
@ -49,9 +45,9 @@ protected:
}; };
/** /**
* the http static server instance, * the http static server instance,
* serve http static file and flv/mp4 vod stream. * serve http static file and flv/mp4 vod stream.
*/ */
class SrsHttpStaticServer : virtual public ISrsReloadHandler class SrsHttpStaticServer : virtual public ISrsReloadHandler
{ {
private: private:

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_http_stream.hpp> #include <srs_app_http_stream.hpp>
@ -991,13 +991,10 @@ int SrsHttpStreamServer::initialize_flv_entry(std::string vhost)
return ret; return ret;
} }
SrsLiveEntry* entry = new SrsLiveEntry( SrsLiveEntry* entry = new SrsLiveEntry(_srs_config->get_vhost_http_remux_mount(vhost));
_srs_config->get_vhost_http_remux_mount(vhost)
);
tflvs[vhost] = entry; tflvs[vhost] = entry;
srs_trace("http flv live stream, vhost=%s, mount=%s", srs_trace("http flv live stream, vhost=%s, mount=%s", vhost.c_str(), entry->mount.c_str());
vhost.c_str(), entry->mount.c_str());
return ret; return ret;
} }

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_HTTP_STREAM_HPP #ifndef SRS_APP_HTTP_STREAM_HPP
#define SRS_APP_HTTP_STREAM_HPP #define SRS_APP_HTTP_STREAM_HPP
/*
#include <srs_app_http_stream.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <srs_app_http_conn.hpp> #include <srs_app_http_conn.hpp>
@ -38,10 +34,10 @@ class SrsFlvTransmuxer;
class SrsTsTransmuxer; class SrsTsTransmuxer;
/** /**
* for the srs http stream cache, * for the srs http stream cache,
* for example, the audio stream cache to make android(weixin) happy. * for example, the audio stream cache to make android(weixin) happy.
* we start a thread to shrink the queue. * we start a thread to shrink the queue.
*/ */
class SrsBufferCache : public ISrsEndlessThreadHandler class SrsBufferCache : public ISrsEndlessThreadHandler
{ {
private: private:
@ -64,8 +60,8 @@ public:
}; };
/** /**
* the stream encoder in some codec, for example, flv or aac. * the stream encoder in some codec, for example, flv or aac.
*/ */
class ISrsBufferEncoder class ISrsBufferEncoder
{ {
public: public:
@ -98,8 +94,8 @@ public:
}; };
/** /**
* the flv stream encoder, remux rtmp stream to flv stream. * the flv stream encoder, remux rtmp stream to flv stream.
*/ */
class SrsFlvStreamEncoder : public ISrsBufferEncoder class SrsFlvStreamEncoder : public ISrsBufferEncoder
{ {
protected: protected:
@ -136,8 +132,8 @@ public:
#endif #endif
/** /**
* the ts stream encoder, remux rtmp stream to ts stream. * the ts stream encoder, remux rtmp stream to ts stream.
*/ */
class SrsTsStreamEncoder : public ISrsBufferEncoder class SrsTsStreamEncoder : public ISrsBufferEncoder
{ {
private: private:
@ -156,8 +152,8 @@ public:
}; };
/** /**
* the aac stream encoder, remux rtmp stream to aac stream. * the aac stream encoder, remux rtmp stream to aac stream.
*/ */
class SrsAacStreamEncoder : public ISrsBufferEncoder class SrsAacStreamEncoder : public ISrsBufferEncoder
{ {
private: private:
@ -177,8 +173,8 @@ public:
}; };
/** /**
* the mp3 stream encoder, remux rtmp stream to mp3 stream. * the mp3 stream encoder, remux rtmp stream to mp3 stream.
*/ */
class SrsMp3StreamEncoder : public ISrsBufferEncoder class SrsMp3StreamEncoder : public ISrsBufferEncoder
{ {
private: private:
@ -198,8 +194,8 @@ public:
}; };
/** /**
* write stream to http response direclty. * write stream to http response direclty.
*/ */
class SrsBufferWriter : public SrsFileWriter class SrsBufferWriter : public SrsFileWriter
{ {
private: private:
@ -219,9 +215,9 @@ public:
}; };
/** /**
* the flv live stream supports access rtmp in flv over http. * the flv live stream supports access rtmp in flv over http.
* srs will remux rtmp to flv streaming. * srs will remux rtmp to flv streaming.
*/ */
class SrsLiveStream : public ISrsHttpHandler class SrsLiveStream : public ISrsHttpHandler
{ {
private: private:
@ -239,8 +235,8 @@ private:
}; };
/** /**
* the srs live entry * the srs live entry
*/ */
struct SrsLiveEntry struct SrsLiveEntry
{ {
private: private:
@ -268,12 +264,12 @@ public:
}; };
/** /**
* the http stream server instance, * the http stream server instance,
* serve http stream, for example, flv/ts/mp3/aac live stream. * serve http stream, for example, flv/ts/mp3/aac live stream.
*/ */
// TODO: Support multiple stream. // TODO: Support multiple stream.
class SrsHttpStreamServer : virtual public ISrsReloadHandler class SrsHttpStreamServer : virtual public ISrsReloadHandler
, virtual public ISrsHttpMatchHijacker , virtual public ISrsHttpMatchHijacker
{ {
private: private:
SrsServer* server; SrsServer* server;
@ -288,7 +284,7 @@ public:
virtual ~SrsHttpStreamServer(); virtual ~SrsHttpStreamServer();
public: public:
virtual int initialize(); virtual int initialize();
// http flv/ts/mp3/aac stream // http flv/ts/mp3/aac stream
public: public:
virtual int http_mount(SrsSource* s, SrsRequest* r); virtual int http_mount(SrsSource* s, SrsRequest* r);
virtual void http_unmount(SrsSource* s, SrsRequest* r); virtual void http_unmount(SrsSource* s, SrsRequest* r);

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_ingest.hpp> #include <srs_app_ingest.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_INGEST_HPP #ifndef SRS_APP_INGEST_HPP
#define SRS_APP_INGEST_HPP #define SRS_APP_INGEST_HPP
/*
#include <srs_app_ingest.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_AUTO_INGEST #ifdef SRS_AUTO_INGEST
@ -41,8 +38,8 @@ class SrsConfDirective;
class SrsPithyPrint; class SrsPithyPrint;
/** /**
* ingester ffmpeg object. * ingester ffmpeg object.
*/ */
class SrsIngesterFFMPEG class SrsIngesterFFMPEG
{ {
private: private:
@ -70,10 +67,10 @@ public:
}; };
/** /**
* ingest file/stream/device, * ingest file/stream/device,
* encode with FFMPEG(optional), * encode with FFMPEG(optional),
* push to SRS(or any RTMP server) over RTMP. * push to SRS(or any RTMP server) over RTMP.
*/ */
class SrsIngester : public ISrsReusableThreadHandler, public ISrsReloadHandler class SrsIngester : public ISrsReusableThreadHandler, public ISrsReloadHandler
{ {
private: private:

View file

@ -1,24 +1,24 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_kafka.hpp> #include <srs_app_kafka.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_KAFKA_HPP #ifndef SRS_APP_KAFKA_HPP
#define SRS_APP_KAFKA_HPP #define SRS_APP_KAFKA_HPP
/*
#include <srs_app_kafka.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <map> #include <map>

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_listener.hpp> #include <srs_app_listener.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_LISTENER_HPP #ifndef SRS_APP_LISTENER_HPP
#define SRS_APP_LISTENER_HPP #define SRS_APP_LISTENER_HPP
/*
#include <srs_app_listener.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
@ -38,8 +34,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
struct sockaddr_in; struct sockaddr_in;
/** /**
* the udp packet handler. * the udp packet handler.
*/ */
class ISrsUdpHandler class ISrsUdpHandler
{ {
public: public:
@ -65,8 +61,8 @@ public:
}; };
/** /**
* the tcp connection handler. * the tcp connection handler.
*/ */
class ISrsTcpHandler class ISrsTcpHandler
{ {
public: public:
@ -80,8 +76,8 @@ public:
}; };
/** /**
* bind udp port, start thread to recv packet and handler it. * bind udp port, start thread to recv packet and handler it.
*/ */
class SrsUdpListener : public ISrsReusableThreadHandler class SrsUdpListener : public ISrsReusableThreadHandler
{ {
private: private:
@ -109,8 +105,8 @@ public:
}; };
/** /**
* bind and listen tcp port, use handler to process the client. * bind and listen tcp port, use handler to process the client.
*/ */
class SrsTcpListener : public ISrsReusableThreadHandler class SrsTcpListener : public ISrsReusableThreadHandler
{ {
private: private:

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_log.hpp> #include <srs_app_log.hpp>
@ -426,10 +426,7 @@ void SrsFastLog::open_log_file()
fd = ::open(filename.c_str(), O_RDWR | O_APPEND); fd = ::open(filename.c_str(), O_RDWR | O_APPEND);
if(fd == -1 && errno == ENOENT) { if(fd == -1 && errno == ENOENT) {
fd = open(filename.c_str(), fd = open(filename.c_str(), O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
O_RDWR | O_CREAT | O_TRUNC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
);
} }
} }

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_LOG_HPP #ifndef SRS_APP_LOG_HPP
#define SRS_APP_LOG_HPP #define SRS_APP_LOG_HPP
/*
#include <srs_app_log.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <srs_app_st.hpp> #include <srs_app_st.hpp>
@ -40,9 +36,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <map> #include <map>
/** /**
* st thread context, get_id will get the st-thread id, * st thread context, get_id will get the st-thread id,
* which identify the client. * which identify the client.
*/ */
class SrsThreadContext : public ISrsThreadContext class SrsThreadContext : public ISrsThreadContext
{ {
private: private:
@ -59,13 +55,13 @@ public:
}; };
/** /**
* we use memory/disk cache and donot flush when write log. * we use memory/disk cache and donot flush when write log.
* it's ok to use it without config, which will log to console, and default trace level. * it's ok to use it without config, which will log to console, and default trace level.
* when you want to use different level, override this classs, set the protected _level. * when you want to use different level, override this classs, set the protected _level.
*/ */
class SrsFastLog : public ISrsLog, public ISrsReloadHandler class SrsFastLog : public ISrsLog, public ISrsReloadHandler
{ {
// for utest to override // for utest to override
protected: protected:
// defined in SrsLogLevel. // defined in SrsLogLevel.
int _level; int _level;

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_mpegts_udp.hpp> #include <srs_app_mpegts_udp.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_MPEGTS_UDP_HPP #ifndef SRS_APP_MPEGTS_UDP_HPP
#define SRS_APP_MPEGTS_UDP_HPP #define SRS_APP_MPEGTS_UDP_HPP
/*
#include <srs_app_mpegts_udp.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_AUTO_STREAM_CASTER #ifdef SRS_AUTO_STREAM_CASTER
@ -55,10 +51,10 @@ class SrsSimpleRtmpClient;
#include <srs_app_listener.hpp> #include <srs_app_listener.hpp>
/** /**
* the queue for mpegts over udp to send packets. * the queue for mpegts over udp to send packets.
* for the aac in mpegts contains many flv packets in a pes packet, * for the aac in mpegts contains many flv packets in a pes packet,
* we must recalc the timestamp. * we must recalc the timestamp.
*/ */
class SrsMpegtsQueue class SrsMpegtsQueue
{ {
private: private:
@ -75,10 +71,10 @@ public:
}; };
/** /**
* the mpegts over udp stream caster. * the mpegts over udp stream caster.
*/ */
class SrsMpegtsOverUdp : virtual public ISrsTsHandler class SrsMpegtsOverUdp : virtual public ISrsTsHandler
, virtual public ISrsUdpHandler , virtual public ISrsUdpHandler
{ {
private: private:
SrsBuffer* stream; SrsBuffer* stream;

View file

@ -1,24 +1,24 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_ng_exec.hpp> #include <srs_app_ng_exec.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_NG_EXEC_HPP #ifndef SRS_APP_NG_EXEC_HPP
#define SRS_APP_NG_EXEC_HPP #define SRS_APP_NG_EXEC_HPP
/*
#include <srs_app_ng_exec.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <vector> #include <vector>

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_pithy_print.hpp> #include <srs_app_pithy_print.hpp>

View file

@ -1,40 +1,36 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_PITHY_PRINT_HPP #ifndef SRS_APP_PITHY_PRINT_HPP
#define SRS_APP_PITHY_PRINT_HPP #define SRS_APP_PITHY_PRINT_HPP
/*
#include <srs_app_pithy_print.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <srs_app_reload.hpp> #include <srs_app_reload.hpp>
/** /**
* the stage info to calc the age. * the stage info to calc the age.
*/ */
class SrsStageInfo : public ISrsReloadHandler class SrsStageInfo : public ISrsReloadHandler
{ {
public: public:
@ -63,16 +59,16 @@ public:
* if there is 1client, it will print every 3s. * if there is 1client, it will print every 3s.
* if there is 10clients, random select one to print every 3s. * if there is 10clients, random select one to print every 3s.
* Usage: * Usage:
SrsPithyPrint* pprint = SrsPithyPrint::create_rtmp_play(); * SrsPithyPrint* pprint = SrsPithyPrint::create_rtmp_play();
SrsAutoFree(SrsPithyPrint, pprint); * SrsAutoFree(SrsPithyPrint, pprint);
while (true) { * while (true) {
pprint->elapse(); * pprint->elapse();
if (pprint->can_print()) { * if (pprint->can_print()) {
// print pithy message. * // print pithy message.
// user can get the elapse time by: pprint->age() * // user can get the elapse time by: pprint->age()
} * }
// read and write RTMP messages. * // read and write RTMP messages.
} * }
*/ */
class SrsPithyPrint class SrsPithyPrint
{ {

View file

@ -1,24 +1,24 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_process.hpp> #include <srs_app_process.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_PROCESS_HPP #ifndef SRS_APP_PROCESS_HPP
#define SRS_APP_PROCESS_HPP #define SRS_APP_PROCESS_HPP
/*
#include <srs_app_process.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_recv_thread.hpp> #include <srs_app_recv_thread.hpp>
@ -148,7 +148,7 @@ void SrsRecvThread::on_thread_stop()
} }
SrsQueueRecvThread::SrsQueueRecvThread(SrsConsumer* consumer, SrsRtmpServer* rtmp_sdk, int timeout_ms) SrsQueueRecvThread::SrsQueueRecvThread(SrsConsumer* consumer, SrsRtmpServer* rtmp_sdk, int timeout_ms)
: trd(this, rtmp_sdk, timeout_ms) : trd(this, rtmp_sdk, timeout_ms)
{ {
_consumer = consumer; _consumer = consumer;
rtmp = rtmp_sdk; rtmp = rtmp_sdk;
@ -251,11 +251,8 @@ void SrsQueueRecvThread::on_stop()
rtmp->set_auto_response(true); rtmp->set_auto_response(true);
} }
SrsPublishRecvThread::SrsPublishRecvThread( SrsPublishRecvThread::SrsPublishRecvThread(SrsRtmpServer* rtmp_sdk, SrsRequest* _req, int mr_sock_fd, int timeout_ms, SrsRtmpConn* conn, SrsSource* source)
SrsRtmpServer* rtmp_sdk, : trd(this, rtmp_sdk, timeout_ms)
SrsRequest* _req, int mr_sock_fd, int timeout_ms,
SrsRtmpConn* conn, SrsSource* source
): trd(this, rtmp_sdk, timeout_ms)
{ {
rtmp = rtmp_sdk; rtmp = rtmp_sdk;

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_RECV_THREAD_HPP #ifndef SRS_APP_RECV_THREAD_HPP
#define SRS_APP_RECV_THREAD_HPP #define SRS_APP_RECV_THREAD_HPP
/*
#include <srs_app_recv_thread.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <vector> #include <vector>
@ -119,11 +115,11 @@ public:
}; };
/** /**
* the recv thread used to replace the timeout recv, * the recv thread used to replace the timeout recv,
* which hurt performance for the epoll_ctrl is frequently used. * which hurt performance for the epoll_ctrl is frequently used.
* @see: SrsRtmpConn::playing * @see: SrsRtmpConn::playing
* @see: https://github.com/ossrs/srs/issues/217 * @see: https://github.com/ossrs/srs/issues/217
*/ */
class SrsQueueRecvThread : public ISrsMessagePumper class SrsQueueRecvThread : public ISrsMessagePumper
{ {
private: private:
@ -154,12 +150,12 @@ public:
}; };
/** /**
* the publish recv thread got message and callback the source method to process message. * the publish recv thread got message and callback the source method to process message.
* @see: https://github.com/ossrs/srs/issues/237 * @see: https://github.com/ossrs/srs/issues/237
*/ */
class SrsPublishRecvThread : virtual public ISrsMessagePumper, virtual public ISrsReloadHandler class SrsPublishRecvThread : virtual public ISrsMessagePumper, virtual public ISrsReloadHandler
#ifdef SRS_PERF_MERGED_READ #ifdef SRS_PERF_MERGED_READ
, virtual public IMergeReadHandler , virtual public IMergeReadHandler
#endif #endif
{ {
private: private:
@ -188,9 +184,7 @@ private:
int cid; int cid;
int ncid; int ncid;
public: public:
SrsPublishRecvThread(SrsRtmpServer* rtmp_sdk, SrsPublishRecvThread(SrsRtmpServer* rtmp_sdk, SrsRequest* _req, int mr_sock_fd, int timeout_ms, SrsRtmpConn* conn, SrsSource* source);
SrsRequest* _req, int mr_sock_fd, int timeout_ms,
SrsRtmpConn* conn, SrsSource* source);
virtual ~SrsPublishRecvThread(); virtual ~SrsPublishRecvThread();
public: public:
/** /**

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_refer.hpp> #include <srs_app_refer.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_REFER_HPP #ifndef SRS_APP_REFER_HPP
#define SRS_APP_REFER_HPP #define SRS_APP_REFER_HPP
/*
#include <srs_app_refer.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_reload.hpp> #include <srs_app_reload.hpp>

View file

@ -1,43 +1,40 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_RELOAD_HPP #ifndef SRS_APP_RELOAD_HPP
#define SRS_APP_RELOAD_HPP #define SRS_APP_RELOAD_HPP
/*
#include <srs_app_reload.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
/** /**
* the handler for config reload. * the handler for config reload.
* when reload callback, the config is updated yet. * when reload callback, the config is updated yet.
* *
* features not support reload, * features not support reload,
* @see: https://github.com/ossrs/srs/wiki/v1_CN_Reload#notsupportedfeatures * @see: https://github.com/ossrs/srs/wiki/v1_CN_Reload#notsupportedfeatures
*/ */
class ISrsReloadHandler class ISrsReloadHandler
{ {
public: public:

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_rtmp_conn.hpp> #include <srs_app_rtmp_conn.hpp>
@ -298,7 +298,7 @@ SrsClientInfo::~SrsClientInfo()
} }
SrsRtmpConn::SrsRtmpConn(SrsServer* svr, st_netfd_t c, string cip) SrsRtmpConn::SrsRtmpConn(SrsServer* svr, st_netfd_t c, string cip)
: SrsConnection(svr, c, cip) : SrsConnection(svr, c, cip)
{ {
server = svr; server = svr;
@ -1426,9 +1426,9 @@ void SrsRtmpConn::change_mw_sleep(int sleep_ms)
int nb_sbuf = socket_buffer_size / 2; int nb_sbuf = socket_buffer_size / 2;
// override the send buffer by macro. // override the send buffer by macro.
#ifdef SRS_PERF_SO_SNDBUF_SIZE #ifdef SRS_PERF_SO_SNDBUF_SIZE
nb_sbuf = SRS_PERF_SO_SNDBUF_SIZE / 2; nb_sbuf = SRS_PERF_SO_SNDBUF_SIZE / 2;
#endif #endif
// set the socket send buffer when required larger buffer // set the socket send buffer when required larger buffer
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &nb_sbuf, sock_buf_size) < 0) { if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &nb_sbuf, sock_buf_size) < 0) {

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_RTMP_CONN_HPP #ifndef SRS_APP_RTMP_CONN_HPP
#define SRS_APP_RTMP_CONN_HPP #define SRS_APP_RTMP_CONN_HPP
/*
#include <srs_app_rtmp_conn.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_rtsp.hpp> #include <srs_app_rtsp.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_RTSP_HPP #ifndef SRS_APP_RTSP_HPP
#define SRS_APP_RTSP_HPP #define SRS_APP_RTSP_HPP
/*
#include <srs_app_rtsp.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
@ -59,8 +55,8 @@ class SrsPithyPrint;
class SrsSimpleRtmpClient; class SrsSimpleRtmpClient;
/** /**
* a rtp connection which transport a stream. * a rtp connection which transport a stream.
*/ */
class SrsRtpConn: public ISrsUdpHandler class SrsRtpConn: public ISrsUdpHandler
{ {
private: private:
@ -82,8 +78,8 @@ public:
}; };
/** /**
* audio is group by frames. * audio is group by frames.
*/ */
struct SrsRtspAudioCache struct SrsRtspAudioCache
{ {
int64_t dts; int64_t dts;
@ -95,8 +91,8 @@ struct SrsRtspAudioCache
}; };
/** /**
* the time jitter correct for rtsp. * the time jitter correct for rtsp.
*/ */
class SrsRtspJitter class SrsRtspJitter
{ {
private: private:
@ -112,8 +108,8 @@ public:
}; };
/** /**
* the rtsp connection serve the fd. * the rtsp connection serve the fd.
*/ */
class SrsRtspConn : public ISrsOneCycleThreadHandler class SrsRtspConn : public ISrsOneCycleThreadHandler
{ {
private: private:
@ -159,7 +155,7 @@ public:
virtual int serve(); virtual int serve();
private: private:
virtual int do_cycle(); virtual int do_cycle();
// internal methods // internal methods
public: public:
virtual int on_rtp_packet(SrsRtpPacket* pkt, int stream_id); virtual int on_rtp_packet(SrsRtpPacket* pkt, int stream_id);
// interface ISrsOneCycleThreadHandler // interface ISrsOneCycleThreadHandler
@ -184,8 +180,8 @@ private:
}; };
/** /**
* the caster for rtsp. * the caster for rtsp.
*/ */
class SrsRtspCaster : public ISrsTcpHandler class SrsRtspCaster : public ISrsTcpHandler
{ {
private: private:
@ -212,7 +208,7 @@ public:
// interface ISrsTcpHandler // interface ISrsTcpHandler
public: public:
virtual int on_tcp_client(st_netfd_t stfd); virtual int on_tcp_client(st_netfd_t stfd);
// internal methods. // internal methods.
public: public:
virtual void remove(SrsRtspConn* conn); virtual void remove(SrsRtspConn* conn);
}; };

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_security.hpp> #include <srs_app_security.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_SECURITY_HPP #ifndef SRS_APP_SECURITY_HPP
#define SRS_APP_SECURITY_HPP #define SRS_APP_SECURITY_HPP
/*
#include <srs_app_security.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>
@ -37,9 +33,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
class SrsConfDirective; class SrsConfDirective;
/** /**
* the security apply on vhost. * the security apply on vhost.
* @see https://github.com/ossrs/srs/issues/211 * @see https://github.com/ossrs/srs/issues/211
*/ */
class SrsSecurity class SrsSecurity
{ {
public: public:

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_server.hpp> #include <srs_app_server.hpp>
@ -604,7 +604,7 @@ int SrsServer::initialize_st()
// @remark, st alloc segment use mmap, which only support 32757 threads, // @remark, st alloc segment use mmap, which only support 32757 threads,
// if need to support more, for instance, 100k threads, define the macro MALLOC_STACK. // if need to support more, for instance, 100k threads, define the macro MALLOC_STACK.
// TODO: FIXME: maybe can use "sysctl vm.max_map_count" to refine. // TODO: FIXME: maybe can use "sysctl vm.max_map_count" to refine.
#define __MMAP_MAX_CONNECTIONS 32756 #define __MMAP_MAX_CONNECTIONS 32756
if (_srs_config->get_max_connections() > __MMAP_MAX_CONNECTIONS) { if (_srs_config->get_max_connections() > __MMAP_MAX_CONNECTIONS) {
ret = ERROR_ST_EXCEED_THREADS; ret = ERROR_ST_EXCEED_THREADS;
srs_error("st mmap for stack allocation must <= %d threads, " srs_error("st mmap for stack allocation must <= %d threads, "

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_SERVER_HPP #ifndef SRS_APP_SERVER_HPP
#define SRS_APP_SERVER_HPP #define SRS_APP_SERVER_HPP
/*
#include <srs_app_server.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <vector> #include <vector>
@ -78,8 +74,8 @@ enum SrsListenerType
}; };
/** /**
* the common tcp listener, for RTMP/HTTP server. * the common tcp listener, for RTMP/HTTP server.
*/ */
class SrsListener class SrsListener
{ {
protected: protected:
@ -97,8 +93,8 @@ public:
}; };
/** /**
* tcp listener. * tcp listener.
*/ */
class SrsBufferListener : virtual public SrsListener, virtual public ISrsTcpHandler class SrsBufferListener : virtual public SrsListener, virtual public ISrsTcpHandler
{ {
private: private:
@ -108,15 +104,15 @@ public:
virtual ~SrsBufferListener(); virtual ~SrsBufferListener();
public: public:
virtual int listen(std::string ip, int port); virtual int listen(std::string ip, int port);
// ISrsTcpHandler // ISrsTcpHandler
public: public:
virtual int on_tcp_client(st_netfd_t stfd); virtual int on_tcp_client(st_netfd_t stfd);
}; };
#ifdef SRS_AUTO_STREAM_CASTER #ifdef SRS_AUTO_STREAM_CASTER
/** /**
* the tcp listener, for rtsp server. * the tcp listener, for rtsp server.
*/ */
class SrsRtspListener : virtual public SrsListener, virtual public ISrsTcpHandler class SrsRtspListener : virtual public SrsListener, virtual public ISrsTcpHandler
{ {
private: private:
@ -127,7 +123,7 @@ public:
virtual ~SrsRtspListener(); virtual ~SrsRtspListener();
public: public:
virtual int listen(std::string i, int p); virtual int listen(std::string i, int p);
// ISrsTcpHandler // ISrsTcpHandler
public: public:
virtual int on_tcp_client(st_netfd_t stfd); virtual int on_tcp_client(st_netfd_t stfd);
}; };
@ -145,7 +141,7 @@ public:
virtual ~SrsHttpFlvListener(); virtual ~SrsHttpFlvListener();
public: public:
virtual int listen(std::string i, int p); virtual int listen(std::string i, int p);
// ISrsTcpHandler // ISrsTcpHandler
public: public:
virtual int on_tcp_client(st_netfd_t stfd); virtual int on_tcp_client(st_netfd_t stfd);
}; };
@ -179,9 +175,9 @@ public:
#endif #endif
/** /**
* convert signal to io, * convert signal to io,
* @see: st-1.9/docs/notes.html * @see: st-1.9/docs/notes.html
*/ */
class SrsSignalManager : public ISrsEndlessThreadHandler class SrsSignalManager : public ISrsEndlessThreadHandler
{ {
private: private:
@ -210,8 +206,8 @@ private:
}; };
/** /**
* the handler to the handle cycle in SRS RTMP server. * the handler to the handle cycle in SRS RTMP server.
*/ */
class ISrsServerCycle class ISrsServerCycle
{ {
public: public:
@ -233,12 +229,12 @@ public:
}; };
/** /**
* SRS RTMP server, initialize and listen, * SRS RTMP server, initialize and listen,
* start connection service thread, destroy client. * start connection service thread, destroy client.
*/ */
class SrsServer : virtual public ISrsReloadHandler class SrsServer : virtual public ISrsReloadHandler
, virtual public ISrsSourceHandler , virtual public ISrsSourceHandler
, virtual public IConnectionManager , virtual public IConnectionManager
{ {
private: private:
// TODO: FIXME: rename to http_api // TODO: FIXME: rename to http_api
@ -296,7 +292,7 @@ private:
* to stop all ingesters, cleanup HLS and dvr. * to stop all ingesters, cleanup HLS and dvr.
*/ */
virtual void dispose(); virtual void dispose();
// server startup workflow, @see run_master() // server startup workflow, @see run_master()
public: public:
/** /**
* initialize server with callback handler. * initialize server with callback handler.
@ -311,7 +307,7 @@ public:
virtual int http_handle(); virtual int http_handle();
virtual int ingest(); virtual int ingest();
virtual int cycle(); virtual int cycle();
// server utilities. // server utilities.
public: public:
/** /**
* callback for signal manager got a signal. * callback for signal manager got a signal.
@ -351,7 +347,7 @@ private:
* resample the server kbs. * resample the server kbs.
*/ */
virtual void resample_kbps(); virtual void resample_kbps();
// internal only // internal only
public: public:
/** /**
* when listener got a fd, notice server to accept it. * when listener got a fd, notice server to accept it.
@ -362,7 +358,7 @@ public:
virtual int accept_client(SrsListenerType type, st_netfd_t stfd); virtual int accept_client(SrsListenerType type, st_netfd_t stfd);
private: private:
virtual SrsConnection* fd2conn(SrsListenerType type, st_netfd_t stfd); virtual SrsConnection* fd2conn(SrsListenerType type, st_netfd_t stfd);
// IConnectionManager // IConnectionManager
public: public:
/** /**
* callback for connection to remove itself. * callback for connection to remove itself.

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_source.hpp> #include <srs_app_source.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_SOURCE_HPP #ifndef SRS_APP_SOURCE_HPP
#define SRS_APP_SOURCE_HPP #define SRS_APP_SOURCE_HPP
/*
#include <srs_app_source.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <map> #include <map>
@ -67,11 +63,11 @@ class SrsHds;
#endif #endif
/** /**
* the time jitter algorithm: * the time jitter algorithm:
* 1. full, to ensure stream start at zero, and ensure stream monotonically increasing. * 1. full, to ensure stream start at zero, and ensure stream monotonically increasing.
* 2. zero, only ensure sttream start at zero, ignore timestamp jitter. * 2. zero, only ensure sttream start at zero, ignore timestamp jitter.
* 3. off, disable the time jitter algorithm, like atc. * 3. off, disable the time jitter algorithm, like atc.
*/ */
enum SrsRtmpJitterAlgorithm enum SrsRtmpJitterAlgorithm
{ {
SrsRtmpJitterAlgorithmFULL = 0x01, SrsRtmpJitterAlgorithmFULL = 0x01,
@ -81,9 +77,9 @@ enum SrsRtmpJitterAlgorithm
int _srs_time_jitter_string2int(std::string time_jitter); int _srs_time_jitter_string2int(std::string time_jitter);
/** /**
* time jitter detect and correct, * time jitter detect and correct,
* to ensure the rtmp stream is monotonically. * to ensure the rtmp stream is monotonically.
*/ */
class SrsRtmpJitter class SrsRtmpJitter
{ {
private: private:
@ -106,10 +102,10 @@ public:
#ifdef SRS_PERF_QUEUE_FAST_VECTOR #ifdef SRS_PERF_QUEUE_FAST_VECTOR
/** /**
* to alloc and increase fixed space, * to alloc and increase fixed space,
* fast remove and insert for msgs sender. * fast remove and insert for msgs sender.
* @see https://github.com/ossrs/srs/issues/251 * @see https://github.com/ossrs/srs/issues/251
*/ */
class SrsFastVector class SrsFastVector
{ {
private: private:
@ -133,9 +129,9 @@ public:
#endif #endif
/** /**
* the message queue for the consumer(client), forwarder. * the message queue for the consumer(client), forwarder.
* we limit the size in seconds, drop old messages(the whole gop) if full. * we limit the size in seconds, drop old messages(the whole gop) if full.
*/ */
class SrsMessageQueue class SrsMessageQueue
{ {
private: private:
@ -216,8 +212,8 @@ public:
}; };
/** /**
* the consumer for SrsSource, that is a play client. * the consumer for SrsSource, that is a play client.
*/ */
class SrsConsumer : public ISrsWakable class SrsConsumer : public ISrsWakable
{ {
private: private:
@ -280,7 +276,7 @@ public:
* when client send the pause message. * when client send the pause message.
*/ */
virtual int on_play_client_pause(bool is_pause); virtual int on_play_client_pause(bool is_pause);
// ISrsWakable // ISrsWakable
public: public:
/** /**
* when the consumer(for player) got msg from recv thread, * when the consumer(for player) got msg from recv thread,
@ -291,10 +287,10 @@ public:
}; };
/** /**
* cache a gop of video/audio data, * cache a gop of video/audio data,
* delivery at the connect of flash player, * delivery at the connect of flash player,
* to enable it to fast startup. * to enable it to fast startup.
*/ */
class SrsGopCache class SrsGopCache
{ {
private: private:
@ -371,10 +367,10 @@ public:
}; };
/** /**
* the handler to handle the event of srs source. * the handler to handle the event of srs source.
* for example, the http flv streaming module handle the event and * for example, the http flv streaming module handle the event and
* mount http when rtmp start publishing. * mount http when rtmp start publishing.
*/ */
class ISrsSourceHandler class ISrsSourceHandler
{ {
public: public:
@ -467,7 +463,7 @@ public:
virtual int on_publish(); virtual int on_publish();
// When stop publish stream. // When stop publish stream.
virtual void on_unpublish(); virtual void on_unpublish();
// Internal callback. // Internal callback.
public: public:
// for the SrsForwarder to callback to request the sequence headers. // for the SrsForwarder to callback to request the sequence headers.
virtual int on_forwarder_start(SrsForwarder* forwarder); virtual int on_forwarder_start(SrsForwarder* forwarder);
@ -527,8 +523,8 @@ public:
}; };
/** /**
* live streaming source. * live streaming source.
*/ */
class SrsSource : public ISrsReloadHandler class SrsSource : public ISrsReloadHandler
{ {
friend class SrsOriginHub; friend class SrsOriginHub;
@ -621,7 +617,7 @@ public:
virtual int cycle(); virtual int cycle();
// remove source when expired. // remove source when expired.
virtual bool expired(); virtual bool expired();
// initialize, get and setter. // initialize, get and setter.
public: public:
/** /**
* initialize the hls with handlers. * initialize the hls with handlers.
@ -630,14 +626,14 @@ public:
// interface ISrsReloadHandler // interface ISrsReloadHandler
public: public:
virtual int on_reload_vhost_play(std::string vhost); virtual int on_reload_vhost_play(std::string vhost);
// for the tools callback // for the tools callback
public: public:
// source id changed. // source id changed.
virtual int on_source_id_changed(int id); virtual int on_source_id_changed(int id);
// get current source id. // get current source id.
virtual int source_id(); virtual int source_id();
virtual int pre_source_id(); virtual int pre_source_id();
// logic data methods // logic data methods
public: public:
virtual bool can_publish(bool is_edge); virtual bool can_publish(bool is_edge);
virtual int on_meta_data(SrsCommonMessage* msg, SrsOnMetaDataPacket* metadata); virtual int on_meta_data(SrsCommonMessage* msg, SrsOnMetaDataPacket* metadata);
@ -658,7 +654,7 @@ public:
*/ */
virtual int on_publish(); virtual int on_publish();
virtual void on_unpublish(); virtual void on_unpublish();
// consumer methods // consumer methods
public: public:
/** /**
* create consumer and dumps packets in cache. * create consumer and dumps packets in cache.
@ -667,14 +663,11 @@ public:
* @param dm, whether dumps the metadata. * @param dm, whether dumps the metadata.
* @param dg, whether dumps the gop cache. * @param dg, whether dumps the gop cache.
*/ */
virtual int create_consumer( virtual int create_consumer(SrsConnection* conn, SrsConsumer*& consumer, bool ds = true, bool dm = true, bool dg = true);
SrsConnection* conn, SrsConsumer*& consumer,
bool ds = true, bool dm = true, bool dg = true
);
virtual void on_consumer_destroy(SrsConsumer* consumer); virtual void on_consumer_destroy(SrsConsumer* consumer);
virtual void set_cache(bool enabled); virtual void set_cache(bool enabled);
virtual SrsRtmpJitterAlgorithm jitter(); virtual SrsRtmpJitterAlgorithm jitter();
// internal // internal
public: public:
// for edge, when publish edge stream, check the state // for edge, when publish edge stream, check the state
virtual int on_edge_start_publish(); virtual int on_edge_start_publish();

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_st.hpp> #include <srs_app_st.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_ST_HPP #ifndef SRS_APP_ST_HPP
#define SRS_APP_ST_HPP #define SRS_APP_ST_HPP
/*
#include <srs_app_st.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <string> #include <string>

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_statistic.hpp> #include <srs_app_statistic.hpp>
@ -308,10 +308,8 @@ SrsStatisticClient* SrsStatistic::find_client(int cid)
return NULL; return NULL;
} }
int SrsStatistic::on_video_info(SrsRequest* req, int SrsStatistic::on_video_info(SrsRequest* req, SrsVideoCodecId vcodec, SrsAvcProfile avc_profile, SrsAvcLevel avc_level, int width, int height)
SrsVideoCodecId vcodec, SrsAvcProfile avc_profile, SrsAvcLevel avc_level, {
int width, int height
) {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
SrsStatisticVhost* vhost = create_vhost(req); SrsStatisticVhost* vhost = create_vhost(req);
@ -328,10 +326,8 @@ int SrsStatistic::on_video_info(SrsRequest* req,
return ret; return ret;
} }
int SrsStatistic::on_audio_info(SrsRequest* req, int SrsStatistic::on_audio_info(SrsRequest* req, SrsAudioCodecId acodec, SrsAudioSampleRate asample_rate, SrsAudioChannels asound_type, SrsAacObjectType aac_object)
SrsAudioCodecId acodec, SrsAudioSampleRate asample_rate, SrsAudioChannels asound_type, {
SrsAacObjectType aac_object
) {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
SrsStatisticVhost* vhost = create_vhost(req); SrsStatisticVhost* vhost = create_vhost(req);

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_STATISTIC_HPP #ifndef SRS_APP_STATISTIC_HPP
#define SRS_APP_STATISTIC_HPP #define SRS_APP_STATISTIC_HPP
/*
#include <srs_app_statistic.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <map> #include <map>
@ -169,17 +165,11 @@ public:
/** /**
* when got video info for stream. * when got video info for stream.
*/ */
virtual int on_video_info(SrsRequest* req, virtual int on_video_info(SrsRequest* req, SrsVideoCodecId vcodec, SrsAvcProfile avc_profile, SrsAvcLevel avc_level, int width, int height);
SrsVideoCodecId vcodec, SrsAvcProfile avc_profile, SrsAvcLevel avc_level,
int width, int height
);
/** /**
* when got audio info for stream. * when got audio info for stream.
*/ */
virtual int on_audio_info(SrsRequest* req, virtual int on_audio_info(SrsRequest* req, SrsAudioCodecId acodec, SrsAudioSampleRate asample_rate, SrsAudioChannels asound_type, SrsAacObjectType aac_object);
SrsAudioCodecId acodec, SrsAudioSampleRate asample_rate, SrsAudioChannels asound_type,
SrsAacObjectType aac_object
);
/** /**
* when publish stream. * when publish stream.
* @param req the request object of publish connection. * @param req the request object of publish connection.

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_thread.hpp> #include <srs_app_thread.hpp>

View file

@ -1,32 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_THREAD_HPP #ifndef SRS_APP_THREAD_HPP
#define SRS_APP_THREAD_HPP #define SRS_APP_THREAD_HPP
/*
#include <srs_app_thread.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <srs_app_st.hpp> #include <srs_app_st.hpp>

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_app_utility.hpp> #include <srs_app_utility.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_APP_UTILITY_HPP #ifndef SRS_APP_UTILITY_HPP
#define SRS_APP_UTILITY_HPP #define SRS_APP_UTILITY_HPP
/*
#include <srs_app_utility.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
#include <vector> #include <vector>
@ -48,32 +44,32 @@ class SrsJsonObject;
extern int srs_socket_connect(std::string server, int port, int64_t tm, st_netfd_t* pstfd); extern int srs_socket_connect(std::string server, int port, int64_t tm, st_netfd_t* pstfd);
/** /**
* convert level in string to log level in int. * convert level in string to log level in int.
* @return the log level defined in SrsLogLevel. * @return the log level defined in SrsLogLevel.
*/ */
extern int srs_get_log_level(std::string level); extern int srs_get_log_level(std::string level);
/** /**
* build the path according to vhost/app/stream, where replace variables: * build the path according to vhost/app/stream, where replace variables:
* [vhost], the vhost of stream. * [vhost], the vhost of stream.
* [app], the app of stream. * [app], the app of stream.
* [stream], the stream name of stream. * [stream], the stream name of stream.
* @return the replaced path. * @return the replaced path.
*/ */
extern std::string srs_path_build_stream(std::string template_path, std::string vhost, std::string app, std::string stream); extern std::string srs_path_build_stream(std::string template_path, std::string vhost, std::string app, std::string stream);
/** /**
* build the path according to timestamp, where replace variables: * build the path according to timestamp, where replace variables:
* [2006], replace this const to current year. * [2006], replace this const to current year.
* [01], replace this const to current month. * [01], replace this const to current month.
* [02], replace this const to current date. * [02], replace this const to current date.
* [15], replace this const to current hour. * [15], replace this const to current hour.
* [04], repleace this const to current minute. * [04], repleace this const to current minute.
* [05], repleace this const to current second. * [05], repleace this const to current second.
* [999], repleace this const to current millisecond. * [999], repleace this const to current millisecond.
* [timestamp],replace this const to current UNIX timestamp in ms. * [timestamp],replace this const to current UNIX timestamp in ms.
* @return the replaced path. * @return the replaced path.
*/ */
extern std::string srs_path_build_timestamp(std::string template_path); extern std::string srs_path_build_timestamp(std::string template_path);
/** /**
@ -118,7 +114,7 @@ public:
// the percent of usage. 0.153 is 15.3%. // the percent of usage. 0.153 is 15.3%.
float percent; float percent;
// data of /proc/[pid]/stat // data of /proc/[pid]/stat
public: public:
// pid %d The process ID. // pid %d The process ID.
int pid; int pid;
@ -265,34 +261,34 @@ public:
// to stat the cpu time. // to stat the cpu time.
// @see: man 5 proc, /proc/stat // @see: man 5 proc, /proc/stat
/** /**
* about the cpu time, @see: http://stackoverflow.com/questions/16011677/calculating-cpu-usage-using-proc-files * about the cpu time, @see: http://stackoverflow.com/questions/16011677/calculating-cpu-usage-using-proc-files
* for example, for ossrs.net, a single cpu machine: * for example, for ossrs.net, a single cpu machine:
* [winlin@SRS ~]$ cat /proc/uptime && cat /proc/stat * [winlin@SRS ~]$ cat /proc/uptime && cat /proc/stat
* 5275153.01 4699624.99 * 5275153.01 4699624.99
* cpu 43506750 973 8545744 466133337 4149365 190852 804666 0 0 * cpu 43506750 973 8545744 466133337 4149365 190852 804666 0 0
* where the uptime is 5275153.01s * where the uptime is 5275153.01s
* generally, USER_HZ sysconf(_SC_CLK_TCK)=100, which means the unit of /proc/stat is "1/100ths seconds" * generally, USER_HZ sysconf(_SC_CLK_TCK)=100, which means the unit of /proc/stat is "1/100ths seconds"
* that is, USER_HZ=1/100 seconds * that is, USER_HZ=1/100 seconds
* cpu total = 43506750+973+8545744+466133337+4149365+190852+804666+0+0 (USER_HZ) * cpu total = 43506750+973+8545744+466133337+4149365+190852+804666+0+0 (USER_HZ)
* = 523331687 (USER_HZ) * = 523331687 (USER_HZ)
* = 523331687 * 1/100 (seconds) * = 523331687 * 1/100 (seconds)
* = 5233316.87 seconds * = 5233316.87 seconds
* the cpu total seconds almost the uptime, the delta is more precise. * the cpu total seconds almost the uptime, the delta is more precise.
* *
* we run the command about 26minutes: * we run the command about 26minutes:
* [winlin@SRS ~]$ cat /proc/uptime && cat /proc/stat * [winlin@SRS ~]$ cat /proc/uptime && cat /proc/stat
* 5276739.83 4701090.76 * 5276739.83 4701090.76
* cpu 43514105 973 8548948 466278556 4150480 190899 804937 0 0 * cpu 43514105 973 8548948 466278556 4150480 190899 804937 0 0
* where the uptime is 5276739.83s * where the uptime is 5276739.83s
* cpu total = 43514105+973+8548948+466278556+4150480+190899+804937+0+0 (USER_HZ) * cpu total = 43514105+973+8548948+466278556+4150480+190899+804937+0+0 (USER_HZ)
* = 523488898 (USER_HZ) * = 523488898 (USER_HZ)
* = 523488898 * 1/100 (seconds) * = 523488898 * 1/100 (seconds)
* = 5234888.98 seconds * = 5234888.98 seconds
* where: * where:
* uptime delta = 1586.82s * uptime delta = 1586.82s
* cpu total delta = 1572.11s * cpu total delta = 1572.11s
* the deviation is more smaller. * the deviation is more smaller.
*/ */
class SrsProcSystemStat class SrsProcSystemStat
{ {
public: public:
@ -310,7 +306,7 @@ public:
// previous cpu total = this->total() - total_delta // previous cpu total = this->total() - total_delta
int64_t total_delta; int64_t total_delta;
// data of /proc/stat // data of /proc/stat
public: public:
// The amount of time, measured in units of USER_HZ // The amount of time, measured in units of USER_HZ
// (1/100ths of a second on most architectures, use // (1/100ths of a second on most architectures, use
@ -478,7 +474,7 @@ public:
float percent_ram; float percent_ram;
float percent_swap; float percent_swap;
// data of /proc/meminfo // data of /proc/meminfo
public: public:
// MemActive = MemTotal - MemFree // MemActive = MemTotal - MemFree
uint64_t MemActive; uint64_t MemActive;
@ -515,7 +511,7 @@ public:
// whether the data is ok. // whether the data is ok.
bool ok; bool ok;
// data of /proc/cpuinfo // data of /proc/cpuinfo
public: public:
// The number of processors configured. // The number of processors configured.
int nb_processors; int nb_processors;

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_core.hpp> #include <srs_core.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_CORE_HPP #ifndef SRS_CORE_HPP
#define SRS_CORE_HPP #define SRS_CORE_HPP
/*
#include <srs_core.hpp>
*/
// current release version // current release version
#define VERSION_MAJOR 3 #define VERSION_MAJOR 3
#define VERSION_MINOR 0 #define VERSION_MINOR 0
@ -63,10 +59,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SRS_INTERNAL_STR(v) #v #define SRS_INTERNAL_STR(v) #v
/** /**
* the core provides the common defined macros, utilities, * the core provides the common defined macros, utilities,
* user must include the srs_core.hpp before any header, or maybe * user must include the srs_core.hpp before any header, or maybe
* build failed. * build failed.
*/ */
// for 32bit os, 2G big file limit for unistd io, // for 32bit os, 2G big file limit for unistd io,
// ie. read/write/lseek to use 64bits size for huge file. // ie. read/write/lseek to use 64bits size for huge file.

View file

@ -1,25 +1,25 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_core_autofree.hpp> #include <srs_core_autofree.hpp>

View file

@ -1,33 +1,29 @@
/* /**
The MIT License (MIT) * The MIT License (MIT)
*
Copyright (c) 2013-2017 SRS(ossrs) * Copyright (c) 2013-2017 SRS(ossrs)
*
Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: * subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. * copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef SRS_CORE_AUTO_FREE_HPP #ifndef SRS_CORE_AUTO_FREE_HPP
#define SRS_CORE_AUTO_FREE_HPP #define SRS_CORE_AUTO_FREE_HPP
/*
#include <srs_core_autofree.hpp>
*/
#include <srs_core.hpp> #include <srs_core.hpp>
/** /**

Some files were not shown because too many files have changed in this diff Show more