Currently, AVStream contains an embedded AVCodecContext instance, which
is used by demuxers to export stream parameters to the caller and by
muxers to receive stream parameters from the caller. It is also used
internally as the codec context that is passed to parsers.
In addition, it is also widely used by the callers as the decoding (when
demuxer) or encoding (when muxing) context, though this has been
officially discouraged since Libav 11.
There are multiple important problems with this approach:
- the fields in AVCodecContext are in general one of
* stream parameters
* codec options
* codec state
However, it's not clear which ones are which. It is consequently
unclear which fields are a demuxer allowed to set or a muxer allowed to
read. This leads to erratic behaviour depending on whether decoding or
encoding is being performed or not (and whether it uses the AVStream
embedded codec context).
- various synchronization issues arising from the fact that the same
context is used by several different APIs (muxers/demuxers,
parsers, bitstream filters and encoders/decoders) simultaneously, with
there being no clear rules for who can modify what and the different
processes being typically delayed with respect to each other.
- avformat_find_stream_info() making it necessary to support opening
and closing a single codec context multiple times, thus
complicating the semantics of freeing various allocated objects in the
codec context.
Those problems are resolved by replacing the AVStream embedded codec
context with a newly added AVCodecParameters instance, which stores only
the stream parameters exported by the demuxers or read by the muxers.
The next frame time could slip, causing the frame rate to drop until
frames were dropped. Now will capture at the next correct moment instead.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* commit 'b31328d008985f87f0a7c83c700847cef1a4f08c':
xcbgrab: Provide better names for the y and x option
Conflicts:
doc/indevs.texi
libavdevice/x11grab.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Incidentally `-y` also collides with avconv global options.
Update x11grab to match and document the option.
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* commit '5b9c817dc7577b6d44acc94d73b9c77c52cda489':
x11grab: Check XFixesGetCursorImage return value
Conflicts:
libavdevice/x11grab.c
See: a65c0a3fe8
The warning with adjusted text is kept from a65c0a3fe8
but drawing the cursor is not disabled in case XFixesGetCursorImage() fails
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The paint_mouse_pointer() code uses XFixes to retrieve the cursor
coordinates, but XFixes gives no information about which screen the
pointer is on; this results in always drawing the cursor on the
captured screen even if the mouse pointer was on another screen.
For example, when capturing from screen 1 (i.e. -f x11grab -i ":0.1")
the cursor was being drawn in the captured image even when the mouse
pointer was actually on screen 0, which is wrong and visually confusing.
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
The code uses XFixes to retrieve the cursor coordinates, but XFixes
gives no information of what screen the pointer is on; this results in
always drawing the cursor on the captured screen even if the mouse
pointer was on another screen.
For example, when capturing from screen 1 (i.e. -f x11grab -i ":0.1")
the cursor was being drawn in the captured image even when the mouse
pointer was actually on screen 0, which is wrong and visually confusing.
Use XQueryPointer to check that the pointer is actually on the screen
which is being captured.
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This specifies better the meaning of the variable, and is also in
preparation of a subsequent change which will introduce a temporary
Window variable for which "w" is an good name.
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'bb3ead7e54fec205c595cfb8b1d8900d50d3d1cc':
x11grab: Fallback to normal XImage if SHM is not supported
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '58396e806c65fe0eb00e6ccf1980f810cdceed05':
x11grab: Use a typedef for the context, as most other code does
Conflicts:
libavdevice/x11grab.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '7bb505a33ca131906b2ceb2f298e104c862740ea':
x11grab: Drop a spurious space in the extension reporting message
Conflicts:
libavdevice/x11grab.c
See: 9af2097120
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The X11 servers by VNC, at 32-bits depths, has the following masks:
R:0x000007ff G:0x003ff800 B:0xffc00000
This is not compatible with AV_PIX_FMT_0RGB32, and the result
is success with completely wrong colors.
* commit '124134e42455763b28cc346fed1d07017a76e84e':
avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union member
Conflicts:
libavcodec/aacenc.c
libavcodec/libopenjpegenc.c
libavcodec/options_table.h
libavdevice/bktr.c
libavdevice/v4l2.c
libavdevice/x11grab.c
libavfilter/af_amix.c
libavfilter/vf_drawtext.c
libavformat/movenc.c
libavformat/options_table.h
libavutil/opt.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>