Skip to content

Commit

Permalink
for #742, refine the u_intxx_t to uintxx_t
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 30, 2017
1 parent 011ac4f commit b16ab03
Show file tree
Hide file tree
Showing 49 changed files with 278 additions and 275 deletions.
4 changes: 2 additions & 2 deletions trunk/research/librtmp/srs_aac_raw_publish.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ int main(int argc, char** argv)
}
srs_human_trace("publish stream success");

u_int32_t timestamp = 0;
u_int32_t time_delta = 45;
uint32_t timestamp = 0;
uint32_t time_delta = 45;
// @remark, to decode the file.
char* p = audio_raw;
for (;p < audio_raw + file_size;) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/research/librtmp/srs_audio_raw_publish.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ int main(int argc, char** argv)
}
srs_human_trace("publish stream success");

u_int32_t timestamp = 0;
u_int32_t time_delta = 17;
uint32_t timestamp = 0;
uint32_t time_delta = 17;
// @remark, to decode the file.
char* p = audio_raw;
for (;p < audio_raw + file_size;) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/research/librtmp/srs_bandwidth_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int main(int argc, char** argv)
int size;
char type;
char* data;
u_int32_t timestamp;
uint32_t timestamp;

// srs debug info.
char srs_server_ip[128];
Expand Down
4 changes: 2 additions & 2 deletions trunk/research/librtmp/srs_detect_rtmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ int main(int argc, char** argv)
int size;
char type;
char* data;
u_int32_t timestamp;
u_int32_t basetime = 0;
uint32_t timestamp;
uint32_t basetime = 0;

