FLVCOM.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. /*
  3. Ben Allison
  4. April 30, 2008
  5. */
  6. #include <oaidl.h>
  7. #include <vector>
  8. #include "FLVMetadata.h"
  9. struct DispatchCallbackInfo
  10. {
  11. DispatchCallbackInfo() : dispatch(0), threadId(0), threadHandle(0) {}
  12. DispatchCallbackInfo(IDispatch *d, DWORD id, HANDLE _handle) : dispatch(d), threadId(id), threadHandle(_handle) {}
  13. IDispatch *dispatch;
  14. DWORD threadId;
  15. HANDLE threadHandle;
  16. };
  17. class FLVCOM : public IDispatch
  18. {
  19. public:
  20. STDMETHOD(QueryInterface)(REFIID riid, PVOID *ppvObject);
  21. STDMETHOD_(ULONG, AddRef)(void);
  22. STDMETHOD_(ULONG, Release)(void);
  23. void MetadataCallback(FLVMetadata::Tag *tag);
  24. private:
  25. // *** IDispatch Methods ***
  26. STDMETHOD (GetIDsOfNames)(REFIID riid, OLECHAR FAR* FAR* rgszNames, unsigned int cNames, LCID lcid, DISPID FAR* rgdispid);
  27. STDMETHOD (GetTypeInfo)(unsigned int itinfo, LCID lcid, ITypeInfo FAR* FAR* pptinfo);
  28. STDMETHOD (GetTypeInfoCount)(unsigned int FAR * pctinfo);
  29. STDMETHOD (Invoke)(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult, EXCEPINFO FAR * pexecinfo, unsigned int FAR *puArgErr);
  30. std::vector<DispatchCallbackInfo> callbacks;
  31. };
  32. extern FLVCOM flvCOM;