00001 // /// // Mx clientSDK 00002 // ///// //// Mx Crossplatform Client Library 00003 // /// XXX XXX /// 00004 // /// XXX XXX /// $RCSfile: mxcpcMxPEGRawFrameDumper.h,v $ 00005 // /// XXX /// $Revision: 1.3 $ 00006 // /// XXX XXX /// $Date: 2006/01/13 13:53:08 $ 00007 // //// XXX XXX //// $Author: cvs-kai $ 00008 // //// //// 00009 // //// M O B O T I X //////////////////////////////////////////////// 00010 // //// Security Vision Systems ////////////////////////////////////////////// 00011 // // 00012 // Copyright (C) 2005 - 2006, MOBOTIX AG, Germany // 00013 // This software is made available under the BSD licence. Please refer // 00014 // to the file LICENCE.TXT contained in this distribution for details. // 00015 // // 00016 // ///////////////////////////////////////////////////////////////////// 00017 00018 00019 00020 #ifndef __MXCPC_MXPEGRAWFRAMEDUMPER_H__ 00021 #define __MXCPC_MXPEGRAWFRAMEDUMPER_H__ 00022 00023 00024 00025 #include <mxcpcBufferedMxPEGDecoderBackEnd.h> 00026 00027 00028 00029 class mxcpcByteStreamReceiver; 00030 00031 00032 00033 //! <tt>MxPEG</tt> decoder backend dumping raw <tt>RGB</tt> / </tt>YUV</tt> 00034 //! frames to a generic byte stream receiver. 00035 /*! 00036 * \ingroup mxcpc_core 00037 * 00038 * Per default, the dumper writes raw <tt>RGB</tt> data with 3 bytes per pixel 00039 * (being <tt>R</tt>, <tt>G</tt> and <tt>B</tt> values respectively). If 00040 * <tt>RGB</tt>-to-<tt>YUV</tt> conversion is turned on by passing the 00041 * respective flag to the constructor, the frame is dumped in the planar 00042 * <tt>yv12 YUV</tt> format. Note that this <tt>YUV</tt> format uses the 00043 * <tt>YCbCr</tt> colorspace rather than plain <tt>YUV</tt>. 00044 * 00045 * No frame separators will be written. 00046 * 00047 * If <i>explicit dump mode</i> is enabled via setExplicitDumpModeEnabled(), 00048 * frames will not automatically be dumped on frameComplete() events, but only 00049 * when dumpFrame() gets called. 00050 * 00051 * \note The generated raw frame formats are digestible by the commonly used 00052 * <tt>transcode</tt> and <tt>MPlayer/mencoder</tt> tools. 00053 */ 00054 class mxcpcMxPEGRawFrameDumper : public mxcpcBufferedMxPEGDecoderBackEnd { 00055 00056 private: 00057 mxcpcByteStreamReceiver *FrameReceiver; 00058 bool ConvertToYUV; 00059 mxcpc::u8 *YUVBuffer; 00060 bool ExplicitDumpMode; 00061 00062 public: 00063 //! The frame dumper assumes ownership over the frame receiver. 00064 mxcpcMxPEGRawFrameDumper(mxcpcByteStreamReceiver *frame_receiver, 00065 bool convert_to_YUV = false); 00066 ~mxcpcMxPEGRawFrameDumper(); 00067 00068 public: 00069 //! Explicitly causes the current contents of the frame buffer to be written 00070 //! to the frame receiver. 00071 void dumpFrame(void); 00072 //! Toggles explicit dump mode. 00073 void setExplicitDumpModeEnabled(bool enabled); 00074 //! (Re)implemented. 00075 void videoResolutionChanged(int width, int height); 00076 //! (Re)implemented. 00077 void errorEncountered(void); 00078 //! (Re)implemented. 00079 void frameComplete(void); 00080 //! (Re)implemented. 00081 void videoTileReceived(void); 00082 }; 00083 00084 00085 00086 #endif // __MXCPC_MXPEGRAWFRAMEDUMPER_H__ 00087