Computing

Windows Mobile / DirectShow / SampleGrabber

Donghoon 2010. 2. 4. 14:44

code project의 SampleGrabber 사용

http://www.codeproject.com/KB/mobile/samplegrabberfilter-wm6.aspx

 

VS2005에서 빌드할때 문제발생

method undefined

  1. CSampleGrabber::FindPin
  2. CSampleGrabber::JoinFilterGraph
  3. CSampleGrabber::QueryVendorInfo
  4. CSampleGrabber::NonDelegatingRelease

위 목록중에서 3개는 아래 방법으로 해결

  • Under Project Propeties/C++/Language change the compiler option  "Treat wchar_t as builtin type" to No and rebuild

마지막 1개는 아래 방법으로 해결

  • #ifdef DEBUG
    #define UNDEFINEDEBUGTEMPORARILY
    #undef DEBUG
    #endif
    #include <streams.h>
    #ifdef UNDEFINEDEBUGTEMPORARILY
    #define DEBUG
    #endif
  • streams.h안에 NonDelegatingRelease는 DEBUG에서만 정의되도록 되어있어서, CBaseFilter를 implement하는 모든 class들은 이를 DEBUG에서는 구현해야하나 보통 구현하지않게되므로, streams.h를 include할때 그냥 DEBUG를 undef해버림
  • codeproject의 소스는 그 외에도 precompiled header에서 streams.h를 include하고 있으므로 이또한 처리를 해주어야 한다.