gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r8269 - in Extractor/src/plugins/ffmpeg: libavcodec libavfo


From: gnunet
Subject: [GNUnet-SVN] r8269 - in Extractor/src/plugins/ffmpeg: libavcodec libavformat libavutil libswscale
Date: Fri, 20 Feb 2009 01:15:07 -0700

Author: grothoff
Date: 2009-02-20 01:15:06 -0700 (Fri, 20 Feb 2009)
New Revision: 8269

Modified:
   Extractor/src/plugins/ffmpeg/libavcodec/bitstream.c
   Extractor/src/plugins/ffmpeg/libavcodec/bitstream_filter.c
   Extractor/src/plugins/ffmpeg/libavcodec/eval.c
   Extractor/src/plugins/ffmpeg/libavcodec/eval.h
   Extractor/src/plugins/ffmpeg/libavcodec/pnm.h
   Extractor/src/plugins/ffmpeg/libavcodec/pnm_parser.c
   Extractor/src/plugins/ffmpeg/libavcodec/pnmenc.c
   Extractor/src/plugins/ffmpeg/libavcodec/snow.h
   Extractor/src/plugins/ffmpeg/libavcodec/utils.c
   Extractor/src/plugins/ffmpeg/libavformat/avformat.h
   Extractor/src/plugins/ffmpeg/libavformat/aviobuf.c
   Extractor/src/plugins/ffmpeg/libavformat/utils.c
   Extractor/src/plugins/ffmpeg/libavutil/fifo.c
   Extractor/src/plugins/ffmpeg/libavutil/fifo.h
   Extractor/src/plugins/ffmpeg/libavutil/internal.h
   Extractor/src/plugins/ffmpeg/libswscale/yuv2rgb.c
Log:
cleaning up types, reducing warnings

Modified: Extractor/src/plugins/ffmpeg/libavcodec/bitstream.c
===================================================================
--- Extractor/src/plugins/ffmpeg/libavcodec/bitstream.c 2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavcodec/bitstream.c 2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -46,9 +46,6 @@
  * @deprecated. Code which uses ff_realloc_static is broken/misdesigned
  * and should correctly use static arrays
  */
-attribute_deprecated av_alloc_size(2)
-static void *ff_realloc_static(void *ptr, unsigned int size);
-
 static void *ff_realloc_static(void *ptr, unsigned int size)
 {
     return av_realloc(ptr, size);

Modified: Extractor/src/plugins/ffmpeg/libavcodec/bitstream_filter.c
===================================================================
--- Extractor/src/plugins/ffmpeg/libavcodec/bitstream_filter.c  2009-02-20 
08:08:20 UTC (rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavcodec/bitstream_filter.c  2009-02-20 
08:15:06 UTC (rev 8269)
@@ -57,9 +57,9 @@
 
 int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
                                AVCodecContext *avctx, const char *args,
-                     uint8_t **poutbuf, int *poutbuf_size,
+                              uint8_t **poutbuf, int *poutbuf_size,
                      const uint8_t *buf, int buf_size, int keyframe){
-    *poutbuf= (uint8_t *) buf;
-    *poutbuf_size= buf_size;
-    return bsfc->filter->filter(bsfc, avctx, args, poutbuf, poutbuf_size, buf, 
buf_size, keyframe);
+  *poutbuf= (uint8_t *)buf;
+  *poutbuf_size= buf_size;
+  return bsfc->filter->filter(bsfc, avctx, args, poutbuf, poutbuf_size, buf, 
buf_size, keyframe);
 }

Modified: Extractor/src/plugins/ffmpeg/libavcodec/eval.c
===================================================================
--- Extractor/src/plugins/ffmpeg/libavcodec/eval.c      2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavcodec/eval.c      2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -47,8 +47,8 @@
 typedef struct Parser{
     int stack_index;
     char *s;
-    double *const_value;
-    const char **const_name;          // NULL terminated
+    const double *const_value;
+    const char *const*const_name;          // NULL terminated
     double (**func1)(void *, double a); // NULL terminated
     const char **func1_name;          // NULL terminated
     double (**func2)(void *, double a, double b); // NULL terminated
@@ -375,7 +375,7 @@
     }
 }
 
