• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AVIFileRelease函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AVIFileRelease函数的典型用法代码示例。如果您正苦于以下问题:C++ AVIFileRelease函数的具体用法?C++ AVIFileRelease怎么用?C++ AVIFileRelease使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AVIFileRelease函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DeleteDC

void CAviFile::ReleaseMemory()
{
	m_nAppendFuncSelector=0;		//Point to DummyFunction

	if(m_hAviDC)
	{
		DeleteDC(m_hAviDC);
		m_hAviDC=NULL;
	}
	if(m_pAviCompressedStream)
	{
		AVIStreamRelease(m_pAviCompressedStream);
		m_pAviCompressedStream=NULL;
	}
	if(m_pAviStream)
	{
		AVIStreamRelease(m_pAviStream);
		m_pAviStream=NULL;
	}
	if(m_pAviFile)
	{
		AVIFileRelease(m_pAviFile);
		m_pAviFile=NULL;
	}
	if(m_lpBits)
	{
		HeapFree(m_hHeap,HEAP_NO_SERIALIZE,m_lpBits);
		m_lpBits=NULL;
	}
	if(m_hHeap)
	{
		HeapDestroy(m_hHeap);
		m_hHeap=NULL;
	}
}
开发者ID:stainlessio,项目名称:Linkage,代码行数:35,代码来源:AviFile.cpp


示例2: 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;
}
开发者ID:244xiao,项目名称:blender,代码行数:34,代码来源:anim_movie.c


示例3: 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;
}
开发者ID:nxgraphics,项目名称:NxGraphics,代码行数:25,代码来源:NxVideo_Avi_Recorder.cpp


示例4: capCaptureAbort

void CMainFrame::OnClose()
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	capCaptureAbort(m_hWndCap);
	capDriverDisconnect(m_hWndCap);
	Sleep(100);
	capSetCallbackOnError(m_hWndCap,NULL);
	capSetCallbackOnStatus(m_hWndCap,NULL);
	capSetCallbackOnVideoStream(m_hWndCap,NULL);
	delete lpbiIn;
	delete lpbiTmp;
	delete lpbiOut;
	if (m_vfwState==ENCDEC){
		ICDecompressEnd(hic2);
		ICClose(hic2);
		ICSeqCompressFrameEnd(&pc);
		ICCompressEnd(hic1);
		ICClose(hic1);
		AVIStreamClose(ps);
		if(m_pFile != NULL)
			AVIFileRelease(m_pFile);
	}

	enc_stop();
	dec_stop();

	Sleep(100);
	CFrameWnd::OnClose();
}
开发者ID:hiccupzhu,项目名称:misc_starting,代码行数:29,代码来源:MainFrm.cpp


示例5: test_ash1_corruption

static void test_ash1_corruption(void)
{
    COMMON_AVI_HEADERS cah;
    char filename[MAX_PATH];
    PAVIFILE pFile;
    int res;
    PAVISTREAM pStream1;
    AVISTREAMINFOA asi1;

    GetTempPathA(MAX_PATH, filename);
    strcpy(filename+strlen(filename), testfilename);

    /* Corrupt the sample size in the audio stream header */
    init_test_struct(&cah);
    cah.ash1.dwSampleSize = 0xdeadbeef;

    create_avi_file(&cah, filename);

    res = AVIFileOpenA(&pFile, filename, OF_SHARE_DENY_WRITE, 0L);
    ok(res == 0, "Unable to open file: error=%u\n", res);

    res = AVIFileGetStream(pFile, &pStream1, 0, 1);
    ok(res == 0, "Unable to open audio stream: error=%u\n", res);

    res = AVIStreamInfoA(pStream1, &asi1, sizeof(asi1));
    ok(res == 0, "Unable to read stream info: error=%u\n", res);

    /* The result will still be 2, because the value is dynamically replaced with the nBlockAlign
       value from the stream format header. The next test will prove this */
    ok(asi1.dwSampleSize == 2, "got %u (expected 2)\n", asi1.dwSampleSize);

    AVIStreamRelease(pStream1);
    AVIFileRelease(pFile);
    ok(DeleteFileA(filename) !=0, "Deleting file %s failed\n", filename);
}
开发者ID:AlexSteel,项目名称:wine,代码行数:35,代码来源:api.c


