00001 #ifndef RAGEMOVIETEXTURE_HELPER_H 00002 #define RAGEMOVIETEXTURE_HELPER_H 00003 00004 00005 // #include <windows.h> 00006 // #include <atlbase.h> 00007 00008 //#include "baseclasses/streams.h" 00009 //#include "baseclasses/streams.h" 00010 #include "MovieTexture_DShow.h" 00011 00012 //----------------------------------------------------------------------------- 00013 // CTextureRenderer Class Declarations 00014 // 00015 // Usage: 1) CheckMediaType is called by the graph 00016 // 2) SetMediaType is called by the graph 00017 // 3) call GetVidWidth and GetVidHeight to get texture information 00018 // 4) call SetRenderTarget 00019 // 5) Do RenderSample is called by the graph 00020 //----------------------------------------------------------------------------- 00021 class CTextureRenderer : public CBaseVideoRenderer 00022 { 00023 public: 00024 CTextureRenderer(); 00025 ~CTextureRenderer(); 00026 00027 // overridden methods 00028 HRESULT CheckMediaType(const CMediaType *pmt ); // Format acceptable? 00029 HRESULT SetMediaType(const CMediaType *pmt ); // Video format notification 00030 HRESULT DoRenderSample(IMediaSample *pMediaSample); // New video sample 00031 void OnReceiveFirstSample( IMediaSample * pSample ); 00032 00033 // new methods 00034 long GetVidWidth() const { return m_lVidWidth; } 00035 long GetVidHeight() const { return m_lVidHeight; } 00036 void SetRenderTarget( MovieTexture_DShow* pTexture ); 00037 00038 RageSemaphore m_OneFrameDecoded; 00039 00040 protected: 00041 // Video width, height, and pitch. 00042 long m_lVidWidth, m_lVidHeight, m_lVidPitch; 00043 00044 char *output; 00045 00046 MovieTexture_DShow* m_pTexture; // the video surface we will copy new frames to 00047 // D3DFORMAT m_TextureFormat; // Texture format 00048 }; 00049 00050 #endif 00051 00052 /* 00053 * (c) 2001-2004 Chris Danford, Glenn Maynard 00054 * All rights reserved. 00055 * 00056 * Permission is hereby granted, free of charge, to any person obtaining a 00057 * copy of this software and associated documentation files (the 00058 * "Software"), to deal in the Software without restriction, including 00059 * without limitation the rights to use, copy, modify, merge, publish, 00060 * distribute, and/or sell copies of the Software, and to permit persons to 00061 * whom the Software is furnished to do so, provided that the above 00062 * copyright notice(s) and this permission notice appear in all copies of 00063 * the Software and that both the above copyright notice(s) and this 00064 * permission notice appear in supporting documentation. 00065 * 00066 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00067 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00068 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00069 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00070 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00071 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00072 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00073 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00074 * PERFORMANCE OF THIS SOFTWARE. 00075 */