-AVEvalExpr * ff_parse(const char *s, const char **const_name,
+AVEvalExpr * ff_parse(const char *s, const char *const *const_name,
                double (**func1)(void *, double), const char **func1_name,
                double (**func2)(void *, double, double), char **func2_name,
                const char **error){
@@ -404,7 +404,7 @@
     return e;
 }
 
-double ff_parse_eval(AVEvalExpr * e, double *const_value, void *opaque) {
+double ff_parse_eval(AVEvalExpr * e, const double *const_value, void *opaque) {
     Parser p;
 
     p.const_value= const_value;
@@ -412,7 +412,7 @@
     return eval_expr(&p, e);
 }
 
-double ff_eval2(const char *s, double *const_value, const char **const_name,
+double ff_eval2(const char *s, const double *const_value, const char 
*const*const_name,
                double (**func1)(void *, double), const char **func1_name,
                double (**func2)(void *, double, double), char **func2_name,
                void *opaque, const char **error){

Modified: Extractor/src/plugins/ffmpeg/libavcodec/eval.h
===================================================================
--- Extractor/src/plugins/ffmpeg/libavcodec/eval.h      2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavcodec/eval.h      2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -52,7 +52,7 @@
  * @param opaque a pointer which will be passed to all functions from func1 
and func2
  * @return the value of the expression
  */
-double ff_eval2(const char *s, double *const_value, const char **const_name,
+double ff_eval2(const char *s, const double *const_value, const char 
*const*const_name,
                double (**func1)(void *, double), const char **func1_name,
                double (**func2)(void *, double, double), char **func2_name,
                void *opaque, const char **error);
@@ -71,7 +71,7 @@
  * @return AVEvalExpr which must be freed with ff_eval_free by the user when 
it is not needed anymore
  *         NULL if anything went wrong
  */
-AVEvalExpr * ff_parse(const char *s, const char **const_name,
+AVEvalExpr * ff_parse(const char *s, const char *const *const_name,
                double (**func1)(void *, double), const char **func1_name,
                double (**func2)(void *, double, double), char **func2_name,
                const char **error);
@@ -81,7 +81,7 @@
  * @param opaque a pointer which will be passed to all functions from func1 
and func2
  * @return the value of the expression
  */
-double ff_parse_eval(AVEvalExpr * e, double *const_value, void *opaque);
+double ff_parse_eval(AVEvalExpr * e, const double *const_value, void *opaque);
 void ff_eval_free(AVEvalExpr * e);
 
 #endif /* FFMPEG_EVAL_H */

Modified: Extractor/src/plugins/ffmpeg/libavcodec/pnm.h
===================================================================
--- Extractor/src/plugins/ffmpeg/libavcodec/pnm.h       2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavcodec/pnm.h       2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -26,8 +26,8 @@
 
 typedef struct PNMContext {
     uint8_t *bytestream;
-    uint8_t *bytestream_start;
-    uint8_t *bytestream_end;
+    const uint8_t *bytestream_start;
+    const uint8_t *bytestream_end;
     AVFrame picture;
     int maxval;                 ///< maximum value of a pixel
 } PNMContext;

Modified: Extractor/src/plugins/ffmpeg/libavcodec/pnm_parser.c
===================================================================
--- Extractor/src/plugins/ffmpeg/libavcodec/pnm_parser.c        2009-02-20 
08:08:20 UTC (rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavcodec/pnm_parser.c        2009-02-20 
08:15:06 UTC (rev 8269)
@@ -38,7 +38,7 @@
 retry:
     if(pc->index){
         pnmctx.bytestream_start=
-        pnmctx.bytestream= pc->buffer;
+         pnmctx.bytestream= (uint8_t) pc->buffer;
         pnmctx.bytestream_end= pc->buffer + pc->index;
     }else{
         pnmctx.bytestream_start=

Modified: Extractor/src/plugins/ffmpeg/libavcodec/pnmenc.c
===================================================================
--- Extractor/src/plugins/ffmpeg/libavcodec/pnmenc.c    2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavcodec/pnmenc.c    2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -95,7 +95,7 @@
             } else if (upgrade == 2) {
                 unsigned int j, v, f = (65535*32768 + s->maxval/2) / s->maxval;
                 for (j=0; j<n/2; j++) {
-                    v = be2me_16(((uint16_t *)s->bytestream)[j]);
+                    v = be2me_16(((const uint16_t *)s->bytestream)[j]);
                     ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15;
                 }
             }
@@ -238,6 +238,7 @@
     return s->bytestream - s->bytestream_start;
 }
 
+#if HAVE_DEAD_CODE
 static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int 
buf_size, void *data){
     PNMContext *s = avctx->priv_data;
     AVFrame *pict = data;
@@ -318,6 +319,7 @@
     }
     return s->bytestream - s->bytestream_start;
 }
+#endif
 
 #if 0
 static int pnm_probe(AVProbeData *pd)

Modified: Extractor/src/plugins/ffmpeg/libavcodec/snow.h
===================================================================
--- Extractor/src/plugins/ffmpeg/libavcodec/snow.h      2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavcodec/snow.h      2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -129,9 +129,11 @@
 int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h);
 int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h);
 #else
+#if HAVE_DEAD_CODE
 static int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, 
int h) {assert (0);}
 static int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, 
int h) {assert (0);}
 #endif
