Browse code

Merge remote branch 'qatar/master'

* qatar/master:
Makefile: Include dependencies for test tools, too
Remove a version check in av_log made unnecessary by the big bump.
update last major version increase dates in APIchanges
Reduce picture size for yadif.
oggdec: use av_freep() instead of av_free()
avio: Fix sanity checks in ffurl_read*
libavformat: Free AVFormatContext->streams
libavformat: Make protocols pass URLContext as log context where available
asf: remove commented out code in asf_read_seek
not pulled: libpostproc: Remove crufty code disabled by the big bump.
Reflect 0.7_beta1 release in the Changelog
not pulled: sws: remove disabled cruft.
lavu: remove disabled ff_random_get_seed cruft.
lavu: remove disabled sha1 cruft.

Conflicts:
Changelog
libavutil/sha1.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/04/21 10:23:46
Showing 15 changed files
... ...
@@ -9,6 +9,11 @@ version <next>:
9 9
 - mpeg2 aspect ratio dection fixed
10 10
 - libxvid aspect pickiness fixed
11 11
 - Frame multithreaded decoding
12
+- Lots of deprecated API cruft removed
13
+
14
+
15
+version 0.7_beta1:
16
+
12 17
 - WebM support in Matroska de/muxer
13 18
 - low overhead Ogg muxing
14 19
 - MMS-TCP support
... ...
@@ -93,6 +93,7 @@ tools/%.o: tools/%.c
93 93
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $<
94 94
 
95 95
 -include $(wildcard tools/*.d)
96
+-include $(wildcard tests/*.d)
96 97
 
97 98
 ffplay.o: CFLAGS += $(SDL_CFLAGS)
98 99
 
... ...
@@ -1,13 +1,13 @@
1 1
 Never assume the API of libav* to be stable unless at least 1 week has passed since
2 2
 the last major version increase.
3 3
 The last version increases were:
4
-libavcodec:  ?
5
-libavdevice: ?
6
-libavfilter: 2009-10-18
7
-libavformat: ?
8
-libpostproc: ?
9
-libswscale:  ?
10
-libavutil:   2009-03-08
4
+libavcodec:  2011-04-18
5
+libavdevice: 2011-04-18
6
+libavfilter: 2011-04-18
7
+libavformat: 2011-04-18
8
+libpostproc: 2011-04-18
9
+libswscale:  2011-04-18
10
+libavutil:   2011-04-18
11 11
 
12 12
 
13 13
 API changes, most recent first:
... ...
@@ -195,7 +195,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
195 195
         av_strlcpy(s->playlisturl, "http://", sizeof(s->playlisturl));
196 196
         av_strlcat(s->playlisturl, nested_url, sizeof(s->playlisturl));
197 197
     } else {
198
-        av_log(NULL, AV_LOG_ERROR, "Unsupported url %s\n", uri);
198
+        av_log(h, AV_LOG_ERROR, "Unsupported url %s\n", uri);
199 199
         ret = AVERROR(EINVAL);
200 200
         goto fail;
201 201
     }
... ...
@@ -218,7 +218,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
218 218
     }
219 219
 
220 220
     if (s->n_segments == 0) {
221
-        av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
221
+        av_log(h, AV_LOG_WARNING, "Empty playlist\n");
222 222
         ret = AVERROR(EIO);
223 223
         goto fail;
224 224
     }
... ...
@@ -258,7 +258,7 @@ retry:
258 258
                 return ret;
259 259
     }
260 260
     if (s->cur_seq_no < s->start_seq_no) {
261
-        av_log(NULL, AV_LOG_WARNING,
261
+        av_log(h, AV_LOG_WARNING,
262 262
                "skipping %d segments ahead, expired from playlist\n",
263 263
                s->start_seq_no - s->cur_seq_no);
264 264
         s->cur_seq_no = s->start_seq_no;
... ...
@@ -274,12 +274,12 @@ retry:
274 274
         goto retry;
275 275
     }
276 276
     url = s->segments[s->cur_seq_no - s->start_seq_no]->url,
277
-    av_log(NULL, AV_LOG_DEBUG, "opening %s\n", url);
277
+    av_log(h, AV_LOG_DEBUG, "opening %s\n", url);
278 278
     ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ);
279 279
     if (ret < 0) {
280 280
         if (url_interrupt_cb())
281 281
             return AVERROR_EXIT;
282
-        av_log(NULL, AV_LOG_WARNING, "Unable to open %s\n", url);
282
+        av_log(h, AV_LOG_WARNING, "Unable to open %s\n", url);
283 283
         s->cur_seq_no++;
284 284
         goto retry;
285 285
     }
... ...
@@ -1262,27 +1262,6 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
1262 1262
         /* find the position */
1263 1263
         pos = st->index_entries[index].pos;
1264 1264
 
1265
-    // various attempts to find key frame have failed so far
1266
-    //    asf_reset_header(s);
1267
-    //    avio_seek(s->pb, pos, SEEK_SET);
1268
-    //    key_pos = pos;
1269
-    //     for(i=0;i<16;i++){
1270
-    //         pos = avio_tell(s->pb);
1271
-    //         if (av_read_frame(s, &pkt) < 0){
1272
-    //             av_log(s, AV_LOG_INFO, "seek failed\n");
1273
-    //             return -1;
1274
-    //         }
1275
-    //         asf_st = s->streams[stream_index]->priv_data;
1276
-    //         pos += st->parser->frame_offset;
1277
-    //
1278
-    //         if (pkt.size > b) {
1279
-    //             b = pkt.size;
1280
-    //             key_pos = pos;
1281
-    //         }
1282
-    //
1283
-    //         av_free_packet(&pkt);
1284
-    //     }
1285
-
1286 1265
         /* do the seek */
1287 1266
         av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos);
