Compare commits

..

1 Commits

Author SHA1 Message Date
Michael Niedermayer 3c1ecb057d Bump minor versions after release/4.0 branching
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-16 12:35:12 +02:00
36 changed files with 92 additions and 464 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version 4.0:
version <next>:
- Bitstream filters for editing metadata in H.264, HEVC and MPEG-2 streams
- Dropped support for OpenJPEG versions 2.0 and below. Using OpenJPEG now
requires 2.1 (or later) and pkg-config.
+1 -1
View File
@@ -1 +1 @@
4.0
3.4.git
-15
View File
@@ -1,15 +0,0 @@
┌───────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 4.0 "Wu" │
└───────────────────────────────────┘
The FFmpeg Project proudly presents FFmpeg 4.0 "Wu", about 6
months after the release of FFmpeg 3.4.
A complete Changelog is available at the root of the project, and the
complete Git history on https://git.ffmpeg.org/gitweb/ffmpeg.git
We hope you will like this release as much as we enjoyed working on it, and
as usual, if you have any questions about it, or any FFmpeg related topic,
feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
on the mailing-lists.
Vendored
+2 -4
View File
@@ -2372,7 +2372,6 @@ CMDLINE_SET="
malloc_prefix
nm
optflags
nvcc
nvccflags
pkg_config
pkg_config_flags
@@ -4411,7 +4410,7 @@ probe_cc(){
_flags_filter=msvc_flags
_ld_lib='lib%.a'
_ld_path='-libpath:'
elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
elif $_cc -nologo- 2>&1 | grep -q Microsoft || $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; then
_type=msvc
_ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
_DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
@@ -5829,8 +5828,7 @@ check_header asm/types.h
check_builtin stdatomic stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar"
check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&
check_cpp_condition bcrypt bcrypt.h "defined BCRYPT_RNG_ALGORITHM"
check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt
check_lib ole32 "windows.h" CoTaskMemFree -lole32
check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
+2 -2
View File
@@ -889,7 +889,7 @@ API changes, most recent first:
Add av_opt_get_dict_val/set_dict_val with AV_OPT_TYPE_DICT to support
dictionary types being set as options.
2014-08-13 - afbd4b7e09 - lavf 56.01.0 - avformat.h
2014-08-13 - afbd4b8 - lavf 56.01.0 - avformat.h
Add AVFormatContext.event_flags and AVStream.event_flags for signaling to
the user when events happen in the file/stream.
@@ -906,7 +906,7 @@ API changes, most recent first:
2014-08-08 - 5c3c671 - lavf 55.53.100 - avio.h
Add avio_feof() and deprecate url_feof().
2014-08-07 - bb789016d4 - lsws 2.1.3 - swscale.h
2014-08-07 - bb78903 - lsws 2.1.3 - swscale.h
sws_getContext is not going to be removed in the future.
2014-08-07 - a561662 / ad1ee5f - lavc 55.73.101 / 55.57.3 - avcodec.h
+1 -1
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 4.0
PROJECT_NUMBER =
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
+1 -1
View File
@@ -2521,7 +2521,7 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
#endif
print_int("has_b_frames", par->video_delay);
sar = av_guess_sample_aspect_ratio(fmt_ctx, stream, NULL);
if (sar.num) {
if (sar.den) {
print_q("sample_aspect_ratio", sar, ':');
av_reduce(&dar.num, &dar.den,
par->width * sar.num,
+5 -29
View File
@@ -315,11 +315,14 @@ static int cinepak_decode_strip (CinepakContext *s,
return AVERROR_INVALIDDATA;
}
static int cinepak_predecode_check (CinepakContext *s)
static int cinepak_decode (CinepakContext *s)
{
int num_strips;
const uint8_t *eod = (s->data + s->size);
int i, result, strip_size, frame_flags, num_strips;
int y0 = 0;
int encoded_buf_size;
frame_flags = s->data[0];
num_strips = AV_RB16 (&s->data[8]);
encoded_buf_size = AV_RB24(&s->data[1]);
@@ -350,21 +353,6 @@ static int cinepak_predecode_check (CinepakContext *s)
s->sega_film_skip_bytes = 0;
}
if (s->size < 10 + s->sega_film_skip_bytes + num_strips * 12)
return AVERROR_INVALIDDATA;
return 0;
}
static int cinepak_decode (CinepakContext *s)
{
const uint8_t *eod = (s->data + s->size);
int i, result, strip_size, frame_flags, num_strips;
int y0 = 0;
frame_flags = s->data[0];
num_strips = AV_RB16 (&s->data[8]);
s->data += 10 + s->sega_film_skip_bytes;
num_strips = FFMIN(num_strips, MAX_STRIPS);
@@ -444,7 +432,6 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
const uint8_t *buf = avpkt->data;
int ret = 0, buf_size = avpkt->size;
CinepakContext *s = avctx->priv_data;
int num_strips;
s->data = buf;
s->size = buf_size;
@@ -452,17 +439,6 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
if (s->size < 10)
return AVERROR_INVALIDDATA;
num_strips = AV_RB16 (&s->data[8]);
//Empty frame, do not waste time
if (!num_strips && (!s->palette_video || !av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL)))
return buf_size;
if ((ret = cinepak_predecode_check(s)) < 0) {
av_log(avctx, AV_LOG_ERROR, "cinepak_predecode_check failed\n");
return ret;
}
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return ret;
+1 -1
View File
@@ -41,7 +41,7 @@ static av_cold int dfa_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_PAL8;
if (!avctx->width || !avctx->height || FFMAX(avctx->width, avctx->height) >= (1<<16))
if (!avctx->width || !avctx->height)
return AVERROR_INVALIDDATA;
av_assert0(av_image_check_size(avctx->width, avctx->height, 0, avctx) >= 0);
+4 -19
View File
@@ -158,9 +158,6 @@ static int cin_decode_lzss(const unsigned char *src, int src_size,
}
}
if (dst_end - dst > dst_size - dst_size/10)
return AVERROR_INVALIDDATA;
return 0;
}
@@ -187,10 +184,6 @@ static int cin_decode_rle(const unsigned char *src, int src_size,
}
dst += len;
}
if (dst_end - dst > dst_size - dst_size/10)
return AVERROR_INVALIDDATA;
return 0;
}
@@ -233,35 +226,27 @@ static int cinvideo_decode_frame(AVCodecContext *avctx,
* surface.width = surface.pitch */
switch (bitmap_frame_type) {
case 9:
res = cin_decode_rle(buf, bitmap_frame_size,
cin_decode_rle(buf, bitmap_frame_size,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
if (res < 0)
return res;
break;
case 34:
res = cin_decode_rle(buf, bitmap_frame_size,
cin_decode_rle(buf, bitmap_frame_size,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
if (res < 0)
return res;
cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
break;
case 35:
bitmap_frame_size = cin_decode_huffman(buf, bitmap_frame_size,
cin->bitmap_table[CIN_INT_BMP], cin->bitmap_size);
res = cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size,
cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
if (res < 0)
return res;
break;
case 36:
bitmap_frame_size = cin_decode_huffman(buf, bitmap_frame_size,
cin->bitmap_table[CIN_INT_BMP],
cin->bitmap_size);
res = cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size,
cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
if (res < 0)
return res;
cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
break;
+1 -1
View File
@@ -93,7 +93,7 @@ static const AVClass dump_extradata_class = {
.class_name = "dump_extradata bsf",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
.version = LIBAVUTIL_VERSION_MAJOR,
};
const AVBitStreamFilter ff_dump_extradata_bsf = {
+1 -1
View File
@@ -122,7 +122,7 @@ static const AVClass hapqa_extract_class = {
.class_name = "hapqa_extract_bsf",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
.version = LIBAVUTIL_VERSION_MAJOR,
};
const AVBitStreamFilter ff_hapqa_extract_bsf = {
+2 -2
View File
@@ -156,7 +156,7 @@ static const struct FFJniField jni_amediaformat_mapping[] = {
static const AVClass amediaformat_class = {
.class_name = "amediaformat",
.item_name = av_default_item_name,
.version = LIBAVUTIL_VERSION_INT,
.version = LIBAVCODEC_VERSION_INT,
};
struct FFAMediaFormat {
@@ -268,7 +268,7 @@ static const struct FFJniField jni_amediacodec_mapping[] = {
static const AVClass amediacodec_class = {
.class_name = "amediacodec",
.item_name = av_default_item_name,
.version = LIBAVUTIL_VERSION_INT,
.version = LIBAVCODEC_VERSION_INT,
};
struct FFAMediaCodec {
+2 -2
View File
@@ -385,10 +385,10 @@ static int mediacodec_dec_parse_format(AVCodecContext *avctx, MediaCodecDecConte
AMEDIAFORMAT_GET_INT32(s->width, "width", 1);
AMEDIAFORMAT_GET_INT32(s->height, "height", 1);
AMEDIAFORMAT_GET_INT32(s->stride, "stride", 0);
AMEDIAFORMAT_GET_INT32(s->stride, "stride", 1);
s->stride = s->stride > 0 ? s->stride : s->width;
AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 0);
AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 1);
s->slice_height = s->slice_height > 0 ? s->slice_height : s->height;
if (strstr(s->codec_name, "OMX.Nvidia.")) {
+3 -2
View File
@@ -399,12 +399,13 @@ static void celt_search_for_intensity(OpusPsyContext *s, CeltFrame *f)
{
int i, best_band = CELT_MAX_BANDS - 1;
float dist, best_dist = FLT_MAX;
/* TODO: fix, make some heuristic up here using the lambda value */
float end_band = 0;
if (s->avctx->channels < 2)
return;
/* TODO: fix, make some heuristic up here using the lambda value */
float end_band = 0;
for (i = f->end_band; i >= end_band; i--) {
f->intensity_stereo = i;
bands_dist(s, f, &dist);
+1 -1
View File
@@ -52,7 +52,7 @@ static const int sbc_offset8[4][8] = {
/*
* Calculates the CRC-8 of the first len bits in data
*/
uint8_t ff_sbc_crc8(const AVCRC *ctx, const uint8_t *data, size_t len)
uint8_t sbc_crc8(const AVCRC *ctx, const uint8_t *data, size_t len)
{
size_t byte_length = len >> 3;
int bit_length = len & 7;
+1 -1
View File
@@ -112,7 +112,7 @@ struct sbc_frame {
const AVCRC *crc_ctx;
};
uint8_t ff_sbc_crc8(const AVCRC *crc_ctx, const uint8_t *data, size_t len);
uint8_t sbc_crc8(const AVCRC *crc_ctx, const uint8_t *data, size_t len);
void ff_sbc_calculate_bits(const struct sbc_frame *frame, int (*bits)[8]);
#endif /* AVCODEC_SBC_H */
+1 -1
View File
@@ -147,7 +147,7 @@ static int sbc_unpack_frame(const uint8_t *data, struct sbc_frame *frame,
}
}
if (data[3] != ff_sbc_crc8(frame->crc_ctx, crc_header, crc_pos))
if (data[3] != sbc_crc8(frame->crc_ctx, crc_header, crc_pos))
return -3;
ff_sbc_calculate_bits(frame, bits);
+1 -1
View File
@@ -156,7 +156,7 @@ static size_t sbc_pack_frame(AVPacket *avpkt, struct sbc_frame *frame,
if (crc_pos % 8)
crc_header[crc_pos >> 3] <<= 8 - (crc_pos % 8);
avpkt->data[3] = ff_sbc_crc8(frame->crc_ctx, crc_header, crc_pos);
avpkt->data[3] = sbc_crc8(frame->crc_ctx, crc_header, crc_pos);
ff_sbc_calculate_bits(frame, bits);
+1 -1
View File
@@ -22,7 +22,7 @@
#ifndef AVCODEC_SHEERVIDEODATA_H
#define AVCODEC_SHEERVIDEODATA_H
#include "libavutil/common.h"
#include <libavutil/common.h>
static const uint8_t l_r_rgb[256] = {
3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 8,
+1 -1
View File
@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 18
#define LIBAVCODEC_VERSION_MINOR 19
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
+1 -1
View File
@@ -855,7 +855,7 @@ static const AVClass android_camera_class = {
.class_name = "android_camera indev",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
.version = LIBAVDEVICE_VERSION_INT,
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
+4 -14
View File
@@ -118,7 +118,7 @@ static int iec61883_callback(unsigned char *data, int length,
goto exit;
}
packet->buf = av_malloc(length + AV_INPUT_BUFFER_PADDING_SIZE);
packet->buf = av_malloc(length);
if (!packet->buf) {
av_free(packet);
ret = -1;
@@ -127,7 +127,6 @@ static int iec61883_callback(unsigned char *data, int length,
packet->len = length;
memcpy(packet->buf, data, length);
memset(packet->buf + length, 0, AV_INPUT_BUFFER_PADDING_SIZE);
if (dv->queue_first) {
dv->queue_last->next = packet;
@@ -201,21 +200,13 @@ static int iec61883_parse_queue_dv(struct iec61883_data *dv, AVPacket *pkt)
size = avpriv_dv_produce_packet(dv->dv_demux, pkt,
packet->buf, packet->len, -1);
dv->queue_first = packet->next;
if (size < 0)
av_free(packet->buf);
av_free(packet);
dv->packets--;
if (size < 0)
return -1;
if (size > 0)
return size;
if (av_packet_from_data(pkt, pkt->data, pkt->size) < 0) {
av_freep(&pkt->data);
av_packet_unref(pkt);
return -1;
}
return size;
return -1;
}
static int iec61883_parse_queue_hdv(struct iec61883_data *dv, AVPacket *pkt)
@@ -463,7 +454,6 @@ static int iec61883_close(AVFormatContext *context)
} else {
iec61883_dv_fb_stop(dv->iec61883_dv);
iec61883_dv_fb_close(dv->iec61883_dv);
av_freep(&dv->dv_demux);
}
while (dv->queue_first) {
DVPacket *packet = dv->queue_first;
+1 -1
View File
@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVDEVICE_VERSION_MAJOR 58
#define LIBAVDEVICE_VERSION_MINOR 3
#define LIBAVDEVICE_VERSION_MINOR 4
#define LIBAVDEVICE_VERSION_MICRO 100
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
+1 -1
View File
@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 7
#define LIBAVFILTER_VERSION_MINOR 16
#define LIBAVFILTER_VERSION_MINOR 17
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
+36 -252
View File
@@ -21,13 +21,10 @@
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavcodec/flac.h"
#include "avformat.h"
#include "avio_internal.h"
#include "flacenc.h"
#include "id3v2.h"
#include "internal.h"
#include "vorbiscomment.h"
#include "libavcodec/bytestream.h"
@@ -36,15 +33,8 @@ typedef struct FlacMuxerContext {
const AVClass *class;
int write_header;
int audio_stream_idx;
int waiting_pics;
/* audio packets are queued here until we get all the attached pictures */
AVPacketList *queue, *queue_end;
/* updated streaminfo sent by the encoder at the end */
uint8_t *streaminfo;
unsigned attached_types;
} FlacMuxerContext;
static int flac_write_block_padding(AVIOContext *pb, unsigned int n_padding_bytes,
@@ -84,160 +74,36 @@ static int flac_write_block_comment(AVIOContext *pb, AVDictionary **m,
return 0;
}
static int flac_write_picture(struct AVFormatContext *s, AVPacket *pkt)
static int flac_write_header(struct AVFormatContext *s)
{
FlacMuxerContext *c = s->priv_data;
AVIOContext *pb = s->pb;
const AVPixFmtDescriptor *pixdesc;
const CodecMime *mime = ff_id3v2_mime_tags;
AVDictionaryEntry *e;
const char *mimetype = NULL, *desc = "";
const AVStream *st = s->streams[pkt->stream_index];
int i, mimelen, desclen, type = 0;
int ret;
int padding = s->metadata_header_padding;
AVCodecParameters *par = s->streams[0]->codecpar;
FlacMuxerContext *c = s->priv_data;
if (!pkt->data)
if (!c->write_header)
return 0;
while (mime->id != AV_CODEC_ID_NONE) {
if (mime->id == st->codecpar->codec_id) {
mimetype = mime->str;
break;
}
mime++;
}
if (!mimetype) {
av_log(s, AV_LOG_ERROR, "No mimetype is known for stream %d, cannot "
"write an attached picture.\n", st->index);
if (s->nb_streams > 1) {
av_log(s, AV_LOG_ERROR, "only one stream is supported\n");
return AVERROR(EINVAL);
}
mimelen = strlen(mimetype);
/* get the picture type */
e = av_dict_get(st->metadata, "comment", NULL, 0);
for (i = 0; e && i < FF_ARRAY_ELEMS(ff_id3v2_picture_types); i++) {
if (!av_strcasecmp(e->value, ff_id3v2_picture_types[i])) {
type = i;
break;
}
}
if ((c->attached_types & (1 << type)) & 0x6) {
av_log(s, AV_LOG_ERROR, "Duplicate attachment for type '%s'\n", ff_id3v2_picture_types[type]);
if (par->codec_id != AV_CODEC_ID_FLAC) {
av_log(s, AV_LOG_ERROR, "unsupported codec\n");
return AVERROR(EINVAL);
}
if (type == 1 && (st->codecpar->codec_id != AV_CODEC_ID_PNG ||
st->codecpar->width != 32 ||
st->codecpar->height != 32)) {
av_log(s, AV_LOG_ERROR, "File icon attachment must be a 32x32 PNG");
return AVERROR(EINVAL);
}
c->attached_types |= (1 << type);
/* get the description */
if ((e = av_dict_get(st->metadata, "title", NULL, 0)))
desc = e->value;
desclen = strlen(desc);
avio_w8(pb, 0x06);
avio_wb24(pb, 4 + 4 + mimelen + 4 + desclen + 4 + 4 + 4 + 4 + 4 + pkt->size);
avio_wb32(pb, type);
avio_wb32(pb, mimelen);
avio_write(pb, mimetype, mimelen);
avio_wb32(pb, desclen);
avio_write(pb, desc, desclen);
avio_wb32(pb, st->codecpar->width);
avio_wb32(pb, st->codecpar->height);
if ((pixdesc = av_pix_fmt_desc_get(st->codecpar->format)))
avio_wb32(pb, av_get_bits_per_pixel(pixdesc));
else
avio_wb32(pb, 0);
avio_wb32(pb, 0);
avio_wb32(pb, pkt->size);
avio_write(pb, pkt->data, pkt->size);
return 0;
}
static int flac_finish_header(struct AVFormatContext *s)
{
int i, ret, padding = s->metadata_header_padding;
if (padding < 0)
padding = 8192;
/* The FLAC specification states that 24 bits are used to represent the
* size of a metadata block so we must clip this value to 2^24-1. */
padding = av_clip_uintp2(padding, 24);
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
AVPacket *pkt = st->priv_data;
if (!pkt)
continue;
ret = flac_write_picture(s, pkt);
av_packet_unref(pkt);
if (ret < 0 && (s->error_recognition & AV_EF_EXPLODE))
return ret;
}
ret = flac_write_block_comment(s->pb, &s->metadata, !padding,
s->flags & AVFMT_FLAG_BITEXACT);
ret = ff_flac_write_header(s->pb, par->extradata,
par->extradata_size, 0);
if (ret)
return ret;
/* The command line flac encoder defaults to placing a seekpoint
* every 10s. So one might add padding to allow that later
* but there seems to be no simple way to get the duration here.
* So just add the amount requested by the user. */
if (padding)
flac_write_block_padding(s->pb, padding, 1);
return 0;
}
static int flac_init(struct AVFormatContext *s)
{
AVCodecParameters *par;
FlacMuxerContext *c = s->priv_data;
int i;
c->audio_stream_idx = -1;
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
if (c->audio_stream_idx >= 0 || st->codecpar->codec_id != AV_CODEC_ID_FLAC) {
av_log(s, AV_LOG_ERROR, "Invalid audio stream. Exactly one FLAC "
"audio stream is required.\n");
return AVERROR(EINVAL);
}
par = s->streams[i]->codecpar;
c->audio_stream_idx = i;
} else if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
if (!(st->disposition & AV_DISPOSITION_ATTACHED_PIC)) {
av_log(s, AV_LOG_WARNING, "Video stream #%d is not an attached picture. Ignoring\n", i);
continue;
} else if (st->codecpar->codec_id == AV_CODEC_ID_GIF) {
av_log(s, AV_LOG_ERROR, "GIF image support is not implemented.\n");
return AVERROR_PATCHWELCOME;
} else if (!c->write_header) {
av_log(s, AV_LOG_ERROR, "Can't write attached pictures without a header.\n");
return AVERROR(EINVAL);
}
c->waiting_pics++;
} else {
av_log(s, AV_LOG_ERROR, "Only audio streams and pictures are allowed in FLAC.\n");
return AVERROR(EINVAL);
}
}
if (c->audio_stream_idx < 0) {
av_log(s, AV_LOG_ERROR, "No audio stream present.\n");
return AVERROR(EINVAL);
}
/* add the channel layout tag */
if (par->channel_layout &&
!(par->channel_layout & ~0x3ffffULL) &&
@@ -255,84 +121,28 @@ static int flac_init(struct AVFormatContext *s)
}
}
return 0;
}
static int flac_write_header(struct AVFormatContext *s)
{
FlacMuxerContext *c = s->priv_data;
AVCodecParameters *par = s->streams[c->audio_stream_idx]->codecpar;
int ret;
if (!c->write_header)
return 0;
ret = ff_flac_write_header(s->pb, par->extradata,
par->extradata_size, 0);
if (ret < 0)
ret = flac_write_block_comment(s->pb, &s->metadata, !padding,
s->flags & AVFMT_FLAG_BITEXACT);
if (ret)
return ret;
if (!c->waiting_pics)
ret = flac_finish_header(s);
/* The command line flac encoder defaults to placing a seekpoint
* every 10s. So one might add padding to allow that later
* but there seems to be no simple way to get the duration here.
* So just add the amount requested by the user. */
if (padding)
flac_write_block_padding(s->pb, padding, 1);
return ret;
}
static int flac_write_audio_packet(struct AVFormatContext *s, AVPacket *pkt)
{
FlacMuxerContext *c = s->priv_data;
uint8_t *streaminfo;
int streaminfo_size;
/* check for updated streaminfo */
streaminfo = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
&streaminfo_size);
if (streaminfo && streaminfo_size == FLAC_STREAMINFO_SIZE) {
av_freep(&c->streaminfo);
c->streaminfo = av_malloc(FLAC_STREAMINFO_SIZE);
if (!c->streaminfo)
return AVERROR(ENOMEM);
memcpy(c->streaminfo, streaminfo, FLAC_STREAMINFO_SIZE);
}
if (pkt->size)
avio_write(s->pb, pkt->data, pkt->size);
return 0;
}
static int flac_queue_flush(AVFormatContext *s)
{
FlacMuxerContext *c = s->priv_data;
AVPacket pkt;
int ret, write = 1;
ret = flac_finish_header(s);
if (ret < 0)
write = 0;
while (c->queue) {
ff_packet_list_get(&c->queue, &c->queue_end, &pkt);
if (write && (ret = flac_write_audio_packet(s, &pkt)) < 0)
write = 0;
av_packet_unref(&pkt);
}
return ret;
}
static int flac_write_trailer(struct AVFormatContext *s)
{
AVIOContext *pb = s->pb;
int64_t file_size;
FlacMuxerContext *c = s->priv_data;
uint8_t *streaminfo = c->streaminfo ? c->streaminfo :
s->streams[c->audio_stream_idx]->codecpar->extradata;
if (c->waiting_pics) {
av_log(s, AV_LOG_WARNING, "No packets were sent for some of the "
"attached pictures.\n");
flac_queue_flush(s);
}
s->streams[0]->codecpar->extradata;
if (!c->write_header || !streaminfo)
return 0;
@@ -356,48 +166,23 @@ static int flac_write_trailer(struct AVFormatContext *s)
static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
FlacMuxerContext *c = s->priv_data;
int ret;
uint8_t *streaminfo;
int streaminfo_size;
if (pkt->stream_index == c->audio_stream_idx) {
if (c->waiting_pics) {
/* buffer audio packets until we get all the pictures */
ret = ff_packet_list_put(&c->queue, &c->queue_end, pkt, FF_PACKETLIST_FLAG_REF_PACKET);
if (ret < 0) {
av_log(s, AV_LOG_ERROR, "Out of memory in packet queue; skipping attached pictures\n");
c->waiting_pics = 0;
ret = flac_queue_flush(s);
if (ret < 0)
return ret;
return flac_write_audio_packet(s, pkt);
}
} else
return flac_write_audio_packet(s, pkt);
} else {
AVStream *st = s->streams[pkt->stream_index];
/* check for updated streaminfo */
streaminfo = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
&streaminfo_size);
if (streaminfo && streaminfo_size == FLAC_STREAMINFO_SIZE) {
av_freep(&c->streaminfo);
if (!c->waiting_pics ||
!(st->disposition & AV_DISPOSITION_ATTACHED_PIC))
return 0;
/* warn only once for each stream */
if (st->nb_frames == 1) {
av_log(s, AV_LOG_WARNING, "Got more than one picture in stream %d,"
" ignoring.\n", pkt->stream_index);
}
if (st->nb_frames >= 1)
return 0;
st->priv_data = av_packet_clone(pkt);
if (!st->priv_data)
av_log(s, AV_LOG_ERROR, "Out of memory queueing an attached picture; skipping\n");
c->waiting_pics--;
/* flush the buffered audio packets */
if (!c->waiting_pics &&
(ret = flac_queue_flush(s)) < 0)
return ret;
c->streaminfo = av_malloc(FLAC_STREAMINFO_SIZE);
if (!c->streaminfo)
return AVERROR(ENOMEM);
memcpy(c->streaminfo, streaminfo, FLAC_STREAMINFO_SIZE);
}
if (pkt->size)
avio_write(s->pb, pkt->data, pkt->size);
return 0;
}
@@ -420,8 +205,7 @@ AVOutputFormat ff_flac_muxer = {
.mime_type = "audio/x-flac",
.extensions = "flac",
.audio_codec = AV_CODEC_ID_FLAC,
.video_codec = AV_CODEC_ID_PNG,
.init = flac_init,
.video_codec = AV_CODEC_ID_NONE,
.write_header = flac_write_header,
.write_packet = flac_write_packet,
.write_trailer = flac_write_trailer,
-4
View File
@@ -576,11 +576,7 @@ static int http_accept(URLContext *s, URLContext **c)
goto fail;
cc->hd = cl;
cc->is_multi_client = 1;
return 0;
fail:
if (c) {
ffurl_closep(c);
}
return ret;
}
+5 -87
View File
@@ -142,9 +142,7 @@ static int co64_required(const MOVTrack *track)
static int rtp_hinting_needed(const AVStream *st)
{
/* Add hint tracks for each real audio and video stream */
if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
return 0;
/* Add hint tracks for each audio and video stream */
return st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ||
st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO;
}
@@ -3422,51 +3420,6 @@ static int mov_write_int8_metadata(AVFormatContext *s, AVIOContext *pb,
return size;
}
static int mov_write_covr(AVIOContext *pb, AVFormatContext *s)
{
MOVMuxContext *mov = s->priv_data;
int64_t pos = 0;
int i, type;
for (i = 0; i < s->nb_streams; i++) {
MOVTrack *trk = &mov->tracks[i];
AVStream *st = s->streams[i];
if (!(st->disposition & AV_DISPOSITION_ATTACHED_PIC) ||
trk->cover_image.size <= 0)
continue;
switch (st->codecpar->codec_id) {
case AV_CODEC_ID_MJPEG:
type = 0xD;
break;
case AV_CODEC_ID_PNG:
type = 0xE;
break;
case AV_CODEC_ID_BMP:
type = 0x1B;
break;
default:
av_log(s, AV_LOG_ERROR, "unsupported codec_id (0x%x) for cover",
st->codecpar->codec_id);
continue;
}
if (!pos) {
pos = avio_tell(pb);
avio_wb32(pb, 0);
ffio_wfourcc(pb, "covr");
}
avio_wb32(pb, 16 + trk->cover_image.size);
ffio_wfourcc(pb, "data");
avio_wb32(pb, type);
avio_wb32(pb , 0);
avio_write(pb, trk->cover_image.data, trk->cover_image.size);
}
return pos ? update_size(pb, pos) : 0;
}
/* iTunes meta data list */
static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
AVFormatContext *s)
@@ -3501,7 +3454,6 @@ static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
mov_write_int8_metadata (s, pb, "hdvd", "hd_video", 1);
mov_write_int8_metadata (s, pb, "pgap", "gapless_playback",1);
mov_write_int8_metadata (s, pb, "cpil", "compilation", 1);
mov_write_covr(pb, s);
mov_write_trkn_tag(pb, mov, s, 0); // track number
mov_write_trkn_tag(pb, mov, s, 1); // disc number
mov_write_tmpo_tag(pb, s);
@@ -3999,8 +3951,6 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
} else {
continue;
}
if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
continue;
props = (AVCPBProperties*)av_stream_get_side_data(track->st, AV_PKT_DATA_CPB_PROPERTIES, NULL);
@@ -4614,8 +4564,6 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
continue;
if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
has_video = 1;
if (st->codecpar->codec_id == AV_CODEC_ID_H264)
@@ -4764,8 +4712,6 @@ static int mov_write_identification(AVIOContext *pb, AVFormatContext *s)
int video_streams_nb = 0, audio_streams_nb = 0, other_streams_nb = 0;
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
continue;
if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
video_streams_nb++;
else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
@@ -4955,8 +4901,7 @@ static int mov_flush_fragment(AVFormatContext *s, int force)
int buf_size, moov_size;
for (i = 0; i < mov->nb_streams; i++)
if (!mov->tracks[i].entry &&
(i >= s->nb_streams || !(s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC)))
if (!mov->tracks[i].entry)
break;
/* Don't write the initial moov unless all tracks have data */
if (i < mov->nb_streams && !force)
@@ -5535,34 +5480,13 @@ static int mov_write_subtitle_end_packet(AVFormatContext *s,
static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
{
MOVMuxContext *mov = s->priv_data;
MOVTrack *trk;
AVStream *st;
if (!pkt) {
mov_flush_fragment(s, 1);
return 1;
}
st = s->streams[pkt->stream_index];
trk = &mov->tracks[pkt->stream_index];
if (st->disposition & AV_DISPOSITION_ATTACHED_PIC) {
int ret;
if (st->nb_frames >= 1) {
if (st->nb_frames == 1)
av_log(s, AV_LOG_WARNING, "Got more than one picture in stream %d,"
" ignoring.\n", pkt->stream_index);
return 0;
}
if ((ret = av_packet_ref(&trk->cover_image, pkt)) < 0)
return ret;
return 0;
} else {
int i;
MOVMuxContext *mov = s->priv_data;
MOVTrack *trk = &mov->tracks[pkt->stream_index];
if (!pkt->size)
return mov_write_single_packet(s, pkt); /* Passthrough. */
@@ -5809,8 +5733,7 @@ static void enable_tracks(AVFormatContext *s)
AVStream *st = s->streams[i];
if (st->codecpar->codec_type <= AVMEDIA_TYPE_UNKNOWN ||
st->codecpar->codec_type >= AVMEDIA_TYPE_NB ||
st->disposition & AV_DISPOSITION_ATTACHED_PIC)
st->codecpar->codec_type >= AVMEDIA_TYPE_NB)
continue;
if (first[st->codecpar->codec_type] < 0)
@@ -5853,7 +5776,6 @@ static void mov_free(AVFormatContext *s)
av_freep(&mov->tracks[i].par);
av_freep(&mov->tracks[i].cluster);
av_freep(&mov->tracks[i].frag_info);
av_packet_unref(&mov->tracks[i].cover_image);
if (mov->tracks[i].vos_len)
av_freep(&mov->tracks[i].vos_data);
@@ -6159,10 +6081,6 @@ static int mov_init(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "VP9 only supported in MP4.\n");
return AVERROR(EINVAL);
}
} else if (track->par->codec_id == AV_CODEC_ID_AV1) {
/* spec is not finished, so forbid for now */
av_log(s, AV_LOG_ERROR, "AV1 muxing is currently not supported.\n");
return AVERROR_PATCHWELCOME;
} else if (track->par->codec_id == AV_CODEC_ID_VP8) {
/* altref frames handling is not defined in the spec as of version v1.0,
* so just forbid muxing VP8 streams altogether until a new version does */
-1
View File
@@ -132,7 +132,6 @@ typedef struct MOVTrack {
uint32_t default_size;
HintSampleQueue sample_queue;
AVPacket cover_image;
AVIOContext *mdat_buf;
int64_t data_offset;
+4 -6
View File
@@ -413,13 +413,11 @@ static int tls_read(URLContext *h, uint8_t *buf, int len)
ret = ffurl_read(s->tcp, c->enc_buf + c->enc_buf_offset,
c->enc_buf_size - c->enc_buf_offset);
if (ret == AVERROR_EOF) {
c->connection_closed = 1;
ret = 0;
} else if (ret < 0) {
if (ret < 0) {
av_log(h, AV_LOG_ERROR, "Unable to read from socket\n");
return ret;
}
} else if (ret == 0)
c->connection_closed = 1;
c->enc_buf_offset += ret;
}
@@ -517,7 +515,7 @@ cleanup:
if (ret == 0 && !c->connection_closed)
ret = AVERROR(EAGAIN);
return ret < 0 ? ret : AVERROR_EOF;
return ret < 0 ? ret : 0;
}
static int tls_write(URLContext *h, const uint8_t *buf, int len)
+1 -1
View File
@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MINOR 12
#define LIBAVFORMAT_VERSION_MINOR 13
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
+1 -1
View File
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 56
#define LIBAVUTIL_VERSION_MINOR 14
#define LIBAVUTIL_VERSION_MINOR 15
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
+1 -1
View File
@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBPOSTPROC_VERSION_MAJOR 55
#define LIBPOSTPROC_VERSION_MINOR 1
#define LIBPOSTPROC_VERSION_MINOR 2
#define LIBPOSTPROC_VERSION_MICRO 100
#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
+2 -4
View File
@@ -22,7 +22,6 @@
#include "libavutil/arm/asm.S"
function swri_oldapi_conv_flt_to_s16_neon, export=1
_swri_oldapi_conv_flt_to_s16_neon:
subs r2, r2, #8
vld1.32 {q0}, [r1,:128]!
vcvt.s32.f32 q8, q0, #31
@@ -67,7 +66,6 @@ _swri_oldapi_conv_flt_to_s16_neon:
endfunc
function swri_oldapi_conv_fltp_to_s16_2ch_neon, export=1
_swri_oldapi_conv_fltp_to_s16_2ch_neon:
ldm r1, {r1, r3}
subs r2, r2, #8
vld1.32 {q0}, [r1,:128]!
@@ -135,8 +133,8 @@ function swri_oldapi_conv_fltp_to_s16_nch_neon, export=1
cmp r3, #2
itt lt
ldrlt r1, [r1]
blt _swri_oldapi_conv_flt_to_s16_neon
beq _swri_oldapi_conv_fltp_to_s16_2ch_neon
blt X(swri_oldapi_conv_flt_to_s16_neon)
beq X(swri_oldapi_conv_fltp_to_s16_2ch_neon)
push {r4-r8, lr}
cmp r3, #4
+1 -1
View File
@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBSWRESAMPLE_VERSION_MAJOR 3
#define LIBSWRESAMPLE_VERSION_MINOR 1
#define LIBSWRESAMPLE_VERSION_MINOR 2
#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
+1 -1
View File
@@ -27,7 +27,7 @@
#include "libavutil/version.h"
#define LIBSWSCALE_VERSION_MAJOR 5
#define LIBSWSCALE_VERSION_MINOR 1
#define LIBSWSCALE_VERSION_MINOR 2
#define LIBSWSCALE_VERSION_MICRO 100
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \