class CPlayer : public IMFAsyncCallback { public: static HRESULT CreateInstance( HWND hVideo, HWND hEvent, CPlayer **ppPlayer ); // IUnknown methods STDMETHODIMP QueryInterface(REFIID iid, void** ppv); STDMETHODIMP_(ULONG) AddRef(); STDMETHODIMP_(ULONG) Release(); // IMFAsyncCallback methods STDMETHODIMP GetParameters(DWORD*, DWORD*) { // Implementation of this method is optional. return E_NOTIMPL; } STDMETHODIMP Invoke(IMFAsyncResult* pAsyncResult); // Playback HRESULT OpenURL(PCWSTR sURL); HRESULT Play(); HRESULT Pause(); HRESULT Shutdown(); HRESULT HandleEvent(UINT_PTR pUnkPtr); PlayerState GetState() const { return m_state; } // Video functionality HRESULT Repaint(); HRESULT ResizeVideo(WORD width, WORD height); BOOL HasVideo() const { return (m_pVideoDisplay != NULL); } protected: // Constructor is private. Use static CreateInstance method to instantiate. CPlayer(HWND hVideo, HWND hEvent); // Destructor is private. Caller should call Release. virtual ~CPlayer(); HRESULT Initialize(); HRESULT CreateSession(); HRESULT CloseSession(); HRESULT StartPlayback(); HRESULT CreateMediaSource(PCWSTR sURL); HRESULT CreateTopologyFromSource(IMFTopology **ppTopology); HRESULT AddBranchToPartialTopology( IMFTopology *pTopology, IMFPresentationDescriptor *pSourcePD, DWORD iStream ); // Media event handlers HRESULT OnTopologyReady(IMFMediaEvent *pEvent); HRESULT OnPresentationEnded(IMFMediaEvent *pEvent); long m_nRefCount; // Reference count. IMFMediaSession *m_pSession; IMFMediaSource *m_pSource; IMFVideoDisplayControl *m_pVideoDisplay; HWND m_hwndVideo; // Video window. HWND m_hwndEvent; // App window to receive events. PlayerState m_state; // Current state of the media session. HANDLE m_hCloseEvent; // Event to wait on while closing };
Standard input is empty
prog.cpp:2: error: expected class-name before ‘{’ token prog.cpp:4: error: ‘HRESULT’ does not name a type prog.cpp:11: error: ‘STDMETHODIMP’ does not name a type prog.cpp:12: error: ‘ULONG’ has not been declared prog.cpp:12: error: ISO C++ forbids declaration of ‘STDMETHODIMP_’ with no type prog.cpp:12: error: expected ‘;’ before ‘AddRef’ prog.cpp:13: error: ‘ULONG’ has not been declared prog.cpp:13: error: ISO C++ forbids declaration of ‘STDMETHODIMP_’ with no type prog.cpp:13: error: expected ‘;’ before ‘Release’ prog.cpp:16: error: ‘STDMETHODIMP’ does not name a type prog.cpp:21: error: ‘STDMETHODIMP’ does not name a type prog.cpp:24: error: ‘HRESULT’ does not name a type prog.cpp:25: error: ‘HRESULT’ does not name a type prog.cpp:26: error: ‘HRESULT’ does not name a type prog.cpp:27: error: ‘HRESULT’ does not name a type prog.cpp:28: error: ‘HRESULT’ does not name a type prog.cpp:29: error: ‘PlayerState’ does not name a type prog.cpp:32: error: ‘HRESULT’ does not name a type prog.cpp:33: error: ‘HRESULT’ does not name a type prog.cpp:34: error: ‘BOOL’ does not name a type prog.cpp:39: error: expected `)' before ‘hVideo’ prog.cpp:44: error: ‘HRESULT’ does not name a type prog.cpp:45: error: ‘HRESULT’ does not name a type prog.cpp:46: error: ‘HRESULT’ does not name a type prog.cpp:47: error: ‘HRESULT’ does not name a type prog.cpp:48: error: ‘HRESULT’ does not name a type prog.cpp:49: error: ‘HRESULT’ does not name a type prog.cpp:51: error: ‘HRESULT’ does not name a type prog.cpp:58: error: ‘HRESULT’ does not name a type prog.cpp:59: error: ‘HRESULT’ does not name a type prog.cpp:63: error: ISO C++ forbids declaration of ‘IMFMediaSession’ with no type prog.cpp:63: error: expected ‘;’ before ‘*’ token prog.cpp:64: error: ISO C++ forbids declaration of ‘IMFMediaSource’ with no type prog.cpp:64: error: expected ‘;’ before ‘*’ token prog.cpp:65: error: ISO C++ forbids declaration of ‘IMFVideoDisplayControl’ with no type prog.cpp:65: error: expected ‘;’ before ‘*’ token prog.cpp:67: error: ‘HWND’ does not name a type prog.cpp:68: error: ‘HWND’ does not name a type prog.cpp:69: error: ‘PlayerState’ does not name a type prog.cpp:70: error: ‘HANDLE’ does not name a type
Standard output is empty