示例6: test_ash1_corruption2

static void test_ash1_corruption2(void)
{
    COMMON_AVI_HEADERS cah;
    char filename[MAX_PATH];
    PAVIFILE pFile;
    int res;
    PAVISTREAM pStream1;
    AVISTREAMINFOA asi1;

    GetTempPathA(MAX_PATH, filename);
    strcpy(filename+strlen(filename), testfilename);

    /* Corrupt the block alignment in the audio format header */
    init_test_struct(&cah);
    cah.pcmwf.wf.nBlockAlign = 0xdead;

    create_avi_file(&cah, filename);

    res = AVIFileOpenA(&pFile, filename, OF_SHARE_DENY_WRITE, 0L);
    ok(res == 0, "Unable to open file: error=%u\n", res);

    res = AVIFileGetStream(pFile, &pStream1, 0, 1);
    ok(res == 0, "Unable to open audio stream: error=%u\n", res);

    ok(AVIStreamInfoA(pStream1, &asi1, sizeof(asi1)) == 0, "Unable to read stream info\n");

    /* The result will also be the corrupt value, as explained above. */
    ok(asi1.dwSampleSize == 0xdead, "got 0x%x (expected 0xdead)\n", asi1.dwSampleSize);

    AVIStreamRelease(pStream1);
    AVIFileRelease(pFile);
    ok(DeleteFileA(filename) !=0, "Deleting file %s failed\n", filename);
}
开发者ID:AlexSteel,项目名称:wine,代码行数:33,代码来源:api.c


示例7: 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;
}
开发者ID:killbug2004,项目名称:DvrWorkstation,代码行数:29,代码来源:AviHelper.cpp


示例8: OpenSoundFile

BOOL OpenSoundFile(HWND hWnd,PAVISTREAM *pavi)
	{
#ifndef INTERIM_64_BIT	// CCJ
	OPENFILENAME ofn;
	char filter[256];

	AVIBuildFilter(filter,sizeof(filter),FALSE);

	ofn.lStructSize       = sizeof(OPENFILENAME);
	ofn.hwndOwner         = hWnd;
	ofn.hInstance         = NULL;	
	ofn.lpstrTitle        = GetResString(IDS_RB_OPENSOUND);
	ofn.lpstrFilter       = filter;
	ofn.lpstrCustomFilter = NULL;
	ofn.nMaxCustFilter    = 0;
	ofn.nFilterIndex      = 0;
	ofn.lpstrFile         = fileName;
	ofn.nMaxFile          = sizeof(fileName);
	ofn.lpstrFileTitle    = NULL;
	ofn.nMaxFileTitle     = 0;
	ofn.lpstrInitialDir   = NULL;
	ofn.Flags             = OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_HIDEREADONLY;
	ofn.nFileOffset       = 0;
	ofn.nFileExtension    = 0;
	ofn.lpstrDefExt       = NULL;
	ofn.lCustData         = 0;
	ofn.lpfnHook          = NULL;
	ofn.lpTemplateName    = NULL;

	if (GetOpenFileNamePreview(&ofn)) {
		HRESULT		hr;
    	PAVIFILE	pfile;
		PAVISTREAM	pstream;
		BOOL res = TRUE;

   	 	hr = AVIFileOpen(&pfile,fileName,OF_READ,NULL);
    	if (hr) return FALSE;

		if (AVIFileGetStream(
				pfile,&pstream,streamtypeAUDIO,0) != AVIERR_OK) {			
			res = FALSE;
			goto done;
			}
		
		*pavi = pstream;

	done:
		AVIFileRelease(pfile);
		return res;
	} else {
		return FALSE;
		}
#else	// INTERIM_64_BIT
	return FALSE;
#endif	// INTERIM_64_BIT
	}
开发者ID:2asoft,项目名称:xray,代码行数:56,代码来源:sound.cpp


示例9: AVIFileRelease

void VideoReader::Close()
{
    // Close the stream and file. 
    AVIFileRelease(m_pf); 
    AVIFileExit();

    if (m_lpBuffer != NULL)
    {
        free(m_lpBuffer);
    }
}
开发者ID:bryan610,项目名称:concrtextras,代码行数:11,代码来源:VideoAgent.cpp


