本文整理汇总了C++中AVIFileExit函数的典型用法代码示例。如果您正苦于以下问题:C++ AVIFileExit函数的具体用法?C++ AVIFileExit怎么用?C++ AVIFileExit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AVIFileExit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AVIFileInit
bool CAviHelper::AVI_resolution(const wstring& strAviFileName, int& width, int& height)
{
AVIFileInit();
PAVIFILE avi;
int res = AVIFileOpen(&avi, WS2S(strAviFileName).c_str(), OF_READ, NULL);
int n = GetLastError();
if (res!=AVIERR_OK)
{
//an error occures
if (avi!=NULL)
AVIFileRelease(avi);
return false;
}
AVIFILEINFO avi_info;
memset(&avi_info, 0, sizeof(AVIFILEINFO));
res = AVIFileInfo(avi, &avi_info, sizeof(AVIFILEINFO));
if( res != AVIERR_OK)
{
AVIFileExit();
return false;
}
width = avi_info.dwWidth;
height = avi_info.dwHeight;
AVIFileExit();
return true;
}
示例2: fprintf
void MovieMaker::EndCapture()
{
fprintf( stderr, "\n" );
if (ps)
{
AVIStreamClose(ps);
ps = NULL;
}
if (psCompressed)
{
AVIStreamClose(psCompressed);
psCompressed = NULL;
}
if (psText)
{
AVIStreamClose(psText);
psText = NULL;
}
if (pfile)
{
AVIFileClose(pfile);
pfile = NULL;
}
WORD wVer = HIWORD(VideoForWindowsVersion());
if (wVer >= 0x010A)
{
AVIFileExit();
}
}
示例3: AVIStreamClose
void AviRecorder::Stop()
{
m_fAudioReady = false;
if (m_pstmVideo != NULL) {
AVIStreamClose(m_pstmVideo);
m_pstmVideo = NULL;
}
if (m_pstmAudio != NULL) {
AVIStreamClose(m_pstmAudio);
m_pstmAudio = NULL;
}
if (m_pavif != NULL) {
AVIFileClose(m_pavif);
m_pavif = NULL;
}
AVIFileExit();
m_nSample = 0;
delete m_pbmFlip;
m_pbmFlip = NULL;
delete m_ptbmPointer;
m_ptbmPointer = NULL;
}
示例4: AVIStreamRelease
bool NxVideo_Avi_Recorder::CloseVideoFile()
{
if (mVideo->m_pStream)
{
AVIStreamRelease(mVideo->m_pStream);
mVideo->m_pStream=NULL;
}
if (mVideo->m_pStreamCompressed)
{
AVIStreamRelease(mVideo->m_pStreamCompressed);
mVideo->m_pStreamCompressed=NULL;
}
if (mVideo->m_pAVIFile)
{
AVIFileRelease(mVideo->m_pAVIFile);
mVideo->m_pAVIFile=NULL;
}
// Close engine
AVIFileExit();
return true;
}
示例5: LogMessage
CAVIFileReader::~CAVIFileReader()
{
LogMessage("CAVIFileReader::~CAVIFileReader started");
if (NULL != m_pAudioStream)
{
AVIStreamRelease(m_pAudioStream);
m_pAudioStream = NULL;
}
if (NULL != m_pWaveFormat)
{
FreeMemory(m_pWaveFormat);
m_pWaveFormat = NULL;
}
//
// AVIFileExit must be called on the same thread as AVIFileInit.
// therefore this object must be created and deleted on the same thread
//
AVIFileExit();
LogMessage("CAVIFileReader::~CAVIFileReader completed");
}
示例6: CreateAvi
HAVI CreateAvi (const TCHAR *filename, int frameperiod, const WAVEFORMATEX *wfx)
{
PAVIFILE pfile;
HRESULT hr;
TAviUtil *au;
AVIFileInit();
hr = AVIFileOpen(&pfile, filename, OF_WRITE | OF_CREATE, NULL);
if (hr)
{
AVIFileExit();
return NULL;
}
au = (TAviUtil *)malloc(sizeof(TAviUtil));
au->pfile = pfile;
if (wfx)
CopyMemory(&au->wfx, wfx, sizeof(WAVEFORMATEX));
else ZeroMemory(&au->wfx, sizeof(WAVEFORMATEX));
au->period = frameperiod;
au->audStream = NULL;
au->vidStream = NULL;
au->vidStreamComp = NULL;
au->nframe = 0;
au->nsamp = 0;
au->iserr = FALSE;
return (HAVI)au;
}
示例7: AVIFileInit
int imFileFormatAVI::New(const char* file_name)
{
/* initializes avi file library, can be called many times */
AVIFileInit();
/* creates a new file */
HRESULT hr = AVIFileOpen(&file, file_name, OF_WRITE | OF_CREATE, NULL);
if (hr != 0)
{
AVIFileExit();
if (hr == AVIERR_FILEOPEN)
return IM_ERR_OPEN;
else if (hr == AVIERR_BADFORMAT || hr == REGDB_E_CLASSNOTREG)
return IM_ERR_FORMAT;
else
return IM_ERR_ACCESS;
}
this->frame = 0;
this->stream = 0;
this->use_compressor = 0;
this->dib = 0;
return IM_ERR_NONE;
}
示例8: GetKey
void plAVIWriterImp::Close()
{
plgDispatch::Dispatch()->UnRegisterForExactType(plRenderMsg::Index(), GetKey());
#if HS_BUILD_FOR_WIN32
hsTimer::SetRealTime(fOldRealTime);
if (fStreamHandle)
{
AVIStreamClose(fStreamHandle);
fStreamHandle = nil;
}
if (fCompressedHandle)
{
AVIStreamClose(fCompressedHandle);
fCompressedHandle = nil;
}
if (fFileHandle)
{
AVIFileClose(fFileHandle);
fFileHandle = nil;
}
AVIFileExit();
#endif
}
示例9: free_anim_avi
static void free_anim_avi(struct anim *anim)
{
#if defined(_WIN32) && !defined(FREE_WINDOWS)
int i;
#endif
if (anim == NULL) return;
if (anim->avi == NULL) return;
AVI_close(anim->avi);
MEM_freeN(anim->avi);
anim->avi = NULL;
#if defined(_WIN32) && !defined(FREE_WINDOWS)
if (anim->pgf) {
AVIStreamGetFrameClose(anim->pgf);
anim->pgf = NULL;
}
for (i = 0; i < anim->avistreams; i++) {
AVIStreamRelease(anim->pavi[i]);
}
anim->avistreams = 0;
if (anim->pfileopen) {
AVIFileRelease(anim->pfile);
anim->pfileopen = 0;
AVIFileExit();
}
#endif
anim->duration = 0;
}
示例10: CloseAVI
/*
---------------------------------------------------------------------------------------
- destructor
---------------------------------------------------------------------------------------
*/
AviVideoRenderer::~AviVideoRenderer()
{
CloseAVI();
--_init_counter;
if(_init_counter == 0)
AVIFileExit(); // Release The File
}
示例11: glDeleteTextures
void CAvi::cleanUp(void) // Properly Closes The Avi File
{
glDeleteTextures( 1, &m_textureId );
DeleteObject(m_hBitmap); // Delete The Device Dependant Bitmap Object
DrawDibClose(m_hdd); // Closes The DrawDib Device Context
AVIStreamGetFrameClose(m_pgf); // Deallocates The GetFrame Resources
AVIStreamRelease(m_pavi); // Release The Stream
AVIFileExit(); // Release The File
}
示例12: AVIClose
void AVIClose(struct AVIFile** avi_out)
{
if(*avi_out)
{
clean_up(*avi_out);
delete *avi_out;
}
*avi_out = NULL;
AVIFileExit();
}
示例13: CloseAvi
HRESULT CloseAvi(HAVI avi)
{ if (avi==NULL) return AVIERR_BADHANDLE;
TAviUtil *au = (TAviUtil*)avi;
if (au->as!=0) AVIStreamRelease(au->as); au->as=0;
if (au->psCompressed!=0) AVIStreamRelease(au->psCompressed); au->psCompressed=0;
if (au->ps!=0) AVIStreamRelease(au->ps); au->ps=0;
if (au->pfile!=0) AVIFileRelease(au->pfile); au->pfile=0;
AVIFileExit();
delete au;
return S_OK;
}
示例14: AVIFileRelease
void VideoReader::Close()
{
// Close the stream and file.
AVIFileRelease(m_pf);
AVIFileExit();
if (m_lpBuffer != NULL)
{
free(m_lpBuffer);
}
}
示例15: AVI_stream_close
// AVI_stream_close() should be called when you are finished reading all the frames of an AVI
//
void AVI_stream_close()
{
// Assert( AVI_stream.flags & AVI_STREAM_F_USED);
AVIStreamRelease(AVI_stream.pstream); // closes the video stream
AVIFileRelease(AVI_stream.pfile); // closes the file
AVI_stream.flags &= ~AVI_STREAM_F_USED; // clear the used flag
AVIFileExit(); // releases AVIFile library
AVI_stream_inited = 0;
}