Remove the global and Add a corresponding field to the vo struct, plus
another which tells whether the LAST config call was successful.The
latter value which tells whether the VO should be properly configured
at the moment seems a better match for the semantics actually needed
in most places where the old value was used. The 'count' field with
the old semantics is not currently used by anything, but I'm leaving
it there for vo drivers which would need those semantics if converted
to use the struct.
Existing uses of the global outside old vo drivers are either converted
to use the struct field or moved inside the vo_xyz() calls (instead of
"if (vo_config_count) vo_flip_page(..." just call vo_flip_page which
will now do nothing if not configured). The removal of the check in
mpcommon.c/update_subtitles() is less trivial than the others, but I
think it shouldn't cause problems.
Will be used for common data between X11 VOs. The main reasons for
making it a separate struct rather than extra fields in the main VO
struct are that some field definitions need X headers and that the code
keeps basic X state such as the display connection over opening and
closing of individual VOs.
Replace (hopefully) all cases where normally successful allocations
could return NULL with abort(). This should allow skipping most checks
on allocation return values.
Original talloc build system used autoconf to check for features, most
of which were standard C headers. Assume those always exist. Always
use a workaround for the one non-standard feature (strnlen).
Add a 'struct vo *vo' argument to the x11_common.c functions that
access the variable so it's available as vo->opts->vo_ontop. To keep
VOs using the old API working create a global vo variable that is set
to the currently used old vo. "vo_ontop" will be #defined to
"global_vo->opts->vo_ontop", and x11_common.h will add defines like
the following when it is included by old VOs:
#define vo_x11_ontop() vo_x11_ontop(global_vo)
so that they will call the function according to the new declaration.
Rename the vo_ontop() macro to vo_gl_ontop(). It caused problems with
other changes because it conflicts with a global variable name (gl2
actually called vo_ontop() as a function and used vo_ontop as an int -
this only worked because vo_ontop was defined as a function-like macro
and use without parentheses didn't trigger replacement).
Give sh_audio_t, sh_video_t and sh_sub_t which before had typedef
names only a matching struct name (without _t) too.
Change the a_streams, v_streams and s_streams demuxer fields from
void * to struct sh_audio *, struct sh_video * and struct sh_sub *.
Remove a now unnecessary cast from mplayer.c.
First part of option restructuring. The aim is to move option values
from a huge number of separate globals to a single non-global struct.
This part adds some support for parsing option values into such struct
instances, and moves one example option (fixed-vo) to the struct.
If preinit() failed after allocating some resources it didn't free
them. Also if preinit() completed but all (if any) calls to config()
failed then uninit() it not free resources. Add checks to uninit() to
make it safe with only a subset of resources allocated, then make it
execute independently of vo_config_count and also make preinit() call
it in error cases.
The previous version was not buggy, but this is easier to see correct.
Now it doesn't depend on options determining num_buffers staying
constant and on vo_config_count.
Combine code unnecessarily split in 3 #ifdef blocks into one block and
change local variables there were pointlessly declared static to
normal ones.
After this vo_xv.c no longer defines any global or static variables.
Create new video driver API that has a per-instance context structure
and does not rely on keeping status in global or static variables.
Existing drivers are not yet converted to this API; instead there is a
wrapper which translates calls to them.
In the new API, an old API call vo_functions->xyz(args) is generally
replaced by vo_xyz(vo_instance, args).
The changes to keep the vesa, dxr2 and xover drivers compiling have
not been tested.
These were the only voctrl types with more than one argument. The
second argument was passed using variable arguments. Change them to
use a single argument (address of a struct containing both old
arguments). This makes forwarding the arguments to other functions
easier and allows simplifying code.
necessary, this should err on the side of unneeded recursion instead of
missing a necessary rebuild.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26467 b3059339-0415-0410-9bf9-f77b7e298cf2
Fix mencoder linking when the GUI is enabled.
Patch by Norman Yarvin (yarvin -at- yarchive -dot- net).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26454 b3059339-0415-0410-9bf9-f77b7e298cf2