1288 1267
         avio_seek(s->pb, pos, SEEK_SET);
... ...
@@ -50,7 +50,7 @@ static int gopher_connect(URLContext *h, const char *path)
50 50
             if (!path) return AVERROR(EINVAL);
51 51
             break;
52 52
         default:
53
-            av_log(NULL, AV_LOG_WARNING,
53
+            av_log(h, AV_LOG_WARNING,
54 54
                    "Gopher protocol type '%c' not supported yet!\n",
55 55
                    *path);
56 56
             return AVERROR(EINVAL);
... ...
@@ -70,7 +70,7 @@ void ff_http_set_headers(URLContext *h, const char *headers)
70 70
     int len = strlen(headers);
71 71
 
72 72
     if (len && strcmp("\r\n", headers + len - 2))
73
-        av_log(NULL, AV_LOG_ERROR, "No trailing CRLF found in HTTP header.\n");
73
+        av_log(h, AV_LOG_ERROR, "No trailing CRLF found in HTTP header.\n");
74 74
 
75 75
     av_strlcpy(s->headers, headers, sizeof(s->headers));
76 76
 }
... ...
@@ -232,7 +232,7 @@ static int process_line(URLContext *h, char *line, int line_count,
232 232
          * don't abort until all headers have been parsed. */
233 233
         if (s->http_code >= 400 && s->http_code < 600 && s->http_code != 401) {
234 234
             end += strspn(end, SPACE_CHARS);
235
-            av_log(NULL, AV_LOG_WARNING, "HTTP error %d %s\n",
235
+            av_log(h, AV_LOG_WARNING, "HTTP error %d %s\n",
236 236
                    s->http_code, end);
237 237
             return -1;
238 238
         }
... ...
@@ -64,7 +64,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
64 64
     snprintf(portstr, sizeof(portstr), "%d", port);
65 65
     ret = getaddrinfo(hostname, portstr, &hints, &ai);
66 66
     if (ret) {
67
-        av_log(NULL, AV_LOG_ERROR,
67
+        av_log(h, AV_LOG_ERROR,
68 68
                "Failed to resolve hostname %s: %s\n",
69 69
                hostname, gai_strerror(ret));
70 70
         return AVERROR(EIO);
... ...
@@ -126,7 +126,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
126 126
         optlen = sizeof(ret);
127 127
         getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);
128 128
         if (ret != 0) {
129
-            av_log(NULL, AV_LOG_ERROR,
129
+            av_log(h, AV_LOG_ERROR,
130 130
                    "TCP connection to %s:%d failed: %s\n",
131 131
                    hostname, port, strerror(ret));
132 132
             goto fail;
... ...
@@ -266,7 +266,7 @@ int ff_udp_set_remote_url(URLContext *h, const char *uri)
266 266
                 if (connect(s->udp_fd, (struct sockaddr *) &s->dest_addr,
267 267
                             s->dest_addr_len)) {
268 268
                     s->is_connected = 0;
269
-                    av_log(NULL, AV_LOG_ERROR, "connect: %s\n", strerror(errno));
269
+                    av_log(h, AV_LOG_ERROR, "connect: %s\n", strerror(errno));
270 270
                     return AVERROR(EIO);
271 271
                 }
272 272
             }
... ...
@@ -410,7 +410,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
410 410
         /* limit the tx buf size to limit latency */
411 411
         tmp = s->buffer_size;
412 412
         if (setsockopt(udp_fd, SOL_SOCKET, SO_SNDBUF, &tmp, sizeof(tmp)) < 0) {
413
-            av_log(NULL, AV_LOG_ERROR, "setsockopt(SO_SNDBUF): %s\n", strerror(errno));
413
+            av_log(h, AV_LOG_ERROR, "setsockopt(SO_SNDBUF): %s\n", strerror(errno));
414 414
             goto fail;
415 415
         }
416 416
     } else {
... ...
@@ -418,14 +418,14 @@ static int udp_open(URLContext *h, const char *uri, int flags)
418 418
          * avoid losing data on OSes that set this too low by default. */
419 419
         tmp = s->buffer_size;
420 420
         if (setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp)) < 0) {
421
-            av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_RECVBUF): %s\n", strerror(errno));
421
+            av_log(h, AV_LOG_WARNING, "setsockopt(SO_RECVBUF): %s\n", strerror(errno));
422 422
         }
423 423
         /* make the socket non-blocking */
424 424
         ff_socket_nonblock(udp_fd, 1);
425 425
     }
