directshow的Vivek的vcam有问题
CVCam::CVCam(LPUNKNOWN lpunk, HRESULT *phr) :
CSource(NAME("Virtual Cam"), lpunk, CLSID_VirtualCam)
{
ASSERT(phr);
CAutoLock cAutoLock(&m_cStateLock);
// Create the one and only output pin
m_paStreams = (CSourceStream **) new CVCamStream*[1];
m_paStreams[0] = new CVCamStream(phr, this, L"Virtual Cam");
}
实例化 m_paStreams
两次的原因是什么?
CAutoLock cAutoLock(&m_cStateLock);
是否适用于此过滤器的单独请求(由不同的应用程序)?
CVCam::CVCam(LPUNKNOWN lpunk, HRESULT *phr) :
CSource(NAME("Virtual Cam"), lpunk, CLSID_VirtualCam)
{
ASSERT(phr);
CAutoLock cAutoLock(&m_cStateLock);
// Create the one and only output pin
m_paStreams = (CSourceStream **) new CVCamStream*[1];
m_paStreams[0] = new CVCamStream(phr, this, L"Virtual Cam");
}
What's the reason to instantiate m_paStreams
twice?
Does CAutoLock cAutoLock(&m_cStateLock);
work for separate request(by different application) to this filter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道这段代码的含义,但我可以向您保证 m_paStreams 在您发布的内容中仅初始化一次。
m_paStreams 似乎是一个指向 CSourceStream 对象的指针数组。据推测,可能有多个这些对象,因此,数组。您的代码只需创建一个大小为 1 的数组,然后为该数组的第一个元素创建 CVCamStream 对象。
I have no idea what this code is about, but I can assure you that m_paStreams is only initialized once in what you've posted.
It appears that m_paStreams is intended to be an array of pointers to CSourceStream objects. Presumably, it's possible to have more than one of these objects, hence, the array. Your code simply creates an array of size 1, and then for the first element of the array, creates the CVCamStream object.