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
|
@ -23,8 +23,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <srs_kernel_file.hpp>
|
||||
|
||||
#include <fcntl.h>
|
||||
// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
|
||||
|
@ -173,19 +177,19 @@ int64_t SrsFileReader::tellg()
|
|||
|
||||
void SrsFileReader::skip(int64_t size)
|
||||
{
|
||||
::lseek(fd, size, SEEK_CUR);
|
||||
::lseek(fd, (off_t)size, SEEK_CUR);
|
||||
}
|
||||
|
||||
int64_t SrsFileReader::lseek(int64_t offset)
|
||||
{
|
||||
return (int64_t)::lseek(fd, offset, SEEK_SET);
|
||||
return (int64_t)::lseek(fd, (off_t)offset, SEEK_SET);
|
||||
}
|
||||
|
||||
int64_t SrsFileReader::filesize()
|
||||
{
|
||||
int64_t cur = tellg();
|
||||
int64_t size = (int64_t)::lseek(fd, 0, SEEK_END);
|
||||
::lseek(fd, cur, SEEK_SET);
|
||||
::lseek(fd, (off_t)cur, SEEK_SET);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <srs_kernel_flv.hpp>
|
||||
|
||||
#include <fcntl.h>
|
||||
// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
|
||||
|
@ -157,7 +161,7 @@ int SrsFlvEncoder::write_audio(int64_t timestamp, char* data, int size)
|
|||
return ret;
|
||||
}
|
||||
tag_stream->write_3bytes(size);
|
||||
tag_stream->write_3bytes(timestamp);
|
||||
tag_stream->write_3bytes((int32_t)timestamp);
|
||||
// default to little-endian
|
||||
tag_stream->write_1bytes((timestamp >> 24) & 0xFF);
|
||||
|
||||
|
@ -191,7 +195,7 @@ int SrsFlvEncoder::write_video(int64_t timestamp, char* data, int size)
|
|||
return ret;
|
||||
}
|
||||
tag_stream->write_3bytes(size);
|
||||
tag_stream->write_3bytes(timestamp);
|
||||
tag_stream->write_3bytes((int32_t)timestamp);
|
||||
// default to little-endian
|
||||
tag_stream->write_1bytes((timestamp >> 24) & 0xFF);
|
||||
|
||||
|
|
|
@ -23,11 +23,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <srs_kernel_utility.hpp>
|
||||
|
||||
// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue