2 * Copyright (C) <2014> Stian Selnes <stian@pexip.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 * Author: Dejan Sakelsak sahel@kiberpipa.org
22 #ifndef __GST_RTP_H261_PAY_H__
23 #define __GST_RTP_H261_PAY_H__
26 #include <gst/rtp/gstrtpbasepayload.h>
27 #include <gst/base/gstadapter.h>
30 #define GST_TYPE_RTP_H261_PAY \
31 (gst_rtp_h261_pay_get_type())
32 #define GST_RTP_H261_PAY(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_H261_PAY,GstRtpH261Pay))
34 #define GST_RTP_H261_PAY_CLASS(klass) \
35 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_H261_PAY,GstRtpH261PayClass))
36 #define GST_IS_RTP_H261_PAY(obj) \
37 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_H261_PAY))
38 #define GST_IS_RTP_H261_PAY_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_H261_PAY))
40 typedef struct _GstRtpH261PayClass GstRtpH261PayClass;
41 typedef struct _GstRtpH261Pay GstRtpH261Pay;
45 GstRTPBasePayload payload;
49 GstClockTime timestamp;
52 struct _GstRtpH261PayClass
54 GstRTPBasePayloadClass parent_class;
57 typedef struct _GstRtpH261PayHeader
59 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
60 unsigned int v:1; /* Motion vector flag */
61 unsigned int i:1; /* Intra encoded data */
62 unsigned int ebit:3; /* End position */
63 unsigned int sbit:3; /* Start position */
65 unsigned int mbap1:4; /* MB address predictor - part1 */
66 unsigned int gobn:4; /* GOB number */
68 unsigned int hmvd1:2; /* Horizontal motion vector data - part1 */
69 unsigned int quant:5; /* Quantizer */
70 unsigned int mbap2:1; /* MB address predictor - part2 */
72 unsigned int vmvd:5; /* Horizontal motion vector data - part1 */
73 unsigned int hmvd2:3; /* Vertical motion vector data */
74 #elif G_BYTE_ORDER == G_BIG_ENDIAN
75 unsigned int sbit:3; /* Start position */
76 unsigned int ebit:3; /* End position */
77 unsigned int i:1; /* Intra encoded data */
78 unsigned int v:1; /* Motion vector flag */
80 unsigned int gobn:4; /* GOB number */
81 unsigned int mbap1:4; /* MB address predictor - part1 */
83 unsigned int mbap2:1; /* MB address predictor - part2 */
84 unsigned int quant:5; /* Quantizer */
85 unsigned int hmvd1:2; /* Horizontal motion vector data - part1 */
87 unsigned int hmvd2:3; /* Vertical motion vector data */
88 unsigned int vmvd:5; /* Horizontal motion vector data - part1 */
90 #error "G_BYTE_ORDER should be big or little endian."
92 } GstRtpH261PayHeader;
93 #define GST_RTP_H261_PAYLOAD_HEADER_LEN 4
95 GType gst_rtp_h261_pay_get_type (void);
98 #endif /* __GST_RTP_H261_PAY_H__ */