Revision: 4458 http://pd-gem.svn.sourceforge.net/pd-gem/?rev=4458&view=rev Author: zmoelnig Date: 2011-08-15 12:31:49 +0000 (Mon, 15 Aug 2011)
Log Message: ----------- adjusted to new simplified API (and manually include RTE) Modified Paths: -------------- trunk/Gem/plugins/filmAVI/filmAVI.cpp trunk/Gem/plugins/filmAVI/filmAVI.h trunk/Gem/plugins/filmAVIPLAY/filmAVIPLAY.cpp trunk/Gem/plugins/filmAVIPLAY/filmAVIPLAY.h trunk/Gem/plugins/filmDS/filmDS.cpp trunk/Gem/plugins/filmDS/filmDS.h trunk/Gem/plugins/filmDarwin/filmDarwin.cpp trunk/Gem/plugins/filmDarwin/filmDarwin.h trunk/Gem/plugins/filmGMERLIN/filmGMERLIN.cpp trunk/Gem/plugins/filmGMERLIN/filmGMERLIN.h trunk/Gem/plugins/filmMPEG1/filmMPEG1.cpp trunk/Gem/plugins/filmMPEG1/filmMPEG1.h trunk/Gem/plugins/filmMPEG3/filmMPEG3.cpp trunk/Gem/plugins/filmMPEG3/filmMPEG3.h trunk/Gem/plugins/filmQT/filmQT.cpp trunk/Gem/plugins/filmQT/filmQT.h trunk/Gem/plugins/filmQT4L/filmQT4L.cpp trunk/Gem/plugins/filmQT4L/filmQT4L.h trunk/Gem/plugins/filmTEST/filmTEST.cpp trunk/Gem/plugins/filmTEST/filmTEST.h trunk/Gem/plugins/recordQT/recordQT.cpp Modified: trunk/Gem/plugins/filmAVI/filmAVI.cpp =================================================================== --- trunk/Gem/plugins/filmAVI/filmAVI.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmAVI/filmAVI.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -17,18 +17,18 @@ # include "config.h" #endif +#ifdef _WIN32 + #include "filmAVI.h" #include "plugins/PluginFactory.h" - -using namespace gem::plugins; - - #include "Utils/Functions.h" +#include "Gem/Properties.h" +#include "Gem/RTE.h" -#ifdef _WIN32 REGISTER_FILMFACTORY("AVI", filmAVI); -#endif +using namespace gem::plugins; + ///////////////////////////////////////////////////////// // // filmAVI @@ -38,18 +38,19 @@ // ///////////////////////////////////////////////////////// -filmAVI :: filmAVI(void) : filmBase() { -#ifdef _WIN32 - m_getFrame = NULL; - m_streamVid = NULL; - m_pbmihRaw = NULL; - m_pbmihDst = NULL; - m_hic = NULL; - m_RawBuffer = NULL; - m_frame = NULL; - m_nRawBuffSize = 0; +filmAVI :: filmAVI(void) : filmBase() + m_nRawBuffSize(0), + m_RawBuffer(NULL), + m_format(GL_BGR_EXT), + m_reqFrame(0), + m_frame(NULL), + m_pbmihRaw(NULL), + m_pbmihDst(NULL), + m_hic(NULL), + m_getFrame(NULL), + m_streamVid(NULL) +{ AVIFileInit(); -#endif } ///////////////////////////////////////////////////////// @@ -59,12 +60,9 @@ filmAVI :: ~filmAVI() { close(); -#ifdef _WIN32 AVIFileExit(); -#endif } -#ifdef _WIN32 void filmAVI :: close(void) { if (m_streamVid){ @@ -103,12 +101,15 @@ // open the file // ///////////////////////////////////////////////////////// -bool filmAVI :: open(const std::string filename, int format) +bool filmAVI :: open(const std::string filename, const gem::Properties&wantProps) { AVISTREAMINFO streaminfo; long lSize = 0; // in bytes - if (format>0)m_wantedFormat=format; + double d; + if(wantProps.get("colorspace", d) && d>0) + m_wantedFormat=d; + if (AVIStreamOpenFromFile(&m_streamVid, filename.c_str(), streamtypeVIDEO, 0, OF_READ, NULL)) { //error("filmAVI: Unable to open file: %s", filename.c_str()); goto unsupported; Modified: trunk/Gem/plugins/filmAVI/filmAVI.h =================================================================== --- trunk/Gem/plugins/filmAVI/filmAVI.h 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmAVI/filmAVI.h 2011-08-15 12:31:49 UTC (rev 4458) @@ -17,10 +17,7 @@ #define _INCLUDE_GEMPLUGIN__FILMAVI_FILMAVI_H_ #include "plugins/filmBase.h" - -#ifdef _WIN32 #include <vfw.h> -#endif /*----------------------------------------------------------------- ------------------------------------------------------------------- @@ -47,10 +44,9 @@ // Destructor virtual ~filmAVI(void); -#ifdef _WIN32 ////////// // open a movie up - virtual bool open(const std::string filename, int); + virtual bool open(const std::string filename, const gem::Properties&); ////////// // close the movie file virtual void close(void); @@ -81,8 +77,6 @@ PGETFRAME m_getFrame; // the frame information PAVISTREAM m_streamVid; // the stream itself -#endif //AVI - };};}; #endif // for header file Modified: trunk/Gem/plugins/filmAVIPLAY/filmAVIPLAY.cpp =================================================================== --- trunk/Gem/plugins/filmAVIPLAY/filmAVIPLAY.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmAVIPLAY/filmAVIPLAY.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -17,17 +17,18 @@ # include "config.h" #endif +#ifdef HAVE_LIBAVIPLAY + #include "filmAVIPLAY.h" #include "plugins/PluginFactory.h" - +#include "Gem/Properties.h" using namespace gem::plugins; -#ifdef HAVE_LIBAVIPLAY REGISTER_FILMFACTORY("aviplay", filmAVIPLAY); -# include <unistd.h> -# include <time.h> -#endif +#include <unistd.h> +#include <time.h> + ///////////////////////////////////////////////////////// // // filmAVIPLAY @@ -38,11 +39,9 @@ ///////////////////////////////////////////////////////// filmAVIPLAY :: filmAVIPLAY(void) : filmBase() , -#ifdef HAVE_LIBAVIPLAY m_avifile(NULL), m_avistream(NULL), m_aviimage(NULL), -#endif m_rawdata(NULL), m_rawlength(0) { @@ -57,7 +56,6 @@ close(); if(m_rawdata)delete[]m_rawdata; } -#ifdef HAVE_LIBAVIPLAY void filmAVIPLAY :: close(void) { if (m_avistream)(*m_avistream).StopStreaming(); @@ -67,9 +65,12 @@ // open the file // ///////////////////////////////////////////////////////// -bool filmAVIPLAY :: open(const std::string filename, int format) +bool filmAVIPLAY :: open(const std::string filename, const gem::Properties&wantProps) { - if (format>0)m_wantedFormat=format; + double d; + if(wantProps.get("colorspace", d) && d>0) { + m_wantedFormat=d; + } // how do we close the avifile ??? automagically ? if (!(m_avifile = CreateIAviReadFile(filename.c_str())))goto unsupported; while(!(*m_avifile).IsOpened()){ @@ -92,8 +93,6 @@ m_numFrames = (*m_avistream).GetLength(); m_curFrame = -1; if (1){ - //int format = (*m_avistream).GetVideoFormat(); - //m_image.image.csize = (*m_avistream).GetFrameSize()/(m_image.image.xsize*m_image.image.ysize); avm::StreamInfo *l_info = (*m_avistream).GetStreamInfo(); m_image.image.xsize = (*l_info).GetVideoWidth(); m_image.image.ysize = (*l_info).GetVideoHeight(); Modified: trunk/Gem/plugins/filmAVIPLAY/filmAVIPLAY.h =================================================================== --- trunk/Gem/plugins/filmAVIPLAY/filmAVIPLAY.h 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmAVIPLAY/filmAVIPLAY.h 2011-08-15 12:31:49 UTC (rev 4458) @@ -70,7 +70,7 @@ #ifdef HAVE_LIBAVIPLAY ////////// // open a movie up - virtual bool open(const std::string filename, int format=0); + virtual bool open(const std::string filename, const gem::Properties&); ////////// // close the movie file virtual void close(void); Modified: trunk/Gem/plugins/filmDS/filmDS.cpp =================================================================== --- trunk/Gem/plugins/filmDS/filmDS.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmDS/filmDS.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -16,19 +16,21 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#if defined(_WIN32) && defined(HAVE_DIRECTSHOW) + #include "filmDS.h" #include "plugins/PluginFactory.h" +#include "Gem/RTE.h" using namespace gem::plugins; -#if defined(_WIN32) && defined(HAVE_DIRECTSHOW) REGISTER_FILMFACTORY("DirectShow", filmDS); -# include <atlbase.h> -# include <atlconv.h> -# include <streams.h> -# include <dvdmedia.h> -# define REGISTER_FILTERGRAPH 1 +#include <atlbase.h> +#include <atlconv.h> +#include <streams.h> +#include <dvdmedia.h> +#define REGISTER_FILTERGRAPH 1 #include <strsafe.h> @@ -36,7 +38,6 @@ HRESULT filmConnectFilters(IGraphBuilder *pGraph, IBaseFilter *pFirst, IBaseFilter *pSecond); HRESULT filmAddGraphToRot(IUnknown *pUnkGraph, DWORD *pdwRegister) ; void filmRemoveGraphFromRot(DWORD pdwRegister); -# endif ///////////////////////////////////////////////////////// // // filmDS @@ -47,7 +48,6 @@ ///////////////////////////////////////////////////////// filmDS :: filmDS(void) : filmBase() { -#if defined(_WIN32) && defined(HAVE_DIRECTSHOW) HRESULT RetVal; m_reqFrame = 1; m_frame = NULL; @@ -106,7 +106,6 @@ return; } -#endif } //////////////////////////////////////////////////////// @@ -115,8 +114,6 @@ //////////////////////////////////////////////////////// filmDS :: ~filmDS() { -#if defined(_WIN32) && defined(HAVE_DIRECTSHOW) - close(); // Release IMediaControl interface @@ -153,11 +150,9 @@ // Release COM CoUninitialize(); -#endif } -#if defined(_WIN32) && defined(HAVE_DIRECTSHOW) void filmDS :: close(void) { @@ -226,7 +221,7 @@ // open the file // ///////////////////////////////////////////////////////// -bool filmDS :: open(const std::string filename, int format) +bool filmDS :: open(const std::string filename, const gem::Properties&wantProps) { WCHAR WideFileName[MAXPDSTRING]; HRESULT RetVal; Modified: trunk/Gem/plugins/filmDS/filmDS.h =================================================================== --- trunk/Gem/plugins/filmDS/filmDS.h 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmDS/filmDS.h 2011-08-15 12:31:49 UTC (rev 4458) @@ -50,7 +50,7 @@ #if defined(_WIN32) && defined(HAVE_DIRECTSHOW) ////////// // open a movie up - virtual bool open(const std::string filename, int format=0); + virtual bool open(const std::string filename, const gem::Properties&); ////////// // close the movie file virtual void close(void); Modified: trunk/Gem/plugins/filmDarwin/filmDarwin.cpp =================================================================== --- trunk/Gem/plugins/filmDarwin/filmDarwin.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmDarwin/filmDarwin.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -18,14 +18,15 @@ # include "config.h" #endif #include "filmDarwin.h" +#ifdef HAVE_CARBONQUICKTIME + #include "plugins/PluginFactory.h" +#include "Gem/RTE.h" using namespace gem::plugins; -#ifdef HAVE_CARBONQUICKTIME REGISTER_FILMFACTORY("Darwin", filmDarwin); -#endif - + ///////////////////////////////////////////////////////// // // filmDarwin @@ -36,15 +37,12 @@ ///////////////////////////////////////////////////////// filmDarwin :: filmDarwin(void) : filmBase(false), -#ifdef HAVE_CARBONQUICKTIME m_movie(NULL), m_srcGWorld(NULL), m_movieTime(0), m_movieTrack(0), m_movieMedia(0), m_timeScale(0), - duration(0), -#endif durationf(0.) { } @@ -60,23 +58,23 @@ void filmDarwin :: close(void) { -#ifdef HAVE_CARBONQUICKTIME if(m_srcGWorld){ ::DisposeMovie(m_movie); ::DisposeGWorld(m_srcGWorld); m_srcGWorld = NULL; } -#endif /* HAVE_CARBONQUICKTIME */ } ///////////////////////////////////////////////////////// // open the file // ///////////////////////////////////////////////////////// -bool filmDarwin :: open(const std::string filename, int format) +bool filmDarwin :: open(const std::string filename, const gem::Properties&wantProps) { - if (format>0)m_wantedFormat=format; -#ifdef HAVE_CARBONQUICKTIME + double d; + if(wantProps.get("colorspace", d) && d>0) { + m_wantedFormat=d; + } FSSpec theFSSpec; OSErr err = noErr; FSRef ref; @@ -192,7 +190,6 @@ ::SetMovieGWorld(m_movie, m_srcGWorld, GetGWorldDevice(m_srcGWorld)); ::MoviesTask(m_movie, 0); // *** this does the actual drawing into the GWorld *** return true; -#endif /* HAVE_CARBONQUICKTIME */ goto unsupported; unsupported: //post("Darwin: unsupported!"); @@ -204,7 +201,6 @@ // ///////////////////////////////////////////////////////// pixBlock* filmDarwin :: getFrame(){ -#ifdef HAVE_CARBONQUICKTIME CGrafPtr savedPort; GDHandle savedDevice; Rect m_srcRect; @@ -270,7 +266,6 @@ // m_image.image.data = (unsigned char *)m_baseAddr; m_image.newimage=1; -#endif /* HAVE_CARBONQUICKTIME */ return &m_image; } @@ -279,3 +274,4 @@ // return 0; return film::SUCCESS; } +#endif /* CARBONQUiCKTIME */ Modified: trunk/Gem/plugins/filmDarwin/filmDarwin.h =================================================================== --- trunk/Gem/plugins/filmDarwin/filmDarwin.h 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmDarwin/filmDarwin.h 2011-08-15 12:31:49 UTC (rev 4458) @@ -56,7 +56,7 @@ ////////// // open a movie up - virtual bool open(const std::string filename, int format=0); + virtual bool open(const std::string filename, const gem::Properties&); ////////// // close the movie file virtual void close(void); Modified: trunk/Gem/plugins/filmGMERLIN/filmGMERLIN.cpp =================================================================== --- trunk/Gem/plugins/filmGMERLIN/filmGMERLIN.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmGMERLIN/filmGMERLIN.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -18,6 +18,7 @@ #endif #include "filmGMERLIN.h" #include "plugins/PluginFactory.h" +#include "Gem/RTE.h" using namespace gem::plugins; @@ -114,7 +115,7 @@ // really open the file ! // ///////////////////////////////////////////////////////// -bool filmGMERLIN :: open(const std::string sfilename, int format) +bool filmGMERLIN :: open(const std::string sfilename, const gem::Properties&wantProps) { close(); @@ -183,7 +184,7 @@ for(i = 0; i < num_urls; i++) { filename=(char*)bgav_redirector_get_url(m_file, i); close(); - if (open(filename)) { + if (open(filename, wantProps)) { return true; } } Modified: trunk/Gem/plugins/filmGMERLIN/filmGMERLIN.h =================================================================== --- trunk/Gem/plugins/filmGMERLIN/filmGMERLIN.h 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmGMERLIN/filmGMERLIN.h 2011-08-15 12:31:49 UTC (rev 4458) @@ -69,7 +69,7 @@ #ifdef HAVE_GMERLIN ////////// // open a movie up - virtual bool open(const std::string filename, int format = 0); + virtual bool open(const std::string filename, const gem::Properties&); ////////// // close the movie file virtual void close(void); Modified: trunk/Gem/plugins/filmMPEG1/filmMPEG1.cpp =================================================================== --- trunk/Gem/plugins/filmMPEG1/filmMPEG1.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmMPEG1/filmMPEG1.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -25,7 +25,6 @@ #ifdef HAVE_LIBMPEG REGISTER_FILMFACTORY("MPEG1", filmMPEG1); -#endif ///////////////////////////////////////////////////////// // @@ -36,12 +35,14 @@ // ///////////////////////////////////////////////////////// -filmMPEG1 :: filmMPEG1(void) : filmBase(), - m_data(NULL), m_length(0) +filmMPEG1 :: filmMPEG1(void) : + filmBase(), + m_streamfile(NULL), + m_reachedEnd(false), + m_data(NULL), + m_length(0) { -#ifdef HAVE_LIBMPEG - m_streamfile=0; -#endif + m_numFrames=-1; } ///////////////////////////////////////////////////////// @@ -54,7 +55,6 @@ if(m_data)delete[]m_data; } -#ifdef HAVE_LIBMPEG void filmMPEG1 :: close(void) { if (m_streamfile)fclose(m_streamfile); Modified: trunk/Gem/plugins/filmMPEG1/filmMPEG1.h =================================================================== --- trunk/Gem/plugins/filmMPEG1/filmMPEG1.h 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmMPEG1/filmMPEG1.h 2011-08-15 12:31:49 UTC (rev 4458) @@ -18,9 +18,7 @@ #include "plugins/filmBase.h" #include <stdio.h> -#ifdef HAVE_LIBMPEG -# include <mpeg.h> -#endif // MPEG +#include <mpeg.h> /*----------------------------------------------------------------- ------------------------------------------------------------------- @@ -47,10 +45,9 @@ // Destructor virtual ~filmMPEG1(void); -#ifdef HAVE_LIBMPEG ////////// // open a movie up - virtual bool open(const std::string filename, int format = 0); + virtual bool open(const std::string filename, const gem::Properties&); ////////// // close the movie file virtual void close(void); @@ -60,10 +57,6 @@ virtual pixBlock* getFrame(void); ////////// - // get the number of frames - virtual int getFrameNum(void) {return -1;} - - ////////// // set the next frame to read; virtual errCode changeImage(int imgNum, int trackNum = -1); @@ -75,7 +68,6 @@ FILE *m_streamfile; ImageDesc m_streamVid; bool m_reachedEnd; -#endif unsigned char*m_data; int m_length; };};}; Modified: trunk/Gem/plugins/filmMPEG3/filmMPEG3.cpp =================================================================== --- trunk/Gem/plugins/filmMPEG3/filmMPEG3.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmMPEG3/filmMPEG3.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -19,6 +19,9 @@ #include "filmMPEG3.h" #include "plugins/PluginFactory.h" +#include "Gem/Properties.h" +#include "Gem/RTE.h" + using namespace gem::plugins; #ifdef HAVE_LIBMPEG3 @@ -68,7 +71,7 @@ // really open the file ! (OS dependent) // ///////////////////////////////////////////////////////// -bool filmMPEG3 :: open(const std::string filename, int format) +bool filmMPEG3 :: open(const std::string filename, const gem::Properties&wantProps) { char*cfilename=const_cast<char*>(filename.c_str()); if (mpeg3_check_sig(cfilename)){/* ok, this is mpeg(3) */ @@ -96,8 +99,11 @@ m_image.image.xsize=mpeg3_video_width(mpeg_file, m_curTrack); m_image.image.ysize=mpeg3_video_height(mpeg_file, m_curTrack); if (!m_image.image.xsize*m_image.image.ysize)goto unsupported; - m_wantedFormat=format; - m_image.image.setCsizeByFormat(format); + double d; + if(wantProps.get("colorspace", d)) { + m_image.image.setCsizeByFormat((int)d); + m_wantedFormat=m_image.image.format; + } m_image.image.reallocate(); changeImage(0,-1); m_newfilm=true; Modified: trunk/Gem/plugins/filmMPEG3/filmMPEG3.h =================================================================== --- trunk/Gem/plugins/filmMPEG3/filmMPEG3.h 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmMPEG3/filmMPEG3.h 2011-08-15 12:31:49 UTC (rev 4458) @@ -49,7 +49,7 @@ #ifdef HAVE_LIBMPEG3 ////////// // open a movie up - virtual bool open(const std::string filename, int format = 0); + virtual bool open(const std::string filename, const gem::Properties&); ////////// // close the movie file virtual void close(void); Modified: trunk/Gem/plugins/filmQT/filmQT.cpp =================================================================== --- trunk/Gem/plugins/filmQT/filmQT.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmQT/filmQT.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -32,6 +32,8 @@ #include "filmQT.h" #include "plugins/PluginFactory.h" +#include "Gem/RTE.h" + using namespace gem::plugins; REGISTER_FILMFACTORY("QuickTime", filmQT); @@ -121,7 +123,7 @@ // m_srcGWorld = NULL; } -bool filmQT :: open(const std::string filename, int format) { +bool filmQT :: open(const std::string filename, const gem::Properties&wantProps) { FSSpec theFSSpec; OSErr err = noErr; Rect m_srcRect; @@ -132,13 +134,16 @@ OSType whichMediaType; short flags = 0; int wantedFormat; + double d; if (filename.empty())return false; if (!m_bInit){ error("filmQT: object not correctly initialized\n"); return false; } - if (format>0)m_wantedFormat=format; + if(wantProps.get("colorspace", d)) + m_wantedFormat=d; + wantedFormat= (m_wantedFormat)?m_wantedFormat:GL_RGBA; // Clean up any open files: closeMess(); @@ -191,6 +196,7 @@ &whichMediaType, 0, static_cast<Fixed>(1<<16), NULL, &duration); m_numFrames = movieDur/duration; + m_fps = m_numFrames; // Get the bounds for the movie ::GetMovieBox(m_movie, &m_srcRect); @@ -275,12 +281,6 @@ return &m_image; } - -double filmQT :: getFPS() { - m_fps = m_numFrames; - return m_fps; -} - film::errCode filmQT :: changeImage(int imgNum, int trackNum){ m_readNext = false; if (imgNum ==-1) imgNum=m_curFrame; Modified: trunk/Gem/plugins/filmQT/filmQT.h =================================================================== --- trunk/Gem/plugins/filmQT/filmQT.h 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmQT/filmQT.h 2011-08-15 12:31:49 UTC (rev 4458) @@ -49,14 +49,11 @@ ////////// // open a movie up - virtual bool open(const std::string filename, int format = 0); + virtual bool open(const std::string filename, const gem::Properties&); ////////// // close the movie file virtual void close(void); - // get the frames per seconds (or "-1" if unknown) - virtual double getFPS(void); - ////////// // get the next frame virtual pixBlock* getFrame(void); Modified: trunk/Gem/plugins/filmQT4L/filmQT4L.cpp =================================================================== --- trunk/Gem/plugins/filmQT4L/filmQT4L.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmQT4L/filmQT4L.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -17,15 +17,18 @@ # include "config.h" #endif +#ifdef HAVE_LIBQUICKTIME + #include "filmQT4L.h" #include "plugins/PluginFactory.h" +#include "Gem/Properties.h" +#include "Gem/RTE.h" + using namespace gem::plugins; -#ifdef HAVE_LIBQUICKTIME -# include <colormodels.h> +#include <colormodels.h> REGISTER_FILMFACTORY("quicktime4linux", filmQT4L); -#endif ///////////////////////////////////////////////////////// // @@ -36,10 +39,11 @@ // ///////////////////////////////////////////////////////// -filmQT4L :: filmQT4L(void) : filmBase() { -#ifdef HAVE_LIBQUICKTIME - m_quickfile=0; -#endif +filmQT4L :: filmQT4L(void) : filmBase(), + m_quickfile(NULL), + m_qtformat(0), + m_lastFrame(0) +{ } ///////////////////////////////////////////////////////// @@ -51,7 +55,6 @@ close(); } -#ifdef HAVE_LIBQUICKTIME void filmQT4L :: close(void) { if(m_quickfile)quicktime_close(m_quickfile); @@ -62,9 +65,14 @@ // really open the file ! (OS dependent) // ///////////////////////////////////////////////////////// -bool filmQT4L :: open(const std::string filename, int format) +bool filmQT4L :: open(const std::string filename, const gem::Properties&wantProps) { int wantedFormat=GL_RGBA; + double d; + unsigned int format=0; + if(wantProps.get("format", d)) { + format=d; + } switch(format){ default: break; Modified: trunk/Gem/plugins/filmQT4L/filmQT4L.h =================================================================== --- trunk/Gem/plugins/filmQT4L/filmQT4L.h 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmQT4L/filmQT4L.h 2011-08-15 12:31:49 UTC (rev 4458) @@ -18,10 +18,8 @@ #include "plugins/filmBase.h" #include <stdio.h> -#ifdef HAVE_LIBQUICKTIME #include <quicktime.h> #include <colormodels.h> -#endif // QT /*----------------------------------------------------------------- ------------------------------------------------------------------- @@ -48,10 +46,9 @@ // Destructor virtual ~filmQT4L(void); -#ifdef HAVE_LIBQUICKTIME ////////// // open a movie up - virtual bool open(const std::string filename, int format = 0); + virtual bool open(const std::string filename, const gem::Properties&); ////////// // close the movie file virtual void close(void); @@ -73,7 +70,6 @@ int m_qtformat; imageStruct m_qtimage; -#endif int m_lastFrame; };};}; Modified: trunk/Gem/plugins/filmTEST/filmTEST.cpp =================================================================== --- trunk/Gem/plugins/filmTEST/filmTEST.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmTEST/filmTEST.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -21,6 +21,7 @@ #include "filmTEST.h" #include "plugins/PluginFactory.h" #include "Gem/RTE.h" +#include "Gem/Properties.h" using namespace gem::plugins; @@ -35,8 +36,7 @@ // ///////////////////////////////////////////////////////// -filmTEST :: filmTEST(void) : filmBase(), - m_data(NULL), m_length(0) +filmTEST :: filmTEST(void) { m_image.image.setCsizeByFormat(GL_RGBA); m_image.image.xsize=320; @@ -48,20 +48,39 @@ // really open the file ! (OS dependent) // ///////////////////////////////////////////////////////// -bool filmTEST :: open(const std::string filename, int format) +bool filmTEST :: open(const std::string filename, const gem::Properties&wantProps) { - m_numTracks=1, - - m_curFrame=0; m_numFrames=100; m_fps=20; - m_newfilm=true; - + changeImage(0,0); return true; } +void filmTEST::close(void) {} +bool filmTEST::isThreadable(void) {return true;} + +void filmTEST::setProperties(gem::Properties&props) { +} + +void filmTEST::getProperties(gem::Properties&props) { + std::vector<std::string> keys=props.keys(); + unsigned int i=0; + for(i=0; i<keys.size(); i++) { + std::string key=keys[i]; + props.erase(key); +#define SETPROP(k, v) } else if(k == key) { double d=(double)v; props.set(key, v) + if(""==key) { + SETPROP("fps", m_fps); + SETPROP("frames", m_numFrames); + SETPROP("width", m_image.image.xsize); + SETPROP("height", m_image.image.ysize); + } + } +} + + ///////////////////////////////////////////////////////// // render // @@ -85,3 +104,18 @@ return film::SUCCESS; } + + +bool filmTEST::enumProperties(gem::Properties&readprops, gem::Properties&writeprops) { + readprops.clear(); + writeprops.clear(); + + double d=0; + + readprops.set("width", d); + readprops.set("height", d); + readprops.set("fps", d); + readprops.set("frames", d); + + return true; +} Modified: trunk/Gem/plugins/filmTEST/filmTEST.h =================================================================== --- trunk/Gem/plugins/filmTEST/filmTEST.h 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/filmTEST/filmTEST.h 2011-08-15 12:31:49 UTC (rev 4458) @@ -15,8 +15,8 @@ #ifndef _INCLUDE_GEMPLUGIN__FILMTEST_FILMTEST_H_ #define _INCLUDE_GEMPLUGIN__FILMTEST_FILMTEST_H_ -#include "plugins/filmBase.h" -#include <stdio.h> +#include "plugins/film.h" +#include "Gem/Image.h" /*----------------------------------------------------------------- ------------------------------------------------------------------- @@ -32,7 +32,7 @@ -----------------------------------------------------------------*/ namespace gem { namespace plugins { -class GEM_EXPORT filmTEST : public filmBase { +class GEM_EXPORT filmTEST : public film { public: ////////// @@ -41,8 +41,10 @@ ////////// // open a movie up - virtual bool open(const std::string filename, int format = 0); + virtual bool open(const std::string filename, const gem::Properties&); + virtual void close(void); + ////////// // get the next frame virtual pixBlock* getFrame(void); @@ -51,9 +53,17 @@ // set the next frame to read; virtual errCode changeImage(int imgNum, int trackNum = -1); + virtual bool enumProperties(gem::Properties&readprops, gem::Properties&writeprops); + + virtual void getProperties(gem::Properties&props); + virtual void setProperties(gem::Properties&props); + + virtual bool isThreadable(void); + //----------------------------------- - unsigned char*m_data; - int m_length; + pixBlock m_image; + double m_fps; + unsigned int m_numFrames; };};}; #endif // for header file Modified: trunk/Gem/plugins/recordQT/recordQT.cpp =================================================================== --- trunk/Gem/plugins/recordQT/recordQT.cpp 2011-08-15 12:30:07 UTC (rev 4457) +++ trunk/Gem/plugins/recordQT/recordQT.cpp 2011-08-15 12:31:49 UTC (rev 4458) @@ -8,10 +8,10 @@ #endif #include "recordQT.h" +#include "plugins/PluginFactory.h" #include "Gem/Exception.h" +#include "Gem/RTE.h" -#include "plugins/PluginFactory.h" - using namespace gem::plugins; #ifdef __APPLE__ @@ -34,9 +34,7 @@ /* for post() and error() */ #include "m_pd.h" -#ifdef HAVE_QUICKTIME REGISTER_RECORDFACTORY("QT", recordQT); -#endif ///////////////////////////////////////////////////////// // // recordQT @@ -45,10 +43,6 @@ // Constructor // ///////////////////////////////////////////////////////// -#ifndef HAVE_QUICKTIME -recordQT :: recordQT() : recordBase() {} -recordQT :: ~recordQT(){} -#else recordQT :: recordQT() : recordBase(), m_recordSetup(false), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ pd-gem-CVS mailing list pd-gem-CVS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pd-gem-cvs