Compare commits

...

36 Commits

Author SHA1 Message Date
Timothy Gu
327033d913 jni: Return ENOSYS on unsupported platforms 2016-08-02 22:33:03 -07:00
Carl Eugen Hoyos
9a345b235f lavu/hwcontext_vaapi: Fix compilation if VA_FOURCC_ABGR is not defined.
Fixes ticket #5484.
(cherry picked from commit 5aede051202150a1904c0f07a5c7901f402395a5)
2016-08-02 23:25:07 +02:00
Michael Niedermayer
8f6a95a103 avcodec/vp9_parser: Check the input frame sizes for being consistent
Suggested-by: BBB
Fixed-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 77b0f3f26d33d4f46f274896e0583ad1f5936b7c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 17:29:14 +02:00
Xinzheng Zhang
b4922daead avformat/flvdec: parse keyframe before a\v stream was created add_keyframes_index() when stream created or keyframe parsed
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ad14aab3b4f88cdb6c2a3f8877c578e5a8042f1d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 17:29:14 +02:00
Xinzheng Zhang
88e3e6b943 avformat/flvdec: splitting add_keyframes_index() out from parse_keyframes_index()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cd141e71bd3441ac9b7b720b934b7d4d85a75355)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 17:29:14 +02:00
Kacper Michajłow
87d5146fb7 libavformat/rtpdec_asf: zero initialize the AVIOContext struct
This fixes crash in avformat_open_input() when accessing
protocol_whitelist field.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e947b75b1c76ef6793209c2c445b8c224a28717a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 17:29:14 +02:00
Kacper Michajłow
caf32880fd libavutil/opt: Small bugfix in example.
Fix const corectness and zero init the struct. This example code would actually crash when initializing string.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 69630f4d304a4e35d90957d6a170744af87cbf93)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 17:29:14 +02:00
Sasi Inguva
7c01fa962e libx264: Increase x264 opts character limit to 4096
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 282477bf4534439ecb06f14d46446a4f1ab82284)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 17:29:14 +02:00
Michael Niedermayer
e4eab67a0a avcodec/h264_parser: Set sps/pps_ref
Fixes use of freed memory
Should fix valgrind failures of fate-h264-skip-nointra

Found-by: logan
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit febc862b53c090e530b943ebd873747addf5f913)

Conflicts:

	libavcodec/h264_parser.c
2016-08-01 17:29:14 +02:00
Luca Barbato
86f9228740 librtmp: Avoid an infiniloop setting connection arguments
The exit condition was missing.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
(cherry picked from commit e85d38c20a8893cb59d7c86f74481f2497882196)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2016-07-26 12:07:40 -07:00
James Almer
7cab4142c5 avformat/oggparsevp8: fix pts calculation on pages ending with an invisible frame
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 5adfbd391847fcdaea1e9b105fae2dd90af2a733)
2016-07-25 10:01:11 -03:00
Carl Eugen Hoyos
2e1be22715 lavc/Makefile: Fix standalone compilation of the svq3 decoder.
Regression since 0bf5fd2e
(cherry picked from commit 71167f7f8434341b3f76da68a10923b6525e2e87)
2016-07-24 23:56:39 +02:00
Clément Bœsch
7da59005be lavf/vplayerdec: Improve auto-detection.
Fixes the incorrect detection of 16_selma_OneFrame_QP39.yuv (gray16le
rawvideo) as vplayer format.
(cherry picked from commit 77726d32a872ad500434fd8799b289cf56215047)
2016-07-15 10:36:59 +02:00
Matthieu Bouron
1410732621 lavc/mediacodecdec_h264: properly convert extradata to annex-b
H264ParamSets has its SPS/PPS stored raw (SODB) and needs to be
converted to NAL units before sending them to MediaCodec.

This patch adds the missing convertion of the SPS/PPS from SOBP to RBSP
which makes the resulting NAL units correct.

Fixes codec initialization on Nexus 4 and Nexus 7.

(cherry picked from commit 88d9c30cf57ec7328f16a241f10c84415e9aef4e)
2016-07-11 15:32:30 +02:00
James Almer
f9a150fc31 Revert "configure: Enable GCC vectorization on ≥4.9 on x86"
This reverts commit cb8646af24bd8e9627cc5e1c62b049a00fe0b07b.

This change has brough more issues than benefits, between compilation
time failures depending on flags used and code miscompilation causing
runtime crashes.

See the "[PATCH 2/2] configure: Enable GCC vectorization on ≥4.9"
thread in the ffmpeg-devel mailing list for the relevant discussion.

(cherry picked from commit fd6dbc53855fbfc9a782095d0ffe11dd3a98905f)
2016-07-09 17:38:48 -03:00
Michael Niedermayer
ce36e74e75 doc/APIchanges: fill in missing git hash
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2a8dadb38f6b458ffe3ac2037bace7c3892cb282)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-01 02:43:01 +02:00
Michael Niedermayer
fc25481d17 Update for 3.1.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-01 02:13:51 +02:00
Michael Niedermayer
5c695ce903 doc/APIchanges: document the lavu/lavf field moves
Based-on: patch by James Almer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 86fec7a7e861f0ad3c95cb27271267ec143ff754)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-01 02:12:28 +02:00
Michael Niedermayer
f617b94c23 avformat/avformat: Move new field to the end of AVStream
This fixes part of Ticket5676
This fixes kodi, mpv, chromium and ffplay build against 3.0 and linked to 3.1

This is a similar ABI fix to 1eb43af1a0e542ad83dcbf327197785d815fc42d

Approved-by: BBB
Approved-by: jamrial
Approved-by: BtbN
Approved-by: nevcairiel
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1c7e0abb0c513a5f35b29126175b99fc9ca0254)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-30 17:58:11 +02:00
Hendrik Leppkes
79af094b93 avformat/utils: update deprecated AVStream->codec when the context is updated
This ensures the AVStream->codec entry is kept in sync when new streams are
discovered mid-playback or changes to the context occur from other sources.

Fixes trac 5678.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c2e13d2ecd388bab28e743c34ed146c5ed213fc9)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-30 17:58:11 +02:00
Michael Niedermayer
7747300289 avutil/frame: Move new field to the end of AVFrame
This fixes part of Ticket5676
This fixes kodi, mpv, chromium and ffplay build against 3.0 and linked to 3.1

This is a similar ABI fix to 1eb43af1a0e542ad83dcbf327197785d815fc42d

Approved-by: BBB
Approved-by: jamrial
Approved-by: BtbN
Approved-by: nevcairiel
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 042fb69deb5303d147b21ab1061387fb6e0c7afc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-30 17:58:10 +02:00
Martin Vignali
37c83b5373 libavcodec/exr : fix decoding piz float file.
fix ticket #5674

the size of data to process in piz_uncompress, is now calc
using the pixel type of each channel.

the data reorganization, alos take care about the size of
each channel

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d9e1e08133234dc4501413f0e3211f3a268049bc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-30 17:57:59 +02:00
Michael Niedermayer
3e730278f5 avformat/mov: Check sample size
Fixes integer overflow
Fixes: poc.mp4

Found-by: ajax secure <ajax4sec@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8a3221cc67a516dfc1700bdae3566ec52c7ee823)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-29 20:00:49 +02:00
Timo Rothenpieler
1fdf549462 lavfi: Move new field to the end of AVFilterContext
This fixes an accidental ABI break introduced at 8688d3a.
2016-06-29 18:24:06 +02:00
Timo Rothenpieler
0a6d760230 lavfi: Move new field to the end of AVFilterLink
Even though this is not part of the public API, some external
applications access fields after it, thus breaking after updating from
ffmpeg 3.0 or earlier.
Since it is not public, it can be freely moved to the end to avoid
that problem in the future.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-29 12:59:21 +02:00
Timo Rothenpieler
cd427a9d07 ffplay: Fix usage of private lavfi API
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-29 12:59:19 +02:00
Matthieu Bouron
8fd5669077 lavc/mediacodecdec_h264: add missing NAL headers to SPS/PPS buffers
Fixes a regression introduced by 0cd5e281df3f69c1ed8f2a72a5bcbf9691e1b5d5.

(cherry picked from commit db0af7250a276700a349766c5412eb48ec630f0a)
2016-06-29 11:00:42 +02:00
Clément Bœsch
25f0ea9ece lavc/pnm_parser: disable parsing for text based PNMs
P1, P2, and P3 are respectively the text versions of PBM, PGM and PPM
files.

We can not obtain the buffer size using av_imgage_get_buffer_size() as
every pixel in the picture will occupy a random size between 16 and 32
bits ("4 " and "231 " are such example).

Ideally, we could look for the next header (or EOF) in the bytestream,
but this commit is meant to fix a decoding regression introduced by
48ac4532d437790e56b8ed5d0d467dc88685f035.

Fix Ticket #5670

(cherry picked from commit c5566f0a944e376b39c8f994659060ca036c441d)
2016-06-29 11:00:34 +02:00
Rick Kern
36fcb8cc55 Changelog: Add VideoToolbox encoder entry for 3.1
Signed-off-by: Rick Kern <kernrj@gmail.com>
(cherry picked from commit d9561718135a6eba8c781fa248679d9280030a0c)
2016-06-27 11:45:11 -04:00
Rick Kern
18ce5a4d1b configure: use c++98 for c++ files
Use c++98 standard instead of c++11.

Signed-off-by: Rick Kern <kernrj@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 729d82abae2f9bae3e5152022d2df0bb5bcde98e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-26 23:27:22 +02:00
James Almer
cf09348b9e changelog: fix entry order
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit c6f2d1a21f80ec4f2184c23fe399c2a222d34e24)
2016-06-26 15:28:16 -03:00
James Almer
970f2ad966 Update FFmpeg 3.1 cut marker
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 069fd69662a13eb6a2b3d0497232b841e8f1caf8)
2016-06-26 15:17:48 -03:00
James Almer
104c357b6a Merge branch 'master' into release/3.1
Merged-by: James Almer <jamrial@gmail.com>
2016-06-26 15:14:17 -03:00
Michael Niedermayer
b2a74dd629 Set version to 3.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-26 11:35:22 +02:00
Michael Niedermayer
182cfe4832 release notes (based on release/3.0)
Better release notes are welcome
write better ones or do not complain later!

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-26 03:57:55 +02:00
Michael Niedermayer
e5d434b840 tests/checkasm/checkasm: Disable checkasm_check_pixblockdsp for ppc64be
See: Ticket5508

Suggested-by: Carl
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-26 03:56:11 +02:00
31 changed files with 324 additions and 96 deletions

View File

@ -2,7 +2,20 @@ Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version <next>:
- YUY2 Lossless Codec decoder
version 3.1.1:
- doc/APIchanges: document the lavu/lavf field moves
- avformat/avformat: Move new field to the end of AVStream
- avformat/utils: update deprecated AVStream->codec when the context is updated
- avutil/frame: Move new field to the end of AVFrame
- libavcodec/exr : fix decoding piz float file.
- avformat/mov: Check sample size
- lavfi: Move new field to the end of AVFilterContext
- lavfi: Move new field to the end of AVFilterLink
- ffplay: Fix usage of private lavfi API
- lavc/mediacodecdec_h264: add missing NAL headers to SPS/PPS buffers
- lavc/pnm_parser: disable parsing for text based PNMs
version 3.1:
@ -48,6 +61,8 @@ version 3.1:
- CUDA CUVID H264/HEVC decoder
- 10-bit depth support in native utvideo decoder
- libutvideo wrapper removed
- YUY2 Lossless Codec decoder
- VideoToolbox H.264 encoder
version 3.0:

View File

@ -1 +1 @@
3.0.git
3.1.1

15
RELEASE_NOTES Normal file
View File

@ -0,0 +1,15 @@
┌────────────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 3.1 "Laplace" │
└────────────────────────────────────────┘
The FFmpeg Project proudly presents FFmpeg 3.1 "Laplace", about 4
months after the release of FFmpeg 3.0.
A complete Changelog is available at the root of the project, and the
complete Git history on http://source.ffmpeg.org.
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.

8
configure vendored
View File

@ -4529,7 +4529,7 @@ fi
add_cppflags -D_ISOC99_SOURCE
add_cxxflags -D__STDC_CONSTANT_MACROS
add_cxxflags -std=c++11
add_cxxflags -std=c++98
check_cflags -std=c99
check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
#include <stdlib.h>
@ -6125,11 +6125,7 @@ elif enabled ccc; then
add_cflags -msg_disable nonstandcast
add_cflags -msg_disable unsupieee
elif enabled gcc; then
case $gcc_basever in
4.9*) enabled x86 || check_optflags -fno-tree-vectorize ;;
4.*) check_optflags -fno-tree-vectorize ;;
*) enabled x86 || check_optflags -fno-tree-vectorize ;;
esac
check_optflags -fno-tree-vectorize
check_cflags -Werror=format-security
check_cflags -Werror=implicit-function-declaration
check_cflags -Werror=missing-prototypes

View File

@ -15,14 +15,30 @@ libavutil: 2015-08-28
API changes, most recent first:
2016-06-26 - xxxxxxx / 1c9e861 - lavu 55.27.100 / 55.13.0 - hwcontext.h
Add av_hwdevice_ctx_create().
2016-06-30 - c1c7e0ab - lavf 57.41.100 - avformat.h
Moved codecpar field from AVStream to the end of the struct, so that
the following private fields are in the same location as in FFmpeg 3.0 (lavf 57.25.100).
2016-06-26 - xxxxxxx / e47b8bb - lavc 57.48.101 / 57.19.1 - avcodec.h
Adjust values for JPEG 2000 profiles.
2016-06-30 - 042fb69d - lavu 55.28.100 - frame.h
Moved hw_frames_ctx field from AVFrame to the end of the struct, so that
the following private fields are in the same location as in FFmpeg 3.0 (lavu 55.17.103).
2016-06-29 - 1a751455 - lavfi 6.47.100 - avfilter.h
Fix accidental ABI breakage in AVFilterContext.
ABI was broken in 8688d3a, lavfi 6.42.100 and released as ffmpeg 3.1.
Because of this, ffmpeg and ffplay built against lavfi>=6.42.100 will not be
compatible with lavfi>=6.47.100. Potentially also affects other users of
libavfilter if they are using one of the affected fields.
-------- 8< --------- FFmpeg 3.1 was cut here -------- 8< ---------
2016-06-26 - 481f320 / 1c9e861 - lavu 55.27.100 / 55.13.0 - hwcontext.h
Add av_hwdevice_ctx_create().
2016-06-26 - b95534b / e47b8bb - lavc 57.48.101 / 57.19.1 - avcodec.h
Adjust values for JPEG 2000 profiles.
2016-06-23 - 5d75e46 / db7968b - lavf 57.40.100 / 57.7.0 - avio.h
Add AVIODataMarkerType, write_data_type, ignore_boundary_point and
avio_write_marker.

View File

@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 3.1.1
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55

View File

@ -2725,7 +2725,7 @@ static int stream_component_open(VideoState *is, int stream_index)
goto fail;
link = is->out_audio_filter->inputs[0];
sample_rate = link->sample_rate;
nb_channels = link->channels;
nb_channels = avfilter_link_get_channels(link);
channel_layout = link->channel_layout;
}
#else

View File

@ -528,7 +528,8 @@ OBJS-$(CONFIG_SUNRAST_ENCODER) += sunrastenc.o
OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o svq13.o h263data.o
OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o h263data.o \
h263.o ituh263enc.o
OBJS-$(CONFIG_SVQ3_DECODER) += svq3.o svq13.o mpegutils.o h264_parse.o h264data.o
OBJS-$(CONFIG_SVQ3_DECODER) += svq3.o svq13.o mpegutils.o \
h264_parse.o h264data.o h264_ps.o h2645_parse.o
OBJS-$(CONFIG_TEXT_DECODER) += textdec.o ass.o
OBJS-$(CONFIG_TEXT_ENCODER) += srtenc.o ass_split.o
OBJS-$(CONFIG_TAK_DECODER) += takdec.o tak.o takdsp.o

View File

@ -749,6 +749,9 @@ static int piz_uncompress(EXRContext *s, const uint8_t *src, int ssize,
uint16_t *tmp = (uint16_t *)td->tmp;
uint8_t *out;
int ret, i, j;
int pixel_half_size;/* 1 for half, 2 for float and uint32 */
EXRChannel *channel;
int tmp_offset;
if (!td->bitmap)
td->bitmap = av_malloc(BITMAP_SIZE);
@ -781,24 +784,38 @@ static int piz_uncompress(EXRContext *s, const uint8_t *src, int ssize,
ptr = tmp;
for (i = 0; i < s->nb_channels; i++) {
EXRChannel *channel = &s->channels[i];
int size = channel->pixel_type;
channel = &s->channels[i];
for (j = 0; j < size; j++)
wav_decode(ptr + j, td->xsize, size, td->ysize,
td->xsize * size, maxval);
ptr += td->xsize * td->ysize * size;
if (channel->pixel_type == EXR_HALF)
pixel_half_size = 1;
else
pixel_half_size = 2;
for (j = 0; j < pixel_half_size; j++)
wav_decode(ptr + j, td->xsize, pixel_half_size, td->ysize,
td->xsize * pixel_half_size, maxval);
ptr += td->xsize * td->ysize * pixel_half_size;
}
apply_lut(td->lut, tmp, dsize / sizeof(uint16_t));
out = td->uncompressed_data;
for (i = 0; i < td->ysize; i++)
for (i = 0; i < td->ysize; i++) {
tmp_offset = 0;
for (j = 0; j < s->nb_channels; j++) {
uint16_t *in = tmp + j * td->xsize * td->ysize + i * td->xsize;
memcpy(out, in, td->xsize * 2);
out += td->xsize * 2;
uint16_t *in;
EXRChannel *channel = &s->channels[j];
if (channel->pixel_type == EXR_HALF)
pixel_half_size = 1;
else
pixel_half_size = 2;
in = tmp + tmp_offset * td->xsize * td->ysize + i * td->xsize * pixel_half_size;
tmp_offset += pixel_half_size;
memcpy(out, in, td->xsize * 2 * pixel_half_size);
out += td->xsize * 2 * pixel_half_size;
}
}
return 0;
}

View File

@ -367,13 +367,26 @@ static inline int parse_nal_units(AVCodecParserContext *s,
"non-existing PPS %u referenced\n", pps_id);
goto fail;
}
p->ps.pps = (const PPS*)p->ps.pps_list[pps_id]->data;
av_buffer_unref(&p->ps.pps_ref);
av_buffer_unref(&p->ps.sps_ref);
p->ps.pps = NULL;
p->ps.sps = NULL;
p->ps.pps_ref = av_buffer_ref(p->ps.pps_list[pps_id]);
if (!p->ps.pps_ref)
goto fail;
p->ps.pps = (const PPS*)p->ps.pps_ref->data;
if (!p->ps.sps_list[p->ps.pps->sps_id]) {
av_log(avctx, AV_LOG_ERROR,
"non-existing SPS %u referenced\n", p->ps.pps->sps_id);
goto fail;
}
p->ps.sps = (SPS*)p->ps.sps_list[p->ps.pps->sps_id]->data;
p->ps.sps_ref = av_buffer_ref(p->ps.sps_list[p->ps.pps->sps_id]);
if (!p->ps.sps_ref)
goto fail;
p->ps.sps = (SPS*)p->ps.sps_ref->data;
sps = p->ps.sps;

View File

@ -20,19 +20,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include <stdlib.h>
#include "config.h"
#include "libavutil/error.h"
#include "jni.h"
#if CONFIG_JNI
#include <errno.h>
#include <jni.h>
#include <pthread.h>
#include "libavutil/log.h"
#include "libavutil/error.h"
#include "ffjni.h"
void *java_vm;
@ -69,7 +68,7 @@ void *av_jni_get_java_vm(void *log_ctx)
int av_jni_set_java_vm(void *vm, void *log_ctx)
{
return 0;
return AVERROR(ENOSYS);
}
void *av_jni_get_java_vm(void *log_ctx)

View File

@ -777,8 +777,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
if(x4->x264opts){
const char *p= x4->x264opts;
while(p){
char param[256]={0}, val[256]={0};
if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
char param[4096]={0}, val[4096]={0};
if(sscanf(p, "%4095[^:=]=%4095[^:]", param, val) == 1){
OPT_STR(param, "1");
}else
OPT_STR(param, val);

View File

@ -65,6 +65,58 @@ static av_cold int mediacodec_decode_close(AVCodecContext *avctx)
return 0;
}
static int h264_ps_to_nalu(const uint8_t *src, int src_size, uint8_t **out, int *out_size)
{
int i;
int ret = 0;
uint8_t *p = NULL;
static const uint8_t nalu_header[] = { 0x00, 0x00, 0x00, 0x01 };
if (!out || !out_size) {
return AVERROR(EINVAL);
}
p = av_malloc(sizeof(nalu_header) + src_size);
if (!p) {
return AVERROR(ENOMEM);
}
*out = p;
*out_size = sizeof(nalu_header) + src_size;
memcpy(p, nalu_header, sizeof(nalu_header));
memcpy(p + sizeof(nalu_header), src, src_size);
/* Escape 0x00, 0x00, 0x0{0-3} pattern */
for (i = 4; i < *out_size; i++) {
if (i < *out_size - 3 &&
p[i + 0] == 0 &&
p[i + 1] == 0 &&
p[i + 2] <= 3) {
uint8_t *new;
*out_size += 1;
new = av_realloc(*out, *out_size);
if (!new) {
ret = AVERROR(ENOMEM);
goto done;
}
*out = p = new;
i = i + 3;
memmove(p + i, p + i - 1, *out_size - i);
p[i - 1] = 0x03;
}
}
done:
if (ret < 0) {
av_freep(out);
*out_size = 0;
}
return ret;
}
static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
{
int i;
@ -112,8 +164,20 @@ static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
}
if (pps && sps) {
ff_AMediaFormat_setBuffer(format, "csd-0", (void*)sps->data, sps->data_size);
ff_AMediaFormat_setBuffer(format, "csd-1", (void*)pps->data, pps->data_size);
uint8_t *data = NULL;
size_t data_size = 0;
if ((ret = h264_ps_to_nalu(sps->data, sps->data_size, &data, &data_size)) < 0) {
goto done;
}
ff_AMediaFormat_setBuffer(format, "csd-0", (void*)data, data_size);
av_freep(&data);
if ((ret = h264_ps_to_nalu(pps->data, pps->data_size, &data, &data_size)) < 0) {
goto done;
}
ff_AMediaFormat_setBuffer(format, "csd-1", (void*)data, data_size);
av_freep(&data);
} else {
av_log(avctx, AV_LOG_ERROR, "Could not extract PPS/SPS from extradata");
ret = AVERROR_INVALIDDATA;

View File

@ -66,6 +66,8 @@ retry:
}
#endif
next = END_NOT_FOUND;
} else if (pnmctx.type < 4) {
next = END_NOT_FOUND;
} else {
next = pnmctx.bytestream - pnmctx.bytestream_start
+ av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1);

View File

@ -28,6 +28,7 @@
typedef struct VP9ParseContext {
int n_frames; // 1-8
int size[8];
int marker_size;
int64_t pts;
} VP9ParseContext;
@ -88,6 +89,21 @@ static int parse(AVCodecParserContext *ctx,
return 0;
}
if (s->n_frames > 0) {
int i;
int size_sum = 0;
for (i = 0; i < s->n_frames ;i++)
size_sum += s->size[i];
size_sum += s->marker_size;
if (size_sum != size) {
av_log(avctx, AV_LOG_ERROR, "Inconsistent input frame sizes %d %d\n",
size_sum, size);
s->n_frames = 0;
}
}
if (s->n_frames > 0) {
*out_data = data;
*out_size = s->size[--s->n_frames];
@ -131,6 +147,7 @@ static int parse(AVCodecParserContext *ctx,
data += sz; \
size -= sz; \
} \
s->marker_size = size; \
parse_frame(ctx, *out_data, *out_size); \
return s->n_frames > 0 ? *out_size : full_size

View File

@ -344,6 +344,13 @@ struct AVFilterContext {
*/
AVFilterInternal *internal;
struct AVFilterCommand *command_queue;
char *enable_str; ///< enable expression string
void *enable; ///< parsed expression (AVExpr*)
double *var_values; ///< variable values for the enable expression
int is_disabled; ///< the enabled state from the last expression evaluation
/**
* For filters which will create hardware frames, sets the device the
* filter should create them in. All other filters will ignore this field:
@ -352,13 +359,6 @@ struct AVFilterContext {
* hardware context information.
*/
AVBufferRef *hw_device_ctx;
struct AVFilterCommand *command_queue;
char *enable_str; ///< enable expression string
void *enable; ///< parsed expression (AVExpr*)
double *var_values; ///< variable values for the enable expression
int is_disabled; ///< the enabled state from the last expression evaluation
};
/**
@ -473,12 +473,6 @@ struct AVFilterLink {
*/
AVRational frame_rate;
/**
* For hwaccel pixel formats, this should be a reference to the
* AVHWFramesContext describing the frames.
*/
AVBufferRef *hw_frames_ctx;
/**
* Buffer partially filled with samples to achieve a fixed/minimum size.
*/
@ -550,6 +544,12 @@ struct AVFilterLink {
* cleared when a frame is filtered.
*/
int frame_wanted_out;
/**
* For hwaccel pixel formats, this should be a reference to the
* AVHWFramesContext describing the frames.
*/
AVBufferRef *hw_frames_ctx;
};
/**

View File

@ -30,8 +30,8 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 46
#define LIBAVFILTER_VERSION_MICRO 102
#define LIBAVFILTER_VERSION_MINOR 47
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \

View File

@ -985,17 +985,6 @@ typedef struct AVStream {
int event_flags;
#define AVSTREAM_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata.
/*
* Codec parameters associated with this stream. Allocated and freed by
* libavformat in avformat_new_stream() and avformat_free_context()
* respectively.
*
* - demuxing: filled by libavformat on stream creation or in
* avformat_find_stream_info()
* - muxing: filled by the caller before avformat_write_header()
*/
AVCodecParameters *codecpar;
/*****************************************************************
* All fields below this line are not part of the public API. They
* may not be used outside of libavformat and can be changed and
@ -1217,6 +1206,17 @@ typedef struct AVStream {
* Must not be accessed in any way by callers.
*/
AVStreamInternal *internal;
/*
* Codec parameters associated with this stream. Allocated and freed by
* libavformat in avformat_new_stream() and avformat_free_context()
* respectively.
*
* - demuxing: filled by libavformat on stream creation or in
* avformat_find_stream_info()
* - muxing: filled by the caller before avformat_write_header()
*/
AVCodecParameters *codecpar;
} AVStream;
AVRational av_stream_get_r_frame_rate(const AVStream *s);

View File

@ -61,6 +61,11 @@ typedef struct FLVContext {
int broken_sizes;
int sum_flv_tag_size;
int last_keyframe_stream_index;
int keyframe_count;
int64_t *keyframe_times;
int64_t *keyframe_filepositions;
} FLVContext;
static int probe(AVProbeData *p, int live)
@ -92,8 +97,38 @@ static int live_flv_probe(AVProbeData *p)
return probe(p, 1);
}
static void add_keyframes_index(AVFormatContext *s)
{
FLVContext *flv = s->priv_data;
AVStream *stream = NULL;
unsigned int i = 0;
if (flv->last_keyframe_stream_index < 0) {
av_log(s, AV_LOG_DEBUG, "keyframe stream hasn't been created\n");
return;
}
av_assert0(flv->last_keyframe_stream_index <= s->nb_streams);
stream = s->streams[flv->last_keyframe_stream_index];
if (stream->nb_index_entries == 0) {
for (i = 0; i < flv->keyframe_count; i++) {
av_add_index_entry(stream, flv->keyframe_filepositions[i],
flv->keyframe_times[i] * 1000, 0, 0, AVINDEX_KEYFRAME);
}
} else
av_log(s, AV_LOG_WARNING, "Skipping duplicate index\n");
if (stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
av_freep(&flv->keyframe_times);
av_freep(&flv->keyframe_filepositions);
flv->keyframe_count = 0;
}
}
static AVStream *create_stream(AVFormatContext *s, int codec_type)
{
FLVContext *flv = s->priv_data;
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return NULL;
@ -104,6 +139,8 @@ static AVStream *create_stream(AVFormatContext *s, int codec_type)
s->ctx_flags &= ~AVFMTCTX_NOHEADER;
avpriv_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */
flv->last_keyframe_stream_index = s->nb_streams - 1;
add_keyframes_index(s);
return st;
}
@ -305,8 +342,7 @@ static int amf_get_string(AVIOContext *ioc, char *buffer, int buffsize)
return length;
}
static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc,
AVStream *vstream, int64_t max_pos)
static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, int64_t max_pos)
{
FLVContext *flv = s->priv_data;
unsigned int timeslen = 0, fileposlen = 0, i;
@ -316,10 +352,12 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc,
int ret = AVERROR(ENOSYS);
int64_t initial_pos = avio_tell(ioc);
if (vstream->nb_index_entries>0) {
av_log(s, AV_LOG_WARNING, "Skipping duplicate index\n");
if (flv->keyframe_count > 0) {
av_log(s, AV_LOG_DEBUG, "keyframes have been paresed\n");
return 0;
}
av_assert0(!flv->keyframe_times);
av_assert0(!flv->keyframe_filepositions);
if (s->flags & AVFMT_FLAG_IGNIDX)
return 0;
@ -368,15 +406,16 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc,
}
if (timeslen == fileposlen && fileposlen>1 && max_pos <= filepositions[0]) {
for (i = 0; i < fileposlen; i++) {
av_add_index_entry(vstream, filepositions[i], times[i] * 1000,
0, 0, AVINDEX_KEYFRAME);
if (i < 2) {
flv->validate_index[i].pos = filepositions[i];
flv->validate_index[i].dts = times[i] * 1000;
flv->validate_count = i + 1;
}
for (i = 0; i < FFMIN(2,fileposlen); i++) {
flv->validate_index[i].pos = filepositions[i];
flv->validate_index[i].dts = times[i] * 1000;
flv->validate_count = i + 1;
}
flv->keyframe_times = times;
flv->keyframe_filepositions = filepositions;
flv->keyframe_count = timeslen;
times = NULL;
filepositions = NULL;
} else {
invalid:
av_log(s, AV_LOG_WARNING, "Invalid keyframes object, skipping.\n");
@ -418,13 +457,14 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
}
break;
case AMF_DATA_TYPE_OBJECT:
if ((vstream || astream) && key &&
if (key &&
ioc->seekable &&
!strcmp(KEYFRAMES_TAG, key) && depth == 1)
if (parse_keyframes_index(s, ioc, vstream ? vstream : astream,
if (parse_keyframes_index(s, ioc,
max_pos) < 0)
av_log(s, AV_LOG_ERROR, "Keyframe index parsing failed\n");
else
add_keyframes_index(s);
while (avio_tell(ioc) < max_pos - 2 &&
amf_get_string(ioc, str_val, sizeof(str_val)) > 0)
if (amf_parse_object(s, astream, vstream, str_val, max_pos,
@ -574,6 +614,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
static int flv_read_metabody(AVFormatContext *s, int64_t next_pos)
{
FLVContext *flv = s->priv_data;
AMFDataType type;
AVStream *stream, *astream, *vstream;
AVStream av_unused *dstream;
@ -612,10 +653,14 @@ static int flv_read_metabody(AVFormatContext *s, int64_t next_pos)
// the lookup every time it is called.
for (i = 0; i < s->nb_streams; i++) {
stream = s->streams[i];
if (stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
if (stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
vstream = stream;
else if (stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
flv->last_keyframe_stream_index = i;
} else if (stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
astream = stream;
if (flv->last_keyframe_stream_index == -1)
flv->last_keyframe_stream_index = i;
}
else if (stream->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE)
dstream = stream;
}
@ -643,6 +688,7 @@ static int flv_read_header(AVFormatContext *s)
s->start_time = 0;
flv->sum_flv_tag_size = 0;
flv->last_keyframe_stream_index = -1;
return 0;
}
@ -653,6 +699,8 @@ static int flv_read_close(AVFormatContext *s)
FLVContext *flv = s->priv_data;
for (i=0; i<FLV_STREAM_TYPE_NB; i++)
av_freep(&flv->new_extradata[i]);
av_freep(&flv->keyframe_times);
av_freep(&flv->keyframe_filepositions);
return 0;
}

View File

@ -193,6 +193,8 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
if (sep)
p = sep + 1;
else
break;
}
}
if (ctx->playpath) {

View File

@ -2843,7 +2843,12 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
sample_size = sc->stsz_sample_size > 0 ? sc->stsz_sample_size : sc->sample_sizes[current_sample];
if (sc->pseudo_stream_id == -1 ||
sc->stsc_data[stsc_index].id - 1 == sc->pseudo_stream_id) {
AVIndexEntry *e = &st->index_entries[st->nb_index_entries++];
AVIndexEntry *e;
if (sample_size > 0x3FFFFFFF) {
av_log(mov->fc, AV_LOG_ERROR, "Sample size %u is too large\n", sample_size);
return;
}
e = &st->index_entries[st->nb_index_entries++];
e->pos = current_offset;
e->timestamp = current_dts;
e->size = sample_size;
@ -2968,6 +2973,10 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
av_log(mov->fc, AV_LOG_ERROR, "wrong chunk count %d\n", total);
return;
}
if (size > 0x3FFFFFFF) {
av_log(mov->fc, AV_LOG_ERROR, "Sample size %u is too large\n", size);
return;
}
e = &st->index_entries[st->nb_index_entries++];
e->pos = current_offset;
e->timestamp = current_dts;

View File

@ -82,7 +82,11 @@ static uint64_t vp8_gptopts(AVFormatContext *s, int idx,
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + idx;
uint64_t pts = (granule >> 32);
int invcnt = !((granule >> 30) & 3);
// If page granule is that of an invisible vp8 frame, its pts will be
// that of the end of the next visible frame. We substract 1 for those
// to prevent messing up pts calculations.
uint64_t pts = (granule >> 32) - invcnt;
uint32_t dist = (granule >> 3) & 0x07ffffff;
if (!dist)

View File

@ -101,7 +101,7 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
{
int ret = 0;
if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
AVIOContext pb;
AVIOContext pb = { 0 };
RTSPState *rt = s->priv_data;
AVDictionary *opts = NULL;
int len = strlen(p) * 6 / 8;

View File

@ -1483,6 +1483,15 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
if (ret < 0)
return ret;
#if FF_API_LAVF_AVCTX
FF_DISABLE_DEPRECATION_WARNINGS
/* update deprecated public codec context */
ret = avcodec_parameters_to_context(st->codec, st->codecpar);
if (ret < 0)
return ret;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
st->internal->need_context_update = 0;
}

View File

@ -32,8 +32,8 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you belive might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MINOR 40
#define LIBAVFORMAT_VERSION_MICRO 101
#define LIBAVFORMAT_VERSION_MINOR 41
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \

View File

@ -36,8 +36,8 @@ static int vplayer_probe(AVProbeData *p)
char c;
const unsigned char *ptr = p->buf;
if ((sscanf(ptr, "%*d:%*d:%*d.%*d%c", &c) == 1 ||
sscanf(ptr, "%*d:%*d:%*d%c", &c) == 1) && strchr(": =", c))
if ((sscanf(ptr, "%*3d:%*2d:%*2d.%*2d%c", &c) == 1 ||
sscanf(ptr, "%*3d:%*2d:%*2d%c", &c) == 1) && strchr(": =", c))
return AVPROBE_SCORE_MAX;
return 0;
}

View File

@ -427,12 +427,6 @@ typedef struct AVFrame {
enum AVChromaLocation chroma_location;
/**
* For hwaccel-format frames, this should be a reference to the
* AVHWFramesContext describing the frame.
*/
AVBufferRef *hw_frames_ctx;
/**
* frame timestamp estimated using various heuristics, in stream time base
* Code outside libavutil should access this field using:
@ -524,6 +518,11 @@ typedef struct AVFrame {
*/
AVBufferRef *qp_table_buf;
#endif
/**
* For hwaccel-format frames, this should be a reference to the
* AVHWFramesContext describing the frame.
*/
AVBufferRef *hw_frames_ctx;
} AVFrame;
/**

View File

@ -115,8 +115,10 @@ static struct {
MAP(BGRX, RGB32, BGR0),
MAP(RGBA, RGB32, RGBA),
MAP(RGBX, RGB32, RGB0),
#ifdef VA_FOURCC_ABGR
MAP(ABGR, RGB32, ABGR),
MAP(XBGR, RGB32, 0BGR),
#endif
MAP(ARGB, RGB32, ARGB),
MAP(XRGB, RGB32, 0RGB),
};

View File

@ -58,7 +58,7 @@
* The following example illustrates an AVOptions-enabled struct:
* @code
* typedef struct test_struct {
* AVClass *class;
* const AVClass *class;
* int int_opt;
* char *str_opt;
* uint8_t *bin_opt;
@ -96,7 +96,7 @@
* @code
* test_struct *alloc_test_struct(void)
* {
* test_struct *ret = av_malloc(sizeof(*ret));
* test_struct *ret = av_mallocz(sizeof(*ret));
* ret->class = &test_class;
* av_opt_set_defaults(ret);
* return ret;

View File

@ -64,7 +64,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 55
#define LIBAVUTIL_VERSION_MINOR 27
#define LIBAVUTIL_VERSION_MINOR 28
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

View File

@ -89,7 +89,7 @@ static const struct {
#if CONFIG_JPEG2000_DECODER
{ "jpeg2000dsp", checkasm_check_jpeg2000dsp },
#endif
#if CONFIG_PIXBLOCKDSP
#if CONFIG_PIXBLOCKDSP && !(ARCH_PPC64 && HAVE_BIGENDIAN)
{ "pixblockdsp", checkasm_check_pixblockdsp },
#endif
#if CONFIG_V210_ENCODER