DirectShow specifies that a filter (codec) can expect JoinFilterGraph
to be called, and store a reference to the graph manager. Implement a
very bare-bones graph manager (all functions are stubs, and no extra
interfaces are implemented) and give it to the codec on init.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30866 b3059339-0415-0410-9bf9-f77b7e298cf2
The dpi value for QuickTime codecs is stored as Fixed16 (16.16 fixed-point),
not int. Correct the output value accordingly.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30865 b3059339-0415-0410-9bf9-f77b7e298cf2
Relatively simplistic implementations of ResumeThread (stub) and
SignalObjectAndWait (bAlertable is ignored). Both are needed for ProRes 4:2:2
support on Linux.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30861 b3059339-0415-0410-9bf9-f77b7e298cf2
For some reason commit e306174952, which
replaced translation macro names with the corresponding English
strings, also collapsed multiple consecutive space characters into
one. Change most of these back. In a couple of cases the amount of
whitespace is important for alignment, and for the rest it at least
keeps the strings closer to the existing translations.
The OSErr type on Mac OS X is int16_t, not int32_t (see
http://developer.apple.com/mac/library/documentation/QuickTime/Reference/QTRef_DataTypes/Reference/reference.html).
The upper 16 bits will typically be something random (they're entirely
undefined). Change the type so it's right; a few places tried to compensate
for this by masking out the upper bits, but a few places also missed them,
which made for unpredictable behavior.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30854 b3059339-0415-0410-9bf9-f77b7e298cf2
Implement Win32 mutexes; they used to just be mapped on top of events, which
is not the same thing at all.
The implementation is pretty much the obvious one, similar to the
current critical section implementation and the semaphore implementation;
a single lock count protected by a pthread mutex, and an event lockers can
sleep on to know when the mutex is available.
Also make CreateMutexA and ReleaseMutex available even if QuickTime codecs
support is not configured.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30853 b3059339-0415-0410-9bf9-f77b7e298cf2
Two simple bugfixes for semaphores in WaitForSingleObject:
First, semaphore count should be decreased on loading the semaphore, not
increased. The case for duration=0 had this wrong (duration=-1 was fine).
Second, the code for duration=-1 forgot to set the return value, so it
would always return WAIT_FAILED.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30852 b3059339-0415-0410-9bf9-f77b7e298cf2
loader/win32.c contains a global linked list of all existing mutexes
(whose head is called mlist), which is accessed from multiple threads,
and as such needs to be protected by a mutex. Fixed.
Same thing for the global linked list of all existing threads, whose
head is called list.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30851 b3059339-0415-0410-9bf9-f77b7e298cf2
Some codecs, and more recently Microsoft's CRT library, expect GetModuleHandle(NULL)
to return a pointer to the program's PE header mapped in memory. Thus, just returning
0x0 or 0x1 won't do it anymore, so create a minimal PE header and return that.
Patch originally by Gianluigi Tiesi ( mplayer (at) netfarm (dot) it ).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30848 b3059339-0415-0410-9bf9-f77b7e298cf2
Some extra changes snuck into my commit; they'll probably be reviewed
and committed to Subversion eventually, but were not part of the fix
for WaitForSingleObject on thread handles.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30844 b3059339-0415-0410-9bf9-f77b7e298cf2
Some codecs need this for clean shutdown (as opposed to a crash); we don't
really support timed wait since POSIX doesn't, but it doesn't seem necessary.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30843 b3059339-0415-0410-9bf9-f77b7e298cf2
Earlier, cs->locked was accessed outside the mutex to get around
the problem that default pthread mutexes are not recursive
(ie., you cannot do a double-lock from the same thread), causing
a thread-safety problem, as both detected by Helgrind and showing
up in some multithreaded codecs.
The ideal solution here would be to simply use recursive pthread
mutexes, but there were concerns about reduced debuggability and
possibly portability. Thus, instead, rewrite the critical sections
to be a simple lock count (with owner) protected by a regular mutex.
Whenever a thread wants to enter the critical section and lock_count
is not 0, it sleeps on a special event that tells it when the
critical section is available.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30837 b3059339-0415-0410-9bf9-f77b7e298cf2
CreatePalette had problems for me, and looking at the code it was quite
obvious why; someone had reversed the order of the two elements of the
LOGPALETTE struct, causing it to allocate and copy a bogus amount of memory.
Why on earth anybody would want to do that is beyond me; whoever did it even
left a comment, but it wasn't very helpful, as it crashed nevertheless. :-)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30832 b3059339-0415-0410-9bf9-f77b7e298cf2
Events have a “reset” member that specify if they flag is automatically
set back on read/wait. However, this was populated by bManualReset, so the
flag was inverted and once an event was set, it would forever be counted
as so. Fixed by inverting the flag.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30831 b3059339-0415-0410-9bf9-f77b7e298cf2
These were simply inverted compared to what they should be.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30830 b3059339-0415-0410-9bf9-f77b7e298cf2
These functions return void*, which is compatible with any pointer,
so there is no need for casts.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30744 b3059339-0415-0410-9bf9-f77b7e298cf2
This fixes a ton of gcc warnings about ignored packed attributes.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30581 b3059339-0415-0410-9bf9-f77b7e298cf2
Dependencies were only set correctly if the loader code was enabled.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30542 b3059339-0415-0410-9bf9-f77b7e298cf2
Our loader code is not a general-purpose library and not used from C++.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30538 b3059339-0415-0410-9bf9-f77b7e298cf2
Patch by Steinar H. Gunderson [sgunderson bigfoot com]
with some modifications by me.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30531 b3059339-0415-0410-9bf9-f77b7e298cf2
It will never get enabled in MPlayer, nor is it more than cruft.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30526 b3059339-0415-0410-9bf9-f77b7e298cf2
Convert vo_x11_border (used in vo_gl/gl2 though the vo_gl_border
macro) to use a wrapper macro in old-style VOs which do not provide a
VO object argument. Before this function had an explicit global_vo
argument in vo_gl/gl2. New vo_vdpau uses it too so use the same
mechanism as most other functions.
fixes compilation on uClibc based i386 system
patch by Markus Heidelberg markus(x.x)heidelberg(x@x)web(x.x)de
ok'd by diego
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28387 b3059339-0415-0410-9bf9-f77b7e298cf2
The libdvdread4 and libdvdnav directories, which are externals in the
svn repository, are at least for now not included in any form. I added
configure checks to automatically disable internal libdvdread and
libdvdnav if the corresponding directories are not present; if they're
added manually then things work the same as in svn.