// user options
const char* rtmp_url = NULL;
Expand Down
4 changes: 2 additions & 2 deletions trunk/research/librtmp/srs_flv_injecter.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ int build_keyframes(srs_flv_t ic, srs_amf0_t *pname, srs_amf0_t* pdata, srs_amf0

// packet data
char type;
u_int32_t timestamp = 0;
uint32_t timestamp = 0;
char* data = NULL;
int32_t size;
int64_t offset = 0;
Expand Down Expand Up @@ -294,7 +294,7 @@ int do_inject_flv(srs_flv_t ic, srs_flv_t oc, srs_amf0_t amf0_name, srs_amf0_t a
char header[13];
// packet data
char type;
u_int32_t timestamp = 0;
uint32_t timestamp = 0;
char* data = NULL;
int32_t size;

Expand Down
2 changes: 1 addition & 1 deletion trunk/research/librtmp/srs_flv_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int parse_flv(srs_flv_t flv)
char header[13];
// packet data
char type;
u_int32_t timestamp = 0;
uint32_t timestamp = 0;
char* data = NULL;
int32_t size;
int64_t offset = 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/research/librtmp/srs_h264_raw_publish.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ int main(int argc, char** argv)
// 5bits, 7.3.1 NAL unit syntax,
// ISO_IEC_14496-10-AVC-2003.pdf, page 44.
// 7: SPS, 8: PPS, 5: I Frame, 1: P Frame, 9: AUD, 6: SEI
u_int8_t nut = (char)data[nb_start_code] & 0x1f;
uint8_t nut = (char)data[nb_start_code] & 0x1f;
srs_human_trace("sent packet: type=%s, time=%d, size=%d, fps=%.2f, b[%d]=%#x(%s)",
srs_human_flv_tag_type2string(SRS_RTMP_TYPE_VIDEO), dts, size, fps, nb_start_code, (char)data[nb_start_code],
(nut == 7? "SPS":(nut == 8? "PPS":(nut == 5? "I":(nut == 1? "P":(nut == 9? "AUD":(nut == 6? "SEI":"Unknown")))))));
Expand Down
14 changes: 7 additions & 7 deletions trunk/research/librtmp/srs_ingest_flv.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ int connect_oc(srs_rtmp_t ortmp);
#define RE_PULSE_MS 300
#define RE_PULSE_JITTER_MS 3000
int64_t re_create();
void re_update(int64_t re, int32_t starttime, u_int32_t time);
void re_cleanup(int64_t re, int32_t starttime, u_int32_t time);
void re_update(int64_t re, int32_t starttime, uint32_t time);
void re_cleanup(int64_t re, int32_t starttime, uint32_t time);

int64_t tools_main_entrance_startup_time;
int main(int argc, char** argv)
Expand Down Expand Up @@ -128,7 +128,7 @@ int main(int argc, char** argv)
return ret;
}

int do_proxy(srs_flv_t flv, srs_rtmp_t ortmp, int64_t re, int32_t* pstarttime, u_int32_t* ptimestamp)
int do_proxy(srs_flv_t flv, srs_rtmp_t ortmp, int64_t re, int32_t* pstarttime, uint32_t* ptimestamp)
{
int ret = 0;

Expand Down Expand Up @@ -160,7 +160,7 @@ int do_proxy(srs_flv_t flv, srs_rtmp_t ortmp, int64_t re, int32_t* pstarttime, u
return ret;
}

u_int32_t timestamp = *ptimestamp;
uint32_t timestamp = *ptimestamp;

if ((ret = srs_human_print_rtmp_packet(type, timestamp, data, size)) != 0) {
srs_human_trace("print packet failed. ret=%d", ret);
Expand All @@ -185,7 +185,7 @@ int do_proxy(srs_flv_t flv, srs_rtmp_t ortmp, int64_t re, int32_t* pstarttime, u
int proxy(srs_flv_t flv, srs_rtmp_t ortmp)
{
int ret = 0;
u_int32_t timestamp = 0;
uint32_t timestamp = 0;
int32_t starttime = -1;

char header[13];
Expand Down Expand Up @@ -252,7 +252,7 @@ int64_t re_create()

return re;
}
void re_update(int64_t re, int32_t starttime, u_int32_t time)
void re_update(int64_t re, int32_t starttime, uint32_t time)
{
// send by pulse algorithm.
int64_t now = srs_utils_time_ms();
Expand All @@ -261,7 +261,7 @@ void re_update(int64_t re, int32_t starttime, u_int32_t time)
usleep((useconds_t)(diff * 1000));
}
}
void re_cleanup(int64_t re, int32_t starttime, u_int32_t time)
void re_cleanup(int64_t re, int32_t starttime, uint32_t time)
{
// for the last pulse, always sleep.
// for the virtual live encoder long time publishing.
Expand Down
4 changes: 2 additions & 2 deletions trunk/research/librtmp/srs_ingest_rtmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ int proxy(srs_rtmp_t irtmp, srs_rtmp_t ortmp)
int size;
char type;
char* data;
u_int32_t timestamp;
u_int64_t nb_msgs = 0;
uint32_t timestamp;
uint64_t nb_msgs = 0;

if ((ret = connect_ic(irtmp)) != 0) {
return ret;
Expand Down
2 changes: 1 addition & 1 deletion trunk/research/librtmp/srs_play.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int main(int argc, char** argv)
int size;
char type;
char* data;
u_int32_t timestamp;
uint32_t timestamp;

if (srs_rtmp_read_packet(rtmp, &type, &timestamp, &data, &size) != 0) {
goto rtmp_destroy;
Expand Down
2 changes: 1 addition & 1 deletion trunk/research/librtmp/srs_publish.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int main(int argc, char** argv)
}
srs_human_trace("publish stream success");

u_int32_t timestamp = 0;
uint32_t timestamp = 0;
for (;;) {
char type = SRS_RTMP_TYPE_VIDEO;
int size = 4096;
Expand Down
4 changes: 2 additions & 2 deletions trunk/research/librtmp/srs_rtmp_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,14 @@ int main(int argc, char** argv)
}

int64_t nb_packets = 0;
u_int32_t pre_timestamp = 0;
uint32_t pre_timestamp = 0;
int64_t pre_now = -1;
int64_t start_time = -1;
for (;;) {
int size;
char type;
char* data;
u_int32_t timestamp;
uint32_t timestamp;

if (srs_rtmp_read_packet(rtmp, &type, &timestamp, &data, &size) != 0) {
srs_human_trace("read rtmp packet failed.");
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_caster_flv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int SrsDynamicHttpConn::do_proxy(ISrsHttpResponseReader* rr, SrsFlvDecoder* dec)

char type;
int32_t size;
u_int32_t time;
uint32_t time;
if ((ret = dec->read_tag_header(&type, &size, &time)) != ERROR_SUCCESS) {
if (!srs_is_client_gracefully_close(ret)) {
srs_error("flv: proxy tag header failed. ret=%d", ret);
Expand Down
8 changes: 4 additions & 4 deletions trunk/src/app/srs_app_http_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ SrsConnection* SrsHttpMessage::connection()
return conn;
}

u_int8_t SrsHttpMessage::method()
uint8_t SrsHttpMessage::method()
{
if (jsonp && !jsonp_method.empty()) {
if (jsonp_method == "GET") {
Expand All @@ -595,12 +595,12 @@ u_int8_t SrsHttpMessage::method()
}
}

return (u_int8_t)_header.method;
return (uint8_t)_header.method;
}

u_int16_t SrsHttpMessage::status_code()
uint16_t SrsHttpMessage::status_code()
{
return (u_int16_t)_header.status_code;
return (uint16_t)_header.status_code;
}

string SrsHttpMessage::method_str()
Expand Down
4 changes: 2 additions & 2 deletions trunk/src/app/srs_app_http_conn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ class SrsHttpMessage : public ISrsHttpMessage
public:
virtual SrsConnection* connection();
public:
virtual u_int8_t method();
virtual u_int16_t status_code();
virtual uint8_t method();
virtual uint16_t status_code();
/**
* method helpers.
*/
Expand Down
18 changes: 9 additions & 9 deletions trunk/src/app/srs_app_mpegts_udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsBuffer* avs)
}

// ts tbn to flv tbn.
u_int32_t dts = (u_int32_t)(msg->dts / 90);
u_int32_t pts = (u_int32_t)(msg->dts / 90);
uint32_t dts = (uint32_t)(msg->dts / 90);
uint32_t pts = (uint32_t)(msg->dts / 90);

// send each frame.
while (!avs->empty()) {
Expand Down Expand Up @@ -419,7 +419,7 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsBuffer* avs)
return ret;
}

int SrsMpegtsOverUdp::write_h264_sps_pps(u_int32_t dts, u_int32_t pts)
int SrsMpegtsOverUdp::write_h264_sps_pps(uint32_t dts, uint32_t pts)
{
int ret = ERROR_SUCCESS;

Expand Down Expand Up @@ -447,7 +447,7 @@ int SrsMpegtsOverUdp::write_h264_sps_pps(u_int32_t dts, u_int32_t pts)
}

// the timestamp in rtmp message header is dts.
u_int32_t timestamp = dts;
uint32_t timestamp = dts;
if ((ret = rtmp_write_packet(SrsCodecFlvTagVideo, timestamp, flv, nb_flv)) != ERROR_SUCCESS) {
return ret;
}
Expand All @@ -460,7 +460,7 @@ int SrsMpegtsOverUdp::write_h264_sps_pps(u_int32_t dts, u_int32_t pts)
return ret;
}

int SrsMpegtsOverUdp::write_h264_ipb_frame(char* frame, int frame_size, u_int32_t dts, u_int32_t pts)
int SrsMpegtsOverUdp::write_h264_ipb_frame(char* frame, int frame_size, uint32_t dts, uint32_t pts)
{
int ret = ERROR_SUCCESS;

Expand Down Expand Up @@ -494,7 +494,7 @@ int SrsMpegtsOverUdp::write_h264_ipb_frame(char* frame, int frame_size, u_int32_
}

// the timestamp in rtmp message header is dts.
u_int32_t timestamp = dts;
uint32_t timestamp = dts;
return rtmp_write_packet(SrsCodecFlvTagVideo, timestamp, flv, nb_flv);
}

Expand All @@ -508,7 +508,7 @@ int SrsMpegtsOverUdp::on_ts_audio(SrsTsMessage* msg, SrsBuffer* avs)
}

// ts tbn to flv tbn.
u_int32_t dts = (u_int32_t)(msg->dts / 90);
uint32_t dts = (uint32_t)(msg->dts / 90);

// send each frame.
while (!avs->empty()) {
Expand Down Expand Up @@ -551,7 +551,7 @@ int SrsMpegtsOverUdp::on_ts_audio(SrsTsMessage* msg, SrsBuffer* avs)
return ret;
}

int SrsMpegtsOverUdp::write_audio_raw_frame(char* frame, int frame_size, SrsRawAacStreamCodec* codec, u_int32_t dts)
int SrsMpegtsOverUdp::write_audio_raw_frame(char* frame, int frame_size, SrsRawAacStreamCodec* codec, uint32_t dts)
{
int ret = ERROR_SUCCESS;

Expand All @@ -564,7 +564,7 @@ int SrsMpegtsOverUdp::write_audio_raw_frame(char* frame, int frame_size, SrsRawA
return rtmp_write_packet(SrsCodecFlvTagAudio, dts, data, size);
}

int SrsMpegtsOverUdp::rtmp_write_packet(char type, u_int32_t timestamp, char* data, int size)
int SrsMpegtsOverUdp::rtmp_write_packet(char type, uint32_t timestamp, char* data, int size)
{
int ret = ERROR_SUCCESS;

Expand Down
8 changes: 4 additions & 4 deletions trunk/src/app/srs_app_mpegts_udp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ class SrsMpegtsOverUdp : virtual public ISrsTsHandler
virtual int on_ts_message(SrsTsMessage* msg);
private:
virtual int on_ts_video(SrsTsMessage* msg, SrsBuffer* avs);
virtual int write_h264_sps_pps(u_int32_t dts, u_int32_t pts);
virtual int write_h264_ipb_frame(char* frame, int frame_size, u_int32_t dts, u_int32_t pts);
virtual int write_h264_sps_pps(uint32_t dts, uint32_t pts);
virtual int write_h264_ipb_frame(char* frame, int frame_size, uint32_t dts, uint32_t pts);
virtual int on_ts_audio(SrsTsMessage* msg, SrsBuffer* avs);
virtual int write_audio_raw_frame(char* frame, int frame_size, SrsRawAacStreamCodec* codec, u_int32_t dts);
virtual int write_audio_raw_frame(char* frame, int frame_size, SrsRawAacStreamCodec* codec, uint32_t dts);
private:
virtual int rtmp_write_packet(char type, u_int32_t timestamp, char* data, int size);
virtual int rtmp_write_packet(char type, uint32_t timestamp, char* data, int size);
private:
// Connect to RTMP server.
virtual int connect();
Expand Down
Loading

0 comments on commit b16ab03

Please sign in to comment.