1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-07 11:13:41 +02:00
Commit Graph

15 Commits

Author SHA1 Message Date
James Almer
b33f5299a5 avcodec/bsf: add a flushing mechanism to AVBSFContext
Meant to reset the internal bsf state without the need to reinitialize it.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-16 23:43:10 -03:00
James Almer
265ec55983 avcodec/bsf: use av_packet_make_refcounted to ensure packets are ref counted
Simplifies code.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-02 00:37:46 -03:00
James Almer
ed1f08bfb5 avcodec/bsf: make sure the AVBSFInternal stored packet is reference counted
Some bitstream filters may buffer said packet in their own contexts
for latter use. The documentation for av_bsf_send_packet() doesn't
forbid feeding it non-reference counted packets, which depending on
the way said packets were internally buffered by the bsf it may
result in the data described in them becoming invalid or unavailable
at any time.
This was the case with vp9_superframe after commit e1bc3f4396, which
was then promptly fixed in 37f4a093f7 and 7a02b364b6. It is still the
case even today with vp9_reorder_raw.

With this change the bitstream filters will not have to worry how to
store or consume the packets fed to them.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-23 22:10:39 -03:00
Jan Sebechlebsky
f92e1af844 avcodec/bsf: Check for packet payload when setting BSF EOF flag.
Set BSF EOF flag only if pkt == NULL or both data and
side data are not present in packet.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-22 22:32:24 -03:00
James Almer
844a115cd3 Revert "avcodec/bsf: Forbid packet without payload in av_bsf_send_packet"
This reverts commit bfdca87ab5.

Packets with no data or side data will be valid EOF signal in an
upcoming merge.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-22 21:52:06 -03:00
Steven Liu
d9c2cfd316 avcodec/bsf: fix resource leak in av_bsf_list_parse_str
cid: 1396268
when av_strdup(str) error, the lst need release

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-11 04:09:47 +08:00
Michael Niedermayer
762bf6f4af avcodec/bsf: Fix av_bsf_list_free()
Negate null check
Fixes CID1396248

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-08 15:26:01 +01:00
Jan Sebechlebsky
bcd1153162 libavcodec/bsfs: Fix bsf option setting
AV_OPT_SEARCH_CHILDREN flag must be passed to av_opt_set_dict()
to set options for private context.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-26 02:10:42 +02:00
Jan Sebechlebsky
57503fab4f avcodec/bsf: Add custom item name function for bsf list
which will
construct string description of filter chain. This is
done using lazy-initialization, so there is no overhead
if item name is never accessed.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-21 11:54:53 +02:00
Jan Sebechlebsky
b746ed70ef avcodec/bsf: Add list BSF API
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 14:03:46 +02:00
Jan Sebechlebsky
7ae52f8a6b avcodec/bsf: Add ff_bsf_get_packet_ref() function
Use of this function can save unnecessary malloc operation
in bitstream filter.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-13 12:46:18 +02:00
Jan Sebechlebsky
bfdca87ab5 avcodec/bsf: Forbid packet without payload in av_bsf_send_packet
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-13 10:59:50 +02:00
Jan Sebechlebsky
7d5501be1e avcodec/bsf: Set EOF flag only in pkt == NULL
Set BSF EOF flag only if pkt == NULL in av_bsf_send_packet().

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-13 10:59:50 +02:00
Derek Buitenhuis
af9cac1be1 Merge commit '33d18982fa03feb061c8f744a4f0a9175c1f63ab'
* commit '33d18982fa03feb061c8f744a4f0a9175c1f63ab':
  lavc: add a new bitstream filtering API

Conversions-by: Hendrik Leppkes <h.leppkes@gmail.com>
Conversions-by: Derek Buitenguis <derek.buitenhuis@gmail.com>
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 18:47:40 +01:00
Anton Khirnov
33d18982fa lavc: add a new bitstream filtering API
Deprecate the current bitstream filtering API.
2016-03-20 08:15:01 +01:00