Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Pristine Unix sources for OpenCV 2.4.1

  • Loading branch information...
commit c0231c6c564514810b05c668290bb435b9f7c54d 1 parent 4800530
Clifford Hung hungc authored

Showing 1,620 changed files with 32,277 additions and 23,793 deletions. Show diff stats Hide diff stats

  1. +0 18 3rdparty/CMakeLists.txt
  2. +0 20 3rdparty/ffmpeg/CMakeLists.txt
  3. +11 0 3rdparty/ffmpeg/ffmpeg_version.cmake
  4. +502 0 3rdparty/include/MultiMon.h
  5. +1,083 439 3rdparty/include/ffmpeg_/libavcodec/avcodec.h
  6. +3 0  3rdparty/include/ffmpeg_/libavcodec/dxva2.h
  7. +2 2 3rdparty/include/ffmpeg_/libavcodec/vaapi.h
  8. +168 0 3rdparty/include/ffmpeg_/libavcodec/vda.h
  9. +6 6 3rdparty/include/ffmpeg_/libavcodec/vdpau.h
  10. +61 3 3rdparty/include/ffmpeg_/libavcodec/version.h
  11. +24 6 3rdparty/include/ffmpeg_/libavdevice/avdevice.h
  12. +810 250 3rdparty/include/ffmpeg_/libavformat/avformat.h
  13. +74 14 3rdparty/include/ffmpeg_/libavformat/avio.h
  14. +53 5 3rdparty/include/ffmpeg_/libavformat/version.h
  15. +1 0  3rdparty/include/ffmpeg_/libavutil/adler32.h
  16. +10 0 3rdparty/include/ffmpeg_/libavutil/aes.h
  17. +28 0 3rdparty/include/ffmpeg_/libavutil/attributes.h
  18. +59 7 3rdparty/include/ffmpeg_/libavutil/audioconvert.h
  19. +81 5 3rdparty/include/ffmpeg_/libavutil/avstring.h
  20. +220 5 3rdparty/include/ffmpeg_/libavutil/avutil.h
  21. +11 0 3rdparty/include/ffmpeg_/libavutil/base64.h
  22. +2 17 3rdparty/include/ffmpeg_/libavutil/bswap.h
  23. +25 12 3rdparty/include/ffmpeg_/libavutil/common.h
  24. +2 0  3rdparty/include/ffmpeg_/libavutil/cpu.h
  25. +49 3 3rdparty/include/ffmpeg_/libavutil/dict.h
  26. +19 0 3rdparty/include/ffmpeg_/libavutil/error.h
  27. +1 1  3rdparty/include/ffmpeg_/libavutil/eval.h
  28. +42 15 3rdparty/include/ffmpeg_/libavutil/fifo.h
  29. +9 0 3rdparty/include/ffmpeg_/libavutil/file.h
  30. +10 2 3rdparty/include/ffmpeg_/libavutil/imgutils.h
  31. +73 0 3rdparty/include/ffmpeg_/libavutil/intfloat.h
  32. +6 6 3rdparty/include/ffmpeg_/libavutil/intfloat_readwrite.h
  33. +25 10 3rdparty/include/ffmpeg_/libavutil/log.h
  34. +27 16 3rdparty/include/ffmpeg_/libavutil/lzo.h
  35. +10 0 3rdparty/include/ffmpeg_/libavutil/mathematics.h
  36. +10 0 3rdparty/include/ffmpeg_/libavutil/md5.h
  37. +55 2 3rdparty/include/ffmpeg_/libavutil/mem.h
  38. +370 10 3rdparty/include/ffmpeg_/libavutil/opt.h
  39. +9 2 3rdparty/include/ffmpeg_/libavutil/parseutils.h
  40. +2 0  3rdparty/include/ffmpeg_/libavutil/pixdesc.h
  41. +52 13 3rdparty/include/ffmpeg_/libavutil/pixfmt.h
  42. +12 0 3rdparty/include/ffmpeg_/libavutil/random_seed.h
  43. +9 0 3rdparty/include/ffmpeg_/libavutil/rational.h
  44. +63 32 3rdparty/include/ffmpeg_/libavutil/samplefmt.h
  45. +10 0 3rdparty/include/ffmpeg_/libavutil/sha.h
  46. +39 47 3rdparty/include/ffmpeg_/libswscale/swscale.h
  47. +20 18 3rdparty/libjasper/CMakeLists.txt
  48. +2 2 3rdparty/libjasper/jpc_enc.c
  49. +12 15 3rdparty/libjpeg/CMakeLists.txt
  50. +11 20 3rdparty/libpng/CMakeLists.txt
  51. +202 257 3rdparty/libpng/README
  52. +2,870 918 3rdparty/libpng/png.c
  53. +1,308 1,351 3rdparty/libpng/png.h
  54. +368 1,297 3rdparty/libpng/pngconf.h
  55. +157 0 3rdparty/libpng/pngdebug.h
  56. +685 402 3rdparty/libpng/pngerror.c
  57. +1,124 925 3rdparty/libpng/pngget.c
  58. +269 0 3rdparty/libpng/pnginfo.h
  59. +187 0 3rdparty/libpng/pnglibconf.h
  60. +667 611 3rdparty/libpng/pngmem.c
  61. +1,843 1,765 3rdparty/libpng/pngpread.c
  62. +1,067 398 3rdparty/libpng/pngpriv.h
  63. +1,308 1,361 3rdparty/libpng/pngread.c
  64. +176 163 3rdparty/libpng/pngrio.c
  65. +5,023 4,203 3rdparty/libpng/pngrtran.c
  66. +4,158 3,381 3rdparty/libpng/pngrutil.c
  67. +1,284 1,167 3rdparty/libpng/pngset.c
  68. +358 0 3rdparty/libpng/pngstruct.h
  69. +1,820 1,630 3rdparty/libpng/pngtest.c
  70. BIN  3rdparty/libpng/pngtest.png
  71. +678 677 3rdparty/libpng/pngtrans.c
  72. +254 241 3rdparty/libpng/pngwio.c
  73. +1,655 1,457 3rdparty/libpng/pngwrite.c
  74. +633 566 3rdparty/libpng/pngwtran.c
Sorry, we could not display the entire diff because too many files (1,620) changed.
18 3rdparty/CMakeLists.txt
... ... @@ -1,18 +0,0 @@
1   -if(NOT ZLIB_FOUND)
2   - add_subdirectory(zlib)
3   -endif()
4   -if(WITH_JASPER AND NOT JASPER_FOUND)
5   - add_subdirectory(libjasper)
6   -endif()
7   -if(WITH_JPEG AND NOT JPEG_FOUND)
8   - add_subdirectory(libjpeg)
9   -endif()
10   -if(WITH_PNG AND NOT PNG_FOUND)
11   - add_subdirectory(libpng)
12   -endif()
13   -if(WITH_TIFF AND NOT TIFF_FOUND)
14   - add_subdirectory(libtiff)
15   -endif()
16   -if(WIN32)
17   - add_subdirectory(ffmpeg)
18   -endif()
20 3rdparty/ffmpeg/CMakeLists.txt
... ... @@ -1,20 +0,0 @@
1   -project(opencv_ffmpeg)
2   -
3   -if(MSVC64 OR MINGW64)
4   - set(FFMPEG_SUFFIX _64)
5   -endif()
6   -
7   -set(module_bare_name "opencv_ffmpeg${FFMPEG_SUFFIX}.dll")
8   -set(module_name "${CMAKE_CURRENT_SOURCE_DIR}/${module_bare_name}")
9   -
10   -get_target_property(bin_dir opencv_traincascade LOCATION)
11   -get_filename_component(bin_dir ${bin_dir} PATH)
12   -
13   -message(STATUS "ffmpeg output dir: ${bin_dir}")
14   -
15   -add_custom_target(opencv_ffmpeg ALL
16   - COMMAND ${CMAKE_COMMAND} -E copy
17   - ${module_name} ${bin_dir}/${module_bare_name}
18   - COMMENT "Copying ${module_name} to the output directory")
19   -
20   -install(FILES ${module_name} DESTINATION bin COMPONENT main)
11 3rdparty/ffmpeg/ffmpeg_version.cmake
... ... @@ -0,0 +1,11 @@
  1 +set(NEW_FFMPEG 1)
  2 +set(HAVE_FFMPEG_CODEC 1)
  3 +set(HAVE_FFMPEG_FORMAT 1)
  4 +set(HAVE_FFMPEG_UTIL 1)
  5 +set(HAVE_FFMPEG_SWSCALE 1)
  6 +set(HAVE_GENTOO_FFMPEG 1)
  7 +
  8 +set(ALIASOF_libavcodec_VERSION 53.61.100)
  9 +set(ALIASOF_libavformat_VERSION 53.32.100)
  10 +set(ALIASOF_libavutil_VERSION 51.35.100)
  11 +set(ALIASOF_libswscale_VERSION 2.1.100)
502 3rdparty/include/MultiMon.h
... ... @@ -0,0 +1,502 @@
  1 +//=============================================================================
  2 +//
  3 +// multimon.h -- Stub module that fakes multiple monitor apis on Win32 OSes
  4 +// without them.
  5 +//
  6 +// By using this header your code will get back default values from
  7 +// GetSystemMetrics() for new metrics, and the new multimonitor APIs
  8 +// will act like only one display is present on a Win32 OS without
  9 +// multimonitor APIs.
  10 +//
  11 +// Exactly one source must include this with COMPILE_MULTIMON_STUBS defined.
  12 +//
  13 +// Copyright (c) Microsoft Corporation. All rights reserved.
  14 +//
  15 +//=============================================================================
  16 +
  17 +#ifdef __cplusplus
  18 +extern "C" { // Assume C declarations for C++
  19 +#endif // __cplusplus
  20 +
  21 +//
  22 +// If we are building with Win95/NT4 headers, we need to declare
  23 +// the multimonitor-related metrics and APIs ourselves.
  24 +//
  25 +#ifndef SM_CMONITORS
  26 +
  27 +#define SM_XVIRTUALSCREEN 76
  28 +#define SM_YVIRTUALSCREEN 77
  29 +#define SM_CXVIRTUALSCREEN 78
  30 +#define SM_CYVIRTUALSCREEN 79
  31 +#define SM_CMONITORS 80
  32 +#define SM_SAMEDISPLAYFORMAT 81
  33 +
  34 +// HMONITOR is already declared if WINVER >= 0x0500 in windef.h
  35 +// This is for components built with an older version number.
  36 +//
  37 +#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
  38 +DECLARE_HANDLE(HMONITOR);
  39 +#define HMONITOR_DECLARED
  40 +#endif
  41 +
  42 +#define MONITOR_DEFAULTTONULL 0x00000000
  43 +#define MONITOR_DEFAULTTOPRIMARY 0x00000001
  44 +#define MONITOR_DEFAULTTONEAREST 0x00000002
  45 +
  46 +#define MONITORINFOF_PRIMARY 0x00000001
  47 +
  48 +typedef struct tagMONITORINFO
  49 +{
  50 + DWORD cbSize;
  51 + RECT rcMonitor;
  52 + RECT rcWork;
  53 + DWORD dwFlags;
  54 +} MONITORINFO, *LPMONITORINFO;
  55 +
  56 +#ifndef CCHDEVICENAME
  57 +#define CCHDEVICENAME 32
  58 +#endif
  59 +
  60 +#ifdef __cplusplus
  61 +typedef struct tagMONITORINFOEXA : public tagMONITORINFO
  62 +{
  63 + CHAR szDevice[CCHDEVICENAME];
  64 +} MONITORINFOEXA, *LPMONITORINFOEXA;
  65 +typedef struct tagMONITORINFOEXW : public tagMONITORINFO
  66 +{
  67 + WCHAR szDevice[CCHDEVICENAME];
  68 +} MONITORINFOEXW, *LPMONITORINFOEXW;
  69 +#ifdef UNICODE
  70 +typedef MONITORINFOEXW MONITORINFOEX;
  71 +typedef LPMONITORINFOEXW LPMONITORINFOEX;
  72 +#else
  73 +typedef MONITORINFOEXA MONITORINFOEX;
  74 +typedef LPMONITORINFOEXA LPMONITORINFOEX;
  75 +#endif // UNICODE
  76 +#else // ndef __cplusplus
  77 +typedef struct tagMONITORINFOEXA
  78 +{
  79 + MONITORINFO;
  80 + CHAR szDevice[CCHDEVICENAME];
  81 +} MONITORINFOEXA, *LPMONITORINFOEXA;
  82 +typedef struct tagMONITORINFOEXW
  83 +{
  84 + MONITORINFO;
  85 + WCHAR szDevice[CCHDEVICENAME];
  86 +} MONITORINFOEXW, *LPMONITORINFOEXW;
  87 +#ifdef UNICODE
  88 +typedef MONITORINFOEXW MONITORINFOEX;
  89 +typedef LPMONITORINFOEXW LPMONITORINFOEX;
  90 +#else
  91 +typedef MONITORINFOEXA MONITORINFOEX;
  92 +typedef LPMONITORINFOEXA LPMONITORINFOEX;
  93 +#endif // UNICODE
  94 +#endif
  95 +
  96 +typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM);
  97 +
  98 +#ifndef DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
  99 +typedef struct _DISPLAY_DEVICEA {
  100 + DWORD cb;
  101 + CHAR DeviceName[32];
  102 + CHAR DeviceString[128];
  103 + DWORD StateFlags;
  104 + CHAR DeviceID[128];
  105 + CHAR DeviceKey[128];
  106 +} DISPLAY_DEVICEA, *PDISPLAY_DEVICEA, *LPDISPLAY_DEVICEA;
  107 +typedef struct _DISPLAY_DEVICEW {
  108 + DWORD cb;
  109 + WCHAR DeviceName[32];
  110 + WCHAR DeviceString[128];
  111 + DWORD StateFlags;
  112 + WCHAR DeviceID[128];
  113 + WCHAR DeviceKey[128];
  114 +} DISPLAY_DEVICEW, *PDISPLAY_DEVICEW, *LPDISPLAY_DEVICEW;
  115 +#ifdef UNICODE
  116 +typedef DISPLAY_DEVICEW DISPLAY_DEVICE;
  117 +typedef PDISPLAY_DEVICEW PDISPLAY_DEVICE;
  118 +typedef LPDISPLAY_DEVICEW LPDISPLAY_DEVICE;
  119 +#else
  120 +typedef DISPLAY_DEVICEA DISPLAY_DEVICE;
  121 +typedef PDISPLAY_DEVICEA PDISPLAY_DEVICE;
  122 +typedef LPDISPLAY_DEVICEA LPDISPLAY_DEVICE;
  123 +#endif // UNICODE
  124 +
  125 +#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP 0x00000001
  126 +#define DISPLAY_DEVICE_MULTI_DRIVER 0x00000002
  127 +#define DISPLAY_DEVICE_PRIMARY_DEVICE 0x00000004
  128 +#define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008
  129 +#define DISPLAY_DEVICE_VGA_COMPATIBLE 0x00000010
  130 +#endif
  131 +
  132 +#endif // SM_CMONITORS
  133 +
  134 +#undef GetMonitorInfo
  135 +#undef GetSystemMetrics
  136 +#undef MonitorFromWindow
  137 +#undef MonitorFromRect
  138 +#undef MonitorFromPoint
  139 +#undef EnumDisplayMonitors
  140 +#undef EnumDisplayDevices
  141 +
  142 +//
  143 +// Define COMPILE_MULTIMON_STUBS to compile the stubs;
  144 +// otherwise, you get the declarations.
  145 +//
  146 +#ifdef COMPILE_MULTIMON_STUBS
  147 +
  148 +//-----------------------------------------------------------------------------
  149 +//
  150 +// Implement the API stubs.
  151 +//
  152 +//-----------------------------------------------------------------------------
  153 +
  154 +#ifndef _MULTIMON_USE_SECURE_CRT
  155 +#if defined(__GOT_SECURE_LIB__) && __GOT_SECURE_LIB__ >= 200402L
  156 +#define _MULTIMON_USE_SECURE_CRT 1
  157 +#else
  158 +#define _MULTIMON_USE_SECURE_CRT 0
  159 +#endif
  160 +#endif
  161 +
  162 +#ifndef MULTIMON_FNS_DEFINED
  163 +
  164 +int (WINAPI* g_pfnGetSystemMetrics)(int) = NULL;
  165 +HMONITOR (WINAPI* g_pfnMonitorFromWindow)(HWND, DWORD) = NULL;
  166 +HMONITOR (WINAPI* g_pfnMonitorFromRect)(LPCRECT, DWORD) = NULL;
  167 +HMONITOR (WINAPI* g_pfnMonitorFromPoint)(POINT, DWORD) = NULL;
  168 +BOOL (WINAPI* g_pfnGetMonitorInfo)(HMONITOR, LPMONITORINFO) = NULL;
  169 +BOOL (WINAPI* g_pfnEnumDisplayMonitors)(HDC, LPCRECT, MONITORENUMPROC, LPARAM) = NULL;
  170 +BOOL (WINAPI* g_pfnEnumDisplayDevices)(PVOID, DWORD, PDISPLAY_DEVICE,DWORD) = NULL;
  171 +BOOL g_fMultiMonInitDone = FALSE;
  172 +BOOL g_fMultimonPlatformNT = FALSE;
  173 +
  174 +#endif
  175 +
  176 +BOOL IsPlatformNT()
  177 +{
  178 + OSVERSIONINFOA osvi = {0};
  179 + osvi.dwOSVersionInfoSize = sizeof(osvi);
  180 + GetVersionExA((OSVERSIONINFOA*)&osvi);
  181 + return (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId);
  182 +}
  183 +
  184 +BOOL InitMultipleMonitorStubs(void)
  185 +{
  186 + HMODULE hUser32;
  187 + if (g_fMultiMonInitDone)
  188 + {
  189 + return g_pfnGetMonitorInfo != NULL;
  190 + }
  191 +
  192 + g_fMultimonPlatformNT = IsPlatformNT();
  193 + hUser32 = GetModuleHandle(TEXT("USER32"));
  194 + if (hUser32 &&
  195 + (*(FARPROC*)&g_pfnGetSystemMetrics = GetProcAddress(hUser32,"GetSystemMetrics")) != NULL &&
  196 + (*(FARPROC*)&g_pfnMonitorFromWindow = GetProcAddress(hUser32,"MonitorFromWindow")) != NULL &&
  197 + (*(FARPROC*)&g_pfnMonitorFromRect = GetProcAddress(hUser32,"MonitorFromRect")) != NULL &&
  198 + (*(FARPROC*)&g_pfnMonitorFromPoint = GetProcAddress(hUser32,"MonitorFromPoint")) != NULL &&
  199 + (*(FARPROC*)&g_pfnEnumDisplayMonitors = GetProcAddress(hUser32,"EnumDisplayMonitors")) != NULL &&
  200 +#ifdef UNICODE
  201 + (*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesW")) != NULL &&
  202 + (*(FARPROC*)&g_pfnGetMonitorInfo = g_fMultimonPlatformNT ? GetProcAddress(hUser32,"GetMonitorInfoW") :
  203 + GetProcAddress(hUser32,"GetMonitorInfoA")) != NULL
  204 +#else
  205 + (*(FARPROC*)&g_pfnGetMonitorInfo = GetProcAddress(hUser32,"GetMonitorInfoA")) != NULL &&
  206 + (*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesA")) != NULL
  207 +#endif
  208 + ) {
  209 + g_fMultiMonInitDone = TRUE;
  210 + return TRUE;
  211 + }
  212 + else
  213 + {
  214 + g_pfnGetSystemMetrics = NULL;
  215 + g_pfnMonitorFromWindow = NULL;
  216 + g_pfnMonitorFromRect = NULL;
  217 + g_pfnMonitorFromPoint = NULL;
  218 + g_pfnGetMonitorInfo = NULL;
  219 + g_pfnEnumDisplayMonitors = NULL;
  220 + g_pfnEnumDisplayDevices = NULL;
  221 +
  222 + g_fMultiMonInitDone = TRUE;
  223 + return FALSE;
  224 + }
  225 +}
  226 +
  227 +//-----------------------------------------------------------------------------
  228 +//
  229 +// fake implementations of Monitor APIs that work with the primary display
  230 +// no special parameter validation is made since these run in client code
  231 +//
  232 +//-----------------------------------------------------------------------------
  233 +
  234 +int WINAPI
  235 +xGetSystemMetrics(int nIndex)
  236 +{
  237 + if (InitMultipleMonitorStubs())
  238 + return g_pfnGetSystemMetrics(nIndex);
  239 +
  240 + switch (nIndex)
  241 + {
  242 + case SM_CMONITORS:
  243 + case SM_SAMEDISPLAYFORMAT:
  244 + return 1;
  245 +
  246 + case SM_XVIRTUALSCREEN:
  247 + case SM_YVIRTUALSCREEN:
  248 + return 0;
  249 +
  250 + case SM_CXVIRTUALSCREEN:
  251 + nIndex = SM_CXSCREEN;
  252 + break;
  253 +
  254 + case SM_CYVIRTUALSCREEN:
  255 + nIndex = SM_CYSCREEN;
  256 + break;
  257 + }
  258 +
  259 + return GetSystemMetrics(nIndex);
  260 +}
  261 +
  262 +#define xPRIMARY_MONITOR ((HMONITOR)0x12340042)
  263 +
  264 +HMONITOR WINAPI
  265 +xMonitorFromPoint(POINT ptScreenCoords, DWORD dwFlags)
  266 +{
  267 + if (InitMultipleMonitorStubs())
  268 + return g_pfnMonitorFromPoint(ptScreenCoords, dwFlags);
  269 +
  270 + if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
  271 + ((ptScreenCoords.x >= 0) &&
  272 + (ptScreenCoords.x < GetSystemMetrics(SM_CXSCREEN)) &&
  273 + (ptScreenCoords.y >= 0) &&
  274 + (ptScreenCoords.y < GetSystemMetrics(SM_CYSCREEN))))
  275 + {
  276 + return xPRIMARY_MONITOR;
  277 + }
  278 +
  279 + return NULL;
  280 +}
  281 +
  282 +HMONITOR WINAPI
  283 +xMonitorFromRect(LPCRECT lprcScreenCoords, DWORD dwFlags)
  284 +{
  285 + if (InitMultipleMonitorStubs())
  286 + return g_pfnMonitorFromRect(lprcScreenCoords, dwFlags);
  287 +
  288 + if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
  289 + ((lprcScreenCoords->right > 0) &&
  290 + (lprcScreenCoords->bottom > 0) &&
  291 + (lprcScreenCoords->left < GetSystemMetrics(SM_CXSCREEN)) &&
  292 + (lprcScreenCoords->top < GetSystemMetrics(SM_CYSCREEN))))
  293 + {
  294 + return xPRIMARY_MONITOR;
  295 + }
  296 +
  297 + return NULL;
  298 +}
  299 +
  300 +HMONITOR WINAPI
  301 +xMonitorFromWindow(HWND hWnd, DWORD dwFlags)
  302 +{
  303 + WINDOWPLACEMENT wp;
  304 +
  305 + if (InitMultipleMonitorStubs())
  306 + return g_pfnMonitorFromWindow(hWnd, dwFlags);
  307 +
  308 + if (dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST))
  309 + return xPRIMARY_MONITOR;
  310 +
  311 + if (IsIconic(hWnd) ?
  312 + GetWindowPlacement(hWnd, &wp) :
  313 + GetWindowRect(hWnd, &wp.rcNormalPosition)) {
  314 +
  315 + return xMonitorFromRect(&wp.rcNormalPosition, dwFlags);
  316 + }
  317 +
  318 + return NULL;
  319 +}
  320 +
  321 +BOOL WINAPI
  322 +xGetMonitorInfo(HMONITOR hMonitor, __inout LPMONITORINFO lpMonitorInfo)
  323 +{
  324 + RECT rcWork;
  325 +
  326 + if (InitMultipleMonitorStubs())
  327 + {
  328 + BOOL f = g_pfnGetMonitorInfo(hMonitor, lpMonitorInfo);
  329 +#ifdef UNICODE
  330 + if (f && !g_fMultimonPlatformNT && (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX)))
  331 + {
  332 + MultiByteToWideChar(CP_ACP, 0,
  333 + (LPSTR)((MONITORINFOEX*)lpMonitorInfo)->szDevice, -1,
  334 + ((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)));
  335 + }
  336 +#endif
  337 + return f;
  338 + }
  339 +
  340 + if ((hMonitor == xPRIMARY_MONITOR) &&
  341 + lpMonitorInfo &&
  342 + (lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) &&
  343 + SystemParametersInfoA(SPI_GETWORKAREA, 0, &rcWork, 0))
  344 + {
  345 + lpMonitorInfo->rcMonitor.left = 0;
  346 + lpMonitorInfo->rcMonitor.top = 0;
  347 + lpMonitorInfo->rcMonitor.right = GetSystemMetrics(SM_CXSCREEN);
  348 + lpMonitorInfo->rcMonitor.bottom = GetSystemMetrics(SM_CYSCREEN);
  349 + lpMonitorInfo->rcWork = rcWork;
  350 + lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY;
  351 +
  352 + if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX))
  353 + {
  354 +#ifdef UNICODE
  355 + MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, ((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)));
  356 +#else // UNICODE
  357 +#if _MULTIMON_USE_SECURE_CRT
  358 + strncpy_s(((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)), TEXT("DISPLAY"), (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)) - 1);
  359 +#else
  360 + lstrcpyn(((MONITORINFOEX*)lpMonitorInfo)->szDevice, TEXT("DISPLAY"), (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)));
  361 +#endif // _MULTIMON_USE_SECURE_CRT
  362 +#endif // UNICODE
  363 + }
  364 +
  365 + return TRUE;
  366 + }
  367 +
  368 + return FALSE;
  369 +}
  370 +
  371 +BOOL WINAPI
  372 +xEnumDisplayMonitors(
  373 + HDC hdcOptionalForPainting,
  374 + LPCRECT lprcEnumMonitorsThatIntersect,
  375 + MONITORENUMPROC lpfnEnumProc,
  376 + LPARAM dwData)
  377 +{
  378 + RECT rcLimit;
  379 +
  380 + if (InitMultipleMonitorStubs()) {
  381 + return g_pfnEnumDisplayMonitors(
  382 + hdcOptionalForPainting,
  383 + lprcEnumMonitorsThatIntersect,
  384 + lpfnEnumProc,
  385 + dwData);
  386 + }
  387 +
  388 + if (!lpfnEnumProc)
  389 + return FALSE;
  390 +
  391 + rcLimit.left = 0;
  392 + rcLimit.top = 0;
  393 + rcLimit.right = GetSystemMetrics(SM_CXSCREEN);
  394 + rcLimit.bottom = GetSystemMetrics(SM_CYSCREEN);
  395 +
  396 + if (hdcOptionalForPainting)
  397 + {
  398 + RECT rcClip;
  399 + POINT ptOrg;
  400 +
  401 + switch (GetClipBox(hdcOptionalForPainting, &rcClip))
  402 + {
  403 + default:
  404 + if (!GetDCOrgEx(hdcOptionalForPainting, &ptOrg))
  405 + return FALSE;
  406 +
  407 + OffsetRect(&rcLimit, -ptOrg.x, -ptOrg.y);
  408 + if (IntersectRect(&rcLimit, &rcLimit, &rcClip) &&
  409 + (!lprcEnumMonitorsThatIntersect ||
  410 + IntersectRect(&rcLimit, &rcLimit, lprcEnumMonitorsThatIntersect))) {
  411 +
  412 + break;
  413 + }
  414 + //fall thru
  415 + case NULLREGION:
  416 + return TRUE;
  417 + case ERROR:
  418 + return FALSE;
  419 + }
  420 + } else {
  421 + if ( lprcEnumMonitorsThatIntersect &&
  422 + !IntersectRect(&rcLimit, &rcLimit, lprcEnumMonitorsThatIntersect)) {
  423 +
  424 + return TRUE;
  425 + }
  426 + }
  427 +
  428 + return lpfnEnumProc(
  429 + xPRIMARY_MONITOR,
  430 + hdcOptionalForPainting,
  431 + &rcLimit,
  432 + dwData);
  433 +}
  434 +
  435 +BOOL WINAPI
  436 +xEnumDisplayDevices(
  437 + PVOID Unused,
  438 + DWORD iDevNum,
  439 + __inout PDISPLAY_DEVICE lpDisplayDevice,
  440 + DWORD dwFlags)
  441 +{
  442 + if (InitMultipleMonitorStubs())
  443 + return g_pfnEnumDisplayDevices(Unused, iDevNum, lpDisplayDevice, dwFlags);
  444 +
  445 + if (Unused != NULL)
  446 + return FALSE;
  447 +
  448 + if (iDevNum != 0)
  449 + return FALSE;
  450 +
  451 + if (lpDisplayDevice == NULL || lpDisplayDevice->cb < sizeof(DISPLAY_DEVICE))
  452 + return FALSE;
  453 +
  454 +#ifdef UNICODE
  455 + MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, lpDisplayDevice->DeviceName, (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)));
  456 + MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, lpDisplayDevice->DeviceString, (sizeof(lpDisplayDevice->DeviceString)/sizeof(TCHAR)));
  457 +#else // UNICODE
  458 +#if _MULTIMON_USE_SECURE_CRT
  459 + strncpy_s((LPTSTR)lpDisplayDevice->DeviceName, (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)), TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)) - 1);
  460 + strncpy_s((LPTSTR)lpDisplayDevice->DeviceString, (sizeof(lpDisplayDevice->DeviceString)/sizeof(TCHAR)), TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)) - 1);
  461 +#else
  462 + lstrcpyn((LPTSTR)lpDisplayDevice->DeviceName, TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)));
  463 + lstrcpyn((LPTSTR)lpDisplayDevice->DeviceString, TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceString)/sizeof(TCHAR)));
  464 +#endif // _MULTIMON_USE_SECURE_CRT
  465 +#endif // UNICODE
  466 +
  467 + lpDisplayDevice->StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_PRIMARY_DEVICE;
  468 +
  469 + return TRUE;
  470 +}
  471 +
  472 +#undef xPRIMARY_MONITOR
  473 +#undef COMPILE_MULTIMON_STUBS
  474 +
  475 +#else // COMPILE_MULTIMON_STUBS
  476 +
  477 +extern int WINAPI xGetSystemMetrics(int);
  478 +extern HMONITOR WINAPI xMonitorFromWindow(HWND, DWORD);
  479 +extern HMONITOR WINAPI xMonitorFromRect(LPCRECT, DWORD);
  480 +extern HMONITOR WINAPI xMonitorFromPoint(POINT, DWORD);
  481 +extern BOOL WINAPI xGetMonitorInfo(HMONITOR, LPMONITORINFO);
  482 +extern BOOL WINAPI xEnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM);
  483 +extern BOOL WINAPI xEnumDisplayDevices(PVOID, DWORD, PDISPLAY_DEVICE, DWORD);
  484 +
  485 +#endif // COMPILE_MULTIMON_STUBS
  486 +
  487 +//
  488 +// build defines that replace the regular APIs with our versions
  489 +//
  490 +#define GetSystemMetrics xGetSystemMetrics
  491 +#define MonitorFromWindow xMonitorFromWindow
  492 +#define MonitorFromRect xMonitorFromRect
  493 +#define MonitorFromPoint xMonitorFromPoint
  494 +#define GetMonitorInfo xGetMonitorInfo
  495 +#define EnumDisplayMonitors xEnumDisplayMonitors
  496 +#define EnumDisplayDevices xEnumDisplayDevices
  497 +
  498 +#ifdef __cplusplus
  499 +}
  500 +#endif // __cplusplus
  501 +
  502 +
1,522 3rdparty/include/ffmpeg_/libavcodec/avcodec.h
@@ -30,8 +30,43 @@
30 30 #include "libavutil/samplefmt.h"
31 31 #include "libavutil/avutil.h"
32 32 #include "libavutil/cpu.h"
  33 +#include "libavutil/dict.h"
  34 +#include "libavutil/log.h"
  35 +#include "libavutil/pixfmt.h"
  36 +#include "libavutil/rational.h"
33 37
34 38 #include "libavcodec/version.h"
  39 +/**
  40 + * @defgroup libavc Encoding/Decoding Library
  41 + * @{
  42 + *
  43 + * @defgroup lavc_decoding Decoding
  44 + * @{
  45 + * @}
  46 + *
  47 + * @defgroup lavc_encoding Encoding
  48 + * @{
  49 + * @}
  50 + *
  51 + * @defgroup lavc_codec Codecs
  52 + * @{
  53 + * @defgroup lavc_codec_native Native Codecs
  54 + * @{
  55 + * @}
  56 + * @defgroup lavc_codec_wrappers External library wrappers
  57 + * @{
  58 + * @}
  59 + * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge
  60 + * @{
  61 + * @}
  62 + * @}
  63 + * @defgroup lavc_internal Internal
  64 + * @{
  65 + * @}
  66 + * @}
  67 + *
  68 + */
  69 +
35 70
36 71 /**
37 72 * Identify the syntax and semantics of the bitstream.
@@ -43,7 +78,8 @@
43 78 *
44 79 * If you add a codec ID to this list, add it so that
45 80 * 1. no value of a existing codec ID changes (that would break ABI),
46   - * 2. it is as close as possible to similar codecs.
  81 + * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec.
  82 + * This ensures that 2 forks can independantly add CodecIDs without producing conflicts.
47 83 */
48 84 enum CodecID {
49 85 CODEC_ID_NONE,
@@ -148,7 +184,9 @@ enum CodecID {
148 184 CODEC_ID_TIERTEXSEQVIDEO,
149 185 CODEC_ID_TIFF,
150 186 CODEC_ID_GIF,
  187 +#if LIBAVCODEC_VERSION_MAJOR == 53
151 188 CODEC_ID_FFH264,
  189 +#endif
152 190 CODEC_ID_DXA,
153 191 CODEC_ID_DNXHD,
154 192 CODEC_ID_THP,
@@ -166,8 +204,10 @@ enum CodecID {
166 204 CODEC_ID_INDEO5,
167 205 CODEC_ID_MIMIC,
168 206 CODEC_ID_RL2,
  207 +#if LIBAVCODEC_VERSION_MAJOR == 53
169 208 CODEC_ID_8SVX_EXP,
170 209 CODEC_ID_8SVX_FIB,
  210 +#endif
171 211 CODEC_ID_ESCAPE124,
172 212 CODEC_ID_DIRAC,
173 213 CODEC_ID_BFI,
@@ -204,10 +244,30 @@ enum CodecID {
204 244 CODEC_ID_PRORES,
205 245 CODEC_ID_JV,
206 246 CODEC_ID_DFA,
207   - CODEC_ID_8SVX_RAW,
  247 + CODEC_ID_WMV3IMAGE,
  248 + CODEC_ID_VC1IMAGE,
  249 +#if LIBAVCODEC_VERSION_MAJOR == 53
  250 + CODEC_ID_G723_1_DEPRECATED,
  251 + CODEC_ID_G729_DEPRECATED,
  252 +#endif
  253 + CODEC_ID_UTVIDEO_DEPRECATED,
  254 + CODEC_ID_BMV_VIDEO,
  255 + CODEC_ID_VBLE,
  256 + CODEC_ID_DXTORY,
  257 + CODEC_ID_V410,
  258 + CODEC_ID_XWD,
  259 + CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
  260 + CODEC_ID_UTVIDEO = 0x800,
  261 + CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
  262 + CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
  263 +
  264 + CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
  265 + CODEC_ID_V308 = MKBETAG('V','3','0','8'),
  266 + CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
208 267
209 268 /* various PCM "codecs" */
210   - CODEC_ID_PCM_S16LE= 0x10000,
  269 + CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
  270 + CODEC_ID_PCM_S16LE = 0x10000,
211 271 CODEC_ID_PCM_S16BE,
212 272 CODEC_ID_PCM_U16LE,
213 273 CODEC_ID_PCM_U16BE,
@@ -234,9 +294,10 @@ enum CodecID {
234 294 CODEC_ID_PCM_BLURAY,
235 295 CODEC_ID_PCM_LXF,
236 296 CODEC_ID_S302M,
  297 + CODEC_ID_PCM_S8_PLANAR,
237 298
238 299 /* various ADPCM codecs */
239   - CODEC_ID_ADPCM_IMA_QT= 0x11000,
  300 + CODEC_ID_ADPCM_IMA_QT = 0x11000,
240 301 CODEC_ID_ADPCM_IMA_WAV,
241 302 CODEC_ID_ADPCM_IMA_DK3,
242 303 CODEC_ID_ADPCM_IMA_DK4,
@@ -265,23 +326,24 @@ enum CodecID {
265 326 CODEC_ID_ADPCM_EA_MAXIS_XA,
266 327 CODEC_ID_ADPCM_IMA_ISS,
267 328 CODEC_ID_ADPCM_G722,
  329 + CODEC_ID_ADPCM_IMA_APC,
268 330
269 331 /* AMR */
270   - CODEC_ID_AMR_NB= 0x12000,
  332 + CODEC_ID_AMR_NB = 0x12000,
271 333 CODEC_ID_AMR_WB,
272 334
273 335 /* RealAudio codecs*/
274   - CODEC_ID_RA_144= 0x13000,
  336 + CODEC_ID_RA_144 = 0x13000,
275 337 CODEC_ID_RA_288,
276 338
277 339 /* various DPCM codecs */
278   - CODEC_ID_ROQ_DPCM= 0x14000,
  340 + CODEC_ID_ROQ_DPCM = 0x14000,
279 341 CODEC_ID_INTERPLAY_DPCM,
280 342 CODEC_ID_XAN_DPCM,
281 343 CODEC_ID_SOL_DPCM,
282 344
283 345 /* audio codecs */
284   - CODEC_ID_MP2= 0x15000,
  346 + CODEC_ID_MP2 = 0x15000,
285 347 CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
286 348 CODEC_ID_AAC,
287 349 CODEC_ID_AC3,
@@ -293,8 +355,10 @@ enum CodecID {
293 355 CODEC_ID_MACE3,
294 356 CODEC_ID_MACE6,
295 357 CODEC_ID_VMDAUDIO,
  358 +#if LIBAVCODEC_VERSION_MAJOR == 53
296 359 CODEC_ID_SONIC,
297 360 CODEC_ID_SONIC_LS,
  361 +#endif
298 362 CODEC_ID_FLAC,
299 363 CODEC_ID_MP3ADU,
300 364 CODEC_ID_MP3ON4,
@@ -336,9 +400,21 @@ enum CodecID {
336 400 CODEC_ID_AAC_LATM,
337 401 CODEC_ID_QDMC,
338 402 CODEC_ID_CELT,
  403 +#if LIBAVCODEC_VERSION_MAJOR > 53
  404 + CODEC_ID_G723_1_DEPRECATED,
  405 + CODEC_ID_G729_DEPRECATED,
  406 + CODEC_ID_8SVX_EXP,
  407 + CODEC_ID_8SVX_FIB,
  408 +#endif
  409 + CODEC_ID_BMV_AUDIO,
  410 + CODEC_ID_G729 = 0x15800,
  411 + CODEC_ID_G723_1= 0x15801,
  412 + CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
  413 + CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
339 414
340 415 /* subtitle codecs */
341   - CODEC_ID_DVD_SUBTITLE= 0x17000,
  416 + CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
  417 + CODEC_ID_DVD_SUBTITLE = 0x17000,
342 418 CODEC_ID_DVB_SUBTITLE,
343 419 CODEC_ID_TEXT, ///< raw UTF-8 text
344 420 CODEC_ID_XSUB,
@@ -347,16 +423,22 @@ enum CodecID {
347 423 CODEC_ID_HDMV_PGS_SUBTITLE,
348 424 CODEC_ID_DVB_TELETEXT,
349 425 CODEC_ID_SRT,
350   - CODEC_ID_MICRODVD,
  426 + CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
351 427
352 428 /* other specific kind of codecs (generally used for attachments) */
353   - CODEC_ID_TTF= 0x18000,
  429 + CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
  430 + CODEC_ID_TTF = 0x18000,
  431 + CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
  432 + CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
  433 + CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
354 434
355   - CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
  435 + CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
356 436
357   - CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
  437 + CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
  438 + * stream (only used by libavformat) */
  439 + CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
358 440 * stream (only used by libavformat) */
359   - CODEC_ID_FFMETADATA=0x21000, ///< Dummy codec for streams containing only metadata information.
  441 + CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
360 442 };
361 443
362 444 #if FF_API_OLD_SAMPLE_FMT
@@ -419,8 +501,10 @@ enum CodecID {
419 501 #define CH_LAYOUT_STEREO_DOWNMIX AV_CH_LAYOUT_STEREO_DOWNMIX
420 502 #endif
421 503
  504 +#if FF_API_OLD_DECODE_AUDIO
422 505 /* in bytes */
423 506 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
  507 +#endif
424 508
425 509 /**
426 510 * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
@@ -429,7 +513,7 @@ enum CodecID {
429 513 * Note: If the first 23 bits of the additional bytes are not 0, then damaged
430 514 * MPEG bitstreams could cause overread and segfault.
431 515 */
432   -#define FF_INPUT_BUFFER_PADDING_SIZE 8
  516 +#define FF_INPUT_BUFFER_PADDING_SIZE 16
433 517
434 518 /**
435 519 * minimum encoding buffer size
@@ -481,6 +565,7 @@ enum AVColorTransferCharacteristic{
481 565 AVCOL_TRC_UNSPECIFIED=2,
482 566 AVCOL_TRC_GAMMA22 =4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
483 567 AVCOL_TRC_GAMMA28 =5, ///< also ITU-R BT470BG
  568 + AVCOL_TRC_SMPTE240M =7,
484 569 AVCOL_TRC_NB , ///< Not part of ABI
485 570 };
486 571
@@ -492,6 +577,7 @@ enum AVColorSpace{
492 577 AVCOL_SPC_BT470BG =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
493 578 AVCOL_SPC_SMPTE170M =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
494 579 AVCOL_SPC_SMPTE240M =7,
  580 + AVCOL_SPC_YCGCO =8,
495 581 AVCOL_SPC_NB , ///< Not part of ABI
496 582 };
497 583
@@ -522,7 +608,7 @@ enum AVChromaLocation{
522 608 /**
523 609 * LPC analysis type
524 610 */
525   -attribute_deprecated enum AVLPCType {
  611 +enum AVLPCType {
526 612 AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type
527 613 AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients
528 614 AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients
@@ -564,7 +650,6 @@ typedef struct RcOverride{
564 650 #define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC.
565 651 #define CODEC_FLAG_GMC 0x0020 ///< Use GMC.
566 652 #define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>.
567   -#define CODEC_FLAG_PART 0x0080 ///< Use data partitioning.
568 653 /**
569 654 * The parent program guarantees that the input for B-frames containing
570 655 * streams is not written to for at least s->max_b_frames+1 frames, if
@@ -573,7 +658,6 @@ typedef struct RcOverride{
573 658 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
574 659 #define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode.
575 660 #define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode.
576   -#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG).
577 661 #define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale.
578 662 #define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges.
579 663 #define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding.
@@ -582,25 +666,43 @@ typedef struct RcOverride{
582 666 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< Normalize adaptive quantization.
583 667 #define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
584 668 #define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay.
585   -#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan.
586 669 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe.
587 670 #define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT).
588 671 /* Fx : Flag for h263+ extra options */
589 672 #define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
590   -#define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector
591 673 #define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.
592 674 #define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon.
593   -#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H.263 alternative inter VLC
594   -#define CODEC_FLAG_OBMC 0x00000001 ///< OBMC
595 675 #define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter
596   -#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
597 676 #define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation
598   -#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
599 677 #define CODEC_FLAG_CLOSED_GOP 0x80000000
600 678 #define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks.
601 679 #define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size.
602 680 #define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
603 681 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
  682 +#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping
  683 +#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
  684 +#define CODEC_FLAG2_SHOW_ALL 0x00400000 ///< Show all frames before the first keyframe
  685 +/**
  686 + * @defgroup deprecated_flags Deprecated codec flags
  687 + * Use corresponding private codec options instead.
  688 + * @{
  689 + */
  690 +#if FF_API_MPEGVIDEO_GLOBAL_OPTS
  691 +#define CODEC_FLAG_OBMC 0x00000001 ///< OBMC
  692 +#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H.263 alternative inter VLC
  693 +#define CODEC_FLAG_PART 0x0080 ///< Use data partitioning.
  694 +#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan.
  695 +#define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector
  696 +#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
  697 +#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
  698 +#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table.
  699 +#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
  700 +#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
  701 +#endif
  702 +#if FF_API_MJPEG_GLOBAL_OPTS
  703 +#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG).
  704 +#endif
  705 +#if FF_API_X264_GLOBAL_OPTS
604 706 #define CODEC_FLAG2_BPYRAMID 0x00000010 ///< H.264 allow B-frames to be used as references.
605 707 #define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for B-frames
606 708 #define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
@@ -608,17 +710,20 @@ typedef struct RcOverride{
608 710 #define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip
609 711 #define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters
610 712 #define CODEC_FLAG2_BRDO 0x00000400 ///< B-frame rate-distortion optimization
611   -#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table.
612   -#define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC).
613   -#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
614   -#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping
615   -#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
616   -#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
617   -#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
618 713 #define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
619 714 #define CODEC_FLAG2_PSY 0x00080000 ///< Use psycho visual optimizations.
620 715 #define CODEC_FLAG2_SSIM 0x00100000 ///< Compute SSIM during encoding, error[] values are undefined.
621 716 #define CODEC_FLAG2_INTRA_REFRESH 0x00200000 ///< Use periodic insertion of intra blocks instead of keyframes.
  717 +#endif
  718 +#if FF_API_SNOW_GLOBAL_OPTS
  719 +#define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC).
  720 +#endif
  721 +#if FF_API_LAME_GLOBAL_OPTS
  722 +#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
  723 +#endif
  724 +/**
  725 + * @}
  726 + */
622 727
623 728 /* Unsupported options :
624 729 * Syntax Arithmetic coding (SAC)
@@ -634,14 +739,35 @@ typedef struct RcOverride{
634 739 * assume the buffer was allocated by avcodec_default_get_buffer.
635 740 */
636 741 #define CODEC_CAP_DR1 0x0002
  742 +#if FF_API_PARSE_FRAME
637 743 /* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
638 744 #define CODEC_CAP_PARSE_ONLY 0x0004
  745 +#endif
639 746 #define CODEC_CAP_TRUNCATED 0x0008
640 747 /* Codec can export data for HW decoding (XvMC). */
641 748 #define CODEC_CAP_HWACCEL 0x0010
642 749 /**
643   - * Codec has a nonzero delay and needs to be fed with NULL at the end to get the delayed data.
644   - * If this is not set, the codec is guaranteed to never be fed with NULL data.
  750 + * Encoder or decoder requires flushing with NULL input at the end in order to
  751 + * give the complete and correct output.
  752 + *
  753 + * NOTE: If this flag is not set, the codec is guaranteed to never be fed with
  754 + * with NULL data. The user can still send NULL data to the public encode
  755 + * or decode function, but libavcodec will not pass it along to the codec
  756 + * unless this flag is set.
  757 + *
  758 + * Decoders:
  759 + * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
  760 + * avpkt->size=0 at the end to get the delayed data until the decoder no longer
  761 + * returns frames.
  762 + *
  763 + * Encoders:
  764 + * The encoder needs to be fed with NULL data at the end of encoding until the
  765 + * encoder no longer returns data.
  766 + *
  767 + * NOTE: For encoders implementing the AVCodec.encode2() function, setting this
  768 + * flag also means that the encoder must set the pts and duration for
  769 + * each output packet. If this flag is not set, the pts and duration will
  770 + * be determined by libavcodec from the input frame.
645 771 */
646 772 #define CODEC_CAP_DELAY 0x0020
647 773 /**
@@ -689,6 +815,18 @@ typedef struct RcOverride{
689 815 */
690 816 #define CODEC_CAP_SLICE_THREADS 0x2000
691 817 /**
  818 + * Codec supports changed parameters at any point.
  819 + */
  820 +#define CODEC_CAP_PARAM_CHANGE 0x4000
  821 +/**
  822 + * Codec supports avctx->thread_count == 0 (auto).
  823 + */
  824 +#define CODEC_CAP_AUTO_THREADS 0x8000
  825 +/**
  826 + * Audio encoder supports receiving a different number of samples in each call.
  827 + */
  828 +#define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
  829 +/**
692 830 * Codec is lossless.
693 831 */
694 832 #define CODEC_CAP_LOSSLESS 0x80000000
@@ -746,304 +884,6 @@ typedef struct AVPanScan{
746 884 int16_t position[3][2];
747 885 }AVPanScan;
748 886
749   -#define FF_COMMON_FRAME \
750   - /**\
751   - * pointer to the picture planes.\
752   - * This might be different from the first allocated byte\
753   - * - encoding: \
754   - * - decoding: \
755   - */\
756   - uint8_t *data[4];\
757   - int linesize[4];\
758   - /**\
759   - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.\
760   - * This isn't used by libavcodec unless the default get/release_buffer() is used.\
761   - * - encoding: \
762   - * - decoding: \
763   - */\
764   - uint8_t *base[4];\
765   - /**\
766   - * 1 -> keyframe, 0-> not\
767   - * - encoding: Set by libavcodec.\
768   - * - decoding: Set by libavcodec.\
769   - */\
770   - int key_frame;\
771   -\
772   - /**\
773   - * Picture type of the frame, see ?_TYPE below.\
774   - * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
775   - * - decoding: Set by libavcodec.\
776   - */\
777   - enum AVPictureType pict_type;\
778   -\
779   - /**\
780   - * presentation timestamp in time_base units (time when frame should be shown to user)\
781   - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.\
782   - * - encoding: MUST be set by user.\
783   - * - decoding: Set by libavcodec.\
784   - */\
785   - int64_t pts;\
786   -\
787   - /**\
788   - * picture number in bitstream order\
789   - * - encoding: set by\
790   - * - decoding: Set by libavcodec.\
791   - */\
792   - int coded_picture_number;\
793   - /**\
794   - * picture number in display order\
795   - * - encoding: set by\
796   - * - decoding: Set by libavcodec.\
797   - */\
798   - int display_picture_number;\
799   -\
800   - /**\
801   - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \
802   - * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
803   - * - decoding: Set by libavcodec.\
804   - */\
805   - int quality; \
806   -\
807   - /**\
808   - * buffer age (1->was last buffer and dint change, 2->..., ...).\
809   - * Set to INT_MAX if the buffer has not been used yet.\
810   - * - encoding: unused\
811   - * - decoding: MUST be set by get_buffer().\
812   - */\
813   - int age;\
814   -\
815   - /**\
816   - * is this picture used as reference\
817   - * The values for this are the same as the MpegEncContext.picture_structure\
818   - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields.\
819   - * Set to 4 for delayed, non-reference frames.\
820   - * - encoding: unused\
821   - * - decoding: Set by libavcodec. (before get_buffer() call)).\
822   - */\
823   - int reference;\
824   -\
825   - /**\
826   - * QP table\
827   - * - encoding: unused\
828   - * - decoding: Set by libavcodec.\
829   - */\
830   - int8_t *qscale_table;\
831   - /**\
832   - * QP store stride\
833   - * - encoding: unused\
834   - * - decoding: Set by libavcodec.\
835   - */\
836   - int qstride;\
837   -\
838   - /**\
839   - * mbskip_table[mb]>=1 if MB didn't change\
840   - * stride= mb_width = (width+15)>>4\
841   - * - encoding: unused\
842   - * - decoding: Set by libavcodec.\
843   - */\
844   - uint8_t *mbskip_table;\
845   -\
846   - /**\
847   - * motion vector table\
848   - * @code\
849   - * example:\
850   - * int mv_sample_log2= 4 - motion_subsample_log2;\
851   - * int mb_width= (width+15)>>4;\
852   - * int mv_stride= (mb_width << mv_sample_log2) + 1;\
853   - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];\
854   - * @endcode\
855   - * - encoding: Set by user.\
856   - * - decoding: Set by libavcodec.\
857   - */\
858   - int16_t (*motion_val[2])[2];\
859   -\
860   - /**\
861   - * macroblock type table\
862   - * mb_type_base + mb_width + 2\
863   - * - encoding: Set by user.\
864   - * - decoding: Set by libavcodec.\
865   - */\
866   - uint32_t *mb_type;\
867   -\
868   - /**\
869   - * log2 of the size of the block which a single vector in motion_val represents: \
870   - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)\
871   - * - encoding: unused\
872   - * - decoding: Set by libavcodec.\