示例10: AVIStreamRelease

void CvVideoWriter_VFW::close()
{
    if( uncompressed )
        AVIStreamRelease( uncompressed );
    if( compressed )
        AVIStreamRelease( compressed );
    if( avifile )
        AVIFileRelease( avifile );
    cvReleaseImage( &tempFrame );
    init();
}
开发者ID:12rohanb,项目名称:opencv,代码行数:11,代码来源:cap_vfw.cpp


示例11: 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;
}
开发者ID:rikvdbrule,项目名称:KinectRecording,代码行数:11,代码来源:avi_utils.cpp


示例12: AVIFileRelease

AVIReadHandlerTunnelW32::~AVIReadHandlerTunnelW32() {
    if (mpAvisynthClipInfo) {
        mpAvisynthClipInfo->Release();
        mpAvisynthClipInfo = nullptr;
    }

    if (mpAVIFile) {
        AVIFileRelease(mpAVIFile);
        mpAVIFile = nullptr;
    }
}
开发者ID:Cybuster,项目名称:vapoursynth,代码行数:11,代码来源:AVIReadHandlerTunnelW32.cpp


示例13: AVIStreamGetFrameClose

void CAviToBmp::Close()
{
	if (m_pGetFrame != NULL)
		AVIStreamGetFrameClose(m_pGetFrame);
	if (m_pStream != NULL)
		AVIStreamRelease(m_pStream);
	if (m_pFile != NULL)
		AVIFileRelease(m_pFile);
	if (m_pBmpInfo != NULL)
		delete m_pBmpInfo;
	Init();
}
开发者ID:fdiskcn,项目名称:Whorld,代码行数:12,代码来源:AviToBmp.cpp


示例14: 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;

}
开发者ID:lubomyr,项目名称:freespace2,代码行数:14,代码来源:convert.cpp


示例15: Print

AviFile::~AviFile()
{
    if (!play) {
        Print("*** Closing AVI file '%s' with %d frames\n", (const char*) filename, nframe);
    }

    if (ps_comp)   AVIStreamRelease(ps_comp);
    if (ps)        AVIStreamRelease(ps);
    if (pfile)     AVIFileRelease(pfile);

    AVIFileExit();
}
开发者ID:Banbury,项目名称:starshatter-open,代码行数:12,代码来源:AviFile.cpp


示例16: captureVideo

void captureVideo(HDC hDC){
	if(saves.size()>0){
		SendMessage(hWnd,WM_COMMAND,MAKEWPARAM(IDC_LISTBOX,LBN_SELCHANGE),0);

		currentFrame = 0;
		GLvoid *imageData = 0;
		while(WWDPhysics->totaltime<10000){
			while(!WWDPhysics->clientMoveAndDisplay(true, hDC)){}

			HDC hdcscreen=GetDC(0), hdc=CreateCompatibleDC(hdcscreen); ReleaseDC(0,hdcscreen);
			HBITMAP hData;

			hData = CreateDIBSection(hdc,(BITMAPINFO*) bi,DIB_RGB_COLORS,&imageData,NULL,NULL);
			GdiFlush(); //flush graphics operations batch to ensure memory contains the right pixels

			if(imageData!=0){
				glReadPixels(0, 0, abs(simWidth), abs(simHeight), GL_BGRA, GL_UNSIGNED_BYTE, imageData); //Copy the image to the array imageData

				DIBSECTION dibs; int sbm = GetObject(hData,sizeof(dibs),&dibs);

				if (sbm!=sizeof(DIBSECTION)){
#ifdef _DEBUG
					printf("dibsection fault\n");
#endif
				}else{
					DWORD keyframe = NULL;
					if(currentFrame==0){keyframe=AVIIF_KEYFRAME;}
					AVIStreamWrite(*pcompressedstream,currentFrame,1,dibs.dsBm.bmBits,dibs.dsBmih.biSizeImage,keyframe,NULL,NULL);
					currentFrame++;
				}
				DeleteObject(hData);
			}
			else{
#ifdef _DEBUG
				printf("frame skipped nr %d\n",currentFrame);
#endif
			}
		}
	}

	//vfw cleanup
	if(VFWReturnVal==0){
		AVIStreamRelease(*pcompressedstream);
		delete(pcompressedstream);
		AVIStreamRelease(*pstream);
		delete pstream;
		AVISaveOptionsFree(1,aopts);
		AVIFileRelease(*pfile);  // closes the file
	}
	AVIFileExit();          // releases AVIFile library
	//\vfw cleanup
}
开发者ID:kiniry-supervision,项目名称:walking-with-dinosaurs,代码行数:52,代码来源:GUI.cpp


示例17: AVIStreamWrite

void AVIDump::Stop()
{
	// store one copy of the last video frame, CFR case
	if (s_stream_compressed)
		AVIStreamWrite(s_stream_compressed, s_frame_count++, 1, GetFrame(), s_bitmap.biSizeImage, AVIIF_KEYFRAME, nullptr, &s_byte_buffer);
	
	//Dragonbane:: Dump 5 seconds of the same frame for readability
	if (Movie::cmp_justFinished || Movie::cmp_rightFinished && Movie::cmp_leftFinished || (Movie::cmp_rightFinished || Movie::cmp_leftFinished) && Movie::cmp_movieFinished && !Movie::GetNextComparisonMovie(false))
	{
		Movie::cmp_justFinished = false;

		if (s_stream && s_stream_compressed)
		{
			int endFrames = s_frame_rate * 5;
			for (int i = 0; i < endFrames - 1; i++)
			{
				AVIStreamWrite(s_stream, s_frame_count++, 1, nullptr, 0, 0, nullptr, nullptr);
			}
			AVIStreamWrite(s_stream_compressed, s_frame_count++, 1, GetFrame(), s_bitmap.biSizeImage, AVIIF_KEYFRAME, nullptr, &s_byte_buffer);
		}
	}
	
	s_start_dumping = false;
	CloseFile();
	s_file_count = 0;

	//Dragonbane
	if (s_getFrame_temp)
	{
		AVIStreamGetFrameClose(s_getFrame_temp);
		s_getFrame_temp = nullptr;
	}

	if (s_stream_temp)
	{
		AVIStreamClose(s_stream_temp);
		s_stream_temp = nullptr;
	}

	if (s_file_temp)
	{
		AVIFileRelease(s_file_temp);
		s_file_temp = nullptr;

		std::string movie_file_name = GetCurrDumpFile(tempFileCount, true);

		if (File::Exists(movie_file_name))
			File::Delete(movie_file_name);
	}

	NOTICE_LOG(VIDEO, "Stop");
}
开发者ID:dragonbane0,项目名称:dolphin,代码行数:52,代码来源:AVIDump.cpp


示例18: avisynth_read_close

static int avisynth_read_close(AVFormatContext *s)
{
    AviSynthContext *avs = s->priv_data;
    int i;

    for (i = 0; i < avs->nb_streams; i++)
        AVIStreamRelease(avs->streams[i].handle);

    av_free(avs->streams);
    AVIFileRelease(avs->file);
    AVIFileExit();
    return 0;
}
开发者ID:DDTChen,项目名称:CookieVLC,代码行数:13,代码来源:avisynth.c


示例19: AVIStreamRelease

void CBmpToAvi::Close()
{
	if (m_pavi)
	{
		AVIStreamRelease(m_pavi);
		m_pavi = NULL;
	}
	if (m_pfile)
	{
		AVIFileRelease(m_pfile);
		m_pfile = NULL;
	}		
}
开发者ID:26597925,项目名称:Remote,代码行数:13,代码来源:VideoDlg.cpp


示例20: avi_cleanup_context

static void avi_cleanup_context(avi_encode_context *context)
{
  if (context->pscomp)
    AVIStreamRelease(context->pscomp);
  context->pscomp = NULL;

  if (context->ps)
    AVIStreamRelease(context->ps);
  context->ps = NULL;

  if (context->pfile)
    AVIFileRelease(context->pfile);
  context->pfile = NULL;
}
开发者ID:Alexpux,项目名称:simage,代码行数:14,代码来源:avi_encode.c



注:本文中的AVIFileRelease函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AVL_NEXT函数代码示例发布时间:2022-05-30
下一篇:
C++ AVIFileOpen函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap