Merging gst-plugins-ugly
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-ugly / gst / asfdemux / asfpacket.h
1 /* GStreamer ASF/WMV/WMA demuxer
2  * Copyright (C) 2007 Tim-Philipp Müller <tim centricular net>
3  *
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.
8  *
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.
13  *
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., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef __ASF_PACKET_H__
21 #define __ASF_PACKET_H__
22
23 #include <gst/gstbuffer.h>
24 #include <gst/gstclock.h>
25
26 #include "gstasfdemux.h"
27
28 G_BEGIN_DECLS
29
30 typedef struct {
31   gboolean      keyframe;          /* buffer flags might not survive merge.. */
32   guint         mo_number;         /* media object number (unused)           */
33   guint         mo_offset;         /* offset (timestamp for compressed data) */
34   guint         mo_size;           /* size of media-object-to-be, or 0       */
35   guint         buf_filled;        /* how much of the mo data we got so far  */
36   GstBuffer    *buf;               /* buffer to assemble media-object or NULL*/
37   guint         rep_data_len;      /* should never be more than 256, since   */
38   guint8        rep_data[256];     /* the length should be stored in a byte  */
39   GstClockTime  ts;
40   GstClockTime  duration;          /* is not always available                */
41   guint8        par_x;             /* not always available (0:deactivated)   */
42   guint8        par_y;             /* not always available (0:deactivated)   */
43   gboolean      interlaced;        /* default: FALSE */
44   gboolean      tff;
45   gboolean      rff;
46 } AsfPayload;
47
48 typedef struct {
49   GstBuffer    *buf;
50   const guint8 *bdata;
51   guint         length;            /* packet length (unused)               */
52   guint         padding;           /* length of padding at end of packet   */
53   guint         sequence;          /* sequence (unused)                    */
54   GstClockTime  send_time;
55   GstClockTime  duration;
56
57   guint8        prop_flags;        /* payload length types                 */
58 } AsfPacket;
59
60 typedef enum {
61   GST_ASF_DEMUX_PARSE_PACKET_ERROR_NONE,
62   GST_ASF_DEMUX_PARSE_PACKET_ERROR_RECOVERABLE,
63   GST_ASF_DEMUX_PARSE_PACKET_ERROR_FATAL
64 } GstAsfDemuxParsePacketError;
65
66 GstAsfDemuxParsePacketError gst_asf_demux_parse_packet (GstASFDemux * demux, GstBuffer * buf);
67
68 #define gst_asf_payload_is_complete(payload) \
69     ((payload)->buf_filled >= (payload)->mo_size)
70
71 G_END_DECLS
72
73 #endif /* __ASF_PACKET_H__ */
74