]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Add const to (mostly) char* and make some functions static, which aren't used
authordiego <diego@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 18 Jun 2006 11:33:14 +0000 (11:33 +0000)
committerdiego <diego@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 18 Jun 2006 11:33:14 +0000 (11:33 +0000)
outside their declaring source file and which have no corresponding prototype.
patch by Stefan Huehner stefan^^@^^huehner^^.^^org

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5497 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

16 files changed:
ffmpeg.c
ffplay.c
ffserver.c
libavcodec/alac.c
libavcodec/png.c
libavcodec/resample2.c
libavcodec/truespeech.c
libavformat/aiff.c
libavformat/movenc.c
libavformat/mpegts.c
libavformat/mpegtsenc.c
libavformat/rtsp.c
libavformat/udp.c
libpostproc/postprocess.c
libpostproc/postprocess_internal.h
vhook/watermark.c

index 348bab084df126f005332383e96c9bb467c5f49a..6653c78a9a8f5e72f00d94dce5a1a97065ef8a80 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -211,12 +211,12 @@ static int video_global_header = 0;
 static int rate_emu = 0;
 
 #ifdef CONFIG_BKTR
-static char *video_grab_format = "bktr";
+static const char *video_grab_format = "bktr";
 #else
 #ifdef CONFIG_VIDEO4LINUX2
-static char *video_grab_format = "video4linux2";
+static const char *video_grab_format = "video4linux2";
 #else
-static char *video_grab_format = "video4linux";
+static const char *video_grab_format = "video4linux";
 #endif
 #endif
 static char *video_device = NULL;
@@ -224,7 +224,7 @@ static char *grab_device = NULL;
 static int  video_channel = 0;
 static char *video_standard = "ntsc";
 
-static char *audio_grab_format = "audio_device";
+static const char *audio_grab_format = "audio_device";
 static char *audio_device = NULL;
 static int audio_volume = 256;
 
index 720ce324c9ba51fd854cc65830b52d09dcfd4214..8cffa8f704e6ad34191a109f15fdab200fdd4dcb 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -1735,7 +1735,7 @@ static void stream_component_close(VideoState *is, int stream_index)
     }
 }
 
-void dump_stream_info(AVFormatContext *s)
+static void dump_stream_info(const AVFormatContext *s)
 {
     if (s->track != 0)
         fprintf(stderr, "Track: %d\n", s->track);
@@ -2042,7 +2042,7 @@ static void stream_close(VideoState *is)
     SDL_DestroyMutex(is->video_decoder_mutex);
 }
 
-void stream_cycle_channel(VideoState *is, int codec_type)
+static void stream_cycle_channel(VideoState *is, int codec_type)
 {
     AVFormatContext *ic = is->ic;
     int start_index, stream_index;
@@ -2092,7 +2092,7 @@ void stream_cycle_channel(VideoState *is, int codec_type)
 }
 
 
-void toggle_full_screen(void)
+static void toggle_full_screen(void)
 {
     int w, h, flags;
     is_full_screen = !is_full_screen;
@@ -2117,14 +2117,14 @@ void toggle_full_screen(void)
     }
 }
 
-void toggle_pause(void)
+static void toggle_pause(void)
 {
     if (cur_stream)
         stream_pause(cur_stream);
     step = 0;
 }
 
-void step_to_next_frame(void)
+static void step_to_next_frame(void)
 {
     if (cur_stream) {
         if (cur_stream->paused)
@@ -2134,7 +2134,7 @@ void step_to_next_frame(void)
     step = 1;
 }
 
-void do_exit(void)
+static void do_exit(void)
 {
     if (cur_stream) {
         stream_close(cur_stream);
@@ -2146,7 +2146,7 @@ void do_exit(void)
     exit(0);
 }
 
-void toggle_audio_display(void)
+static void toggle_audio_display(void)
 {
     if (cur_stream) {
         cur_stream->show_audio = !cur_stream->show_audio;
@@ -2154,7 +2154,7 @@ void toggle_audio_display(void)
 }
 
 /* handle an event sent by the GUI */
-void event_loop(void)
+static void event_loop(void)
 {
     SDL_Event event;
     double incr, pos, frac;
index e31a02706c21df741c5709f44ab678ece2b1d539..4fe7b032d71c0d23f538c0445eb7524991bc00f9 100644 (file)
@@ -3704,7 +3704,7 @@ static int opt_video_codec(const char *arg)
 /* simplistic plugin support */
 
 #ifdef CONFIG_HAVE_DLOPEN
-void load_module(const char *filename)
+static void load_module(const char *filename)
 {
     void *dll;
     void (*init_func)(void);
index 2dc1a48559864f92957251909e5c34d3bc621810..8bd75e5d90324749193a8552a1f1421de0df5925 100644 (file)
@@ -407,7 +407,7 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
     }
 }
 
-void deinterlace_16(int32_t *buffer_a, int32_t *buffer_b,
+static void deinterlace_16(int32_t *buffer_a, int32_t *buffer_b,
                     int16_t *buffer_out,
                     int numchannels, int numsamples,
                     uint8_t interlacing_shift,
index c96638c2d86dae9313a67d15510f60fd6fd77ed9..efe4cdf4ffe717500d8aa6a03654056646855807 100644 (file)
@@ -346,7 +346,7 @@ static void convert_from_rgba32(uint8_t *dst, const uint8_t *src, int width)
 
     d = dst;
     for(j = 0; j < width; j++) {
-        v = ((uint32_t *)src)[j];
+        v = ((const uint32_t *)src)[j];
         d[0] = v >> 16;
         d[1] = v >> 8;
         d[2] = v;
index 735f612d1624fe65ce9c6a3f2d065fe6399cc53d..11da57651f52a860453a4d863483ff9558a901d4 100644 (file)
@@ -62,7 +62,7 @@ typedef struct AVResampleContext{
 /**
  * 0th order modified bessel function of the first kind.
  */
-double bessel(double x){
+static double bessel(double x){
     double v=1;
     double t=1;
     int i;
index 71b3297b66d66bebabd462debef964ba241ce040..dbd29b38f56d37d45596eb3e328660bc84a65869 100644 (file)
@@ -188,7 +188,8 @@ static void truespeech_filters_merge(TSContext *dec)
 
 static void truespeech_apply_twopoint_filter(TSContext *dec, int quart)
 {
-    int16_t tmp[146 + 60], *ptr0, *ptr1, *filter;
+    int16_t tmp[146 + 60], *ptr0, *ptr1;
+    const int16_t *filter;
     int i, t, off;
 
     t = dec->offset2[quart];
@@ -201,7 +202,7 @@ static void truespeech_apply_twopoint_filter(TSContext *dec, int quart)
     off = (t / 25) + dec->offset1[quart >> 1] + 18;
     ptr0 = tmp + 145 - off;
     ptr1 = tmp + 146;
-    filter = (int16_t*)ts_240 + (t % 25) * 2;
+    filter = (const int16_t*)ts_240 + (t % 25) * 2;
     for(i = 0; i < 60; i++){
         t = (ptr0[0] * filter[0] + ptr0[1] * filter[1] + 0x2000) >> 14;
         ptr0++;
@@ -214,7 +215,8 @@ static void truespeech_place_pulses(TSContext *dec, int16_t *out, int quart)
 {
     int16_t tmp[7];
     int i, j, t;
-    int16_t *ptr1, *ptr2;
+    const int16_t *ptr1;
+    int16_t *ptr2;
     int coef;
 
     memset(out, 0, 60 * 2);
@@ -225,7 +227,7 @@ static void truespeech_place_pulses(TSContext *dec, int16_t *out, int quart)
     }
 
     coef = dec->pulsepos[quart] >> 15;
-    ptr1 = (int16_t*)ts_140 + 30;
+    ptr1 = (const int16_t*)ts_140 + 30;
     ptr2 = tmp;
     for(i = 0, j = 3; (i < 30) && (j > 0); i++){
         t = *ptr1++;
@@ -238,7 +240,7 @@ static void truespeech_place_pulses(TSContext *dec, int16_t *out, int quart)
         }
     }
     coef = dec->pulsepos[quart] & 0x7FFF;
-    ptr1 = (int16_t*)ts_140;
+    ptr1 = (const int16_t*)ts_140;
     for(i = 30, j = 4; (i < 60) && (j > 0); i++){
         t = *ptr1++;
         if(coef >= t)
index 3dbe6b152405afed08151964d59d37d684b77458..0e7152ca706f0ae468d6b1366a3531cc0e0eeeb2 100644 (file)
@@ -110,7 +110,7 @@ static int fix_bps(int codec_id)
 }
 
 /* Returns the number of sound data frames or negative on error */
-unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
+static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
                              int size, unsigned version)
 {
     AVExtFloat ext;
index cc24e314ab86109501a5056eaa84e5741936e195..59201411735fb35e8d7152bded39d7aeca67cad4 100644 (file)
@@ -1341,7 +1341,7 @@ static int mov_write_moov_tag(ByteIOContext *pb, MOVContext *mov,
     return updateSize(pb, pos);
 }
 
-int mov_write_mdat_tag(ByteIOContext *pb, MOVContext* mov)
+static int mov_write_mdat_tag(ByteIOContext *pb, MOVContext* mov)
 {
     put_be32(pb, 8);    // placeholder for extended size field (64 bit)
     put_tag(pb, "wide");
index 54e7043089b4016d778de44dd36d6ecb747378c4..5575cccda4c342c65aeddd9af83a648221746672 100644 (file)
@@ -151,7 +151,7 @@ static void write_section_data(AVFormatContext *s, MpegTSFilter *tss1,
     }
 }
 
-MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int pid,
+static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int pid,
                                          SectionCallback *section_cb, void *opaque,
                                          int check_crc)
 
@@ -183,7 +183,7 @@ MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int pid,
     return filter;
 }
 
-MpegTSFilter *mpegts_open_pes_filter(MpegTSContext *ts, unsigned int pid,
+static MpegTSFilter *mpegts_open_pes_filter(MpegTSContext *ts, unsigned int pid,
                                      PESCallback *pes_cb,
                                      void *opaque)
 {
@@ -205,7 +205,7 @@ MpegTSFilter *mpegts_open_pes_filter(MpegTSContext *ts, unsigned int pid,
     return filter;
 }
 
-void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter)
+static void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter)
 {
     int pid;
 
@@ -609,7 +609,7 @@ static void pat_scan_cb(void *opaque, const uint8_t *section, int section_len)
     ts->pat_filter = NULL;
 }
 
-void mpegts_set_service(MpegTSContext *ts, int sid,
+static void mpegts_set_service(MpegTSContext *ts, int sid,
                         SetServiceCallback *set_service_cb, void *opaque)
 {
     ts->set_service_cb = set_service_cb;
@@ -696,7 +696,7 @@ static void sdt_cb(void *opaque, const uint8_t *section, int section_len)
 }
 
 /* scan services in a transport stream by looking at the SDT */
-void mpegts_scan_sdt(MpegTSContext *ts)
+static void mpegts_scan_sdt(MpegTSContext *ts)
 {
     ts->sdt_filter = mpegts_open_section_filter(ts, SDT_PID,
                                                 sdt_cb, ts, 1);
@@ -704,7 +704,7 @@ void mpegts_scan_sdt(MpegTSContext *ts)
 
 /* scan services in a transport stream by looking at the PAT (better
    than nothing !) */
-void mpegts_scan_pat(MpegTSContext *ts)
+static void mpegts_scan_pat(MpegTSContext *ts)
 {
     ts->pat_filter = mpegts_open_section_filter(ts, PAT_PID,
                                                 pat_scan_cb, ts, 1);
index 7086b5dc8939d8e677971ddcc4b43db29095d141..ad19516b4610cc41d41c087ff5111a5eacb823a8 100644 (file)
@@ -34,7 +34,7 @@ typedef struct MpegTSSection {
 } MpegTSSection;
 
 /* NOTE: 4 bytes must be left at the end for the crc32 */
-void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len)
+static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len)
 {
     unsigned int crc;
     unsigned char packet[TS_PACKET_SIZE];
@@ -89,7 +89,7 @@ static inline void put16(uint8_t **q_ptr, int val)
     *q_ptr = q;
 }
 
-int mpegts_write_section1(MpegTSSection *s, int tid, int id,
+static int mpegts_write_section1(MpegTSSection *s, int tid, int id,
                           int version, int sec_num, int last_sec_num,
                           uint8_t *buf, int len)
 {
index 31af3c9c8992270f73525217ae3bf2d92c056e64..a4bd40f25a322ed1c2ca7f34ac1c8c94fc708645 100644 (file)
@@ -145,7 +145,7 @@ static int sdp_parse_rtpmap(AVCodecContext *codec, int payload_type, const char
     char buf[256];
     int i;
     AVCodec *c;
-    char *c_name;
+    const char *c_name;
 
     /* Loop into AVRtpDynamicPayloadTypes[] and AVRtpPayloadTypes[] and
        see if we can handle this kind of payload */
@@ -169,7 +169,7 @@ static int sdp_parse_rtpmap(AVCodecContext *codec, int payload_type, const char
 
     c = avcodec_find_decoder(codec->codec_id);
     if (c && c->name)
-        c_name = (char *)c->name;
+        c_name = c->name;
     else
         c_name = (char *)NULL;
 
@@ -255,7 +255,7 @@ static void sdp_parse_fmtp_config(AVCodecContext *codec, char *attr, char *value
 
 typedef struct attrname_map
 {
-    char *str;
+    const char *str;
     uint16_t type;
     uint32_t offset;
 } attrname_map_t;
index ee4f67d654ed6b67cb8416c27b5ed90625a9b6b9..fb72096db5c2df94156ebcf6becffacc2dc64c91 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
 
 #ifdef CONFIG_IPV6
 
-int udp_ipv6_is_multicast_address(const struct sockaddr *addr) {
+static int udp_ipv6_is_multicast_address(const struct sockaddr *addr) {
     if (addr->sa_family == AF_INET)
         return IN_MULTICAST(ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr));
     if (addr->sa_family == AF_INET6)
@@ -59,7 +59,7 @@ int udp_ipv6_is_multicast_address(const struct sockaddr *addr) {
     return -1;
 }
 
-int udp_ipv6_set_multicast_ttl(int sockfd, int mcastTTL, struct sockaddr *addr) {
+static int udp_ipv6_set_multicast_ttl(int sockfd, int mcastTTL, struct sockaddr *addr) {
     if (addr->sa_family == AF_INET) {
         if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL, sizeof(mcastTTL)) < 0) {
             perror("setsockopt(IP_MULTICAST_TTL)");
@@ -75,7 +75,7 @@ int udp_ipv6_set_multicast_ttl(int sockfd, int mcastTTL, struct sockaddr *addr)
     return 0;
 }
 
-int udp_ipv6_join_multicast_group(int sockfd, struct sockaddr *addr) {
+static int udp_ipv6_join_multicast_group(int sockfd, struct sockaddr *addr) {
     struct ip_mreq   mreq;
     struct ipv6_mreq mreq6;
     if (addr->sa_family == AF_INET) {
@@ -97,7 +97,7 @@ int udp_ipv6_join_multicast_group(int sockfd, struct sockaddr *addr) {
     return 0;
 }
 
-int udp_ipv6_leave_multicast_group(int sockfd, struct sockaddr *addr) {
+static int udp_ipv6_leave_multicast_group(int sockfd, struct sockaddr *addr) {
     struct ip_mreq   mreq;
     struct ipv6_mreq mreq6;
     if (addr->sa_family == AF_INET) {
@@ -119,7 +119,7 @@ int udp_ipv6_leave_multicast_group(int sockfd, struct sockaddr *addr) {
     return 0;
 }
 
-struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, int type, int family, int flags) {
+static struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, int type, int family, int flags) {
     struct addrinfo hints, *res = 0;
     int error;
     char sport[16];
@@ -144,7 +144,7 @@ struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, int type,
     return res;
 }
 
-int udp_ipv6_set_remote_url(URLContext *h, const char *uri) {
+static int udp_ipv6_set_remote_url(URLContext *h, const char *uri) {
     UDPContext *s = h->priv_data;
     char hostname[256];
     int port;
@@ -158,7 +158,7 @@ int udp_ipv6_set_remote_url(URLContext *h, const char *uri) {
     return 0;
 }
 
-int udp_ipv6_set_local(URLContext *h) {
+static int udp_ipv6_set_local(URLContext *h) {
     UDPContext *s = h->priv_data;
     int udp_fd = -1;
     struct sockaddr_storage clientaddr;
index 300ea5c42ca93d4c8f32453c8136ab3db533972a..870a8a228dd3bf09da166502adec12730cbef212 100644 (file)
@@ -161,7 +161,7 @@ static struct PPFilter filters[]=
         {NULL, NULL,0,0,0,0} //End Marker
 };
 
-static char *replaceTable[]=
+static const char *replaceTable[]=
 {
         "default",      "hdeblock:a,vdeblock:a,dering:a",
         "de",           "hdeblock:a,vdeblock:a,dering:a",
@@ -766,8 +766,8 @@ pp_mode_t *pp_get_mode_by_name_and_quality(char *name, int quality)
 {
         char temp[GET_MODE_BUFFER_SIZE];
         char *p= temp;
-        char *filterDelimiters= ",/";
-        char *optionDelimiters= ":";
+        const char *filterDelimiters= ",/";
+        const char *optionDelimiters= ":";
         struct PPMode *ppMode;
         char *filterToken;
 
index bab4c841ca71b8330c23e34286862956b765ac9c..90107c733a84a84a445199529e125d3f60b88b01 100644 (file)
@@ -79,8 +79,8 @@ static inline int CLIP(int a){
  * Postprocessng filter.
  */
 struct PPFilter{
-        char *shortName;
-        char *longName;
+        const char *shortName;
+        const char *longName;
         int chromDefault;       ///< is chrominance filtering on by default if this filter is manually activated
         int minLumQuality;      ///< minimum quality to turn luminance filtering on
         int minChromQuality;    ///< minimum quality to turn chrominance filtering on
index cf89e609943ab65752f25904febb8d882a0bbe31..e88dd1b30b02a1777f0f7eee36aae34518a2e608 100644 (file)
@@ -164,7 +164,7 @@ int Configure(void **ctxp, int argc, char *argv[])
 /****************************************************************************
  * For mode 0 (the original one)
  ****************************************************************************/
-void Process0(void *ctx,
+static void Process0(void *ctx,
               AVPicture *picture,
               enum PixelFormat pix_fmt,
               int src_width,
@@ -276,7 +276,7 @@ void Process0(void *ctx,
 /****************************************************************************
  * For mode 1 (the original one)
  ****************************************************************************/
-void Process1(void *ctx,
+static void Process1(void *ctx,
               AVPicture *picture,
               enum PixelFormat pix_fmt,
               int src_width,