mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
support compile srs-librtmp on windows. 2.0.26
This commit is contained in:
parent
5f48d4f566
commit
d6072b16c0
14 changed files with 468 additions and 33 deletions
|
|
@ -30,7 +30,10 @@ 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
|
||||
#ifndef _WIN32
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
|
||||
#include <srs_kernel_buffer.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,11 @@ 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
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
|
|
@ -260,7 +264,7 @@ int SrsHandshakeBytes::create_c0c1()
|
|||
return ret;
|
||||
}
|
||||
stream.write_1bytes(0x03);
|
||||
stream.write_4bytes(::time(NULL));
|
||||
stream.write_4bytes((int32_t)::time(NULL));
|
||||
stream.write_4bytes(0x00);
|
||||
|
||||
return ret;
|
||||
|
|
@ -283,7 +287,7 @@ int SrsHandshakeBytes::create_s0s1s2(const char* c1)
|
|||
return ret;
|
||||
}
|
||||
stream.write_1bytes(0x03);
|
||||
stream.write_4bytes(::time(NULL));
|
||||
stream.write_4bytes((int32_t)::time(NULL));
|
||||
// s2 time2 copy from c1
|
||||
if (c0c1) {
|
||||
stream.write_bytes(c0c1 + 1, 4);
|
||||
|
|
@ -314,7 +318,7 @@ int SrsHandshakeBytes::create_c2()
|
|||
if ((ret = stream.initialize(c2, 8)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
stream.write_4bytes(::time(NULL));
|
||||
stream.write_4bytes((int32_t)::time(NULL));
|
||||
// c2 time2 copy from s1
|
||||
if (s0s1s2) {
|
||||
stream.write_bytes(s0s1s2 + 1, 4);
|
||||
|
|
|
|||
|
|
@ -397,7 +397,8 @@ SrsMessage::~SrsMessage()
|
|||
|
||||
SrsProtocol::AckWindowSize::AckWindowSize()
|
||||
{
|
||||
ack_window_size = acked_size = 0;
|
||||
ack_window_size = 0;
|
||||
acked_size = 0;
|
||||
}
|
||||
|
||||
SrsProtocol::SrsProtocol(ISrsProtocolReaderWriter* io)
|
||||
|
|
@ -1427,7 +1428,7 @@ int SrsProtocol::read_message_header(SrsChunkStream* chunk, char fmt, int bh_siz
|
|||
* @remark, srs always send the extended-timestamp, to keep simple,
|
||||
* and compatible with adobe products.
|
||||
*/
|
||||
u_int32_t chunk_timestamp = chunk->header.timestamp;
|
||||
u_int32_t chunk_timestamp = (u_int32_t)chunk->header.timestamp;
|
||||
|
||||
/**
|
||||
* if chunk_timestamp<=0, the chunk previous packet has no extended-timestamp,
|
||||
|
|
@ -1695,7 +1696,8 @@ int SrsProtocol::response_acknowledgement_message()
|
|||
int ret = ERROR_SUCCESS;
|
||||
|
||||
SrsAcknowledgementPacket* pkt = new SrsAcknowledgementPacket();
|
||||
in_ack_size.acked_size = pkt->sequence_number = skt->get_recv_bytes();
|
||||
in_ack_size.acked_size = skt->get_recv_bytes();
|
||||
pkt->sequence_number = (int32_t)in_ack_size.acked_size;
|
||||
if ((ret = send_and_free_packet(pkt, 0)) != ERROR_SUCCESS) {
|
||||
srs_error("send acknowledgement failed. ret=%d", ret);
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
|
||||
#ifndef _WIN32
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
|
||||
#include <srs_kernel_log.hpp>
|
||||
#include <srs_kernel_error.hpp>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue