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:
parent
b3bd007f0d
commit
115daa3cc1
117 changed files with 323 additions and 323 deletions
|
@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <srs_lib_bandwidth.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
|
||||
|
|
|
@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <srs_kernel_error.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
|
||||
#define SOCKET_ETIME ETIME
|
||||
#define SOCKET_ECONNRESET ECONNRESET
|
||||
|
@ -53,7 +53,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#define SOCKET_CLEANUP() socket_cleanup()
|
||||
#endif
|
||||
|
||||
// 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>
|
||||
#include <sys/socket.h>
|
||||
|
@ -206,7 +206,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
// the writev() function returns the number of bytes written. On error, -1 is
|
||||
// returned, and errno is set appropriately.
|
||||
if (nb_write <= 0) {
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/200
|
||||
// @see https://github.com/simple-rtmp-server/srs/issues/200
|
||||
if (nb_write < 0 && SOCKET_ERRNO() == SOCKET_ETIME) {
|
||||
return ERROR_SOCKET_TIMEOUT;
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
}
|
||||
|
||||
if (nb_write <= 0) {
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/200
|
||||
// @see https://github.com/simple-rtmp-server/srs/issues/200
|
||||
if (nb_write < 0 && SOCKET_ERRNO() == SOCKET_ETIME) {
|
||||
return ERROR_SOCKET_TIMEOUT;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <srs_rtmp_io.hpp>
|
||||
#include <srs_librtmp.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
|
||||
#define SOCKET int
|
||||
#endif
|
||||
|
|
|
@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
// 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/time.h>
|
||||
#endif
|
||||
|
@ -86,20 +86,20 @@ struct Context
|
|||
SrsRawAacStream aac_raw;
|
||||
|
||||
// for h264 raw stream,
|
||||
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/66#issuecomment-62240521
|
||||
// @see: https://github.com/simple-rtmp-server/srs/issues/66#issuecomment-62240521
|
||||
SrsStream h264_raw_stream;
|
||||
// about SPS, @see: 7.3.2.1.1, H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 62
|
||||
std::string h264_sps;
|
||||
std::string h264_pps;
|
||||
// whether the sps and pps sent,
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/203
|
||||
// @see https://github.com/simple-rtmp-server/srs/issues/203
|
||||
bool h264_sps_pps_sent;
|
||||
// only send the ssp and pps when both changed.
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/204
|
||||
// @see https://github.com/simple-rtmp-server/srs/issues/204
|
||||
bool h264_sps_changed;
|
||||
bool h264_pps_changed;
|
||||
// for aac raw stream,
|
||||
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/212#issuecomment-64146250
|
||||
// @see: https://github.com/simple-rtmp-server/srs/issues/212#issuecomment-64146250
|
||||
SrsStream aac_raw_stream;
|
||||
// the aac sequence header.
|
||||
std::string aac_specific_config;
|
||||
|
@ -127,7 +127,7 @@ struct Context
|
|||
}
|
||||
};
|
||||
|
||||
// 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
|
||||
#ifdef _WIN32
|
||||
int gettimeofday(struct timeval* tv, struct timezone* tz)
|
||||
{
|
||||
|
@ -1239,7 +1239,7 @@ int srs_write_h264_ipb_frame(Context* context,
|
|||
int ret = ERROR_SUCCESS;
|
||||
|
||||
// when sps or pps not sent, ignore the packet.
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/203
|
||||
// @see https://github.com/simple-rtmp-server/srs/issues/203
|
||||
if (!context->h264_sps_pps_sent) {
|
||||
return ERROR_H264_DROP_BEFORE_SPS_PPS;
|
||||
}
|
||||
|
@ -1372,8 +1372,8 @@ int srs_h264_write_raw_frames(srs_rtmp_t rtmp,
|
|||
}
|
||||
|
||||
// use the last error
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/203
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/204
|
||||
// @see https://github.com/simple-rtmp-server/srs/issues/203
|
||||
// @see https://github.com/simple-rtmp-server/srs/issues/204
|
||||
int error_code_return = ret;
|
||||
|
||||
// send each frame.
|
||||
|
@ -2391,7 +2391,7 @@ const char* srs_human_format_time()
|
|||
tm->tm_hour, tm->tm_min, tm->tm_sec,
|
||||
(int)(tv.tv_usec / 1000));
|
||||
|
||||
// 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
|
||||
buf[sizeof(buf) - 1] = 0;
|
||||
|
||||
return buf;
|
||||
|
|
|
@ -41,7 +41,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
* Windows SRS-LIBRTMP pre-declare
|
||||
**************************************************************
|
||||
*************************************************************/
|
||||
// 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
|
||||
#ifdef _WIN32
|
||||
// include windows first.
|
||||
#include <windows.h>
|
||||
|
@ -320,7 +320,7 @@ extern srs_bool srs_rtmp_is_onMetaData(char type, char* data, int size);
|
|||
* @remark for aac, only support profile 1-4, AAC main/LC/SSR/LTP,
|
||||
* @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 23, 1.5.1.1 Audio object type
|
||||
*
|
||||
* @see https://github.com/winlinvip/simple-rtmp-server/issues/212
|
||||
* @see https://github.com/simple-rtmp-server/srs/issues/212
|
||||
* @see E.4.2.1 AUDIODATA of video_file_format_spec_v10_1.pdf
|
||||
*
|
||||
* @return 0, success; otherswise, failed.
|
||||
|
@ -376,7 +376,7 @@ extern int srs_aac_adts_frame_size(char* aac_raw_data, int ac_raw_size);
|
|||
* @remark, cts = pts - dts
|
||||
* @remark, use srs_h264_startswith_annexb to check whether frame is annexb format.
|
||||
* @example /trunk/research/librtmp/srs_h264_raw_publish.c
|
||||
* @see https://github.com/winlinvip/simple-rtmp-server/issues/66
|
||||
* @see https://github.com/simple-rtmp-server/srs/issues/66
|
||||
*
|
||||
* @return 0, success; otherswise, failed.
|
||||
* for dvbsp error, @see srs_h264_is_dvbsp_error().
|
||||
|
@ -418,7 +418,7 @@ extern int srs_h264_write_raw_frames(srs_rtmp_t rtmp,
|
|||
/**
|
||||
* whether error_code is dvbsp(drop video before sps/pps/sequence-header) error.
|
||||
*
|
||||
* @see https://github.com/winlinvip/simple-rtmp-server/issues/203
|
||||
* @see https://github.com/simple-rtmp-server/srs/issues/203
|
||||
* @example /trunk/research/librtmp/srs_h264_raw_publish.c
|
||||
* @remark why drop video?
|
||||
* some encoder, for example, ipcamera, will send sps/pps before each IFrame,
|
||||
|
@ -429,14 +429,14 @@ extern srs_bool srs_h264_is_dvbsp_error(int error_code);
|
|||
/**
|
||||
* whether error_code is duplicated sps error.
|
||||
*
|
||||
* @see https://github.com/winlinvip/simple-rtmp-server/issues/204
|
||||
* @see https://github.com/simple-rtmp-server/srs/issues/204
|
||||
* @example /trunk/research/librtmp/srs_h264_raw_publish.c
|
||||
*/
|
||||
extern srs_bool srs_h264_is_duplicated_sps_error(int error_code);
|
||||
/**
|
||||
* whether error_code is duplicated pps error.
|
||||
*
|
||||
* @see https://github.com/winlinvip/simple-rtmp-server/issues/204
|
||||
* @see https://github.com/simple-rtmp-server/srs/issues/204
|
||||
* @example /trunk/research/librtmp/srs_h264_raw_publish.c
|
||||
*/
|
||||
extern srs_bool srs_h264_is_duplicated_pps_error(int error_code);
|
||||
|
@ -1021,7 +1021,7 @@ typedef void* srs_hijack_io_t;
|
|||
* Windows SRS-LIBRTMP solution
|
||||
**************************************************************
|
||||
*************************************************************/
|
||||
// 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
|
||||
#ifdef _WIN32
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#include <time.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue