当前位置: 首页>>代码示例>>C++>>正文


C++ vdrefptr::Init方法代码示例

本文整理汇总了C++中vdrefptr::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ vdrefptr::Init方法的具体用法?C++ vdrefptr::Init怎么用?C++ vdrefptr::Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vdrefptr的用法示例。


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

示例1: Go

void Frameserver::Go(IVDubServerLink *ivdsl, char *name) {
	int server_index = -1;

	lpszFsname = name;
	
	// prepare the sources...
	if (!vSrc->setTargetFormat(g_dubOpts.video.mInputFormat))
		if (!vSrc->setTargetFormat(nsVDPixmap::kPixFormat_XRGB8888))
			if (!vSrc->setTargetFormat(nsVDPixmap::kPixFormat_RGB888))
				if (!vSrc->setTargetFormat(nsVDPixmap::kPixFormat_XRGB1555))
					if (!vSrc->setTargetFormat(nsVDPixmap::kPixFormat_Pal8))
						throw MyError("The decompression codec cannot decompress to an RGB format. This is very unusual. Check that any \"Force YUY2\" options are not enabled in the codec's properties.");

	IVDStreamSource *pVSS = vSrc->asStream();
	FrameSubset videoset(mSubset);

	const VDFraction frameRateTimeline(g_project->GetTimelineFrameRate());
	VDPosition startFrame;
	VDPosition endFrame;
	VDConvertSelectionTimesToFrames(*opt, mSubset, frameRateTimeline, startFrame, endFrame);
	InitVideoStreamValuesStatic(vInfo, vSrc, aSrc, opt, &mSubset, &startFrame, &endFrame);

	const VDPixmap& px = vSrc->getTargetFormat();

	const VDFraction& srcFAR = vSrc->getPixelAspectRatio();
	filters.prepareLinearChain(&g_filterChain, px.w, px.h, px.format, vInfo.mFrameRatePreFilter, -1, srcFAR);

	mpVideoFrameSource = new VDFilterFrameVideoSource;
	mpVideoFrameSource->Init(vSrc, filters.GetInputLayout());

	filters.SetVisualAccelDebugEnabled(false);
	filters.SetAccelEnabled(VDPreferencesGetFilterAccelEnabled());
	filters.SetAsyncThreadCount(VDPreferencesGetFilterThreadCount());
	filters.initLinearChain(NULL, 0, &g_filterChain, mpVideoFrameSource, px.w, px.h, px.format, px.palette, vInfo.mFrameRatePreFilter, -1, srcFAR);

	filters.ReadyFilters();

	InitVideoStreamValuesStatic2(vInfo, opt, &filters, frameRateTimeline);

	InitAudioStreamValuesStatic(aInfo, aSrc, opt);

	vdfastvector<IVDVideoSource *> vsrcs(1, vSrc);
	mVideoFrameMap.Init(vsrcs, vInfo.start_src, vInfo.mFrameRateTimeline / vInfo.mFrameRate, &mSubset, vInfo.end_dst, opt->video.mbUseSmartRendering, opt->video.mode == DubVideoOptions::M_NONE, opt->video.mbPreserveEmptyFrames, &filters, false, false);

	if (opt->audio.fEndAudio)
		videoset.deleteRange(endFrame, videoset.getTotalFrames());

	if (opt->audio.fStartAudio)
		videoset.deleteRange(0, startFrame);

	VDDEBUG("Video subset:\n");
	videoset.dump();

	if (aSrc)
		AudioTranslateVideoSubset(audioset, videoset, vInfo.mFrameRateTimeline, aSrc->getWaveFormat(), !opt->audio.fEndAudio && (videoset.empty() || videoset.back().end() == pVSS->getEnd()) ? aSrc->getEnd() : 0, NULL);

	VDDEBUG("Audio subset:\n");
	audioset.dump();

	if (aSrc) {
		audioset.offset(aSrc->msToSamples(-opt->audio.offset));
		lAudioSamples = VDClampToUint32(audioset.getTotalFrames());
	} else
		lAudioSamples = 0;

	lVideoSamples = VDClampToUint32(mVideoFrameMap.size());

	vSrc->streamBegin(true, false);

	const VDPixmapLayout& outputLayout = filters.GetOutputLayout();

	mFrameSize = VDPixmapCreateLinearLayout(mFrameLayout, nsVDPixmap::kPixFormat_RGB888, outputLayout.w, outputLayout.h, 4);
	VDPixmapLayoutFlipV(mFrameLayout);

	if (aSrc)
		aSrc->streamBegin(true, false);

	// usurp the window

	VDUIFrame *pFrame = VDUIFrame::GetFrame(hwnd);
	mpUIFrame = pFrame;
	pFrame->Attach(this);

	guiSetTitle(hwnd, IDS_TITLE_FRAMESERVER);

	// create dialog box

	mbExit = false;

	if (hwndStatus = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SERVER), hwnd, Frameserver::StatusDlgProc, (LPARAM)this)) {

		// hide the main window

		ShowWindow(hwnd, SW_HIDE);

		// create the frameserver

		server_index = ivdsl->CreateFrameServer(name, hwnd);

		if (server_index>=0) {
//.........这里部分代码省略.........
开发者ID:KGE-INC,项目名称:VirtualDub,代码行数:101,代码来源:server.cpp


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