阅读:1291回复:0
电视采集卡驱动探讨---BdaCapture
各位有看过ddk2003中的bda目录下的capturesample和generictuner的吗??
我自己看过后,在capture中做了如下修改结果,在graphedit中,运行时出错:提示无法进行状态转换,请各位指点! 改动如下: CHardwareSimulation:: Start ( IN CTsSynthesizer *TsSynth, IN LONGLONG TimePerFrame, IN ULONG PacketSize, IN ULONG PacketsPerSample ) 中添加如下代码: (以下代码是用来打开本机器上的一个媒体文件,这样就可以从该文件中读取数据送到分配的缓冲区中) UNICODE_STRING FileUnicodestr; WCHAR FilestrBuffer[] = L"f:\\capturesample\\jl_0_to_299.ts"; RtlInitUnicodeString (&FileUnicodestr, FilestrBuffer); InitializeObjectAttributes(&FilePath, &FileUnicodestr, OBJ_KERNEL_HANDLE , NULL, NULL ); status = ZwCreateFile (&m_Tsfile, FILE_READ_DATA|SYNCHRONIZE, &FilePath, &InfmStatus, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ, FILE_OPEN, FILE_SYNCHRONOUS_IO_ALERT, NULL, 0 ); void CHardwareSimulation:: FakeHardware ( ) if (m_HardwareState == HardwareRunning) { // synthesize a TS;下面为我添加的一行代码 // m_TsSynth->SynthesizeTS(); // // Fill scatter gather buffers // if (!NT_SUCCESS (FillScatterGatherBuffers ())) { InterlockedIncrement (PLONG (&m_NumFramesSkipped)); } } ..................... 下面为对SynthesizeTS的修改 ! void CTsSynthesizer:: SynthesizeTS ( ) { ZwReadFile( m_Tsfile, NULL, NULL, NULL, &m_ReadStatus, m_SynthesisBuffer, 58656, NULL, NULL ); // // Copy the synthesized transport stream to the synthesis buffer // } |
|