+#endif
 
 /* C bits used by mmx/sse2/altivec */
 

Modified: Extractor/src/plugins/ffmpeg/libavcodec/utils.c
===================================================================
--- Extractor/src/plugins/ffmpeg/libavcodec/utils.c     2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavcodec/utils.c     2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -842,7 +842,7 @@
         return -1;
     }
     if((avctx->codec->capabilities & CODEC_CAP_DELAY) || samples){
-        int ret = avctx->codec->encode(avctx, buf, buf_size, (void *)samples);
+      int ret = avctx->codec->encode(avctx, buf, buf_size, (void *) samples);
         avctx->frame_number++;
         return ret;
     }else
@@ -1331,7 +1331,11 @@
         return -1;
     }
 #if !defined(HAVE_MKSTEMP)
-    fd = open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444);
+    fd = open(*filename, O_RDWR | 
+#ifdef O_BINARY
+             O_BINARY |
+#endif
+             O_CREAT, 0444);
 #else
     snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
     fd = mkstemp(*filename);
@@ -1413,6 +1417,7 @@
     int i;
     int n = sizeof(video_frame_size_abbrs) / sizeof(VideoFrameSizeAbbr);
     const char *p;
+    char *pp;
     int frame_width = 0, frame_height = 0;
 
     for(i=0;i<n;i++) {
@@ -1424,10 +1429,12 @@
     }
     if (i == n) {
         p = str;
-        frame_width = strtol(p, (char **)&p, 10);
+        frame_width = strtol(p, &pp, 10);
+       p = pp;
         if (*p)
             p++;
-        frame_height = strtol(p, (char **)&p, 10);
+        frame_height = strtol(p, &pp, 10);
+       p = pp;
     }
     if (frame_width <= 0 || frame_height <= 0)
         return -1;

Modified: Extractor/src/plugins/ffmpeg/libavformat/avformat.h
===================================================================
--- Extractor/src/plugins/ffmpeg/libavformat/avformat.h 2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavformat/avformat.h 2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -128,11 +128,10 @@
 /**
  * the exact value of the fractional number is: 'val + num / den'.
  * num is assumed to be such as 0 <= num < den
- * @deprecated Use AVRational instead
 */
 typedef struct AVFrac {
     int64_t val, num, den;
-} AVFrac attribute_deprecated;
+} AVFrac; 
 
 /*************************************************/
 /* input/output formats */

Modified: Extractor/src/plugins/ffmpeg/libavformat/aviobuf.c
===================================================================
--- Extractor/src/plugins/ffmpeg/libavformat/aviobuf.c  2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavformat/aviobuf.c  2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -538,8 +538,10 @@
 
     if (init_put_byte(*s, buffer, buffer_size,
                       (h->flags & URL_WRONLY || h->flags & URL_RDWR), h,
-                      url_read, url_write, url_seek) < 0) {
-        av_free(buffer);
+                      (int (*)(void *, uint8_t*,int)) url_read, 
+                     (int (*)(void *, uint8_t*,int)) url_write, 
+                     (offset_t (*)(void *, offset_t, int)) url_seek) < 0) {
+      av_free(buffer);
         av_freep(s);
         return AVERROR(EIO);
     }

Modified: Extractor/src/plugins/ffmpeg/libavformat/utils.c
===================================================================
--- Extractor/src/plugins/ffmpeg/libavformat/utils.c    2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavformat/utils.c    2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -2821,6 +2821,7 @@
         "%H%M%S",
     };
     const char *q;
+    char *qq;
     int is_utc, len;
     char lastch;
     int negative = 0;
@@ -2881,10 +2882,11 @@
         q = small_strptime(p, time_fmt[0], &dt);
         if (!q) {
             /* parse datestr as S+ */
-            dt.tm_sec = strtol(p, (char **)&q, 10);
-            if (q == p)
+            dt.tm_sec = strtol(p, &qq, 10);
+            if (qq == p)
                 /* the parsing didn't succeed */
                 return INT64_MIN;
+           q = qq;
             dt.tm_min = 0;
             dt.tm_hour = 0;
         }

