VDAudioSourceWAV::VDAudioSourceWAV(VDInputFileWAV *parent) : mpParent(parent) , mBytesPerSample(parent->GetBytesPerSample()) { mSampleFirst = 0; mSampleLast = parent->GetDataLength() / mBytesPerSample; const vdstructex<VDWaveFormat>& format = parent->GetFormat(); memcpy(allocFormat(format.size()), format.data(), format.size()); streamInfo.fccType = streamtypeAUDIO; streamInfo.fccHandler = 0; streamInfo.dwFlags = 0; streamInfo.wPriority = 0; streamInfo.wLanguage = 0; streamInfo.dwInitialFrames = 0; streamInfo.dwScale = mBytesPerSample; streamInfo.dwRate = getWaveFormat()->mDataRate; streamInfo.dwStart = 0; streamInfo.dwLength = VDClampToUint32(mSampleLast); streamInfo.dwSuggestedBufferSize = 0; streamInfo.dwQuality = 0xffffffff; streamInfo.dwSampleSize = mBytesPerSample; }
VDVideoSourceFLM::VDVideoSourceFLM(IVDInputFileFLM *parent) : mpParent(parent) , mFrameSize(parent->GetFrameSize()) , mVisibleFrameSize(parent->GetVisibleFrameSize()) , mWidth(parent->GetFrameWidth()) , mHeight(parent->GetFrameHeight()) { mpTargetFormatHeader.resize(sizeof(BITMAPINFOHEADER)); mSampleFirst = 0; mSampleLast = mpParent->GetFrameCount(); memset(&streamInfo, 0, sizeof streamInfo); streamInfo.fccType = VDAVIStreamInfo::kTypeVideo; streamInfo.dwLength = (DWORD)mSampleLast; const VDFraction& rate = mpParent->GetFrameRate(); streamInfo.dwRate = rate.getHi(); streamInfo.dwScale = rate.getLo(); streamInfo.rcFrameLeft = 0; streamInfo.rcFrameTop = 0; streamInfo.rcFrameRight = (uint16)mWidth; streamInfo.rcFrameBottom = (uint16)mHeight; BITMAPINFOHEADER& bih = *(BITMAPINFOHEADER *)allocFormat(sizeof(BITMAPINFOHEADER)); bih.biSize = sizeof(BITMAPINFOHEADER); bih.biWidth = mpParent->GetFrameWidth(); bih.biHeight = mpParent->GetFrameHeight(); bih.biPlanes = 1; bih.biCompression = (uint32)0xFFFFFFFF; bih.biBitCount = 32; bih.biSizeImage = mVisibleFrameSize; bih.biXPelsPerMeter = 0; bih.biYPelsPerMeter = 0; bih.biClrUsed = 0; bih.biClrImportant = 0; AllocFrameBuffer(mVisibleFrameSize); }
VideoSourceImages::VideoSourceImages(VDInputFileImages *parent) : mpParent(parent) , mCachedHandleFrame(-1) { mSampleFirst = 0; mpTargetFormatHeader.resize(sizeof(BITMAPINFOHEADER)); allocFormat(sizeof(BITMAPINFOHEADER)); invalidateFrameBuffer(); // This has to be 1 so that read() doesn't kick away the request. mSampleLast = mpParent->GetFrameCount(); getFrame(0); // Fill out streamInfo extern const VDFraction& VDPreferencesGetImageSequenceFrameRate(); const VDFraction& fr = VDPreferencesGetImageSequenceFrameRate(); streamInfo.fccType = VDAVIStreamInfo::kTypeVideo; streamInfo.fccHandler = NULL; streamInfo.dwFlags = 0; streamInfo.dwCaps = 0; streamInfo.wPriority = 0; streamInfo.wLanguage = 0; streamInfo.dwScale = fr.getLo(); streamInfo.dwRate = fr.getHi(); streamInfo.dwStart = 0; streamInfo.dwLength = VDClampToUint32(mSampleLast); streamInfo.dwInitialFrames = 0; streamInfo.dwSuggestedBufferSize = 0; streamInfo.dwQuality = (DWORD)-1; streamInfo.dwSampleSize = 0; streamInfo.rcFrameLeft = 0; streamInfo.rcFrameTop = 0; streamInfo.rcFrameRight = (uint16)getImageFormat()->biWidth; streamInfo.rcFrameBottom = (uint16)getImageFormat()->biHeight; }