mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Support build srs-librtmp by VS2015. 2.0.267
This commit is contained in:
parent
fde11756c3
commit
316628632b
12 changed files with 79 additions and 43 deletions
|
@ -201,7 +201,7 @@ int SrsFastBuffer::grow(ISrsBufferReader* reader, int required_size)
|
|||
// we just move the ptr to next.
|
||||
srs_assert((int)nread > 0);
|
||||
end += nread;
|
||||
nb_free_space -= nread;
|
||||
nb_free_space -= (int)nread;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -200,7 +200,7 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts,
|
|||
// numOfSequenceParameterSets, always 1
|
||||
stream.write_1bytes(0x01);
|
||||
// sequenceParameterSetLength
|
||||
stream.write_2bytes(sps.length());
|
||||
stream.write_2bytes((int16_t)sps.length());
|
||||
// sequenceParameterSetNALUnit
|
||||
stream.write_string(sps);
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts,
|
|||
// numOfPictureParameterSets, always 1
|
||||
stream.write_1bytes(0x01);
|
||||
// pictureParameterSetLength
|
||||
stream.write_2bytes(pps.length());
|
||||
stream.write_2bytes((int16_t)pps.length());
|
||||
// pictureParameterSetNALUnit
|
||||
stream.write_string(pps);
|
||||
}
|
||||
|
|
|
@ -1842,7 +1842,7 @@ namespace _srs_internal
|
|||
srs_error("amf0 write string length failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
stream->write_2bytes(value.length());
|
||||
stream->write_2bytes((int16_t)value.length());
|
||||
srs_verbose("amf0 write string length success. len=%d", (int)value.length());
|
||||
|
||||
// empty string
|
||||
|
|
|
@ -244,6 +244,8 @@ SrsProtocol::SrsProtocol(ISrsProtocolReaderWriter* io)
|
|||
|
||||
cs_cache[cid] = cs;
|
||||
}
|
||||
|
||||
out_c0c3_caches = new char[SRS_CONSTS_C0C3_HEADERS_MAX];
|
||||
}
|
||||
|
||||
SrsProtocol::~SrsProtocol()
|
||||
|
@ -282,6 +284,8 @@ SrsProtocol::~SrsProtocol()
|
|||
srs_freep(cs);
|
||||
}
|
||||
srs_freepa(cs_cache);
|
||||
|
||||
srs_freepa(out_c0c3_caches);
|
||||
}
|
||||
|
||||
void SrsProtocol::set_auto_response(bool v)
|
||||
|
@ -656,12 +660,12 @@ int SrsProtocol::do_simple_send(SrsMessageHeader* mh, char* payload, int size)
|
|||
int nbh = 0;
|
||||
if (p == payload) {
|
||||
nbh = srs_chunk_header_c0(
|
||||
mh->perfer_cid, mh->timestamp, mh->payload_length,
|
||||
mh->perfer_cid, (uint32_t)mh->timestamp, mh->payload_length,
|
||||
mh->message_type, mh->stream_id,
|
||||
c0c3, sizeof(c0c3));
|
||||
} else {
|
||||
nbh = srs_chunk_header_c3(
|
||||
mh->perfer_cid, mh->timestamp,
|
||||
mh->perfer_cid, (uint32_t)mh->timestamp,
|
||||
c0c3, sizeof(c0c3));
|
||||
}
|
||||
srs_assert(nbh > 0);;
|
||||
|
@ -2566,8 +2570,9 @@ int SrsRtmpServer::response_connect_app(SrsRequest *req, const char* server_ip)
|
|||
int ret = ERROR_SUCCESS;
|
||||
|
||||
SrsConnectAppResPacket* pkt = new SrsConnectAppResPacket();
|
||||
|
||||
pkt->props->set("fmsVer", SrsAmf0Any::str("FMS/"RTMP_SIG_FMS_VER));
|
||||
|
||||
// @remark For windows, there must be a space between const string and macro.
|
||||
pkt->props->set("fmsVer", SrsAmf0Any::str("FMS/" RTMP_SIG_FMS_VER));
|
||||
pkt->props->set("capabilities", SrsAmf0Any::number(127));
|
||||
pkt->props->set("mode", SrsAmf0Any::number(1));
|
||||
|
||||
|
|
|
@ -268,7 +268,8 @@ private:
|
|||
*
|
||||
* @remark, the c0c3 cache cannot be realloc.
|
||||
*/
|
||||
char out_c0c3_caches[SRS_CONSTS_C0C3_HEADERS_MAX];
|
||||
// To allocate it in heap to make VS2015 happy.
|
||||
char* out_c0c3_caches;
|
||||
// whether warned user to increase the c0c3 header cache.
|
||||
bool warned_c0c3_cache_dry;
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue