Closed GoogleCodeExporter closed 8 years ago
Not sure if you saw this, but you mentioned problems related to unpacked
coreavc.
May not be helpful, but see this:
http://code.google.com/p/coreavc-for-linux/issues/detail?id=5&can=1&q=mac#c23
Original comment by nickbell...@gmail.com
on 2 Dec 2008 at 5:12
@nickbellomy: could you be more specific in how that thread would help me? I
already wrote that I'm using an
unpacked version of the ax and also postet in the thread you mentioned that it
isn't working wit the same crash I
reported here in detail.
Original comment by Felix.Bu...@gmail.com
on 3 Dec 2008 at 12:06
Felix,
Have you had any success in getting CoreAVC working under OSX?
I am trying to accomplish the same, but without any luck so far. I have tried
the route of
patching mplayer directly (avoiding dshowserver), but I had to massage the
patch a bit to get
mplayer to build.
After building and installing, I installed an unpacked coreavc 1.8, added the
registry info
with serial number and added a section to codecs.conf. I set the coreavc codec
to "untested"
to make mplayer prefer it to the other codecs.
Then I run the following:
DYLD_BIND_AT_LAUNCH=1 mplayer -msglevel win32=9 filename.mkv
MPlayer dev-SVN-r28180-4.0.1 (C) 2000-2008 MPlayer Team
CPU: Intel(R) Atom(TM) CPU N270 @ 1.60GHz (Family: 6, Model: 28, Stepping: 2)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
133 audio & 285 video codecs
Playing filename.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_AC3), -aid 0, -alang und
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [avc1] 1280x720 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [dshow] DirectShow video codecs
tid:a03b1fa0 External func VERSION.dll:GetFileVersionInfoSizeA
tid:a03b1fa0 External func VERSION.dll:GetFileVersionInfoA
tid:a03b1fa0 External func VERSION.dll:VerQueryValueA
tid:a03b1fa0 External func ADVAPI32.dll:RegSetValueA
tid:a03b1fa0 External func ADVAPI32.dll:RegDeleteKeyA
tid:a03b1fa0 External func ADVAPI32.dll:RegEnumKeyExA
tid:a03b1fa0 External func ADVAPI32.dll:RegCreateKeyA
tid:a03b1fa0 External func ADVAPI32.dll:RegSetValueExA
tid:a03b1fa0 External func ADVAPI32.dll:RegQueryValueExA
tid:a03b1fa0 External func ADVAPI32.dll:RegOpenKeyExA
tid:a03b1fa0 External func ADVAPI32.dll:RegCloseKey
tid:a03b1fa0 External func GDI32.dll:GetStockObject
tid:a03b1fa0 External func GDI32.dll:SetBkMode
tid:a03b1fa0 External func COMCTL32.dll:InitCommonControlsEx
tid:a03b1fa0 External func USER32.dll:wvsprintfA
tid:a03b1fa0 External func USER32.dll:MoveWindow
tid:a03b1fa0 External func USER32.dll:DestroyWindow
tid:a03b1fa0 External func USER32.dll:SetTimer
tid:a03b1fa0 External func USER32.dll:CreateDialogParamA
tid:a03b1fa0 External func USER32.dll:SendDlgItemMessageA
tid:a03b1fa0 External func USER32.dll:TrackPopupMenu
tid:a03b1fa0 External func USER32.dll:KillTimer
tid:a03b1fa0 External func USER32.dll:DefWindowProcA
tid:a03b1fa0 External func USER32.dll:SetForegroundWindow
tid:a03b1fa0 External func USER32.dll:LoadMenuA
tid:a03b1fa0 External func USER32.dll:wsprintfA
tid:a03b1fa0 External func USER32.dll:FindWindowExA
tid:a03b1fa0 External func USER32.dll:GetClientRect
tid:a03b1fa0 External func USER32.dll:SendMessageA
tid:a03b1fa0 External func USER32.dll:GetForegroundWindow
tid:a03b1fa0 External func USER32.dll:SetWindowLongA
tid:a03b1fa0 External func USER32.dll:MessageBoxA
tid:a03b1fa0 External func USER32.dll:InvalidateRect
tid:a03b1fa0 External func USER32.dll:GetWindowLongA
tid:a03b1fa0 External func USER32.dll:GetDlgItem
tid:a03b1fa0 External func USER32.dll:EndDialog
tid:a03b1fa0 External func USER32.dll:GetCursorPos
tid:a03b1fa0 External func USER32.dll:ShowWindow
tid:a03b1fa0 External func USER32.dll:GetSystemMetrics
tid:a03b1fa0 External func USER32.dll:LoadImageA
tid:a03b1fa0 External func USER32.dll:MapWindowPoints
tid:a03b1fa0 External func USER32.dll:EnableWindow
tid:a03b1fa0 External func USER32.dll:DestroyMenu
tid:a03b1fa0 External func USER32.dll:GetDlgItemTextA
tid:a03b1fa0 External func USER32.dll:DialogBoxParamA
tid:a03b1fa0 External func USER32.dll:SetDlgItemTextA
tid:a03b1fa0 External func USER32.dll:IsRectEmpty
tid:a03b1fa0 External func USER32.dll:LoadStringA
tid:a03b1fa0 External func USER32.dll:LoadStringW
tid:a03b1fa0 External func USER32.dll:GetDesktopWindow
tid:a03b1fa0 External func USER32.dll:GetWindowRect
tid:a03b1fa0 External func USER32.dll:GetSubMenu
tid:a03b1fa0 External func SHELL32.dll:Shell_NotifyIconA
tid:a03b1fa0 External func SHELL32.dll:SHGetSpecialFolderPathA
tid:a03b1fa0 External func SHELL32.dll:ShellExecuteA
tid:a03b1fa0 External func SHELL32.dll:ShellExecuteExA
tid:a03b1fa0 External func OLEAUT32.dll:8
tid:a03b1fa0 External func OLEAUT32.dll:20
tid:a03b1fa0 External func OLEAUT32.dll:4
tid:a03b1fa0 External func OLEAUT32.dll:24
tid:a03b1fa0 External func OLEAUT32.dll:19
tid:a03b1fa0 External func OLEAUT32.dll:23
tid:a03b1fa0 External func OLEAUT32.dll:9
tid:a03b1fa0 External func ole32.dll:StringFromGUID2
tid:a03b1fa0 External func ole32.dll:CLSIDFromString
tid:a03b1fa0 External func ole32.dll:CoInitialize
tid:a03b1fa0 External func ole32.dll:MkParseDisplayName
tid:a03b1fa0 External func ole32.dll:CreateBindCtx
tid:a03b1fa0 External func ole32.dll:CoUninitialize
tid:a03b1fa0 External func ole32.dll:CoCreateInstance
tid:a03b1fa0 External func ole32.dll:CoTaskMemFree
tid:a03b1fa0 External func ole32.dll:CoFreeUnusedLibraries
tid:a03b1fa0 External func ole32.dll:CoTaskMemAlloc
tid:a03b1fa0 External func ole32.dll:StringFromCLSID
tid:a03b1fa0 External func KERNEL32.dll:WriteConsoleA
tid:a03b1fa0 External func KERNEL32.dll:SetStdHandle
tid:a03b1fa0 External func KERNEL32.dll:GetLocaleInfoA
tid:a03b1fa0 External func KERNEL32.dll:GetStringTypeW
tid:a03b1fa0 External func KERNEL32.dll:GetStringTypeA
tid:a03b1fa0 External func KERNEL32.dll:LCMapStringW
tid:a03b1fa0 External func KERNEL32.dll:LCMapStringA
tid:a03b1fa0 External func KERNEL32.dll:GetConsoleMode
tid:a03b1fa0 External func KERNEL32.dll:GetConsoleCP
tid:a03b1fa0 External func KERNEL32.dll:SetFilePointer
tid:a03b1fa0 External func KERNEL32.dll:RtlUnwind
tid:a03b1fa0 External func KERNEL32.dll:IsValidCodePage
tid:a03b1fa0 External func KERNEL32.dll:GetOEMCP
tid:a03b1fa0 External func KERNEL32.dll:GetCPInfo
tid:a03b1fa0 External func KERNEL32.dll:GetCurrentProcessId
tid:a03b1fa0 External func KERNEL32.dll:QueryPerformanceCounter
tid:a03b1fa0 External func KERNEL32.dll:GetEnvironmentStringsW
tid:a03b1fa0 External func KERNEL32.dll:FreeEnvironmentStringsW
tid:a03b1fa0 External func KERNEL32.dll:GetEnvironmentStrings
tid:a03b1fa0 External func KERNEL32.dll:FreeEnvironmentStringsA
tid:a03b1fa0 External func KERNEL32.dll:GetStartupInfoA
tid:a03b1fa0 External func KERNEL32.dll:GetFileType
tid:a03b1fa0 External func KERNEL32.dll:SetHandleCount
tid:a03b1fa0 External func KERNEL32.dll:RaiseException
tid:a03b1fa0 External func KERNEL32.dll:HeapSize
tid:a03b1fa0 External func KERNEL32.dll:SetLastError
tid:a03b1fa0 External func KERNEL32.dll:TlsFree
tid:a03b1fa0 External func KERNEL32.dll:TlsSetValue
tid:a03b1fa0 External func KERNEL32.dll:TlsAlloc
tid:a03b1fa0 External func KERNEL32.dll:TlsGetValue
tid:a03b1fa0 External func KERNEL32.dll:GetStdHandle
tid:a03b1fa0 External func KERNEL32.dll:WriteFile
tid:a03b1fa0 External func KERNEL32.dll:ExitProcess
tid:a03b1fa0 External func KERNEL32.dll:HeapDestroy
tid:a03b1fa0 External func KERNEL32.dll:GetSystemTimeAsFileTime
tid:a03b1fa0 External func KERNEL32.dll:GetConsoleOutputCP
tid:a03b1fa0 External func KERNEL32.dll:GetCommandLineA
tid:a03b1fa0 External func KERNEL32.dll:HeapReAlloc
tid:a03b1fa0 External func KERNEL32.dll:IsDebuggerPresent
tid:a03b1fa0 External func KERNEL32.dll:SetUnhandledExceptionFilter
tid:a03b1fa0 External func KERNEL32.dll:UnhandledExceptionFilter
tid:a03b1fa0 External func KERNEL32.dll:TerminateProcess
tid:a03b1fa0 External func KERNEL32.dll:HeapAlloc
tid:a03b1fa0 External func KERNEL32.dll:WriteConsoleW
tid:a03b1fa0 External func KERNEL32.dll:InterlockedIncrement
tid:a03b1fa0 External func KERNEL32.dll:InterlockedDecrement
tid:a03b1fa0 External func KERNEL32.dll:GetCurrentProcess
tid:a03b1fa0 External func KERNEL32.dll:WaitForSingleObject
tid:a03b1fa0 External func KERNEL32.dll:InitializeCriticalSection
tid:a03b1fa0 External func KERNEL32.dll:TerminateThread
tid:a03b1fa0 External func KERNEL32.dll:Sleep
tid:a03b1fa0 External func KERNEL32.dll:LeaveCriticalSection
tid:a03b1fa0 External func KERNEL32.dll:CreateSemaphoreA
tid:a03b1fa0 External func KERNEL32.dll:ReleaseSemaphore
tid:a03b1fa0 External func KERNEL32.dll:GetProcAddress
tid:a03b1fa0 External func KERNEL32.dll:EnterCriticalSection
tid:a03b1fa0 External func KERNEL32.dll:GetModuleHandleA
tid:a03b1fa0 External func KERNEL32.dll:DeleteCriticalSection
tid:a03b1fa0 External func KERNEL32.dll:GetCurrentThreadId
tid:a03b1fa0 External func KERNEL32.dll:CloseHandle
tid:a03b1fa0 External func KERNEL32.dll:CreateThread
tid:a03b1fa0 External func KERNEL32.dll:FindResourceA
tid:a03b1fa0 External func KERNEL32.dll:FreeResource
tid:a03b1fa0 External func KERNEL32.dll:FreeLibrary
tid:a03b1fa0 External func KERNEL32.dll:LoadResource
tid:a03b1fa0 External func KERNEL32.dll:GetUserDefaultLCID
tid:a03b1fa0 External func KERNEL32.dll:FormatMessageA
tid:a03b1fa0 External func KERNEL32.dll:WideCharToMultiByte
tid:a03b1fa0 External func KERNEL32.dll:MultiByteToWideChar
tid:a03b1fa0 External func KERNEL32.dll:GetPrivateProfileStringA
tid:a03b1fa0 External func KERNEL32.dll:LoadLibraryA
tid:a03b1fa0 External func KERNEL32.dll:WritePrivateProfileStringA
tid:a03b1fa0 External func KERNEL32.dll:LockResource
tid:a03b1fa0 External func KERNEL32.dll:GetModuleFileNameA
tid:a03b1fa0 External func KERNEL32.dll:GetVersionExA
tid:a03b1fa0 External func KERNEL32.dll:VirtualQuery
tid:a03b1fa0 External func KERNEL32.dll:CreateFileA
tid:a03b1fa0 External func KERNEL32.dll:GetProcessHeap
tid:a03b1fa0 External func KERNEL32.dll:FlushFileBuffers
tid:a03b1fa0 External func KERNEL32.dll:HeapCreate
tid:a03b1fa0 External func KERNEL32.dll:HeapFree
tid:a03b1fa0 External func KERNEL32.dll:DisableThreadLibraryCalls
tid:a03b1fa0 External func KERNEL32.dll:VirtualFree
tid:a03b1fa0 External func KERNEL32.dll:VirtualAlloc
tid:a03b1fa0 External func KERNEL32.dll:GetTickCount
tid:a03b1fa0 External func KERNEL32.dll:GetACP
tid:a03b1fa0 External func KERNEL32.dll:GetLastError
tid:a03b1fa0 External func KERNEL32.dll:lstrlenA
Here, mplayer just freezes.
It might of course be the changes I had to do to the patch to get mplayer to
build, but I
would be very interested in knowing if anyone have successfully used coreavc
under OSX, and
if so what their method was (including mplayer, coreavc-for-linux, dshowserver
and coreavc
revision/version numbers).
Original comment by wiese...@gmail.com
on 24 Dec 2008 at 1:00
Hi,
After some hacking I have CoreAVC working in OS X, using the dshowserver
method. It still isn't quite fast enough to decode 1080p
content at full speed (2.33 Ghz Core2 mobile processor), but it's close. There
are still a few opportunities to improve things at this point:
- Multi-threading in the codec is not working at all, it crashes immediately,
although the dshowserver test works.
- About 20% of the CPU (of about 140% total) is used for memcpy in mplayer; I
believe most of this is copying from the shared memory
buffer to mplayer's internal buffer. I expect that this could be eliminated by
ensuring the memory copy is using copy-on-write.
- Must compile in debug mode
To solve the stack alignment problem I created a wrapper for each system call
in the loader that aligns the stack pointer to nearest 16-
bytes before calling the actual function, then undoes its fix after the
function return. Its only a few assembly instructions before and after
the system call so the overhead is probably not worth noting.
I have also added cpudetect.c / cpudetect.h from current mplayer svn to take
care of GetSystemInfo function. This doesn't quite seem to
work however, probably the flags are wrong when compiling.
To make the solution more manageable, I created a perl script to generate the
wrappers for each function, and a header that gets included
in all source files (via -include passed to gcc), rather than have to touch
each source file.
Versions used:
coreavc-for-linux: 82
CoreAVC: 1.9.5, unpacked
mplayer: 29219
loader/darwincalls.txt
This is the list of system calls we're wrapping, I simply copied the prototypes right out of the man page(s) for each function.
loader/darwincalls.pl
This script creates darwinstubs.h, which contains remapping macros and stub prototypes, and darwinstubsgen.h, which contains the C
function stubs with alignment fix.
loader/darwin.h
This is the header that gets included in all source files.
loader/darwin.c
This includes darwinstubsgen.h and includes a few functions that my generator borks on. (The generator doesn't parse function pointer
types yet).
loader.diff
Misc patches to existing files (apply in loader/)
loader/compat/cpudetect.c
loader/compat/x86_cpu.h
CPU detect from latest mplayer
Also attached are the binaries I compiled, they need to be installed the same
way as the Linux ones (/usr/local/bin should work)
Compiling:
Drop all files into loader/, except cpudetect.c and x86_cpu.h, those go in compat/
Apply the patch in loader/ (patch -p0 < loader.diff)
In dshowserver > make DEBUG=1
Happy Hacking!
-Darrell
Original comment by walis...@mac.com
on 22 Apr 2009 at 1:45
All files in one zip, includes binaries
Original comment by walis...@mac.com
on 22 Apr 2009 at 1:47
Attachments:
Ths stuff should no longer be an issue now that we're using Wine, so hopefully
it
'just works' If not let me know.
Original comment by alannis...@gmail.com
on 8 Jan 2010 at 8:29
Original issue reported on code.google.com by
Felix.Bu...@gmail.com
on 4 Sep 2008 at 1:08