Derek Buitenhuis
500a9bb5ba
lavc/options: Remove unneeded header
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
7 years ago
James Almer
cac8de2da5
avcodec/options: do a more thorough clean up in avcodec_copy_context()
...
Free coded_frame, coded_side_data and unref hw_device_ctx to prevent
potential leaks.
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
8 years ago
James Almer
54a4c9b4e9
avcodec/options: factorize avcodec_copy_context() cleanup code
...
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
8 years ago
Vittorio Giovara
94eed68ace
lavc: Drop deprecated options moved to private contexts
...
Deprecated in 10/2014 and 07/2015.
8 years ago
Anton Khirnov
d59641abfd
lavc: initialize AVCodecContext.sw_pix_fmt properly
...
Currently it's memset to 0, which is YUV420P. It should be initialized
to none.
9 years ago
Andrey Turkin
24b5cff01b
lavc: handle hw_frames_ctx where necessary
...
avcodec_copy_context() didn't handle hw_frames_ctx references correctly
which could cause crashes.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years ago
Anton Khirnov
04fc8e24a0
lavc: deprecate avcodec_get_context_defaults3()
...
This function is supposed to "reset" a codec context to a clean state so
that it can be opened again. The only reason it exists is to allow using
AVStream.codec as a decoding context (after it was already
opened/used/closed by avformat_find_stream_info()). Since that behaviour
is now deprecated, there is no reason for this function to exist
anymore.
9 years ago
Anton Khirnov
5f30ac2779
lavc: deprecate avcodec_copy_context()
...
Since AVCodecContext contains a lot of complex state, copying a codec
context is not a well-defined operation. The purpose for which it is
typically used (which is well-defined) is copying the stream parameters
from one codec context to another. That is now possible with through the
AVCodecParameters API. Therefore, there is no reason for
avcodec_copy_context() to exist.
9 years ago
Michael Niedermayer
845fb3d4a5
avcodec/options: Make dummy_v?_encoder static
...
It does not need to be non static
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
a368920eef
avcodec/options: Silence deprecated warning about coded_frame
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Vittorio Giovara
059a934806
lavc: Consistently prefix input buffer defines
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
James Almer
3e46c7dbbe
avcodec/options-test: don't alloc avctx->coded_frame
...
It's done automatically by avcodec_open2() now.
Fixes memleaks in fate-libavcodec-options.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
Vittorio Giovara
f046c3b5ac
lavc: Move deprecation warning disabling to files including the table
...
Unbreak build from 7a5902c556
.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
10 years ago
Lukasz Marek
72732307d9
lavc/options: add test for avcodec_copy_context
...
This test doesn't cover every possible issue with this function.
It covers options management only.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
10 years ago
Lukasz Marek
8616c5b75a
lavc/options: fix leaks in avcodec_copy_context
...
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
10 years ago
Lukasz Marek
53b2809f2c
lavc/options: don't copy priv context when it is not AVOption object
...
This prevents potential crash when opt API is used without a class.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
10 years ago
Lukasz Marek
345cfd04d0
lavc/options: fix leaks in avcodec_free_context
...
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
10 years ago
Lukasz Marek
7d75a399a4
lavc/options: fix rc_eq leak
...
rc_eq is an option, so it is copied by av_opt_copy(dest, src); above.
10 years ago
Vadim Kalinsky
d1d3904273
avcodec/options: Set AVCodecContext->codec upon initialization.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Lukasz Marek
01974a58df
lavc/options: initialize pkt_timebase
...
It's default in option_table.h is 0, but without this fix it is represented as 0/0.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
10 years ago
Lukasz Marek
4a30277a59
lavc/options: set timecode_frame_start to -1 as option default
...
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
10 years ago
Lukasz Marek
db2caf0a80
lavc/options: fix shallow copy context
...
avcodec_copy_context leaves shallow copy of string/binary/dict options.
Double free/accessing freed memory may occur.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
10 years ago
Anton Khirnov
a75c2eb25a
lavc: make rc_eq into private options of mpegvideo encoders
10 years ago
Anton Khirnov
7ea1b3472a
lavc: deprecate the use of AVCodecContext.time_base for decoding
...
When decoding, this field holds the inverse of the framerate that can be
written in the headers for some codecs. Using a field called 'time_base'
for this is very misleading, as there are no timestamps associated with
it. Furthermore, this field is used for a very different purpose during
encoding.
Add a new field, called 'framerate', to replace the use of time_base for
decoding.
10 years ago
Gabriel Dume
f929ab0569
cosmetics: Write NULL pointer equality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Michael Niedermayer
8b686c886c
avcodec/options: use av_opt_copy() in avcodec_copy_context() to copy priv_data
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e0d0745560
avcodec/options: leave priv_data in avcodec_copy_context() intact
...
previously it was freed but the pointer not cleared
Found-by: ruggles
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
fd056029f4
lavc: add avcodec_free_context().
...
Right now, the caller has to manually manage some allocated
AVCodecContext fields, like extradata or subtitle_header. This is
fragile and prone to leaks, especially if we want to add more such
fields in the future.
The only reason for this behaviour is so that the AVStream codec context
can be reused for decoding. Such reuse is discouraged anyway, so this
commit is the first step to deprecating it.
11 years ago
Michael Niedermayer
97f856a4c2
avcodec/options: avcodec_copy_context() Check subtitle_header_size instead of setting it
...
The value is already copied in the generic code so it should always match
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
3b2fbe67bd
lavc: properly handle subtitle_header in avcodec_copy_context()
11 years ago
Anton Khirnov
efc7df6c1f
lavc: preserve the original private data in avcodec_copy_context()
...
If a non-NULL codec was passed to avcodec_alloc_context3(), private data
will be already allocated in dest.
11 years ago
Anton Khirnov
38ecc3702d
pthread: store thread contexts in AVCodecInternal instead of AVCodecContext
...
It's a private field, it should not be visible to callers.
Deprecate AVCodecContext.thread_opaque
11 years ago
Stefano Sabatini
d3397c3e82
lavc: remove dead FF_API_ALLOC_CONTEXT API
11 years ago
Michael Niedermayer
cba9a40d47
avcodec: free priv_data in avcodec_copy_context()
...
Fixes memleak
Fixes Ticket2216
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
b5a138652f
Give less generic names to global library option arrays
12 years ago
Nicolas George
ceb33f3aee
lavc: copy subtitle_header when copying context.
...
Fix trac ticket #2489 .
12 years ago
Michael Niedermayer
2ae91c86f3
avcodec_get_context_defaults3: set codec_id
...
Fixes Ticket1996
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Stefano Sabatini
96d815fc0c
lavc: add pkt_size field to AVFrame
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Anton Khirnov
0a0f19b577
lavc: add const to AVCodec* function parameters.
13 years ago
Martin Storsjö
1d9c2dc89a
Don't include common.h from avutil.h
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
jamal
938e4470ae
options: Fix warning about incompatible pointer type
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
6fb7d03d74
lavc: seperate encoder/decoder class category
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
a5c7525bcb
set some categories of some AVClass structs
...
Please help setting the category for all remaining AVClasses
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
hakuya
79e5902cf1
Exposing forced flag for DVD and PGS subtitles
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
hakuya
1f46b50a95
Added AVClass for AVSubtitleRect
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Nicolas George
128dda7016
lavc: add a sample_rate field to AVFrame.
...
The field is filled with the codec context information.
13 years ago
Nicolas George
4b0521eca9
lavc: add a channel_layout field to AVFrame.
...
The field is filled with the codec context information.
FIXME need a minor version bump.
13 years ago
Anton Khirnov
5626697104
Move AVFormatContext/AVCodecContext option tables to separate files.
...
This will allow us to automatically generate manpages for them.
13 years ago