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

migarate from winlinvip to srs org

This commit is contained in:
winlin 2015-04-29 17:06:32 +08:00
parent b3bd007f0d
commit 115daa3cc1
117 changed files with 323 additions and 323 deletions

View file

@ -320,7 +320,7 @@ int SrsRawAacStream::adts_demux(SrsStream* stream, char** pframe, int* pnb_frame
// decode the ADTS.
// @see aac-iso-13818-7.pdf, page 26
// 6.2 Audio Data Transport Stream, ADTS
// @see https://github.com/winlinvip/simple-rtmp-server/issues/212#issuecomment-64145885
// @see https://github.com/simple-rtmp-server/srs/issues/212#issuecomment-64145885
// byte_alignment()
// adts_fixed_header:
@ -383,7 +383,7 @@ int SrsRawAacStream::adts_demux(SrsStream* stream, char** pframe, int* pnb_frame
int8_t channel_configuration = (sfiv >> 6) & 0x07;
/*int8_t original = (sfiv >> 5) & 0x01;*/
/*int8_t home = (sfiv >> 4) & 0x01;*/
//int8_t Emphasis; @remark, Emphasis is removed, @see https://github.com/winlinvip/simple-rtmp-server/issues/212#issuecomment-64154736
//int8_t Emphasis; @remark, Emphasis is removed, @see https://github.com/simple-rtmp-server/srs/issues/212#issuecomment-64154736
// 4bits left.
// adts_variable_header(), 1.A.2.2.2 Variable Header of ADTS
// copyright_identification_bit 1 bslbf
@ -473,7 +473,7 @@ int SrsRawAacStream::mux_sequence_header(SrsRawAacStreamCodec* codec, string& sh
char samplingFrequencyIndex = codec->sampling_frequency_index;
// override the aac samplerate by user specified.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/212#issuecomment-64146899
// @see https://github.com/simple-rtmp-server/srs/issues/212#issuecomment-64146899
switch (codec->sound_rate) {
case SrsCodecAudioSampleRate11025:
samplingFrequencyIndex = 0x0a; break;

View file

@ -695,7 +695,7 @@ namespace _srs_internal
* 2.13 Date Type
* time-zone = S16 ; reserved, not supported should be set to 0x0000
* date-type = date-marker DOUBLE time-zone
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/185
* @see: https://github.com/simple-rtmp-server/srs/issues/185
*/
class SrsAmf0Date : public SrsAmf0Any
{

View file

@ -187,7 +187,7 @@ int SrsFastBuffer::grow(ISrsBufferReader* reader, int required_size)
* to improve read performance, merge some packets then read,
* when it on and read small bytes, we sleep to wait more data.,
* that is, we merge some data to read together.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/241
* @see https://github.com/simple-rtmp-server/srs/issues/241
*/
if (merged_read && _handler) {
_handler->on_read(nread);

View file

@ -39,7 +39,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* to improve read performance, merge some packets then read,
* when it on and read small bytes, we sleep to wait more data.,
* that is, we merge some data to read together.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/241
* @see https://github.com/simple-rtmp-server/srs/issues/241
*/
class IMergeReadHandler
{
@ -77,7 +77,7 @@ private:
#endif
// the user-space buffer to fill by reader,
// which use fast index and reset when chunk body read ok.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/248
// @see https://github.com/simple-rtmp-server/srs/issues/248
// ptr to the current read position.
char* p;
// ptr to the content end.
@ -106,7 +106,7 @@ public:
* @param buffer the size of buffer. ignore when smaller than SRS_MAX_SOCKET_BUFFER.
* @remark when MR(SRS_PERF_MERGED_READ) disabled, always set to 8K.
* @remark when buffer changed, the previous ptr maybe invalid.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/241
* @see https://github.com/simple-rtmp-server/srs/issues/241
*/
virtual void set_buffer(int buffer_size);
public:
@ -147,7 +147,7 @@ public:
* that is, we merge some data to read together.
* @param v true to ename merged read.
* @param handler the handler when merge read is enabled.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/241
* @see https://github.com/simple-rtmp-server/srs/issues/241
* @remark the merged read is optional, ignore if not specifies.
*/
virtual void set_merge_read(bool v, IMergeReadHandler* handler);

View file

@ -200,12 +200,12 @@ namespace _srs_internal
// maybe the key_size is 127, but dh will write all 128bytes pkey,
// so, donot need to set/initialize the pkey.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/165
// @see https://github.com/simple-rtmp-server/srs/issues/165
key_size = BN_bn2bin(pdh->pub_key, (unsigned char*)pkey);
srs_assert(key_size > 0);
// output the size of public key.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/165
// @see https://github.com/simple-rtmp-server/srs/issues/165
srs_assert(key_size <= pkey_size);
pkey_size = key_size;
@ -225,7 +225,7 @@ namespace _srs_internal
// if failed, donot return, do cleanup, @see ./test/dhtest.c:168
// maybe the key_size is 127, but dh will write all 128bytes skey,
// so, donot need to set/initialize the skey.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/165
// @see https://github.com/simple-rtmp-server/srs/issues/165
int32_t key_size = DH_compute_key((unsigned char*)skey, ppk, pdh);
if (key_size < ppkey_size) {
@ -525,7 +525,7 @@ namespace _srs_internal
}
// directly generate the public key.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/148
// @see: https://github.com/simple-rtmp-server/srs/issues/148
int pkey_size = 128;
if ((ret = dh.copy_shared_key(c1->get_key(), 128, key.key, pkey_size)) != ERROR_SUCCESS) {
srs_error("calc s1 key failed. ret=%d", ret);

View file

@ -30,7 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp>
// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
// for srs-librtmp, @see https://github.com/simple-rtmp-server/srs/issues/213
#ifndef _WIN32
#include <sys/uio.h>
#endif

View file

@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_kernel_stream.hpp>
#include <srs_kernel_utility.hpp>
// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
// for srs-librtmp, @see https://github.com/simple-rtmp-server/srs/issues/213
#ifndef _WIN32
#include <unistd.h>
#endif
@ -295,7 +295,7 @@ int SrsHandshakeBytes::create_s0s1s2(const char* c1)
}
// if c1 specified, copy c1 to s2.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/46
// @see: https://github.com/simple-rtmp-server/srs/issues/46
if (c1) {
memcpy(s0s1s2 + 1537, c1, 1536);
}
@ -492,7 +492,7 @@ int SrsRtmpClient::connect_app2(
}
pkt->command_object->set("objectEncoding", SrsAmf0Any::number(0));
// @see https://github.com/winlinvip/simple-rtmp-server/issues/160
// @see https://github.com/simple-rtmp-server/srs/issues/160
// the debug_srs_upnode is config in vhost and default to true.
if (debug_srs_upnode && req && req->args) {
srs_freep(pkt->args);
@ -1049,7 +1049,7 @@ int SrsRtmpServer::identify_client(int stream_id, SrsRtmpConnType& type, string&
}
// call msg,
// support response null first,
// @see https://github.com/winlinvip/simple-rtmp-server/issues/106
// @see https://github.com/simple-rtmp-server/srs/issues/106
// TODO: FIXME: response in right way, or forward in edge mode.
SrsCallPacket* call = dynamic_cast<SrsCallPacket*>(pkt);
if (call) {
@ -1139,7 +1139,7 @@ int SrsRtmpServer::start_play(int stream_id)
SrsSampleAccessPacket* pkt = new SrsSampleAccessPacket();
// allow audio/video sample.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/49
// @see: https://github.com/simple-rtmp-server/srs/issues/49
pkt->audio_sample_access = true;
pkt->video_sample_access = true;

View file

@ -85,12 +85,12 @@ public:
std::string stream;
// for play live stream,
// used to specified the stop when exceed the duration.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/45
// @see https://github.com/simple-rtmp-server/srs/issues/45
// in ms.
double duration;
// the token in the connect request,
// used for edge traverse to origin authentication,
// @see https://github.com/winlinvip/simple-rtmp-server/issues/104
// @see https://github.com/simple-rtmp-server/srs/issues/104
SrsAmf0Object* args;
public:
SrsRequest();
@ -343,7 +343,7 @@ public:
/**
* set the auto response message when recv for protocol stack.
* @param v, whether auto response message when recv message.
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/217
* @see: https://github.com/simple-rtmp-server/srs/issues/217
*/
virtual void set_auto_response(bool v);
#ifdef SRS_PERF_MERGED_READ
@ -353,7 +353,7 @@ public:
* that is, we merge some data to read together.
* @param v true to ename merged read.
* @param handler the handler when merge read is enabled.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/241
* @see https://github.com/simple-rtmp-server/srs/issues/241
*/
virtual void set_merge_read(bool v, IMergeReadHandler* handler);
/**
@ -361,7 +361,7 @@ public:
* @param buffer the size of buffer.
* @remark when MR(SRS_PERF_MERGED_READ) disabled, always set to 8K.
* @remark when buffer changed, the previous ptr maybe invalid.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/241
* @see https://github.com/simple-rtmp-server/srs/issues/241
*/
virtual void set_recv_buffer(int buffer_size);
#endif
@ -416,7 +416,7 @@ public:
* @param stream_id, the stream id of packet to send over, 0 for control message.
*
* @remark performance issue, to support 6k+ 250kbps client,
* @see https://github.com/winlinvip/simple-rtmp-server/issues/194
* @see https://github.com/simple-rtmp-server/srs/issues/194
*/
virtual int send_and_free_messages(SrsSharedPtrMessage** msgs, int nb_msgs, int stream_id);
/**

View file

@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_rtmp_buffer.hpp>
#include <srs_rtmp_utility.hpp>
// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
// for srs-librtmp, @see https://github.com/simple-rtmp-server/srs/issues/213
#ifndef _WIN32
#include <unistd.h>
#endif
@ -1008,7 +1008,7 @@ int SrsProtocol::do_iovs_send(iovec* iovs, int size)
int ret = ERROR_SUCCESS;
// the limits of writev iovs.
// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
// for srs-librtmp, @see https://github.com/simple-rtmp-server/srs/issues/213
#ifndef _WIN32
static int limits = sysconf(_SC_IOV_MAX);
#else
@ -1375,7 +1375,7 @@ int SrsProtocol::recv_interlaced_message(SrsCommonMessage** pmsg)
SrsChunkStream* chunk = NULL;
// use chunk stream cache to get the chunk info.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/249
// @see https://github.com/simple-rtmp-server/srs/issues/249
if (cid < SRS_PERF_CHUNK_STREAM_CACHE) {
// chunk stream cache hit.
srs_verbose("cs-cache hit, cid=%d", cid);
@ -1586,7 +1586,7 @@ int SrsProtocol::read_message_header(SrsChunkStream* chunk, char fmt)
// 0x04 where: message_type=4(protocol control user-control message)
// 0x00 0x06 where: event Ping(0x06)
// 0x00 0x00 0x0d 0x0f where: event data 4bytes ping timestamp.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/98
// @see: https://github.com/simple-rtmp-server/srs/issues/98
if (chunk->cid == RTMP_CID_ProtocolControl && fmt == RTMP_FMT_TYPE1) {
srs_warn("accept cid=2, fmt=1 to make librtmp happy.");
} else {
@ -1756,7 +1756,7 @@ int SrsProtocol::read_message_header(SrsChunkStream* chunk, char fmt)
pp[0] = *p++;
// always use 31bits timestamp, for some server may use 32bits extended timestamp.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/111
// @see https://github.com/simple-rtmp-server/srs/issues/111
timestamp &= 0x7fffffff;
/**
@ -1947,12 +1947,12 @@ int SrsProtocol::on_recv_message(SrsCommonMessage* msg)
// for some server, the actual chunk size can greater than the max value(65536),
// so we just warning the invalid chunk size, and actually use it is ok,
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/160
// @see: https://github.com/simple-rtmp-server/srs/issues/160
if (pkt->chunk_size < SRS_CONSTS_RTMP_MIN_CHUNK_SIZE
|| pkt->chunk_size > SRS_CONSTS_RTMP_MAX_CHUNK_SIZE)
{
srs_warn("accept chunk size %d, but should in [%d, %d], "
"@see: https://github.com/winlinvip/simple-rtmp-server/issues/160",
"@see: https://github.com/simple-rtmp-server/srs/issues/160",
pkt->chunk_size, SRS_CONSTS_RTMP_MIN_CHUNK_SIZE,
SRS_CONSTS_RTMP_MAX_CHUNK_SIZE);
}
@ -2150,7 +2150,7 @@ int SrsConnectAppPacket::decode(SrsStream* stream)
if (!stream->empty()) {
srs_freep(args);
// see: https://github.com/winlinvip/simple-rtmp-server/issues/186
// see: https://github.com/simple-rtmp-server/srs/issues/186
// the args maybe any amf0, for instance, a string. we should drop if not object.
SrsAmf0Any* any = NULL;
if ((ret = SrsAmf0Any::discovery(stream, &any)) != ERROR_SUCCESS) {

View file

@ -34,7 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <vector>
#include <string>
// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
// for srs-librtmp, @see https://github.com/simple-rtmp-server/srs/issues/213
#ifndef _WIN32
#include <sys/uio.h>
#endif
@ -220,7 +220,7 @@ class SrsSharedPtrMessage
// 4.1. Message Header
public:
// the header can shared, only set the timestamp and stream id.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/251
// @see https://github.com/simple-rtmp-server/srs/issues/251
//SrsSharedMessageHeader header;
/**
* Four-byte field that contains a timestamp of the message.
@ -255,7 +255,7 @@ private:
{
public:
// shared message header.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/251
// @see https://github.com/simple-rtmp-server/srs/issues/251
SrsSharedMessageHeader header;
// actual shared payload.
char* payload;
@ -408,7 +408,7 @@ private:
/**
* cache some frequently used chunk header.
* cs_cache, the chunk stream cache.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/249
* @see https://github.com/simple-rtmp-server/srs/issues/249
*/
SrsChunkStream** cs_cache;
/**
@ -426,7 +426,7 @@ private:
/**
* whether auto response when recv messages.
* default to true for it's very easy to use the protocol stack.
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/217
* @see: https://github.com/simple-rtmp-server/srs/issues/217
*/
bool auto_response_when_recv;
/**
@ -464,7 +464,7 @@ public:
/**
* set the auto response message when recv for protocol stack.
* @param v, whether auto response message when recv message.
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/217
* @see: https://github.com/simple-rtmp-server/srs/issues/217
*/
virtual void set_auto_response(bool v);
/**
@ -482,7 +482,7 @@ public:
* that is, we merge some data to read together.
* @param v true to ename merged read.
* @param handler the handler when merge read is enabled.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/241
* @see https://github.com/simple-rtmp-server/srs/issues/241
*/
virtual void set_merge_read(bool v, IMergeReadHandler* handler);
/**
@ -490,7 +490,7 @@ public:
* @param buffer the size of buffer.
* @remark when MR(SRS_PERF_MERGED_READ) disabled, always set to 8K.
* @remark when buffer changed, the previous ptr maybe invalid.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/241
* @see https://github.com/simple-rtmp-server/srs/issues/241
*/
virtual void set_recv_buffer(int buffer_size);
#endif
@ -1454,13 +1454,13 @@ public:
std::string command_name;
/**
* whether allow access the sample of video.
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/49
* @see: https://github.com/simple-rtmp-server/srs/issues/49
* @see: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#videoSampleAccess
*/
bool video_sample_access;
/**
* whether allow access the sample of audio.
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/49
* @see: https://github.com/simple-rtmp-server/srs/issues/49
* @see: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#audioSampleAccess
*/
bool audio_sample_access;