Commit 10d2ae8c authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 2c18893a f83acb09
...@@ -9,6 +9,11 @@ version <next>: ...@@ -9,6 +9,11 @@ version <next>:
- mpeg2 aspect ratio dection fixed - mpeg2 aspect ratio dection fixed
- libxvid aspect pickiness fixed - libxvid aspect pickiness fixed
- Frame multithreaded decoding - Frame multithreaded decoding
- Lots of deprecated API cruft removed
version 0.7_beta1:
- WebM support in Matroska de/muxer - WebM support in Matroska de/muxer
- low overhead Ogg muxing - low overhead Ogg muxing
- MMS-TCP support - MMS-TCP support
......
...@@ -93,6 +93,7 @@ tools/%.o: tools/%.c ...@@ -93,6 +93,7 @@ tools/%.o: tools/%.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $< $(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $<
-include $(wildcard tools/*.d) -include $(wildcard tools/*.d)
-include $(wildcard tests/*.d)
ffplay.o: CFLAGS += $(SDL_CFLAGS) ffplay.o: CFLAGS += $(SDL_CFLAGS)
......
Never assume the API of libav* to be stable unless at least 1 week has passed since Never assume the API of libav* to be stable unless at least 1 week has passed since
the last major version increase. the last major version increase.
The last version increases were: The last version increases were:
libavcodec: ? libavcodec: 2011-04-18
libavdevice: ? libavdevice: 2011-04-18
libavfilter: 2009-10-18 libavfilter: 2011-04-18
libavformat: ? libavformat: 2011-04-18
libpostproc: ? libpostproc: 2011-04-18
libswscale: ? libswscale: 2011-04-18
libavutil: 2009-03-08 libavutil: 2011-04-18
API changes, most recent first: API changes, most recent first:
......
...@@ -195,7 +195,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags) ...@@ -195,7 +195,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
av_strlcpy(s->playlisturl, "http://", sizeof(s->playlisturl)); av_strlcpy(s->playlisturl, "http://", sizeof(s->playlisturl));
av_strlcat(s->playlisturl, nested_url, sizeof(s->playlisturl)); av_strlcat(s->playlisturl, nested_url, sizeof(s->playlisturl));
} else { } else {
av_log(NULL, AV_LOG_ERROR, "Unsupported url %s\n", uri); av_log(h, AV_LOG_ERROR, "Unsupported url %s\n", uri);
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto fail; goto fail;
} }
...@@ -218,7 +218,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags) ...@@ -218,7 +218,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
} }
if (s->n_segments == 0) { if (s->n_segments == 0) {
av_log(NULL, AV_LOG_WARNING, "Empty playlist\n"); av_log(h, AV_LOG_WARNING, "Empty playlist\n");
ret = AVERROR(EIO); ret = AVERROR(EIO);
goto fail; goto fail;
} }
...@@ -258,7 +258,7 @@ retry: ...@@ -258,7 +258,7 @@ retry:
return ret; return ret;
} }
if (s->cur_seq_no < s->start_seq_no) { if (s->cur_seq_no < s->start_seq_no) {
av_log(NULL, AV_LOG_WARNING, av_log(h, AV_LOG_WARNING,
"skipping %d segments ahead, expired from playlist\n", "skipping %d segments ahead, expired from playlist\n",
s->start_seq_no - s->cur_seq_no); s->start_seq_no - s->cur_seq_no);
s->cur_seq_no = s->start_seq_no; s->cur_seq_no = s->start_seq_no;
...@@ -274,12 +274,12 @@ retry: ...@@ -274,12 +274,12 @@ retry:
goto retry; goto retry;
} }
url = s->segments[s->cur_seq_no - s->start_seq_no]->url, url = s->segments[s->cur_seq_no - s->start_seq_no]->url,
av_log(NULL, AV_LOG_DEBUG, "opening %s\n", url); av_log(h, AV_LOG_DEBUG, "opening %s\n", url);
ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ); ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ);
if (ret < 0) { if (ret < 0) {
if (url_interrupt_cb()) if (url_interrupt_cb())
return AVERROR_EXIT; return AVERROR_EXIT;
av_log(NULL, AV_LOG_WARNING, "Unable to open %s\n", url); av_log(h, AV_LOG_WARNING, "Unable to open %s\n", url);
s->cur_seq_no++; s->cur_seq_no++;
goto retry; goto retry;
} }
......
...@@ -1262,27 +1262,6 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int ...@@ -1262,27 +1262,6 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
/* find the position */ /* find the position */
pos = st->index_entries[index].pos; pos = st->index_entries[index].pos;
// various attempts to find key frame have failed so far
// asf_reset_header(s);
// avio_seek(s->pb, pos, SEEK_SET);
// key_pos = pos;
// for(i=0;i<16;i++){
// pos = avio_tell(s->pb);
// if (av_read_frame(s, &pkt) < 0){
// av_log(s, AV_LOG_INFO, "seek failed\n");
// return -1;
// }
// asf_st = s->streams[stream_index]->priv_data;
// pos += st->parser->frame_offset;
//
// if (pkt.size > b) {
// b = pkt.size;
// key_pos = pos;
// }
//
// av_free_packet(&pkt);
// }
/* do the seek */ /* do the seek */
av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos); av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos);
avio_seek(s->pb, pos, SEEK_SET); avio_seek(s->pb, pos, SEEK_SET);
......
...@@ -50,7 +50,7 @@ static int gopher_connect(URLContext *h, const char *path) ...@@ -50,7 +50,7 @@ static int gopher_connect(URLContext *h, const char *path)
if (!path) return AVERROR(EINVAL); if (!path) return AVERROR(EINVAL);
break; break;
default: default:
av_log(NULL, AV_LOG_WARNING, av_log(h, AV_LOG_WARNING,
"Gopher protocol type '%c' not supported yet!\n", "Gopher protocol type '%c' not supported yet!\n",
*path); *path);
return AVERROR(EINVAL); return AVERROR(EINVAL);
......
...@@ -70,7 +70,7 @@ void ff_http_set_headers(URLContext *h, const char *headers) ...@@ -70,7 +70,7 @@ void ff_http_set_headers(URLContext *h, const char *headers)
int len = strlen(headers); int len = strlen(headers);
if (len && strcmp("\r\n", headers + len - 2)) if (len && strcmp("\r\n", headers + len - 2))
av_log(NULL, AV_LOG_ERROR, "No trailing CRLF found in HTTP header.\n"); av_log(h, AV_LOG_ERROR, "No trailing CRLF found in HTTP header.\n");
av_strlcpy(s->headers, headers, sizeof(s->headers)); av_strlcpy(s->headers, headers, sizeof(s->headers));
} }
...@@ -232,7 +232,7 @@ static int process_line(URLContext *h, char *line, int line_count, ...@@ -232,7 +232,7 @@ static int process_line(URLContext *h, char *line, int line_count,
* don't abort until all headers have been parsed. */ * don't abort until all headers have been parsed. */
if (s->http_code >= 400 && s->http_code < 600 && s->http_code != 401) { if (s->http_code >= 400 && s->http_code < 600 && s->http_code != 401) {
end += strspn(end, SPACE_CHARS); end += strspn(end, SPACE_CHARS);
av_log(NULL, AV_LOG_WARNING, "HTTP error %d %s\n", av_log(h, AV_LOG_WARNING, "HTTP error %d %s\n",
s->http_code, end); s->http_code, end);
return -1; return -1;
} }
......
...@@ -64,7 +64,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags) ...@@ -64,7 +64,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
snprintf(portstr, sizeof(portstr), "%d", port); snprintf(portstr, sizeof(portstr), "%d", port);
ret = getaddrinfo(hostname, portstr, &hints, &ai); ret = getaddrinfo(hostname, portstr, &hints, &ai);
if (ret) { if (ret) {
av_log(NULL, AV_LOG_ERROR, av_log(h, AV_LOG_ERROR,
"Failed to resolve hostname %s: %s\n", "Failed to resolve hostname %s: %s\n",
hostname, gai_strerror(ret)); hostname, gai_strerror(ret));
return AVERROR(EIO); return AVERROR(EIO);
...@@ -126,7 +126,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags) ...@@ -126,7 +126,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
optlen = sizeof(ret); optlen = sizeof(ret);
getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen); getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);
if (ret != 0) { if (ret != 0) {
av_log(NULL, AV_LOG_ERROR, av_log(h, AV_LOG_ERROR,
"TCP connection to %s:%d failed: %s\n", "TCP connection to %s:%d failed: %s\n",
hostname, port, strerror(ret)); hostname, port, strerror(ret));
goto fail; goto fail;
......
...@@ -266,7 +266,7 @@ int ff_udp_set_remote_url(URLContext *h, const char *uri) ...@@ -266,7 +266,7 @@ int ff_udp_set_remote_url(URLContext *h, const char *uri)
if (connect(s->udp_fd, (struct sockaddr *) &s->dest_addr, if (connect(s->udp_fd, (struct sockaddr *) &s->dest_addr,
s->dest_addr_len)) { s->dest_addr_len)) {
s->is_connected = 0; s->is_connected = 0;
av_log(NULL, AV_LOG_ERROR, "connect: %s\n", strerror(errno)); av_log(h, AV_LOG_ERROR, "connect: %s\n", strerror(errno));
return AVERROR(EIO); return AVERROR(EIO);
} }
} }
...@@ -410,7 +410,7 @@ static int udp_open(URLContext *h, const char *uri, int flags) ...@@ -410,7 +410,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
/* limit the tx buf size to limit latency */ /* limit the tx buf size to limit latency */
tmp = s->buffer_size; tmp = s->buffer_size;
if (setsockopt(udp_fd, SOL_SOCKET, SO_SNDBUF, &tmp, sizeof(tmp)) < 0) { if (setsockopt(udp_fd, SOL_SOCKET, SO_SNDBUF, &tmp, sizeof(tmp)) < 0) {
av_log(NULL, AV_LOG_ERROR, "setsockopt(SO_SNDBUF): %s\n", strerror(errno)); av_log(h, AV_LOG_ERROR, "setsockopt(SO_SNDBUF): %s\n", strerror(errno));
goto fail; goto fail;
} }
} else { } else {
...@@ -418,14 +418,14 @@ static int udp_open(URLContext *h, const char *uri, int flags) ...@@ -418,14 +418,14 @@ static int udp_open(URLContext *h, const char *uri, int flags)
* avoid losing data on OSes that set this too low by default. */ * avoid losing data on OSes that set this too low by default. */
tmp = s->buffer_size; tmp = s->buffer_size;
if (setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp)) < 0) { if (setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp)) < 0) {
av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_RECVBUF): %s\n", strerror(errno)); av_log(h, AV_LOG_WARNING, "setsockopt(SO_RECVBUF): %s\n", strerror(errno));
} }
/* make the socket non-blocking */ /* make the socket non-blocking */
ff_socket_nonblock(udp_fd, 1); ff_socket_nonblock(udp_fd, 1);
} }
if (s->is_connected) { if (s->is_connected) {
if (connect(udp_fd, (struct sockaddr *) &s->dest_addr, s->dest_addr_len)) { if (connect(udp_fd, (struct sockaddr *) &s->dest_addr, s->dest_addr_len)) {
av_log(NULL, AV_LOG_ERROR, "connect: %s\n", strerror(errno)); av_log(h, AV_LOG_ERROR, "connect: %s\n", strerror(errno));
goto fail; goto fail;
} }
} }
......
...@@ -2586,6 +2586,7 @@ void avformat_free_context(AVFormatContext *s) ...@@ -2586,6 +2586,7 @@ void avformat_free_context(AVFormatContext *s)
av_freep(&s->chapters); av_freep(&s->chapters);
av_metadata_free(&s->metadata); av_metadata_free(&s->metadata);
av_freep(&s->key); av_freep(&s->key);
av_freep(&s->streams);
av_free(s); av_free(s);
} }
......
...@@ -35,7 +35,6 @@ HEADERS = adler32.h \ ...@@ -35,7 +35,6 @@ HEADERS = adler32.h \
rational.h \ rational.h \
samplefmt.h \ samplefmt.h \
sha.h \ sha.h \
sha1.h \
BUILT_HEADERS = avconfig.h BUILT_HEADERS = avconfig.h
......
...@@ -100,7 +100,7 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) ...@@ -100,7 +100,7 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
line[0]=0; line[0]=0;
#undef fprintf #undef fprintf
if(print_prefix && avc) { if(print_prefix && avc) {
if(avc->version >= (50<<16 | 15<<8 | 3) && avc->parent_log_context_offset){ if (avc->parent_log_context_offset) {
AVClass** parent= *(AVClass***)(((uint8_t*)ptr) + avc->parent_log_context_offset); AVClass** parent= *(AVClass***)(((uint8_t*)ptr) + avc->parent_log_context_offset);
if(parent && *parent){ if(parent && *parent){
snprintf(line, sizeof(line), "[%s @ %p] ", (*parent)->item_name(parent), parent); snprintf(line, sizeof(line), "[%s @ %p] ", (*parent)->item_name(parent), parent);
......
...@@ -80,11 +80,3 @@ uint32_t av_get_random_seed(void) ...@@ -80,11 +80,3 @@ uint32_t av_get_random_seed(void)
return seed; return seed;
return get_generic_seed(); return get_generic_seed();
} }
#if LIBAVUTIL_VERSION_MAJOR < 51
attribute_deprecated uint32_t ff_random_get_seed(void);
uint32_t ff_random_get_seed(void)
{
return av_get_random_seed();
}
#endif
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "avutil.h" #include "avutil.h"
#include "bswap.h" #include "bswap.h"
#include "sha.h" #include "sha.h"
#include "sha1.h"
#include "intreadwrite.h" #include "intreadwrite.h"
/** hash context */ /** hash context */
...@@ -324,29 +323,6 @@ void av_sha_final(AVSHA* ctx, uint8_t *digest) ...@@ -324,29 +323,6 @@ void av_sha_final(AVSHA* ctx, uint8_t *digest)
AV_WB32(digest + i*4, ctx->state[i]); AV_WB32(digest + i*4, ctx->state[i]);
} }
#if LIBAVUTIL_VERSION_MAJOR < 51
struct AVSHA1 {
AVSHA sha;
};
const int av_sha1_size = sizeof(struct AVSHA1);
void av_sha1_init(struct AVSHA1* context)
{
av_sha_init(&context->sha, 160);
}
void av_sha1_update(struct AVSHA1* context, const uint8_t* data, unsigned int len)
{
av_sha_update(&context->sha, data, len);
}
void av_sha1_final(struct AVSHA1* context, uint8_t digest[20])
{
av_sha_final(&context->sha, digest);
}
#endif
#ifdef TEST #ifdef TEST
#include <stdio.h> #include <stdio.h>
#undef printf #undef printf
......
/*
* Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_SHA1_H
#define AVUTIL_SHA1_H
#include <stdint.h>
extern const int av_sha1_size;
struct AVSHA1;
/**
* Initialize SHA-1 hashing.
*
* @param context pointer to the function context (of size av_sha_size)
* @deprecated use av_sha_init() instead
*/
void av_sha1_init(struct AVSHA1* context);
/**
* Update hash value.
*
* @param context hash function context
* @param data input data to update hash with
* @param len input data length
* @deprecated use av_sha_update() instead
*/
void av_sha1_update(struct AVSHA1* context, const uint8_t* data, unsigned int len);
/**
* Finish hashing and output digest value.
*
* @param context hash function context
* @param digest buffer where output digest value is stored
* @deprecated use av_sha_final() instead
*/
void av_sha1_final(struct AVSHA1* context, uint8_t digest[20]);
#endif /* AVUTIL_SHA1_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment