1576{
1585
1588
1589
1591
1592
1595 ERR(
": not an AVI!\n");
1597 }
1598
1599
1604
1605
1610
1611 if (ck.
cksize !=
sizeof(MainAVIHdr)) {
1612 ERR(
": invalid size of %d for MainAVIHeader!\n", ck.
cksize);
1614 }
1617
1618
1620 WARN(
"file contains %u streams, but only supports %d -- change MAX_AVISTREAMS!\n", MainAVIHdr.dwStreams,
MAX_AVISTREAMS);
1622 }
1623
1624
1626 This->uMode &= ~MMIO_RWMODE;
1628 }
1629
1630
1632 This->fInfo.dwRate = MainAVIHdr.dwMicroSecPerFrame;
1633 This->fInfo.dwScale = 1000000;
1634 This->fInfo.dwMaxBytesPerSec = MainAVIHdr.dwMaxBytesPerSec;
1635 This->fInfo.dwFlags = MainAVIHdr.dwFlags;
1637 This->fInfo.dwLength = MainAVIHdr.dwTotalFrames;
1638 This->fInfo.dwStreams = MainAVIHdr.dwStreams;
1639 This->fInfo.dwSuggestedBufferSize = 0;
1640 This->fInfo.dwWidth = MainAVIHdr.dwWidth;
1641 This->fInfo.dwHeight = MainAVIHdr.dwHeight;
1644
1645
1648
1649
1650 for (nStream = 0; nStream <
This->fInfo.dwStreams; nStream++) {
1651
1654
1655
1658 pStream =
This->ppStreams[nStream] =
1660 if (pStream ==
NULL)
1663
1674
1677 break;
1682 break;
1683
1688
1691
1694
1695
1704 }
1709
1710
1713 }
1714 break;
1716 {
1717 static const WCHAR streamTypeFmt[] = {
'%',
'4',
'.',
'4',
'h',
's',0};
1718 static const WCHAR streamNameFmt[] = {
'%',
's',
' ',
'%',
's',
' ',
'#',
'%',
'd',0};
1719
1724
1725 if (ck.
cksize >
sizeof(streamHdr))
1726 n =
sizeof(streamHdr);
1727
1730
1750
1751
1756 else
1757 wsprintfW(szType, streamTypeFmt, (
char*)&streamHdr.fccType);
1758
1759
1761 for (
n = nStream; 0 <=
n;
n--) {
1762 if (
This->ppStreams[
n]->sInfo.fccHandler == streamHdr.fccType)
1764 }
1765
1767
1768
1771 }
1772 break;
1774 {
1778
1780 {
1783 }
1784
1787
1789 }
1790 break;
1793 break;
1794 default:
1795 WARN(
": found extra chunk 0x%08X\n", ck.
ckid);
1799 };
1801 {
1807 }
1810 }
1811 } else {
1812
1816 }
1819 }
1820
1821
1825
1826
1832
1837
1838
1844 This->fInfo.dwFlags &= ~AVIFILEINFO_HASINDEX;
1845 }
1846
1847
1848
1850 for (nStream = 0; nStream <
This->fInfo.dwStreams; nStream++)
1851 This->ppStreams[nStream]->lLastFrame = -1;
1852
1854 ERR(
": Oops, can't seek back to 'movi' chunk!\n");
1856 }
1857
1858
1863
1864 if (nStream >
This->fInfo.dwStreams)
1866
1869 } else {
1871 WARN(
": file seems to be truncated!\n");
1872 if (nStream <= This->fInfo.dwStreams &&
1873 This->ppStreams[nStream]->sInfo.dwSampleSize > 0) {
1877 ck.
cksize &= ~(
This->ppStreams[nStream]->sInfo.dwSampleSize - 1);
1878
1881 }
1882 }
1883 }
1884 }
1885 }
1886 }
1887
1888 for (nStream = 0; nStream <
This->fInfo.dwStreams; nStream++)
1889 {
1890 DWORD sugbuf =
This->ppStreams[nStream]->sInfo.dwSuggestedBufferSize;
1891 if (
This->fInfo.dwSuggestedBufferSize < sugbuf)
1892 This->fInfo.dwSuggestedBufferSize = sugbuf;
1893 }
1894
1895
1897
1899}
static void AVIFILE_ConstructAVIStream(IAVIFileImpl *paf, DWORD nr, const AVISTREAMINFOW *asi)
static HRESULT AVIFILE_LoadIndex(const IAVIFileImpl *This, DWORD size, DWORD offset)
static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DWORD offset, DWORD flags)
LPCWSTR AVIFILE_BasenameW(LPCWSTR szFileName) DECLSPEC_HIDDEN
#define DIBWIDTHBYTES(bi)
#define MultiByteToWideChar
MMRESULT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags)
LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, const MMCKINFO *lpckParent, UINT uFlags)
LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch)
GLuint GLuint GLsizei count
#define mmioFOURCC(c0, c1, c2, c3)
#define listtypeSTREAMHEADER
#define AVIERR_UNSUPPORTED
#define listtypeAVIHEADER
#define ckidSTREAMHANDLERDATA
#define AVIFILEINFO_HASINDEX
#define AVIFILEINFO_COPYRIGHTED
#define StreamFromFOURCC(fcc)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)