Modified: Extractor/src/plugins/ffmpeg/libavutil/fifo.c
===================================================================
--- Extractor/src/plugins/ffmpeg/libavutil/fifo.c       2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavutil/fifo.c       2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -71,10 +71,10 @@
 
 void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size)
 {
-    av_fifo_generic_write(f, (void *)buf, size, NULL);
+    av_fifo_generic_write(f, buf, size, NULL);
 }
 
-int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int 
(*func)(void*, void*, int))
+int av_fifo_generic_write(AVFifoBuffer *f, const void *src, int size, int 
(*func)(const void*, void*, int))
 {
     int total = size;
     do {
@@ -84,7 +84,7 @@
                 break;
         } else {
             memcpy(f->wptr, src, len);
-            src = (uint8_t*)src + len;
+            src = (const uint8_t*)src + len;
         }
         f->wptr += len;
         if (f->wptr >= f->end)

Modified: Extractor/src/plugins/ffmpeg/libavutil/fifo.h
===================================================================
--- Extractor/src/plugins/ffmpeg/libavutil/fifo.h       2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavutil/fifo.h       2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -91,7 +91,7 @@
  * If func is NULL, src is interpreted as a simple byte array for source data.
  * @return the number of bytes written to the fifo.
  */
-int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int 
(*func)(void*, void*, int));
+int av_fifo_generic_write(AVFifoBuffer *f, const void *src, int size, int 
(*func)(const void*, void*, int));
 
 /**
  * Resizes an AVFifoBuffer.

Modified: Extractor/src/plugins/ffmpeg/libavutil/internal.h
===================================================================
--- Extractor/src/plugins/ffmpeg/libavutil/internal.h   2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libavutil/internal.h   2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -277,24 +277,15 @@
 }
 
 #ifndef HAVE_LLRINT
-av_always_inline av_const long long llrint(double x)
-{
-    return rint(x);
-}
+#define llrint(x) ((long long) rint(x))
 #endif /* HAVE_LLRINT */
 
 #ifndef HAVE_LRINT
-av_always_inline av_const long int lrint(double x)
-{
-    return rint(x);
-}
+#define lrint(x) ((long int) rint(x))
 #endif /* HAVE_LRINT */
 
 #ifndef HAVE_LRINTF
-av_always_inline av_const long int lrintf(float x)
-{
-    return (int)(rint(x));
-}
+#define lrintf(x) ((long int) rint(x))
 #endif /* HAVE_LRINTF */
 
 #ifndef HAVE_ROUND

Modified: Extractor/src/plugins/ffmpeg/libswscale/yuv2rgb.c
===================================================================
--- Extractor/src/plugins/ffmpeg/libswscale/yuv2rgb.c   2009-02-20 08:08:20 UTC 
(rev 8268)
+++ Extractor/src/plugins/ffmpeg/libswscale/yuv2rgb.c   2009-02-20 08:15:06 UTC 
(rev 8269)
@@ -379,6 +379,7 @@
     DST1(3);
 EPILOG(8)
 
+#if HAVE_DEAD_CODE
 // This is exactly the same code as yuv2rgb_c_32 except for the types of
 // r, g, b, dst_1, dst_2
 PROLOG(yuv2rgb_c_8, uint8_t)
@@ -398,6 +399,7 @@
     DST2(3);
     DST1(3);
 EPILOG(8)
+#endif
 
 // r, g, b, dst_1, dst_2
 PROLOG(yuv2rgb_c_8_ordered_dither, uint8_t)
@@ -436,6 +438,7 @@
 
 // This is exactly the same code as yuv2rgb_c_32 except for the types of
 // r, g, b, dst_1, dst_2
+#if HAVE_DEAD_CODE
 PROLOG(yuv2rgb_c_4, uint8_t)
     int acc;
 #define DST1_4(i)                   \
@@ -468,6 +471,7 @@
     DST2_4(3);
     DST1_4(3);
 EPILOG(4)
+#endif
 
 PROLOG(yuv2rgb_c_4_ordered_dither, uint8_t)
     const uint8_t *d64= dither_8x8_73[y&7];
@@ -508,6 +512,7 @@
 
 // This is exactly the same code as yuv2rgb_c_32 except for the types of
 // r, g, b, dst_1, dst_2
+#if HAVE_DEAD_CODE
 PROLOG(yuv2rgb_c_4b, uint8_t)
     RGB(0);
     DST1(0);
@@ -525,6 +530,7 @@
     DST2(3);
     DST1(3);
 EPILOG(8)
+#endif
 
 PROLOG(yuv2rgb_c_4b_ordered_dither, uint8_t)
     const uint8_t *d64= dither_8x8_73[y&7];





reply via email to

[Prev in Thread] Current Thread [Next in Thread]