426 426
     if (s->is_connected) {
427 427
         if (connect(udp_fd, (struct sockaddr *) &s->dest_addr, s->dest_addr_len)) {
428
-            av_log(NULL, AV_LOG_ERROR, "connect: %s\n", strerror(errno));
428
+            av_log(h, AV_LOG_ERROR, "connect: %s\n", strerror(errno));
429 429
             goto fail;
430 430
         }
431 431
     }
... ...
@@ -2586,6 +2586,7 @@ void avformat_free_context(AVFormatContext *s)
2586 2586
     av_freep(&s->chapters);
2587 2587
     av_metadata_free(&s->metadata);
2588 2588
     av_freep(&s->key);
2589
+    av_freep(&s->streams);
2589 2590
     av_free(s);
2590 2591
 }
2591 2592
 
... ...
@@ -35,7 +35,6 @@ HEADERS = adler32.h                                                     \
35 35
           rational.h                                                    \
36 36
           samplefmt.h                                                   \
37 37
           sha.h                                                         \
38
-          sha1.h                                                        \
39 38
 
40 39
 BUILT_HEADERS = avconfig.h
41 40
 
... ...
@@ -100,7 +100,7 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
100 100
     line[0]=0;
101 101
 #undef fprintf
102 102
     if(print_prefix && avc) {
103
-        if(avc->version >= (50<<16 | 15<<8 | 3) && avc->parent_log_context_offset){
103
+        if (avc->parent_log_context_offset) {
104 104
             AVClass** parent= *(AVClass***)(((uint8_t*)ptr) + avc->parent_log_context_offset);
105 105
             if(parent && *parent){
106 106
                 snprintf(line, sizeof(line), "[%s @ %p] ", (*parent)->item_name(parent), parent);
... ...
@@ -80,11 +80,3 @@ uint32_t av_get_random_seed(void)
80 80
         return seed;
81 81
     return get_generic_seed();
82 82
 }
83
-
84
-#if LIBAVUTIL_VERSION_MAJOR < 51
85
-attribute_deprecated uint32_t ff_random_get_seed(void);
86
-uint32_t ff_random_get_seed(void)
87
-{
88
-    return av_get_random_seed();
89
-}
90
-#endif
... ...
@@ -25,7 +25,6 @@
25 25
 #include "avutil.h"
26 26
 #include "bswap.h"
27 27
 #include "sha.h"
28
-#include "sha1.h"
29 28
 #include "intreadwrite.h"
30 29
 
31 30
 /** hash context */
... ...
@@ -324,29 +323,6 @@ void av_sha_final(AVSHA* ctx, uint8_t *digest)
324 324
         AV_WB32(digest + i*4, ctx->state[i]);
325 325
 }
326 326
 
327
-#if LIBAVUTIL_VERSION_MAJOR < 51
328
-struct AVSHA1 {
329
-    AVSHA sha;
330
-};
331
-
332
-const int av_sha1_size = sizeof(struct AVSHA1);
333
-
334
-void av_sha1_init(struct AVSHA1* context)
335
-{
336
-    av_sha_init(&context->sha, 160);
337
-}
338
-
339
-void av_sha1_update(struct AVSHA1* context, const uint8_t* data, unsigned int len)
340
-{
341
-    av_sha_update(&context->sha, data, len);
342
-}
343
-
344
-void av_sha1_final(struct AVSHA1* context, uint8_t digest[20])
345
-{
346
-    av_sha_final(&context->sha, digest);
347
-}
348
-#endif
349
-
350 327
 #ifdef TEST
351 328
 #include <stdio.h>
352 329
 #undef printf
353 330
deleted file mode 100644
... ...
@@ -1,57 +0,0 @@
1
-/*
2
- * Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at>
3
- *
4
- * This file is part of FFmpeg.
5
- *
6
- * FFmpeg is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU Lesser General Public
8
- * License as published by the Free Software Foundation; either
9
- * version 2.1 of the License, or (at your option) any later version.
10
- *
11
- * FFmpeg is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
- * Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public
17
- * License along with FFmpeg; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
- */
20
-
21
-#ifndef AVUTIL_SHA1_H
22
-#define AVUTIL_SHA1_H
23
-
24
-#include <stdint.h>
25
-
26
-extern const int av_sha1_size;
27
-
28
-struct AVSHA1;
29
-
30
-/**
31
- * Initialize SHA-1 hashing.
32
- *
33
- * @param context pointer to the function context (of size av_sha_size)
34
- * @deprecated use av_sha_init() instead
35
- */
36
-void av_sha1_init(struct AVSHA1* context);
37
-
38
-/**
39
- * Update hash value.
40
- *
41
- * @param context hash function context
42
- * @param data    input data to update hash with
43
- * @param len     input data length
44
- * @deprecated use av_sha_update() instead
45
- */
46
-void av_sha1_update(struct AVSHA1* context, const uint8_t* data, unsigned int len);
47
-
48
-/**
49
- * Finish hashing and output digest value.
50
- *
51
- * @param context hash function context
52
- * @param digest  buffer where output digest value is stored
53
- * @deprecated use av_sha_final() instead
54
- */
55
-void av_sha1_final(struct AVSHA1* context, uint8_t digest[20]);
56
-
57
-#endif /* AVUTIL_SHA1_H */