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 * gstmplexibitstream.hh: gstreamer/mplex input bitstream 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_MPLEXIBITSTREAM_H__ 24 #define __GST_MPLEXIBITSTREAM_H__ 25 26 #include <gst/gst.h> 27 #include <mjpeg_types.h> 28 #include <bits.hpp> 29 30 #include "gstmplex.hh" 31 32 /* forward declaration; break circular referencing */ 33 typedef struct _GstMplex GstMplex; 34 typedef struct _GstMplexPad GstMplexPad; 35 36 class GstMplexIBitStream : public IBitStream { 37 public: 38 GstMplexIBitStream (GstMplexPad *pad, guint buf_size = BUFFER_SIZE); 39 bool ReadBuffer (); 40 41 protected: 42 /* read data */ 43 size_t ReadStreamBytes (uint8_t *buf, size_t number); 44 45 /* are we at EOS? */ 46 bool EndOfStream (void); 47 48 private: 49 GstMplex *mplex; 50 GstMplexPad *mpad; 51 gboolean eos; 52 }; 53 54 #endif /* __GST_MPLEXIBITSTREAM_H__ */ 55