1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/gst-plugins-nuvdemux/src/gstnuvdemux.h Tue Oct 24 15:02:26 2006 +0100
1.3 @@ -0,0 +1,173 @@
1.4 +/* GStreamer
1.5 + * Copyright (C) <2006> Renato Araujo Oliveira Filho <renato.filho@indt.org.br>
1.6 + * Rosfran Borges <rosfran.borges@indt.org.br>
1.7 + *
1.8 + * This library is free software; you can redistribute it and/or
1.9 + * modify it under the terms of the GNU Library General Public
1.10 + * License as published by the Free Software Foundation; either
1.11 + * version 2 of the License, or (at your option) any later version.
1.12 + *
1.13 + * This library is distributed in the hope that it will be useful,
1.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.16 + * Library General Public License for more details.
1.17 + *
1.18 + * You should have received a copy of the GNU Library General Public
1.19 + * License along with this library; if not, write to the
1.20 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1.21 + * Boston, MA 02111-1307, USA.
1.22 + */
1.23 +
1.24 +#ifndef __GST_NUV_DEMUX_H__
1.25 +#define __GST_NUV_DEMUX_H__
1.26 +
1.27 +#include <gst/gst.h>
1.28 +
1.29 +#include <gst/base/gstadapter.h>
1.30 +
1.31 +G_BEGIN_DECLS
1.32 +
1.33 +#define GST_TYPE_NUV_DEMUX \
1.34 + (gst_nuv_demux_get_type ())
1.35 +#define GST_NUV_DEMUX(obj) \
1.36 + (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_NUV_DEMUX, GstNuvDemux))
1.37 +#define GST_NUV_DEMUX_CLASS(klass) \
1.38 + (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_NUV_DEMUX, GstNuvDemuxClass))
1.39 +#define GST_IS_NUV_DEMUX(obj) \
1.40 + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NUV_DEMUX))
1.41 +#define GST_IS_NUV_DEMUX_CLASS(klass) \
1.42 + (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_NUV_DEMUX))
1.43 +
1.44 +
1.45 +/* */
1.46 +typedef struct
1.47 +{
1.48 + gchar id[12]; /* "NuppelVideo\0" or "MythTVVideo\0" */
1.49 + gchar version[5]; /* "x.xx\0" */
1.50 +
1.51 + gint i_width;
1.52 + gint i_height;
1.53 + gint i_width_desired;
1.54 + gint i_height_desired;
1.55 +
1.56 + gchar i_mode; /* P progressive, I interlaced */
1.57 +
1.58 + gdouble d_aspect; /* 1.0 squared pixel */
1.59 + gdouble d_fps;
1.60 +
1.61 + gint i_video_blocks; /* 0 no video, -1 unknown */
1.62 + gint i_audio_blocks;
1.63 + gint i_text_blocks;
1.64 +
1.65 + gint i_keyframe_distance;
1.66 +
1.67 +} nuv_header;
1.68 +
1.69 +typedef struct
1.70 +{
1.71 + gchar i_type; /* A: audio, V: video, S: sync; T: test
1.72 + R: Seekpoint (string:RTjjjjjjjj)
1.73 + D: Extra data for codec */
1.74 + gchar i_compression; /* V: 0 uncompressed
1.75 + 1 RTJpeg
1.76 + 2 RTJpeg+lzo
1.77 + N black frame
1.78 + L copy last
1.79 + A: 0 uncompressed (44100 1-bits, 2ch)
1.80 + 1 lzo
1.81 + 2 layer 2
1.82 + 3 layer 3
1.83 + F flac
1.84 + S shorten
1.85 + N null frame loudless
1.86 + L copy last
1.87 + S: B audio and vdeo sync point
1.88 + A audio sync info (timecode == effective
1.89 + dsp frequency*100)
1.90 + V next video sync (timecode == next video
1.91 + frame num)
1.92 + S audio,video,text correlation */
1.93 + gchar i_keyframe; /* 0 keyframe, else no no key frame */
1.94 + guint8 i_filters; /* 0x01: gauss 5 pixel (8,2,2,2,2)/16
1.95 + 0x02: gauss 5 pixel (8,1,1,1,1)/12
1.96 + 0x04: cartoon filter */
1.97 +
1.98 + guint32 i_timecode; /* ms */
1.99 +
1.100 + guint32 i_length; /* V,A,T: length of following data
1.101 + S: length of packet correl */
1.102 +} nuv_frame_header;
1.103 +
1.104 +/* FIXME Not sure of this one */
1.105 +typedef struct
1.106 +{
1.107 + gint i_version;
1.108 + guint32 i_video_fcc;
1.109 +
1.110 + guint32 i_audio_fcc;
1.111 + gint i_audio_sample_rate;
1.112 + gint i_audio_bits_per_sample;
1.113 + gint i_audio_channels;
1.114 + gint i_audio_compression_ratio;
1.115 + gint i_audio_quality;
1.116 + gint i_rtjpeg_quality;
1.117 + gint i_rtjpeg_luma_filter;
1.118 + gint i_rtjpeg_chroma_filter;
1.119 + gint i_lavc_bitrate;
1.120 + gint i_lavc_qmin;
1.121 + gint i_lavc_qmax;
1.122 + gint i_lavc_maxqdiff;
1.123 + gint64 i_seekable_offset;
1.124 + gint64 i_keyframe_adjust_offset;
1.125 +
1.126 +} nuv_extended_header;
1.127 +
1.128 +typedef enum {
1.129 + GST_NUV_DEMUX_START,
1.130 + GST_NUV_DEMUX_HEADER_DATA,
1.131 + GST_NUV_DEMUX_EXTRA_DATA,
1.132 + GST_NUV_DEMUX_MPEG_DATA,
1.133 + GST_NUV_DEMUX_EXTEND_HEADER,
1.134 + GST_NUV_DEMUX_EXTEND_HEADER_DATA,
1.135 + GST_NUV_DEMUX_FRAME_HEADER,
1.136 + GST_NUV_DEMUX_MOVI,
1.137 + GST_NUV_DEMUX_INVALID_DATA
1.138 +} GstNuvDemuxState;
1.139 +
1.140 +typedef struct _GstNuvDemux {
1.141 + GstElement parent;
1.142 +
1.143 + guint mode;
1.144 + GstAdapter *adapter;
1.145 + guint64 video_offset;
1.146 + guint64 audio_offset;
1.147 +
1.148 + /* pads */
1.149 + GstPad *sinkpad;
1.150 + GstPad *src_video_pad;
1.151 + GstPad *src_audio_pad;
1.152 + gboolean first_video;
1.153 + gboolean first_audio;
1.154 +
1.155 + /* NUV decoding state */
1.156 + GstNuvDemuxState state;
1.157 + guint64 offset;
1.158 +
1.159 + /* Mpeg ExtraData */
1.160 + guint64 mpeg_data_size;
1.161 + GstBuffer *mpeg_buffer;
1.162 +
1.163 + nuv_header *h;
1.164 + nuv_extended_header *eh;
1.165 + nuv_frame_header *fh;
1.166 +} GstNuvDemux;
1.167 +
1.168 +typedef struct _GstNuvDemuxClass {
1.169 + GstElementClass parent_class;
1.170 +} GstNuvDemuxClass;
1.171 +
1.172 +GType gst_nuv_demux_get_type (void);
1.173 +
1.174 +G_END_DECLS
1.175 +
1.176 +#endif /* __GST_NUV_DEMUX_H__ */