From 5f103459fade9696c976ce4df893178b55dbd87f Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 14 Dec 2015 17:01:04 +0100 Subject: [PATCH] Cleaned warnings --- Makefile.in | 3 +++ src/rtp/rtpdec_h264.c | 2 +- src/rtsp/BasicRTSPOnlySubsession.cpp | 30 ++++++++++++++-------------- src/rtsp/BasicRTSPOnlySubsession.hh | 4 ++-- src/utils/h264_stream.c | 4 ++-- src/video_capture/rtsp.cpp | 23 ++++++++++----------- 6 files changed, 34 insertions(+), 32 deletions(-) diff --git a/Makefile.in b/Makefile.in index 20a9ba90a..ead84f019 100644 --- a/Makefile.in +++ b/Makefile.in @@ -252,6 +252,9 @@ src/video_display/quicktime.o: src/video_display/quicktime.c $(ALL_INCLUDES) src/video_capture/DeckLinkAPIDispatch.o: $(DECKLINK_PATH)/DeckLinkAPIDispatch.cpp $(CXX) $(CXXFLAGS) -c $(INC) -o src/video_capture/DeckLinkAPIDispatch.o $(DECKLINK_PATH)/DeckLinkAPIDispatch.cpp +src/vo_postprocess/text.o: src/vo_postprocess/text.cpp + $(CXX) $(CXXFLAGS) -Wno-unknown-attributes -c $(INC) -c $< -o $@ + src/video_capture/DeckLinkAPI_i.o: $(DECKLINK_PATH)/DeckLinkAPI_i.c $(CC) $(CFLAGS) -c $(INC) -o src/video_capture/DeckLinkAPI_i.o $(DECKLINK_PATH)/DeckLinkAPI_i.c diff --git a/src/rtp/rtpdec_h264.c b/src/rtp/rtpdec_h264.c index ab0585438..87dec4199 100644 --- a/src/rtp/rtpdec_h264.c +++ b/src/rtp/rtpdec_h264.c @@ -84,7 +84,7 @@ int decode_frame_h264(struct coded_data *cdata, void *decode_data) { total_length+=data->offset_len; } frame->tiles[0].data_len = total_length; - dst = frame->tiles[0].data + total_length; + dst = (unsigned char *) frame->tiles[0].data + total_length; } while (cdata != NULL) { diff --git a/src/rtsp/BasicRTSPOnlySubsession.cpp b/src/rtsp/BasicRTSPOnlySubsession.cpp index 3a0ea309e..ec755ae76 100644 --- a/src/rtsp/BasicRTSPOnlySubsession.cpp +++ b/src/rtsp/BasicRTSPOnlySubsession.cpp @@ -102,7 +102,7 @@ void BasicRTSPOnlySubsession::setSDPLines() { uint8_t rtpPayloadType = 96; AddressString ipAddressStr(fServerAddressForSDP); char* rtpmapLine = strdup("a=rtpmap:96 H264/90000\n"); - char const* auxSDPLine = ""; + //char const* auxSDPLine = ""; char const* const sdpFmt = "m=%s %u RTP/AVP %u\r\n" "c=IN IP4 %s\r\n" @@ -145,7 +145,7 @@ void BasicRTSPOnlySubsession::setSDPLines() { } char* rtpmapLine = strdup("a=rtpmap:97 PCMU/48000/2\n"); //only to alloc max possible size - char const* auxSDPLine = ""; + //char const* auxSDPLine = ""; char const* const sdpFmt = "m=%s %u RTP/AVP %u\r\n" "c=IN IP4 %s\r\n" @@ -177,13 +177,13 @@ void BasicRTSPOnlySubsession::setSDPLines() { } } -void BasicRTSPOnlySubsession::getStreamParameters(unsigned clientSessionId, +void BasicRTSPOnlySubsession::getStreamParameters(unsigned /* clientSessionId */, netAddressBits clientAddress, Port const& clientRTPPort, - Port const& clientRTCPPort, int tcpSocketNum, - unsigned char rtpChannelId, unsigned char rtcpChannelId, + Port const& clientRTCPPort, int /* tcpSocketNum */, + unsigned char /* rtpChannelId */, unsigned char /* rtcpChannelId */, netAddressBits& destinationAddress, uint8_t& /*destinationTTL*/, - Boolean& isMulticast, Port& serverRTPPort, Port& serverRTCPPort, - void*& streamToken) { + Boolean& /* isMulticast */, Port& serverRTPPort, Port& serverRTCPPort, + void*& /* streamToken */) { if (Vdestination == NULL && (avType == video || avType == av)) { Port rtp(rtp_port); serverRTPPort = rtp; @@ -220,12 +220,12 @@ void BasicRTSPOnlySubsession::getStreamParameters(unsigned clientSessionId, } } -void BasicRTSPOnlySubsession::startStream(unsigned clientSessionId, - void* streamToken, TaskFunc* rtcpRRHandler, - void* rtcpRRHandlerClientData, unsigned short& rtpSeqNum, - unsigned& rtpTimestamp, - ServerRequestAlternativeByteHandler* serverRequestAlternativeByteHandler, - void* serverRequestAlternativeByteHandlerClientData) { +void BasicRTSPOnlySubsession::startStream(unsigned /* clientSessionId */, + void* /* streamToken */, TaskFunc* /* rtcpRRHandler */, + void* /* rtcpRRHandlerClientData */, unsigned short& /* rtpSeqNum */, + unsigned& /* rtpTimestamp */, + ServerRequestAlternativeByteHandler* /* serverRequestAlternativeByteHandler */, + void* /* serverRequestAlternativeByteHandlerClientData */) { struct response *resp = NULL; if (Vdestination != NULL) { @@ -287,8 +287,8 @@ void BasicRTSPOnlySubsession::startStream(unsigned clientSessionId, } } -void BasicRTSPOnlySubsession::deleteStream(unsigned clientSessionId, - void*& streamToken) { +void BasicRTSPOnlySubsession::deleteStream(unsigned /* clientSessionId */, + void*& /* streamToken */) { if (Vdestination != NULL) { if (avType == video || avType == av) { char pathV[1024]; diff --git a/src/rtsp/BasicRTSPOnlySubsession.hh b/src/rtsp/BasicRTSPOnlySubsession.hh index edf9d99be..8de3deaca 100644 --- a/src/rtsp/BasicRTSPOnlySubsession.hh +++ b/src/rtsp/BasicRTSPOnlySubsession.hh @@ -129,8 +129,8 @@ private: void setSDPLines(); - Boolean fReuseFirstSource; - void* fLastStreamToken; + Boolean fReuseFirstSource __attribute__((unused)); + void* fLastStreamToken __attribute__((unused)); char fCNAME[100]; struct module *fmod; rtps_types_t avType; diff --git a/src/utils/h264_stream.c b/src/utils/h264_stream.c index 4538208ac..90bc4b4f3 100644 --- a/src/utils/h264_stream.c +++ b/src/utils/h264_stream.c @@ -315,11 +315,11 @@ void read_hrd_parameters(sps_t* sps, bs_t* b) //7.3.2.11 RBSP trailing bits syntax void read_rbsp_trailing_bits(bs_t* b) { - int rbsp_stop_one_bit = bs_read_u1( b ); // equal to 1 + /* int rbsp_stop_one_bit = */ bs_read_u1( b ); // equal to 1 while( !bs_byte_aligned(b) ) { - int rbsp_alignment_zero_bit = bs_read_u1( b ); // equal to 0 + /* int rbsp_alignment_zero_bit = */ bs_read_u1( b ); // equal to 0 } } diff --git a/src/video_capture/rtsp.cpp b/src/video_capture/rtsp.cpp index d072c45eb..5c133c7c6 100644 --- a/src/video_capture/rtsp.cpp +++ b/src/video_capture/rtsp.cpp @@ -87,7 +87,7 @@ if ((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK){ \ fprintf(stderr, "[rtsp error] curl_easy_setopt(%s, %s, %s) failed: %d\n", #A, #B, #C, res); \ printf("[rtsp error] could not configure rtsp capture properly, \n\t\tplease check your parameters. \nExiting...\n\n"); \ - return NULL; \ + return -1; \ } #define my_curl_easy_perform(A) \ @@ -161,7 +161,7 @@ static const uint8_t start_sequence[] = { 0, 0, 0, 1 }; struct video_rtsp_state { uint32_t *in_codec; - char *codec; + const char *codec; struct timeval t0, t; int frames; @@ -179,7 +179,7 @@ struct video_rtsp_state { int port; float fps; - char *control; + const char *control; struct rtp *device; struct pdb *participants; @@ -210,7 +210,7 @@ struct audio_rtsp_state { struct audio_frame audio; int play_audio_frame; - char *codec; + const char *codec; struct timeval last_audio_time; unsigned int grab_audio:1; @@ -218,7 +218,7 @@ struct audio_rtsp_state { int port; float fps; - char *control; + const char *control; struct rtp *device; struct pdb *participants; @@ -245,7 +245,7 @@ struct rtsp_state { CURL *curl; char *uri; rtps_types_t avType; - char *addr; + const char *addr; char *sdp; volatile bool should_exit; @@ -293,6 +293,7 @@ keep_alive_thread(void *arg){ while (!s->should_exit) { rtsp_keepalive_video(s); } + return NULL; } int decode_frame_by_pt(struct coded_data *cdata, void *decode_data, struct pbuf_stats *) { @@ -731,7 +732,7 @@ init_rtsp(char* rtsp_uri, int rtsp_port, void *state, char* nals) { } setup_codecs_and_controls_from_sdp(sdp_filename, s); - if (s->vrtsp_state->codec == "H264"){ + if (strcmp(s->vrtsp_state->codec, "H264") == 0){ s->vrtsp_state->frame->color_spec = H264; sprintf(uri, "%s/%s", url, s->vrtsp_state->control); debug_msg("\n V URI = %s\n",uri); @@ -740,7 +741,7 @@ init_rtsp(char* rtsp_uri, int rtsp_port, void *state, char* nals) { } sprintf(uri, "%s", url); } - if (s->artsp_state->codec == "PCMU"){ + if (strcmp(s->artsp_state->codec, "PCMU") == 0){ sprintf(uri, "%s/%s", url, s->artsp_state->control); debug_msg("\n A URI = %s\n",uri); if(rtsp_setup(curl, uri, Atransport)==0){ @@ -748,7 +749,7 @@ init_rtsp(char* rtsp_uri, int rtsp_port, void *state, char* nals) { } sprintf(uri, "%s", url); } - if (s->artsp_state->codec == "" && s->vrtsp_state->codec == ""){ + if (strlen(s->artsp_state->codec) == 0 && strlen(s->vrtsp_state->codec) == 0){ return -1; } else{ @@ -1019,7 +1020,7 @@ rtsp_setup(CURL *curl, const char *uri, const char *transport) { * send RTSP PLAY request */ static int -rtsp_play(CURL *curl, const char *uri, const char *range) { +rtsp_play(CURL *curl, const char *uri, const char * /* range */) { CURLcode res = CURLE_OK; debug_msg("\n[rtsp] PLAY %s\n", uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri); @@ -1119,8 +1120,6 @@ get_nals(const char *sdp_filename, char *nals, int *width, int *height) { uint8_t nalInfo; uint8_t type; uint8_t nri; - int k; - int sizeSPS = 0; int max_len = 1500, len_nals = 0; char *s = (char *) malloc(max_len); char *sprop;