1 /* GStreamer mpeg2enc (mjpegtools) wrapper
2  * (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
3  * (c) 2006 Mark Nauwelaerts <manauw@skynet.be>
4  *
5  * gstmpeg2encstreamwriter.hh: GStreamer/mpeg2enc output 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_MPEG2ENCSTREAMWRITER_H__
24 #define __GST_MPEG2ENCSTREAMWRITER_H__
25 
26 #include <gst/gst.h>
27 
28 #include <elemstrmwriter.hh>
29 
30 #if GST_MJPEGTOOLS_API >= 10800
31 
32 class GstMpeg2EncStreamWriter : public ElemStrmWriter {
33   public:
34   GstMpeg2EncStreamWriter (GstPad *pad, EncoderParams *params);
35   ~GstMpeg2EncStreamWriter ();
36 
37   /* output functions */
38   void WriteOutBufferUpto (const guint8 * buffer,
39       const guint32 flush_upto);
40   guint64 BitCount ();
41 
42   private:
43   GstPad *pad;
44   GstBuffer *buf;
45 };
46 
47 #else
48 
49 class GstMpeg2EncStreamWriter : public ElemStrmWriter {
50 public:
51   GstMpeg2EncStreamWriter (GstPad *pad, EncoderParams *params);
52   ~GstMpeg2EncStreamWriter ();
53 
54   /* output functions */
55   void PutBits (guint32 val, gint n);
56   void FrameBegin ();
57   void FrameFlush ();
58   void FrameDiscard ();
59 
60 private:
61   GstPad *pad;
62   GstBuffer *buf;
63 };
64 #endif /* GST_MJPEGTOOLS_API >= 10800 */
65 
66 #endif /* __GST_MPEG2ENCSTREAMWRITER_H__ */
67