Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

RgbDataSrcAVI.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Stream_RgbDataSrcAVI_h
00002 #define Impala_Core_Stream_RgbDataSrcAVI_h
00003 
00004 #include "Core/Stream/RgbDataSrc.h"
00005 #include "Link/DXMedia/HxAVIMedia.h"
00006 
00007 namespace Impala
00008 {
00009 namespace Core
00010 {
00011 namespace Stream
00012 {
00013 
00014 
00015 class RgbDataSrcAVI : public RgbDataSrc
00016 {
00017 public:
00018 
00019     RgbDataSrcAVI(int src, String srcName) : RgbDataSrc(src, srcName)
00020     {
00021         mSrcHandle = 0;
00022         Init();
00023     }
00024 
00025     virtual
00026     ~RgbDataSrcAVI()
00027     {
00028         if (mSrcHandle)
00029             HxAVICloseVideo(mSrcHandle);
00030     }
00031 
00032     virtual bool
00033     Valid() const
00034     {
00035         return (mSrcHandle != 0);
00036     }
00037 
00038 protected:
00039 
00040     bool
00041     ReadFrameData()
00042     {
00043         mData = HxAVIGetFrame(mSrcHandle, FrameNr());
00044         return true;
00045     }
00046 
00047 private:
00048 
00049     void
00050     Init()
00051     {
00052         if (!(mSrcHandle = HxAVILoadVideo(mSrcName.c_str())))
00053         {
00054             ILOG_ERROR("Unable to HxAVILoadVideo " << mSrcName);
00055             return;
00056         }
00057         mFrameWidth = HxAVIGetFrameWidth(mSrcHandle);
00058         mFrameHeight = HxAVIGetFrameHeight(mSrcHandle);
00059         mLastFrame = HxAVIGetLength(mSrcHandle) - 1;
00060     }
00061 
00062     void* mSrcHandle;
00063 
00064     ILOG_VAR_DEC;
00065 };
00066 
00067 ILOG_VAR_INIT(RgbDataSrcAVI, Impala.Core.Stream);
00068 
00069 } // namespace Stream
00070 } // namespace Core
00071 } // namespace Impala
00072 
00073 #endif

Generated on Fri Mar 19 09:31:18 2010 for ImpalaSrc by  doxygen 1.5.1