/* * Copyright (c) 2012 Yoann Blein * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #ifndef VIDEOENCODER_H #define VIDEOENCODER_H #include #include #include #include #include #include namespace Swift { class VideoEncoder { public: VideoEncoder() {} virtual ~VideoEncoder() {} void addFrame(VideoFrame::ref frame); void startEncoding(); void stopEncoding(); protected: virtual void encodingLoop() = 0; VideoFrame::ref popWhenFrameIsAvailable(); protected: bool stop; private: std::queue frames; boost::mutex queueMutex; boost::condition_variable queueCondVar; boost::thread encodingThread; }; } #endif // VIDEOENCODER_H