1 /*
2  * gstrtpvp8pay.h - Header for GstRtpVP8Pay
3  * Copyright (C) 2011 Sjoerd Simons <sjoerd@luon.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #ifndef __GST_RTP_VP8_PAY_H__
21 #define __GST_RTP_VP8_PAY_H__
22 
23 #include <gst/rtp/gstrtpbasepayload.h>
24 
25 G_BEGIN_DECLS
26 
27 #define GST_TYPE_RTP_VP8_PAY \
28   (gst_rtp_vp8_pay_get_type())
29 #define GST_RTP_VP8_PAY(obj) \
30   (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_RTP_VP8_PAY, GstRtpVP8Pay))
31 #define GST_RTP_VP8_PAY_CLASS(klass) \
32   (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_RTP_VP8_PAY, GstRtpVP8PayClass))
33 #define GST_IS_RTP_VP8_PAY(obj) \
34   (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_RTP_VP8_PAY))
35 #define GST_IS_RTP_VP8_PAY_CLASS(klass) \
36   (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_RTP_VP8_PAY))
37 #define GST_RTP_VP8_PAY_GET_CLASS(obj) \
38   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_VP8_PAY, GstRtpVP8PayClass))
39 
40 typedef struct _GstRtpVP8Pay GstRtpVP8Pay;
41 typedef struct _GstRtpVP8PayClass GstRtpVP8PayClass;
42 typedef enum _PictureIDMode PictureIDMode;
43 
44 enum _PictureIDMode {
45   VP8_PAY_NO_PICTURE_ID,
46   VP8_PAY_PICTURE_ID_7BITS,
47   VP8_PAY_PICTURE_ID_15BITS,
48 };
49 
50 struct _GstRtpVP8PayClass
51 {
52   GstRTPBasePayloadClass parent_class;
53 };
54 
55 struct _GstRtpVP8Pay
56 {
57   GstRTPBasePayload parent;
58   gboolean is_keyframe;
59   gint n_partitions;
60   /* Treat frame header & tag & partition size block as the first partition,
61    * folowed by max. 8 data partitions. last offset is the end of the buffer */
62   guint partition_offset[10];
63   guint partition_size[9];
64   PictureIDMode picture_id_mode;
65   guint16 picture_id;
66 };
67 
68 GType gst_rtp_vp8_pay_get_type (void);
69 
70 gboolean gst_rtp_vp8_pay_plugin_init (GstPlugin * plugin);
71 
72 G_END_DECLS
73 
74 #endif /* #ifndef __GST_RTP_VP8_PAY_H__ */
75