1 /* GStreamer mplex (mjpegtools) wrapper 2 * (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net> 3 * (c) 2008 Mark Nauwelaerts <mnauw@users.sourceforge.net> 4 * 5 * gstmplexoutputstream.hh: gstreamer/mplex output stream wrapper 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Library General Public 9 * License as published by the Free Software Foundation; either 10 * version 2 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Library General Public License for more details. 16 * 17 * You should have received a copy of the GNU Library General Public 18 * License along with this library; if not, write to the 19 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 20 * Boston, MA 02110-1301, USA. 21 */ 22 23 #ifndef __GST_MPLEXOUTPUTSTREAM_H__ 24 #define __GST_MPLEXOUTPUTSTREAM_H__ 25 26 #include <gst/gst.h> 27 #include <mjpeg_types.h> 28 #include <outputstrm.hpp> 29 30 #include "gstmplex.hh" 31 32 class GstMplexOutputStream : public OutputStream { 33 public: 34 GstMplexOutputStream (GstMplex *element, GstPad *pad); 35 36 /* open/close. Basically 'no-op's (close() sets EOS). */ 37 int Open (void); 38 void Close (void); 39 40 /* get size of current segment */ 41 #if GST_MJPEGTOOLS_API >= 10900 42 uint64_t SegmentSize (void); 43 #else 44 off_t SegmentSize (void); 45 #endif 46 47 /* next segment */ 48 void NextSegment (void); 49 50 /* write data */ 51 void Write (guint8 *data, guint len); 52 53 private: 54 GstMplex *mplex; 55 GstPad *pad; 56 guint64 size; 57 }; 58 59 #endif /* __GST_MPLEXOUTPUTSTREAM_H__ */ 60