⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 srblist.cpp

📁 采集卡的驱动编程,具有较大的参考价值,特别开发视频采集的软件工程师有用
💻 CPP
字号:
// srblist.cpp - SRB List class for Video Capture sample
//=============================================================================
//
// Compuware Corporation
// NuMega Lab
// 9 Townsend West
// Nashua, NH 03060  USA
//
// Copyright (c) 1998 Compuware Corporation. All Rights Reserved.
// Unpublished - rights reserved under the Copyright laws of the
// United States.
//
//=============================================================================

#include <vdw.h>
#include <kstream.h>
#include "srblist.h"

#define SRB_LE_OFFSET ULONG(&PHW_STREAM_REQUEST_BLOCK(0)->SRBExtension)

SrbList::SrbList(void) :
	KList<HW_STREAM_REQUEST_BLOCK>(SRB_LE_OFFSET)
{
	m_Busy = FALSE;
}

BOOL SrbList::AddIfBusy(
	PHW_STREAM_REQUEST_BLOCK pSrb,
	KSpinLock* pLock
	)
{
	if ( !pLock )
		pLock = &m_Lock;

	BOOLEAN EntryState = m_Busy;
	pLock->Lock();


	if (m_Busy)
		InsertTail(pSrb);
	else
		m_Busy = TRUE; // -- jak...this is NOT likely correct 

	pLock->Unlock();
	return EntryState;
}


BOOL SrbList::RemoveIfAvailable(
	PHW_STREAM_REQUEST_BLOCK& pSrb,
	KSpinLock* pLock
	)
{
	if ( !pLock )
		pLock = &m_Lock;

	pLock->Lock();

	m_Busy = !IsEmpty();

	if (m_Busy)
		pSrb = RemoveHead();

	pLock->Unlock();
	return m_Busy;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -