diff options
137 files changed, 4897 insertions, 5312 deletions
@@ -1,3 +1,7 @@ +2004-03-15 Johan Dahlin <johan@gnome.org> + + * *.h: Revert indenting + 2004-03-15 Thomas Vander Stichele <thomas at apestaart dot org> * configure.ac: diff --git a/ext/arts/gst_arts.h b/ext/arts/gst_arts.h index ace4f14e..cf0ead06 100644 --- a/ext/arts/gst_arts.h +++ b/ext/arts/gst_arts.h @@ -28,9 +28,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_ARTS \ (gst_arts_get_type()) @@ -43,26 +42,24 @@ extern "C" #define GST_IS_ARTS_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ARTS)) - typedef struct _GstARTS GstARTS; - typedef struct _GstARTSClass GstARTSClass; +typedef struct _GstARTS GstARTS; +typedef struct _GstARTSClass GstARTSClass; - struct _GstARTS - { - GstElement element; +struct _GstARTS { + GstElement element; - GstPad *sinkpad, *srcpad; - void *wrapper; - }; + GstPad *sinkpad, *srcpad; + void *wrapper; +}; - struct _GstARTSClass - { - GstElementClass parent_class; - }; +struct _GstARTSClass { + GstElementClass parent_class; +}; #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_ARTS_H__ */ +#endif /* __GST_ARTS_H__ */ diff --git a/ext/arts/gst_artsio_impl.h b/ext/arts/gst_artsio_impl.h index c67fbd2b..8ffb29b6 100644 --- a/ext/arts/gst_artsio_impl.h +++ b/ext/arts/gst_artsio_impl.h @@ -1,14 +1,14 @@ #include <gst/gst.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ - void *gst_arts_wrapper_new (GstPad * sinkpad, GstPad * sourcepad); - void gst_arts_wrapper_free (void *wrapper); - void gst_arts_wrapper_do (void *wrapper); +void *gst_arts_wrapper_new(GstPad *sinkpad, GstPad *sourcepad); +void gst_arts_wrapper_free(void *wrapper); +void gst_arts_wrapper_do(void *wrapper); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ + diff --git a/ext/artsd/gstartsdsink.h b/ext/artsd/gstartsdsink.h index 53968568..6cece273 100644 --- a/ext/artsd/gstartsdsink.h +++ b/ext/artsd/gstartsdsink.h @@ -25,9 +25,8 @@ #include <artsc.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_ARTSDSINK \ @@ -41,42 +40,39 @@ extern "C" #define GST_IS_ARTSDSINK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ARTSDSINK)) - typedef enum - { - GST_ARTSDSINK_OPEN = GST_ELEMENT_FLAG_LAST, - GST_ARTSDSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, - } GstArtsdSinkFlags; +typedef enum { + GST_ARTSDSINK_OPEN = GST_ELEMENT_FLAG_LAST, + GST_ARTSDSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST+2, +} GstArtsdSinkFlags; - typedef struct _GstArtsdsink GstArtsdsink; - typedef struct _GstArtsdsinkClass GstArtsdsinkClass; +typedef struct _GstArtsdsink GstArtsdsink; +typedef struct _GstArtsdsinkClass GstArtsdsinkClass; - struct _GstArtsdsink - { - GstElement element; +struct _GstArtsdsink { + GstElement element; - GstPad *sinkpad; + GstPad *sinkpad; - gboolean connected; - arts_stream_t stream; - gboolean mute; - gboolean signd; - gint depth; - gint channels; - gint frequency; - gchar *connect_name; - }; + gboolean connected; + arts_stream_t stream; + gboolean mute; + gboolean signd; + gint depth; + gint channels; + gint frequency; + gchar* connect_name; +}; - struct _GstArtsdsinkClass - { - GstElementClass parent_class; - }; +struct _GstArtsdsinkClass { + GstElementClass parent_class; +}; - GType gst_artsdsink_get_type (void); +GType gst_artsdsink_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_ARTSDSINK_H__ */ +#endif /* __GST_ARTSDSINK_H__ */ diff --git a/ext/audiofile/gstafparse.h b/ext/audiofile/gstafparse.h index 941b427b..0f636dcd 100644 --- a/ext/audiofile/gstafparse.h +++ b/ext/audiofile/gstafparse.h @@ -27,14 +27,13 @@ #include <gst/gst.h> #include <gst/bytestream/bytestream.h> -#include <audiofile.h> /* what else are we to do */ +#include <audiofile.h> /* what else are we to do */ #include <af_vfs.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ /*GstElementDetails gst_afparse_details;*/ @@ -51,58 +50,55 @@ extern "C" #define GST_IS_AFPARSE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AFPARSE)) - typedef struct _GstAFParse GstAFParse; - typedef struct _GstAFParseClass GstAFParseClass; - - typedef enum - { - GST_AFPARSE_OPEN = GST_ELEMENT_FLAG_LAST, - - GST_AFPARSE_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, - } GstAFParseFlags; - - struct _GstAFParse - { - GstElement element; - GstPad *srcpad; - GstPad *sinkpad; - - AFvirtualfile *vfile; - AFfilehandle file; - int format; - int channels; - int width; - unsigned int rate; - gboolean is_signed; - int type; /* type of output, compare to audiofile.h - * RAW, AIFF, AIFFC, NEXTSND, WAVE - */ - /* blocking */ - gulong curoffset; - gulong bytes_per_read; - gint frames_per_read; - - gulong seq; - gint64 timestamp; - /* FIXME : endianness is a little cryptic at this point */ - int endianness_data; /* 4321 or 1234 */ - int endianness_wanted; /* same thing, but what the output format wants */ - int endianness_output; /* what the output endianness will be */ - }; - - struct _GstAFParseClass - { - GstElementClass parent_class; - - /* signals */ - void (*handoff) (GstElement * element, GstPad * pad); - }; - - gboolean gst_afparse_plugin_init (GstPlugin * plugin); +typedef struct _GstAFParse GstAFParse; +typedef struct _GstAFParseClass GstAFParseClass; + +typedef enum { + GST_AFPARSE_OPEN = GST_ELEMENT_FLAG_LAST, + + GST_AFPARSE_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, +} GstAFParseFlags; + +struct _GstAFParse { + GstElement element; + GstPad *srcpad; + GstPad *sinkpad; + + AFvirtualfile *vfile; + AFfilehandle file; + int format; + int channels; + int width; + unsigned int rate; + gboolean is_signed; + int type; /* type of output, compare to audiofile.h + * RAW, AIFF, AIFFC, NEXTSND, WAVE + */ + /* blocking */ + gulong curoffset; + gulong bytes_per_read; + gint frames_per_read; + + gulong seq; + gint64 timestamp; + /* FIXME : endianness is a little cryptic at this point */ + int endianness_data; /* 4321 or 1234 */ + int endianness_wanted; /* same thing, but what the output format wants */ + int endianness_output; /* what the output endianness will be */ +}; + +struct _GstAFParseClass { + GstElementClass parent_class; + + /* signals */ + void (*handoff) (GstElement *element,GstPad *pad); +}; + +gboolean gst_afparse_plugin_init (GstPlugin *plugin); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_AFPARSE_H__ */ +#endif /* __GST_AFPARSE_H__ */ diff --git a/ext/audiofile/gstafsink.h b/ext/audiofile/gstafsink.h index 4e894ee7..76ce30af 100644 --- a/ext/audiofile/gstafsink.h +++ b/ext/audiofile/gstafsink.h @@ -26,13 +26,12 @@ #include <gst/gst.h> -#include <audiofile.h> /* what else are we to do */ +#include <audiofile.h> /* what else are we to do */ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ /*GstElementDetails gst_afsink_details;*/ @@ -49,56 +48,53 @@ extern "C" #define GST_IS_AFSINK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AFSINK)) - typedef struct _GstAFSink GstAFSink; - typedef struct _GstAFSinkClass GstAFSinkClass; +typedef struct _GstAFSink GstAFSink; +typedef struct _GstAFSinkClass GstAFSinkClass; - typedef enum - { - GST_AFSINK_OPEN = GST_ELEMENT_FLAG_LAST, +typedef enum { + GST_AFSINK_OPEN = GST_ELEMENT_FLAG_LAST, - GST_AFSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, - } GstAFSinkFlags; + GST_AFSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, +} GstAFSinkFlags; - struct _GstAFSink - { - GstElement element; - GstPad *sinkpad; +struct _GstAFSink { + GstElement element; + GstPad *sinkpad; - gchar *filename; + gchar *filename; /* FILE *file; */ /* AFfilesetup outfilesetup; */ - AFfilehandle file; - int format; - int channels; - int width; - unsigned int rate; - gboolean is_signed; - int type; /* type of output, compare to audiofile.h - * RAW, AIFF, AIFFC, NEXTSND, WAVE - */ - /* FIXME : endianness is a little cryptic at this point */ - int endianness_data; /* 4321 or 1234 */ - int endianness_wanted; /* same thing, but what the output format wants */ - int endianness_output; /* what the output endianness will be */ - }; - - struct _GstAFSinkClass - { - GstElementClass parent_class; - - /* signals */ - void (*handoff) (GstElement * element, GstPad * pad); - }; - - GType gst_afsink_get_type (void); - gboolean gst_afsink_plugin_init (GstPlugin * plugin); + AFfilehandle file; + int format; + int channels; + int width; + unsigned int rate; + gboolean is_signed; + int type; /* type of output, compare to audiofile.h + * RAW, AIFF, AIFFC, NEXTSND, WAVE + */ + /* FIXME : endianness is a little cryptic at this point */ + int endianness_data; /* 4321 or 1234 */ + int endianness_wanted; /* same thing, but what the output format wants */ + int endianness_output; /* what the output endianness will be */ +}; + +struct _GstAFSinkClass { + GstElementClass parent_class; + + /* signals */ + void (*handoff) (GstElement *element,GstPad *pad); +}; + +GType gst_afsink_get_type (void); +gboolean gst_afsink_plugin_init (GstPlugin *plugin); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_AFSINK_H__ */ +#endif /* __GST_AFSINK_H__ */ diff --git a/ext/audiofile/gstafsrc.h b/ext/audiofile/gstafsrc.h index ff607564..c96c20c3 100644 --- a/ext/audiofile/gstafsrc.h +++ b/ext/audiofile/gstafsrc.h @@ -26,13 +26,12 @@ #include <gst/gst.h> -#include <audiofile.h> /* what else are we to do */ +#include <audiofile.h> /* what else are we to do */ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ /*GstElementDetails gst_afsrc_details;*/ @@ -49,63 +48,60 @@ extern "C" #define GST_IS_AFSRC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AFSRC)) - typedef struct _GstAFSrc GstAFSrc; - typedef struct _GstAFSrcClass GstAFSrcClass; +typedef struct _GstAFSrc GstAFSrc; +typedef struct _GstAFSrcClass GstAFSrcClass; - typedef enum - { - GST_AFSRC_OPEN = GST_ELEMENT_FLAG_LAST, +typedef enum { + GST_AFSRC_OPEN = GST_ELEMENT_FLAG_LAST, - GST_AFSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, - } GstAFSrcFlags; + GST_AFSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, +} GstAFSrcFlags; - struct _GstAFSrc - { - GstElement element; - GstPad *srcpad; +struct _GstAFSrc { + GstElement element; + GstPad *srcpad; - gchar *filename; + gchar *filename; /* FILE *file; */ /* AFfilesetup outfilesetup; */ - AFfilehandle file; - int format; - int channels; - int width; - unsigned int rate; - gboolean is_signed; - int type; /* type of output, compare to audiofile.h - * RAW, AIFF, AIFFC, NEXTSND, WAVE - */ - /* blocking */ - gulong curoffset; - gulong bytes_per_read; + AFfilehandle file; + int format; + int channels; + int width; + unsigned int rate; + gboolean is_signed; + int type; /* type of output, compare to audiofile.h + * RAW, AIFF, AIFFC, NEXTSND, WAVE + */ + /* blocking */ + gulong curoffset; + gulong bytes_per_read; - gulong seq; - guint64 framestamp; - /* FIXME : endianness is a little cryptic at this point */ - int endianness_data; /* 4321 or 1234 */ - int endianness_wanted; /* same thing, but what the output format wants */ - int endianness_output; /* what the output endianness will be */ - }; + gulong seq; + guint64 framestamp; + /* FIXME : endianness is a little cryptic at this point */ + int endianness_data; /* 4321 or 1234 */ + int endianness_wanted; /* same thing, but what the output format wants */ + int endianness_output; /* what the output endianness will be */ +}; - struct _GstAFSrcClass - { - GstElementClass parent_class; +struct _GstAFSrcClass { + GstElementClass parent_class; - /* signals */ - void (*handoff) (GstElement * element, GstPad * pad); - }; + /* signals */ + void (*handoff) (GstElement *element,GstPad *pad); +}; - GType gst_afsrc_get_type (void); - gboolean gst_afsrc_plugin_init (GstPlugin * plugin); +GType gst_afsrc_get_type (void); +gboolean gst_afsrc_plugin_init (GstPlugin *plugin); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_AFSRC_H__ */ +#endif /* __GST_AFSRC_H__ */ diff --git a/ext/divx/gstdivxdec.h b/ext/divx/gstdivxdec.h index 4bf2d364..0468ff0a 100644 --- a/ext/divx/gstdivxdec.h +++ b/ext/divx/gstdivxdec.h @@ -24,9 +24,8 @@ #include <decore.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_DIVXDEC \ @@ -40,36 +39,34 @@ extern "C" #define GST_IS_DIVXDEC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_DIVXDEC)) - typedef struct _GstDivxDec GstDivxDec; - typedef struct _GstDivxDecClass GstDivxDecClass; +typedef struct _GstDivxDec GstDivxDec; +typedef struct _GstDivxDecClass GstDivxDecClass; - struct _GstDivxDec - { - GstElement element; +struct _GstDivxDec { + GstElement element; - /* pads */ - GstPad *sinkpad, *srcpad; + /* pads */ + GstPad *sinkpad, *srcpad; - /* divx handle */ - void *handle; + /* divx handle */ + void *handle; - /* video (output) settings */ - guint32 csp; - int bitcnt, bpp; - int version; - int width, height; - gdouble fps; - }; + /* video (output) settings */ + guint32 csp; + int bitcnt, bpp; + int version; + int width, height; + gdouble fps; +}; - struct _GstDivxDecClass - { - GstElementClass parent_class; - }; +struct _GstDivxDecClass { + GstElementClass parent_class; +}; - GType gst_divxdec_get_type (void); +GType gst_divxdec_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_DIVXDEC_H__ */ +#endif /* __GST_DIVXDEC_H__ */ diff --git a/ext/divx/gstdivxenc.h b/ext/divx/gstdivxenc.h index 906145bb..206659d3 100644 --- a/ext/divx/gstdivxenc.h +++ b/ext/divx/gstdivxenc.h @@ -23,9 +23,8 @@ #include <gst/gst.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_DIVXENC \ @@ -39,48 +38,46 @@ extern "C" #define GST_IS_DIVXENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_DIVXENC)) - typedef struct _GstDivxEnc GstDivxEnc; - typedef struct _GstDivxEncClass GstDivxEncClass; +typedef struct _GstDivxEnc GstDivxEnc; +typedef struct _GstDivxEncClass GstDivxEncClass; - struct _GstDivxEnc - { - GstElement element; +struct _GstDivxEnc { + GstElement element; - /* pads */ - GstPad *sinkpad, *srcpad; + /* pads */ + GstPad *sinkpad, *srcpad; - /* quality of encoded image */ - gulong bitrate; + /* quality of encoded image */ + gulong bitrate; - /* size of the buffers */ - gulong buffer_size; + /* size of the buffers */ + gulong buffer_size; - /* max key interval */ - gint max_key_interval; + /* max key interval */ + gint max_key_interval; - /* amount of motion estimation to do */ - gint quality; + /* amount of motion estimation to do */ + gint quality; - /* divx handle */ - void *handle; - guint32 csp; - gint bitcnt; - gint width, height; - gfloat fps; - }; + /* divx handle */ + void *handle; + guint32 csp; + gint bitcnt; + gint width, height; + gfloat fps; +}; - struct _GstDivxEncClass - { - GstElementClass parent_class; +struct _GstDivxEncClass { + GstElementClass parent_class; - /* signals */ - void (*frame_encoded) (GstElement * element); - }; + /* signals */ + void (*frame_encoded) (GstElement *element); +}; - GType gst_divxenc_get_type (void); +GType gst_divxenc_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_DIVXENC_H__ */ +#endif /* __GST_DIVXENC_H__ */ diff --git a/ext/faac/gstfaac.h b/ext/faac/gstfaac.h index b888ed34..55daea67 100644 --- a/ext/faac/gstfaac.h +++ b/ext/faac/gstfaac.h @@ -24,6 +24,7 @@ #include <faac.h> G_BEGIN_DECLS + #define GST_TYPE_FAAC \ (gst_faac_get_type ()) #define GST_FAAC(obj) \ @@ -34,17 +35,25 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_FAAC)) #define GST_IS_FAAC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_FAAC)) - typedef struct _GstFaac -{ + +typedef struct _GstFaac { GstElement element; /* pads */ GstPad *srcpad, *sinkpad; /* stream properties */ - gint samplerate, channels, format, bps, bitrate, profile, shortctl; - gboolean tns, midside; - gulong bytes, samples; + gint samplerate, + channels, + format, + bps, + bitrate, + profile, + shortctl; + gboolean tns, + midside; + gulong bytes, + samples; /* FAAC object */ faacEncHandle handle; @@ -54,12 +63,12 @@ G_BEGIN_DECLS guint64 cache_time, cache_duration; } GstFaac; -typedef struct _GstFaacClass -{ +typedef struct _GstFaacClass { GstElementClass parent_class; } GstFaacClass; GType gst_faac_get_type (void); G_END_DECLS + #endif /* __GST_FAAC_H__ */ diff --git a/ext/faad/gstfaad.h b/ext/faad/gstfaad.h index 394d90ac..c834f098 100644 --- a/ext/faad/gstfaad.h +++ b/ext/faad/gstfaad.h @@ -24,6 +24,7 @@ #include <faad.h> G_BEGIN_DECLS + #define GST_TYPE_FAAD \ (gst_faad_get_type ()) #define GST_FAAD(obj) \ @@ -34,26 +35,28 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_FAAD)) #define GST_IS_FAAD_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_FAAD)) - typedef struct _GstFaad -{ + +typedef struct _GstFaad { GstElement element; /* pads */ GstPad *srcpad, *sinkpad; /* cache for latest MPEG-frame */ - gint samplerate, channels, bps; + gint samplerate, + channels, + bps; /* FAAD object */ faacDecHandle handle; } GstFaad; -typedef struct _GstFaadClass -{ +typedef struct _GstFaadClass { GstElementClass parent_class; } GstFaadClass; GType gst_faad_get_type (void); G_END_DECLS + #endif /* __GST_FAAD_H__ */ diff --git a/ext/gsm/gstgsmdec.h b/ext/gsm/gstgsmdec.h index da2d4ca6..0544128b 100644 --- a/ext/gsm/gstgsmdec.h +++ b/ext/gsm/gstgsmdec.h @@ -31,9 +31,8 @@ #endif #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_GSMDEC \ @@ -47,32 +46,30 @@ extern "C" #define GST_IS_GSMDEC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GSMDEC)) - typedef struct _GstGSMDec GstGSMDec; - typedef struct _GstGSMDecClass GstGSMDecClass; +typedef struct _GstGSMDec GstGSMDec; +typedef struct _GstGSMDecClass GstGSMDecClass; - struct _GstGSMDec - { - GstElement element; +struct _GstGSMDec { + GstElement element; - /* pads */ - GstPad *sinkpad, *srcpad; + /* pads */ + GstPad *sinkpad,*srcpad; - gsm state; - gsm_byte buffer[33]; - gint bufsize; - }; + gsm state; + gsm_byte buffer[33]; + gint bufsize; +}; - struct _GstGSMDecClass - { - GstElementClass parent_class; - }; +struct _GstGSMDecClass { + GstElementClass parent_class; +}; - GType gst_gsmdec_get_type (void); +GType gst_gsmdec_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_GSMDEC_H__ */ +#endif /* __GST_GSMDEC_H__ */ diff --git a/ext/gsm/gstgsmenc.h b/ext/gsm/gstgsmenc.h index 397ff633..2366ed69 100644 --- a/ext/gsm/gstgsmenc.h +++ b/ext/gsm/gstgsmenc.h @@ -31,9 +31,8 @@ #endif #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_GSMENC \ @@ -47,38 +46,36 @@ extern "C" #define GST_IS_GSMENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GSMENC)) - typedef struct _GstGSMEnc GstGSMEnc; - typedef struct _GstGSMEncClass GstGSMEncClass; +typedef struct _GstGSMEnc GstGSMEnc; +typedef struct _GstGSMEncClass GstGSMEncClass; - struct _GstGSMEnc - { - GstElement element; +struct _GstGSMEnc { + GstElement element; - /* pads */ - GstPad *sinkpad, *srcpad; + /* pads */ + GstPad *sinkpad,*srcpad; - gsm state; - gsm_signal buffer[160]; - gint bufsize; + gsm state; + gsm_signal buffer[160]; + gint bufsize; - guint64 next_ts; - gint rate; - }; + guint64 next_ts; + gint rate; +}; - struct _GstGSMEncClass - { - GstElementClass parent_class; +struct _GstGSMEncClass { + GstElementClass parent_class; - /* signals */ - void (*frame_encoded) (GstElement * element); - }; + /* signals */ + void (*frame_encoded) (GstElement *element); +}; - GType gst_gsmenc_get_type (void); +GType gst_gsmenc_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_GSMENC_H__ */ +#endif /* __GST_GSMENC_H__ */ diff --git a/ext/ivorbis/vorbisenc.h b/ext/ivorbis/vorbisenc.h index e33fb1d9..60fdf670 100644 --- a/ext/ivorbis/vorbisenc.h +++ b/ext/ivorbis/vorbisenc.h @@ -27,9 +27,8 @@ #include <tremor/ivorbiscodec.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_VORBISENC \ (vorbisenc_get_type()) @@ -42,61 +41,60 @@ extern "C" #define GST_IS_VORBISENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VORBISENC)) - typedef struct _VorbisEnc VorbisEnc; - typedef struct _VorbisEncClass VorbisEncClass; +typedef struct _VorbisEnc VorbisEnc; +typedef struct _VorbisEncClass VorbisEncClass; - struct _VorbisEnc - { - GstElement element; +struct _VorbisEnc { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad, + *srcpad; - ogg_stream_state os; /* take physical pages, weld into a logical - stream of packets */ - ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */ - ogg_packet op; /* one raw packet of data for decode */ + ogg_stream_state os; /* take physical pages, weld into a logical + stream of packets */ + ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */ + ogg_packet op; /* one raw packet of data for decode */ - vorbis_info vi; /* struct that stores all the static vorbis bitstream - settings */ - vorbis_comment vc; /* struct that stores all the user comments */ + vorbis_info vi; /* struct that stores all the static vorbis bitstream + settings */ + vorbis_comment vc; /* struct that stores all the user comments */ - vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ - vorbis_block vb; /* local working space for packet->PCM decode */ + vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ + vorbis_block vb; /* local working space for packet->PCM decode */ - gboolean eos; + gboolean eos; - gboolean managed; - gint bitrate; - gint min_bitrate; - gint max_bitrate; - gfloat quality; - gboolean quality_set; - gint serial; + gboolean managed; + gint bitrate; + gint min_bitrate; + gint max_bitrate; + gfloat quality; + gboolean quality_set; + gint serial; - gint channels; - gint frequency; + gint channels; + gint frequency; - guint64 samples_in; - guint64 bytes_out; + guint64 samples_in; + guint64 bytes_out; - GstCaps *metadata; + GstCaps *metadata; - gboolean setup; - gboolean flush_header; - gchar *last_message; - }; + gboolean setup; + gboolean flush_header; + gchar *last_message; +}; - struct _VorbisEncClass - { - GstElementClass parent_class; - }; +struct _VorbisEncClass { + GstElementClass parent_class; +}; - GType vorbisenc_get_type (void); +GType vorbisenc_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __VORBISENC_H__ */ +#endif /* __VORBISENC_H__ */ diff --git a/ext/jack/gstjack.h b/ext/jack/gstjack.h index f5a5416f..87d7d611 100644 --- a/ext/jack/gstjack.h +++ b/ext/jack/gstjack.h @@ -51,7 +51,7 @@ #define GST_IS_JACK_BIN_CLASS(klass) G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_JACK_BIN) #define GST_TYPE_JACK_BIN gst_jack_bin_get_type() -#define GST_JACK_PAD(l) ((GstJackPad*)l->data) /* l is a GList */ +#define GST_JACK_PAD(l) ((GstJackPad*)l->data) /* l is a GList */ typedef struct _GstJack GstJack; @@ -64,65 +64,59 @@ typedef GstJack GstJackSrc; typedef GstJackClass GstJackSrcClass; -enum -{ - GST_JACK_OPEN = GST_BIN_FLAG_LAST, - GST_JACK_ACTIVE, - GST_JACK_FLAG_LAST = GST_BIN_FLAG_LAST + 3, +enum { + GST_JACK_OPEN = GST_BIN_FLAG_LAST, + GST_JACK_ACTIVE, + GST_JACK_FLAG_LAST = GST_BIN_FLAG_LAST + 3, }; typedef jack_default_audio_sample_t sample_t; -typedef struct -{ - GstPad *pad; - void *data; - const gchar *name; - const gchar *peer_name; - jack_port_t *port; +typedef struct { + GstPad *pad; + void *data; + const gchar *name; + const gchar *peer_name; + jack_port_t *port; } GstJackPad; -struct _GstJack -{ - GstElement element; +struct _GstJack { + GstElement element; - /* list of GstJackPads */ - GList *pads; + /* list of GstJackPads */ + GList *pads; - /* for convenience */ - GstPadDirection direction; + /* for convenience */ + GstPadDirection direction; - gchar *port_name_prefix; + gchar *port_name_prefix; - GstJackBin *bin; + GstJackBin *bin; }; -struct _GstJackClass -{ - GstElementClass parent_class; +struct _GstJackClass { + GstElementClass parent_class; }; -struct _GstJackBin -{ - GstBin bin; +struct _GstJackBin { + GstBin bin; - jack_client_t *client; - gint default_new_port_number; + jack_client_t *client; + gint default_new_port_number; - /* lists of GstJackPads */ - GList *sink_pads; - GList *src_pads; + /* lists of GstJackPads */ + GList *sink_pads; + GList *src_pads; - gchar *client_name; + gchar *client_name; - guint rate; - jack_nframes_t nframes; + guint rate; + jack_nframes_t nframes; }; -struct _GstJackBinClass -{ - GstBinClass parent_class; +struct _GstJackBinClass { + GstBinClass parent_class; }; diff --git a/ext/ladspa/gstladspa.h b/ext/ladspa/gstladspa.h index b40cd145..f3556f74 100644 --- a/ext/ladspa/gstladspa.h +++ b/ext/ladspa/gstladspa.h @@ -31,60 +31,62 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ - typedef struct _ladspa_control_info - { - gchar *name; - gchar *param_name; - gfloat lowerbound, upperbound; - gfloat def; - gboolean lower, upper, samplerate; - gboolean toggled, logarithmic, integer, writable; - } ladspa_control_info; +typedef struct _ladspa_control_info { + gchar *name; + gchar *param_name; + gfloat lowerbound, upperbound; + gfloat def; + gboolean lower,upper,samplerate; + gboolean toggled, logarithmic, integer, writable; +} ladspa_control_info; - typedef struct _GstLADSPA GstLADSPA; - typedef struct _GstLADSPAClass GstLADSPAClass; +typedef struct _GstLADSPA GstLADSPA; +typedef struct _GstLADSPAClass GstLADSPAClass; - struct _GstLADSPA - { - GstElement element; +struct _GstLADSPA { + GstElement element; - LADSPA_Descriptor *descriptor; - LADSPA_Handle *handle; + LADSPA_Descriptor *descriptor; + LADSPA_Handle *handle; - GstDParamManager *dpman; + GstDParamManager *dpman; - gfloat *controls; + gfloat *controls; + + GstPad **sinkpads, + **srcpads; - GstPad **sinkpads, **srcpads; + gboolean activated; - gboolean activated; + gint samplerate, buffer_frames; + gint64 timestamp; + gboolean inplace_broken; +}; - gint samplerate, buffer_frames; - gint64 timestamp; - gboolean inplace_broken; - }; +struct _GstLADSPAClass { + GstElementClass parent_class; - struct _GstLADSPAClass - { - GstElementClass parent_class; + LADSPA_Descriptor *descriptor; - LADSPA_Descriptor *descriptor; + gint numports, + numsinkpads, + numsrcpads, + numcontrols; - gint numports, numsinkpads, numsrcpads, numcontrols; + gint *sinkpad_portnums, + *srcpad_portnums, + *control_portnums; - gint *sinkpad_portnums, *srcpad_portnums, *control_portnums; - - ladspa_control_info *control_info; - }; + ladspa_control_info *control_info; +}; #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_LADSPA_H__ */ +#endif /* __GST_LADSPA_H__ */ diff --git a/ext/ladspa/utils.h b/ext/ladspa/utils.h index 7a22b50b..d470eb0d 100644 --- a/ext/ladspa/utils.h +++ b/ext/ladspa/utils.h @@ -20,19 +20,20 @@ unloadLADSPAPluginLibrary(). Errors are handled by writing a message to stderr and calling exit(1). It is alright (although inefficient) to call this more than once for the same file. */ -void *loadLADSPAPluginLibrary (const char *pcPluginFilename); +void * loadLADSPAPluginLibrary(const char * pcPluginFilename); /* This function unloads a LADSPA plugin library. */ -void unloadLADSPAPluginLibrary (void *pvLADSPAPluginLibrary); +void unloadLADSPAPluginLibrary(void * pvLADSPAPluginLibrary); /* This function locates a LADSPA plugin within a plugin library loaded with loadLADSPAPluginLibrary(). Errors are handled by writing a message to stderr and calling exit(1). Note that the plugin library filename is only included to help provide informative error messages. */ -const LADSPA_Descriptor *findLADSPAPluginDescriptor (void - *pvLADSPAPluginLibrary, const char *pcPluginLibraryFilename, - const char *pcPluginLabel); +const LADSPA_Descriptor * +findLADSPAPluginDescriptor(void * pvLADSPAPluginLibrary, + const char * pcPluginLibraryFilename, + const char * pcPluginLabel); /*****************************************************************************/ @@ -43,15 +44,16 @@ const LADSPA_Descriptor *findLADSPAPluginDescriptor (void style) and a LADSPA_DescriptorFunction (from which LADSPA_Descriptors can be acquired). */ typedef void LADSPAPluginSearchCallbackFunction - (const char *pcFullFilename, - void *pvPluginHandle, LADSPA_Descriptor_Function fDescriptorFunction); +(const char * pcFullFilename, + void * pvPluginHandle, + LADSPA_Descriptor_Function fDescriptorFunction); /* Search through the $(LADSPA_PATH) (or a default path) for any LADSPA plugin libraries. Each plugin library is tested using dlopen() and dlsym(,"ladspa_descriptor"). After loading each library, the callback function is called to process it. This function leaves items passed to the callback function open. */ -void LADSPAPluginSearch (LADSPAPluginSearchCallbackFunction fCallbackFunction); +void LADSPAPluginSearch(LADSPAPluginSearchCallbackFunction fCallbackFunction); /*****************************************************************************/ diff --git a/ext/libfame/gstlibfame.h b/ext/libfame/gstlibfame.h index 74726bb6..15affdaf 100644 --- a/ext/libfame/gstlibfame.h +++ b/ext/libfame/gstlibfame.h @@ -25,9 +25,8 @@ #include <fame.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_FAMEENC \ @@ -41,50 +40,48 @@ extern "C" #define GST_IS_FAMEENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAMEENC)) - typedef struct _GstFameEnc GstFameEnc; - typedef struct _GstFameEncClass GstFameEncClass; +typedef struct _GstFameEnc GstFameEnc; +typedef struct _GstFameEncClass GstFameEncClass; - struct _GstFameEnc - { - GstElement element; +struct _GstFameEnc { + GstElement element; - /* pads */ - GstPad *sinkpad, *srcpad; + /* pads */ + GstPad *sinkpad, *srcpad; - /* the timestamp of the next frame */ - guint64 next_time; - /* the interval between frames */ - guint64 time_interval; + /* the timestamp of the next frame */ + guint64 next_time; + /* the interval between frames */ + guint64 time_interval; - /* video state */ - gint format; - /* the size of the output buffer */ - gint outsize; + /* video state */ + gint format; + /* the size of the output buffer */ + gint outsize; - /* encoding pattern string */ - gchar *pattern; + /* encoding pattern string */ + gchar *pattern; - /* fameenc stuff */ - gboolean verbose; - fame_context_t *fc; - fame_parameters_t fp; - fame_yuv_t fy; - gulong buffer_size; - unsigned char *buffer; - gboolean initialized; - }; + /* fameenc stuff */ + gboolean verbose; + fame_context_t *fc; + fame_parameters_t fp; + fame_yuv_t fy; + gulong buffer_size; + unsigned char *buffer; + gboolean initialized; +}; - struct _GstFameEncClass - { - GstElementClass parent_class; - }; +struct _GstFameEncClass { + GstElementClass parent_class; +}; - GType gst_fameenc_get_type (void); +GType gst_fameenc_get_type (void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_FAMEENC_H__ */ +#endif /* __GST_FAMEENC_H__ */ diff --git a/ext/musicbrainz/gsttrm.h b/ext/musicbrainz/gsttrm.h index 717826b7..6516f94d 100644 --- a/ext/musicbrainz/gsttrm.h +++ b/ext/musicbrainz/gsttrm.h @@ -26,9 +26,8 @@ #include <musicbrainz/mb_c.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_MUSICBRAINZ \ @@ -43,43 +42,41 @@ extern "C" (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MUSICBRAINZ)) - typedef struct _GstMusicBrainz GstMusicBrainz; - typedef struct _GstMusicBrainzClass GstMusicBrainzClass; +typedef struct _GstMusicBrainz GstMusicBrainz; +typedef struct _GstMusicBrainzClass GstMusicBrainzClass; - struct _GstMusicBrainz - { - GstElement element; +struct _GstMusicBrainz { + GstElement element; - GstPad *sinkpad; - GstPad *srcpad; - const GstCaps *caps; + GstPad *sinkpad; + GstPad *srcpad; + const GstCaps *caps; - trm_t trm; - gchar signature[17]; - gchar ascii_signature[37]; + trm_t trm; + gchar signature[17]; + gchar ascii_signature[37]; - guint depth; - guint rate; - guint channels; - gboolean linked; - gboolean data_available; - gboolean signature_available; - guint64 total_time; - }; + guint depth; + guint rate; + guint channels; + gboolean linked; + gboolean data_available; + gboolean signature_available; + guint64 total_time; +}; - struct _GstMusicBrainzClass - { - GstElementClass parent_class; +struct _GstMusicBrainzClass { + GstElementClass parent_class; - /* signals */ - void (*signature_available) (GstElement * element); - }; + /* signals */ + void (*signature_available) (GstElement *element); +}; - GType gst_musicbrainz_get_type (void); +GType gst_musicbrainz_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_MUSICBRAINZE_H__ */ +#endif /* __GST_MUSICBRAINZE_H__ */ diff --git a/ext/nas/nassink.h b/ext/nas/nassink.h index afebe9ba..3206541c 100644 --- a/ext/nas/nassink.h +++ b/ext/nas/nassink.h @@ -24,9 +24,8 @@ #include <gst/gst.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_NASSINK \ @@ -40,54 +39,51 @@ extern "C" #define GST_IS_NASSINK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NASSINK)) - typedef enum - { - GST_NASSINK_OPEN = GST_ELEMENT_FLAG_LAST, - GST_NASSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2 - } GstNasSinkFlags; +typedef enum { + GST_NASSINK_OPEN = GST_ELEMENT_FLAG_LAST, + GST_NASSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST+2 +} GstNasSinkFlags; - typedef struct _GstNassink GstNassink; - typedef struct _GstNassinkClass GstNassinkClass; +typedef struct _GstNassink GstNassink; +typedef struct _GstNassinkClass GstNassinkClass; - struct _GstNassink - { - GstElement element; +struct _GstNassink { + GstElement element; - GstPad *sinkpad; + GstPad *sinkpad; - /* instance properties */ + /* instance properties */ - gboolean mute; - gint depth; - gint tracks; - gint rate; - gchar *host; + gboolean mute; + gint depth; + gint tracks; + gint rate; + gchar* host; - /* Server info */ + /* Server info */ - AuServer *audio; - AuFlowID flow; - AuDeviceID device; + AuServer *audio; + AuFlowID flow; + AuDeviceID device; - /* buffer */ + /* buffer */ - AuUint32 size; - AuUint32 pos; + AuUint32 size; + AuUint32 pos; - char *buf; - }; + char *buf; +}; - struct _GstNassinkClass - { - GstElementClass parent_class; - }; +struct _GstNassinkClass { + GstElementClass parent_class; +}; - GType gst_nassink_get_type (void); +GType gst_nassink_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_NASSINK_H__ */ +#endif /* __GST_NASSINK_H__ */ diff --git a/ext/sdl/sdlvideosink.h b/ext/sdl/sdlvideosink.h index 5c42abc4..ad682385 100644 --- a/ext/sdl/sdlvideosink.h +++ b/ext/sdl/sdlvideosink.h @@ -25,6 +25,7 @@ #include <SDL.h> G_BEGIN_DECLS + #define GST_TYPE_SDLVIDEOSINK \ (gst_sdlvideosink_get_type()) #define GST_SDLVIDEOSINK(obj) \ @@ -35,9 +36,9 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SDLVIDEOSINK)) #define GST_IS_SDLVIDEOSINK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SDLVIDEOSINK)) - typedef enum -{ - GST_SDLVIDEOSINK_OPEN = GST_ELEMENT_FLAG_LAST, + +typedef enum { + GST_SDLVIDEOSINK_OPEN = GST_ELEMENT_FLAG_LAST, GST_SDLVIDEOSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, } GstSDLVideoSinkFlags; @@ -45,12 +46,11 @@ G_BEGIN_DECLS typedef struct _GstSDLVideoSink GstSDLVideoSink; typedef struct _GstSDLVideoSinkClass GstSDLVideoSinkClass; -struct _GstSDLVideoSink -{ +struct _GstSDLVideoSink { GstVideoSink videosink; guint32 format; - gint width, height; /* the size of the incoming YUV stream */ + gint width, height; /* the size of the incoming YUV stream */ unsigned long xwindow_id; gboolean init; @@ -62,13 +62,13 @@ struct _GstSDLVideoSink GMutex *lock; }; -struct _GstSDLVideoSinkClass -{ +struct _GstSDLVideoSinkClass { GstVideoSinkClass parent_class; }; -GType gst_sdlsink_get_type (void); +GType gst_sdlsink_get_type(void); G_END_DECLS + #endif /* __GST_SDLVIDEOSINK_H__ */ diff --git a/ext/shout/gstshout.h b/ext/shout/gstshout.h index 210b6b5d..129fcba8 100644 --- a/ext/shout/gstshout.h +++ b/ext/shout/gstshout.h @@ -25,43 +25,40 @@ #include <shout/shout.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ /* Definition of structure storing data for this element. */ - typedef struct _GstIcecastSend GstIcecastSend; - struct _GstIcecastSend - { - GstElement element; - - GstPad *sinkpad, *srcpad; - - shout_conn_t conn; - - gchar *ip; - guint port; - gchar *password; - gboolean public; - gchar *name; - gchar *description; - gchar *genre; - gchar *mount; - gchar *dumpfile; - gboolean icy; - gchar *aim; - gchar *icq; - gchar *irc; - - }; +typedef struct _GstIcecastSend GstIcecastSend; +struct _GstIcecastSend { + GstElement element; + + GstPad *sinkpad,*srcpad; + + shout_conn_t conn; + + gchar *ip; + guint port; + gchar *password; + gboolean public; + gchar *name; + gchar *description; + gchar *genre; + gchar *mount; + gchar *dumpfile; + gboolean icy; + gchar *aim; + gchar *icq; + gchar *irc; + +}; /* Standard definition defining a class for this element. */ - typedef struct _GstIcecastSendClass GstIcecastSendClass; - struct _GstIcecastSendClass - { - GstElementClass parent_class; - }; +typedef struct _GstIcecastSendClass GstIcecastSendClass; +struct _GstIcecastSendClass { + GstElementClass parent_class; +}; /* Standard macros for defining types for this element. */ #define GST_TYPE_ICECASTSEND \ @@ -76,12 +73,12 @@ extern "C" (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ICECASTSEND)) /* Standard function returning type information. */ - GType gst_icecastsend_get_type (void); +GType gst_icecastsend_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_ICECASTSEND_H__ */ +#endif /* __GST_ICECASTSEND_H__ */ diff --git a/ext/smoothwave/gstsmoothwave.h b/ext/smoothwave/gstsmoothwave.h index df4d8763..87165131 100644 --- a/ext/smoothwave/gstsmoothwave.h +++ b/ext/smoothwave/gstsmoothwave.h @@ -26,9 +26,8 @@ #include <gtk/gtk.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_SMOOTHWAVE \ @@ -42,33 +41,31 @@ extern "C" #define GST_IS_SMOOTHWAVE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMOOTHWAVE)) - typedef struct _GstSmoothWave GstSmoothWave; - typedef struct _GstSmoothWaveClass GstSmoothWaveClass; +typedef struct _GstSmoothWave GstSmoothWave; +typedef struct _GstSmoothWaveClass GstSmoothWaveClass; - struct _GstSmoothWave - { - GstElement element; +struct _GstSmoothWave { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - gint width, height; + gint width,height; - GdkRgbCmap *cmap; - GtkWidget *image; - guchar *imagebuffer; - }; + GdkRgbCmap *cmap; + GtkWidget *image; + guchar *imagebuffer; +}; - struct _GstSmoothWaveClass - { - GstElementClass parent_class; - }; +struct _GstSmoothWaveClass { + GstElementClass parent_class; +}; - GType gst_smoothwave_get_type (void); +GType gst_smoothwave_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_SMOOTHWAVE_H__ */ +#endif /* __GST_SMOOTHWAVE_H__ */ diff --git a/ext/snapshot/gstsnapshot.h b/ext/snapshot/gstsnapshot.h index 23cca911..0ca1fb93 100644 --- a/ext/snapshot/gstsnapshot.h +++ b/ext/snapshot/gstsnapshot.h @@ -26,9 +26,8 @@ #include <png.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_SNAPSHOT \ @@ -42,38 +41,36 @@ extern "C" #define GST_IS_SNAPSHOT_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SNAPSHOT)) - typedef struct _GstSnapshot GstSnapshot; - typedef struct _GstSnapshotClass GstSnapshotClass; +typedef struct _GstSnapshot GstSnapshot; +typedef struct _GstSnapshotClass GstSnapshotClass; - struct _GstSnapshot - { - GstElement element; +struct _GstSnapshot { + GstElement element; - guint32 format; - gint width; - gint height; - gint to_bpp; - glong frame; - glong cur_frame; - const gchar *location; - gboolean snapshot_asked; + guint32 format; + gint width; + gint height; + gint to_bpp; + glong frame; + glong cur_frame; + const gchar *location; + gboolean snapshot_asked; - png_structp png_struct_ptr; - png_infop png_info_ptr; + png_structp png_struct_ptr; + png_infop png_info_ptr; - GstPad *sinkpad, *srcpad; - }; + GstPad *sinkpad,*srcpad; +}; - struct _GstSnapshotClass - { - GstElementClass parent_class; +struct _GstSnapshotClass { + GstElementClass parent_class; - void (*snapshot) (GstElement * elem); - }; + void (*snapshot) (GstElement *elem); +}; #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_SNAPSHOT_H__ */ +#endif /* __GST_SNAPSHOT_H__ */ diff --git a/ext/sndfile/gstsf.h b/ext/sndfile/gstsf.h index 13517625..a2531112 100644 --- a/ext/sndfile/gstsf.h +++ b/ext/sndfile/gstsf.h @@ -27,6 +27,8 @@ G_BEGIN_DECLS + + #define GST_TYPE_SF \ (gst_sf_get_type()) #define GST_SF(obj) \ @@ -37,6 +39,7 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SF)) #define GST_IS_SF_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SF)) + #define GST_TYPE_SFSRC \ (gst_sfsrc_get_type()) #define GST_SFSRC(obj) \ @@ -47,6 +50,7 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SFSRC)) #define GST_IS_SFSRC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SFSRC)) + #define GST_TYPE_SFSINK \ (gst_sfsink_get_type()) #define GST_SFSINK(obj) \ @@ -57,17 +61,16 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SFSINK)) #define GST_IS_SFSINK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SFSINK)) + typedef struct _GstSF GstSF; typedef struct _GstSFClass GstSFClass; -typedef enum -{ - GST_SF_OPEN = GST_ELEMENT_FLAG_LAST, - GST_SF_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, +typedef enum { + GST_SF_OPEN = GST_ELEMENT_FLAG_LAST, + GST_SF_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, } GstSFlags; -typedef struct -{ +typedef struct { GstPad *pad; gint num; gboolean caps_set; @@ -75,8 +78,7 @@ typedef struct #define GST_SF_CHANNEL(l) ((GstSFChannel*)l->data) -struct _GstSF -{ +struct _GstSF { GstElement element; GList *channels; @@ -100,15 +102,16 @@ struct _GstSF guint64 time; }; -struct _GstSFClass -{ +struct _GstSFClass { GstElementClass parent_class; }; -GType gst_sf_get_type (void); -GType gst_sfsrc_get_type (void); -GType gst_sfsink_get_type (void); +GType gst_sf_get_type (void); +GType gst_sfsrc_get_type (void); +GType gst_sfsink_get_type (void); G_END_DECLS + + #endif /* __GST_SFSINK_H__ */ diff --git a/ext/swfdec/gstswfdec.h b/ext/swfdec/gstswfdec.h index dab1ac17..05015682 100644 --- a/ext/swfdec/gstswfdec.h +++ b/ext/swfdec/gstswfdec.h @@ -26,9 +26,8 @@ #include <swfdec.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_SWFDEC \ @@ -42,49 +41,47 @@ extern "C" #define GST_IS_SWFDEC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SWFDEC)) - typedef struct _GstSwfdec GstSwfdec; - typedef struct _GstSwfdecClass GstSwfdecClass; +typedef struct _GstSwfdec GstSwfdec; +typedef struct _GstSwfdecClass GstSwfdecClass; - struct _GstSwfdec - { - GstElement element; +struct _GstSwfdec { + GstElement element; - /* pads */ - GstPad *sinkpad; - GstPad *videopad; - GstPad *audiopad; + /* pads */ + GstPad *sinkpad; + GstPad *videopad; + GstPad *audiopad; - SwfdecDecoder *state; - gboolean closed; + SwfdecDecoder *state; + gboolean closed; - /* the timestamp of the next frame */ - gboolean first; - gboolean have_format; + /* the timestamp of the next frame */ + gboolean first; + gboolean have_format; - double rate; - gint64 timestamp; - gint64 interval; - double frame_rate; + double rate; + gint64 timestamp; + gint64 interval; + double frame_rate; - /* video state */ - gint format; - gint width; - gint height; - gint64 total_frames; + /* video state */ + gint format; + gint width; + gint height; + gint64 total_frames; - }; +}; - struct _GstSwfdecClass - { - GstElementClass parent_class; - }; +struct _GstSwfdecClass { + GstElementClass parent_class; +}; - GType gst_swfdec_get_type (void); +GType gst_swfdec_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_SWFDEC_H__ */ +#endif /* __GST_SWFDEC_H__ */ diff --git a/ext/tarkin/bitcoder.h b/ext/tarkin/bitcoder.h index fe1e6eae..312cd887 100644 --- a/ext/tarkin/bitcoder.h +++ b/ext/tarkin/bitcoder.h @@ -15,7 +15,7 @@ #define ENTROPY_ENCODER_FLUSH(coder) bitcoder_flush(coder) #define ENTROPY_DECODER_INIT(coder,bitstream,limit) \ bitcoder_decoder_init(coder,bitstream,limit) -#define ENTROPY_DECODER_DONE(coder) /* nothing to do ... */ +#define ENTROPY_DECODER_DONE(coder) /* nothing to do ... */ #define ENTROPY_CODER_BITSTREAM(coder) (coder)->bitstream #define ENTROPY_CODER_SYMBOL(coder) 1 @@ -25,107 +25,106 @@ #endif -typedef struct -{ - int32_t bit_count; /* number of valid bits in byte */ - uint8_t byte; /* buffer to save bits */ - uint32_t byte_count; /* number of bytes written */ - uint8_t *bitstream; - uint32_t limit; /* don't write more bytes to bitstream ... */ - int eos; /* end of stream reached */ +typedef struct { + int32_t bit_count; /* number of valid bits in byte */ + uint8_t byte; /* buffer to save bits */ + uint32_t byte_count; /* number of bytes written */ + uint8_t *bitstream; + uint32_t limit; /* don't write more bytes to bitstream ... */ + int eos; /* end of stream reached */ } BitCoderState; -static inline void -bitcoder_encoder_init (BitCoderState * s, uint32_t limit) +static inline +void bitcoder_encoder_init (BitCoderState *s, uint32_t limit) { - s->bit_count = 0; - s->byte = 0; - s->byte_count = 0; - s->bitstream = (uint8_t *) MALLOC (limit); - s->limit = limit; - s->eos = 0; + s->bit_count = 0; + s->byte = 0; + s->byte_count = 0; + s->bitstream = (uint8_t*) MALLOC (limit); + s->limit = limit; + s->eos = 0; } -static inline void -bitcoder_encoder_done (BitCoderState * s) +static inline +void bitcoder_encoder_done (BitCoderState *s) { - FREE (s->bitstream); + FREE (s->bitstream); } -static inline void -bitcoder_decoder_init (BitCoderState * s, uint8_t * bitstream, uint32_t limit) +static inline +void bitcoder_decoder_init (BitCoderState *s, uint8_t *bitstream, uint32_t limit) { - s->bit_count = -1; - s->byte = 0; - s->byte_count = 0; - s->bitstream = bitstream; - s->limit = limit; - s->eos = 0; + s->bit_count = -1; + s->byte = 0; + s->byte_count = 0; + s->bitstream = bitstream; + s->limit = limit; + s->eos = 0; } -static inline uint32_t -bitcoder_flush (BitCoderState * s) +static inline +uint32_t bitcoder_flush (BitCoderState *s) { - if (s->bit_count > 0 && s->byte_count < s->limit) - s->bitstream[s->byte_count++] = s->byte << (8 - s->bit_count); + if (s->bit_count > 0 && s->byte_count < s->limit) + s->bitstream [s->byte_count++] = s->byte << (8 - s->bit_count); /*printf ("%s: %i bytes written.\n", __FUNCTION__, s->byte_count); */ /*printf ("%s: last bit %i\n", __FUNCTION__, s->bit_count); */ - return s->byte_count; + return s->byte_count; } -static inline void -bitcoder_write_bit (BitCoderState * s, int bit) +static inline +void bitcoder_write_bit (BitCoderState *s, int bit) { - s->byte <<= 1; - s->byte |= bit & 1; - - s->bit_count++; - - if (s->bit_count == 8) { - if (s->byte_count < s->limit) { - s->bitstream[s->byte_count++] = s->byte; - s->bit_count = 0; - } else { - s->eos = 1; - } - } + s->byte <<= 1; + s->byte |= bit & 1; + + s->bit_count++; + + if (s->bit_count == 8) { + if (s->byte_count < s->limit) { + s->bitstream [s->byte_count++] = s->byte; + s->bit_count = 0; + } else { + s->eos = 1; + } + } } -static inline int -bitcoder_read_bit (BitCoderState * s) +static inline +int bitcoder_read_bit (BitCoderState *s) { - int ret; + int ret; - if (s->bit_count <= 0) { - if (!s->bitstream) { - s->eos = 1; - return 0; - } + if (s->bit_count <= 0) { + if (!s->bitstream) { + s->eos = 1; + return 0; + } - if (s->byte_count < s->limit) { - s->byte = s->bitstream[s->byte_count++]; - } else { - s->eos = 1; - s->byte = 0; - } + if (s->byte_count < s->limit) { + s->byte = s->bitstream [s->byte_count++]; + } else { + s->eos = 1; + s->byte = 0; + } - s->bit_count = 8; - } + s->bit_count = 8; + } - ret = s->byte >> 7; - s->byte <<= 1; - s->bit_count--; + ret = s->byte >> 7; + s->byte <<= 1; + s->bit_count--; - return ret & 1; + return ret & 1; } @@ -133,16 +132,17 @@ bitcoder_read_bit (BitCoderState * s) -static inline void -bit_print (TYPE byte) +static inline +void bit_print (TYPE byte) { - int bit = 8 * sizeof (TYPE); + int bit = 8*sizeof(TYPE); - do { - bit--; - printf ((byte & (1 << bit)) ? "1" : "0"); - } while (bit); - printf ("\n"); + do { + bit--; + printf ((byte & (1 << bit)) ? "1" : "0"); + } while (bit); + printf ("\n"); } #endif + diff --git a/ext/tarkin/golomb.h b/ext/tarkin/golomb.h index 47c23b44..95e63c30 100644 --- a/ext/tarkin/golomb.h +++ b/ext/tarkin/golomb.h @@ -5,126 +5,128 @@ #include "bitcoder.h" -static inline unsigned int -required_bits (unsigned int x) +static inline +unsigned int required_bits (unsigned int x) { - int bits = 31; + int bits = 31; - while ((x & (1 << bits)) == 0 && bits) - bits--; + while ((x & (1 << bits)) == 0 && bits) + bits--; - return bits; + return bits; } -static inline void -write_number_binary (BitCoderState * b, unsigned int x, int bits, int u) +static inline +void write_number_binary (BitCoderState *b, unsigned int x, int bits, int u) { /*printf ("wrote %i with %i bits (%i+%i)\n", x, u+bits, u, bits); */ - while (bits) { - bits--; - bitcoder_write_bit (b, (x >> bits) & 1); - } + while (bits) { + bits--; + bitcoder_write_bit (b, (x >> bits) & 1); + } } -static inline unsigned int -read_number_binary (BitCoderState * b, int bits) +static inline +unsigned int read_number_binary (BitCoderState *b, int bits) { - unsigned int x = 0; + unsigned int x = 0; - while (bits) { - bits--; - x |= bitcoder_read_bit (b) << bits; - } + while (bits) { + bits--; + x |= bitcoder_read_bit (b) << bits; + } - return x; + return x; } -static inline void -golomb_write_number (BitCoderState * b, unsigned int x, int bits) +static inline +void golomb_write_number (BitCoderState *b, unsigned int x, int bits) { - unsigned int q, r; - int i = 0; + unsigned int q, r; +int i = 0; - assert (x > 0); + assert (x > 0); - while ((q = (x - 1) >> bits) > 0) { - bitcoder_write_bit (b, 1); /* fast temporary adaption, write */ - bits++; /* unary representation of q */ - i++; - }; + while ((q = (x - 1) >> bits) > 0) { + bitcoder_write_bit (b, 1); /* fast temporary adaption, write */ + bits++; /* unary representation of q */ +i++; + }; - bitcoder_write_bit (b, 0); + bitcoder_write_bit (b, 0); - r = x - 1 - (q << bits); + r = x - 1 - (q << bits); - write_number_binary (b, r, bits, i + 1); + write_number_binary (b, r, bits, i+1); } -static inline unsigned int -golomb_read_number (BitCoderState * b, int bits) +static inline +unsigned int golomb_read_number (BitCoderState *b, int bits) { - unsigned int q = 0, r, x; + unsigned int q = 0, r, x; - while (bitcoder_read_bit (b) != 0) { - bits++; - } + while (bitcoder_read_bit (b) != 0) { + bits++; + } - r = read_number_binary (b, bits); - x = (q << bits) + r + 1; + r = read_number_binary (b, bits); + x = (q << bits) + r + 1; - return x; + return x; } -typedef struct -{ - uint8_t count; - uint8_t bits; /* a 5.3 fixed point integer */ +typedef struct { + uint8_t count; + uint8_t bits; /* a 5.3 fixed point integer */ } GolombAdaptiveCoderState; #define GOLOMB_ADAPTIVE_CODER_STATE_INITIALIZER { 8<<3, 0 } -static const int golomb_w_tab[] = { 256, 128, 64 }; +static const int golomb_w_tab [] = { 256, 128, 64 }; -static inline void -golombcoder_encode_number (GolombAdaptiveCoderState * g, - BitCoderState * b, unsigned int x) +static inline +void golombcoder_encode_number (GolombAdaptiveCoderState *g, + BitCoderState *b, + unsigned int x) { - golomb_write_number (b, x, g->bits >> 3); + golomb_write_number (b, x, g->bits >> 3); - g->bits = ((256 - golomb_w_tab[g->count]) * (int) g->bits + - golomb_w_tab[g->count] * (required_bits (x) << 3)) / 256; - g->count++; + g->bits = ((256 - golomb_w_tab[g->count]) * (int) g->bits + + golomb_w_tab[g->count] * (required_bits(x)<<3)) / 256; + g->count++; - if (g->count > 2) - g->count = 2; + if (g->count > 2) + g->count = 2; } -static inline unsigned int -golombcoder_decode_number (GolombAdaptiveCoderState * g, BitCoderState * b) +static inline +unsigned int golombcoder_decode_number (GolombAdaptiveCoderState *g, + BitCoderState *b) { - unsigned int x; + unsigned int x; - x = golomb_read_number (b, g->bits >> 3); + x = golomb_read_number (b, g->bits >> 3); - g->bits = ((256 - golomb_w_tab[g->count]) * g->bits + - golomb_w_tab[g->count] * (required_bits (x) << 3)) / 256; - g->count++; + g->bits = ((256 - golomb_w_tab[g->count]) * g->bits + + golomb_w_tab[g->count] * (required_bits(x)<<3)) / 256; + g->count++; - if (g->count > 2) - g->count = 2; + if (g->count > 2) + g->count = 2; - return x; + return x; } #endif + diff --git a/ext/tarkin/gsttarkindec.h b/ext/tarkin/gsttarkindec.h index 77b8954d..b1baf4f3 100644 --- a/ext/tarkin/gsttarkindec.h +++ b/ext/tarkin/gsttarkindec.h @@ -27,9 +27,8 @@ #include "tarkin.h" #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_TARKINDEC \ (tarkindec_get_type()) @@ -42,44 +41,42 @@ extern "C" #define GST_IS_TARKINDEC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TARKINDEC)) - typedef struct _TarkinDec TarkinDec; - typedef struct _TarkinDecClass TarkinDecClass; +typedef struct _TarkinDec TarkinDec; +typedef struct _TarkinDecClass TarkinDecClass; - struct _TarkinDec - { - GstElement element; +struct _TarkinDec { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - ogg_sync_state oy; - ogg_stream_state os; - ogg_page og; - ogg_packet op; + ogg_sync_state oy; + ogg_stream_state os; + ogg_page og; + ogg_packet op; - TarkinStream *tarkin_stream; - TarkinComment tc; - TarkinInfo ti; - TarkinVideoLayerDesc layer[1]; + TarkinStream *tarkin_stream; + TarkinComment tc; + TarkinInfo ti; + TarkinVideoLayerDesc layer[1]; - gint frame_num; - gint nheader; + gint frame_num; + gint nheader; + + gboolean eos; + gint bitrate; + gboolean setup; +}; - gboolean eos; - gint bitrate; - gboolean setup; - }; +struct _TarkinDecClass { + GstElementClass parent_class; +}; - struct _TarkinDecClass - { - GstElementClass parent_class; - }; - - GType tarkindec_get_type (void); +GType tarkindec_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __TARKINDEC_H__ */ +#endif /* __TARKINDEC_H__ */ diff --git a/ext/tarkin/gsttarkinenc.h b/ext/tarkin/gsttarkinenc.h index 9e03e5ca..b6252a88 100644 --- a/ext/tarkin/gsttarkinenc.h +++ b/ext/tarkin/gsttarkinenc.h @@ -27,9 +27,8 @@ #include "tarkin.h" #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_TARKINENC \ (tarkinenc_get_type()) @@ -42,45 +41,43 @@ extern "C" #define GST_IS_TARKINENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TARKINENC)) - typedef struct _TarkinEnc TarkinEnc; - typedef struct _TarkinEncClass TarkinEncClass; +typedef struct _TarkinEnc TarkinEnc; +typedef struct _TarkinEncClass TarkinEncClass; - struct _TarkinEnc - { - GstElement element; +struct _TarkinEnc { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - ogg_stream_state os; /* take physical pages, weld into a logical - stream of packets */ - ogg_page og; /* one Ogg bitstream page. Tarkin packets are inside */ - ogg_packet op[3]; /* one raw packet of data for decode */ + ogg_stream_state os; /* take physical pages, weld into a logical + stream of packets */ + ogg_page og; /* one Ogg bitstream page. Tarkin packets are inside */ + ogg_packet op[3]; /* one raw packet of data for decode */ - TarkinStream *tarkin_stream; - TarkinComment tc; - TarkinInfo ti; - TarkinVideoLayerDesc layer[1]; + TarkinStream *tarkin_stream; + TarkinComment tc; + TarkinInfo ti; + TarkinVideoLayerDesc layer[1]; - gint frame_num; + gint frame_num; + + gboolean eos; + gint bitrate; + gint s_moments; + gint a_moments; + gboolean setup; +}; - gboolean eos; - gint bitrate; - gint s_moments; - gint a_moments; - gboolean setup; - }; +struct _TarkinEncClass { + GstElementClass parent_class; +}; - struct _TarkinEncClass - { - GstElementClass parent_class; - }; - - GType tarkinenc_get_type (void); +GType tarkinenc_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __TARKINENC_H__ */ +#endif /* __TARKINENC_H__ */ diff --git a/ext/tarkin/mem.h b/ext/tarkin/mem.h index f6e4c726..f218f8e4 100644 --- a/ext/tarkin/mem.h +++ b/ext/tarkin/mem.h @@ -9,11 +9,9 @@ #if defined(DBG_MEMLEAKS) -extern void *dbg_malloc (char *file, int line, char *func, size_t bytes); -extern void *dbg_calloc (char *file, int line, char *func, size_t count, - size_t bytes); -extern void *dbg_realloc (char *file, int line, char *func, char *what, - void *mem, size_t bytes); +extern void* dbg_malloc (char *file, int line, char *func, size_t bytes); +extern void* dbg_calloc (char *file, int line, char *func, size_t count, size_t bytes); +extern void* dbg_realloc (char *file, int line, char *func, char *what, void *mem, size_t bytes); extern void dbg_free (char *file, int line, char *func, char *what, void *mem); #define MALLOC(bytes) dbg_malloc(__FILE__,__LINE__,__FUNCTION__,bytes) @@ -31,3 +29,4 @@ extern void dbg_free (char *file, int line, char *func, char *what, void *mem); #endif #endif + diff --git a/ext/tarkin/rle.h b/ext/tarkin/rle.h index 6ccef22b..7cf79517 100644 --- a/ext/tarkin/rle.h +++ b/ext/tarkin/rle.h @@ -19,7 +19,7 @@ #define ENTROPY_ENCODER_FLUSH(coder) rlecoder_encoder_flush(coder) #define ENTROPY_DECODER_INIT(coder,bitstream,limit) \ rlecoder_decoder_init(coder,bitstream,limit) -#define ENTROPY_DECODER_DONE(coder) /* nothing to do ... */ +#define ENTROPY_DECODER_DONE(coder) /* nothing to do ... */ #define ENTROPY_CODER_BITSTREAM(coder) ((coder)->bitcoder.bitstream) #define ENTROPY_CODER_EOS(coder) ((coder)->bitcoder.eos) @@ -31,13 +31,12 @@ -typedef struct -{ - int symbol; - uint32_t count; /* have seen count symbol's */ - BitCoderState bitcoder; - GolombAdaptiveCoderState golomb_state[2]; /* 2 states for 2 symbols... */ - int have_seen_1; +typedef struct { + int symbol; + uint32_t count; /* have seen count symbol's */ + BitCoderState bitcoder; + GolombAdaptiveCoderState golomb_state [2]; /* 2 states for 2 symbols... */ + int have_seen_1; } RLECoderState; @@ -45,99 +44,100 @@ typedef struct /* * bit should be 0 or 1 !!! */ -static inline void -rlecoder_write_bit (RLECoderState * s, int bit) +static inline +void rlecoder_write_bit (RLECoderState *s, int bit) { - assert (bit == 0 || bit == 1); - - if (s->symbol == -1) { - s->symbol = bit & 1; - s->count = 1; - s->have_seen_1 = bit; - bitcoder_write_bit (&s->bitcoder, bit); - } - - if (s->symbol != bit) { - golombcoder_encode_number (&s->golomb_state[s->symbol], - &s->bitcoder, s->count); - s->symbol = ~s->symbol & 1; - s->have_seen_1 = 1; - s->count = 1; - } else - s->count++; + assert (bit == 0 || bit == 1); + + if (s->symbol == -1) { + s->symbol = bit & 1; + s->count = 1; + s->have_seen_1 = bit; + bitcoder_write_bit (&s->bitcoder, bit); + } + + if (s->symbol != bit) { + golombcoder_encode_number (&s->golomb_state[s->symbol], + &s->bitcoder, s->count); + s->symbol = ~s->symbol & 1; + s->have_seen_1 = 1; + s->count = 1; + } else + s->count++; } -static inline int -rlecoder_read_bit (RLECoderState * s) +static inline +int rlecoder_read_bit (RLECoderState *s) { - if (s->count == 0) { - s->symbol = ~s->symbol & 1; - s->count = golombcoder_decode_number (&s->golomb_state[s->symbol], - &s->bitcoder); - if (s->bitcoder.eos) { - s->symbol = 0; - s->count = ~0; - } - } - s->count--; - return (s->symbol); + if (s->count == 0) { + s->symbol = ~s->symbol & 1; + s->count = golombcoder_decode_number (&s->golomb_state[s->symbol], + &s->bitcoder); + if (s->bitcoder.eos) { + s->symbol = 0; + s->count = ~0; + } + } + s->count--; + return (s->symbol); } int coder_id = 0; FILE *file = NULL; -static inline void -rlecoder_encoder_init (RLECoderState * s, uint32_t limit) +static inline +void rlecoder_encoder_init (RLECoderState *s, uint32_t limit) { - bitcoder_encoder_init (&s->bitcoder, limit); - s->symbol = -1; - s->have_seen_1 = 0; - s->golomb_state[0].count = 0; - s->golomb_state[1].count = 0; - s->golomb_state[0].bits = 5 << 3; - s->golomb_state[1].bits = 5 << 3; + bitcoder_encoder_init (&s->bitcoder, limit); + s->symbol = -1; + s->have_seen_1 = 0; + s->golomb_state[0].count = 0; + s->golomb_state[1].count = 0; + s->golomb_state[0].bits = 5 << 3; + s->golomb_state[1].bits = 5 << 3; } /** * once you called this, you better should not encode any more symbols ... */ -static inline uint32_t -rlecoder_encoder_flush (RLECoderState * s) +static inline +uint32_t rlecoder_encoder_flush (RLECoderState *s) { - if (s->symbol == -1 || !s->have_seen_1) - return 0; + if (s->symbol == -1 || !s->have_seen_1) + return 0; - golombcoder_encode_number (&s->golomb_state[s->symbol], - &s->bitcoder, s->count); - return bitcoder_flush (&s->bitcoder); + golombcoder_encode_number (&s->golomb_state[s->symbol], + &s->bitcoder, s->count); + return bitcoder_flush (&s->bitcoder); } -static inline void -rlecoder_decoder_init (RLECoderState * s, uint8_t * bitstream, uint32_t limit) +static inline +void rlecoder_decoder_init (RLECoderState *s, uint8_t *bitstream, uint32_t limit) { - bitcoder_decoder_init (&s->bitcoder, bitstream, limit); - s->golomb_state[0].count = 0; - s->golomb_state[1].count = 0; - s->golomb_state[0].bits = 5 << 3; - s->golomb_state[1].bits = 5 << 3; - s->symbol = bitcoder_read_bit (&s->bitcoder); - s->count = golombcoder_decode_number (&s->golomb_state[s->symbol], - &s->bitcoder) - 1; - if (s->bitcoder.eos) { - s->symbol = 0; - s->count = ~0; - } + bitcoder_decoder_init (&s->bitcoder, bitstream, limit); + s->golomb_state[0].count = 0; + s->golomb_state[1].count = 0; + s->golomb_state[0].bits = 5 << 3; + s->golomb_state[1].bits = 5 << 3; + s->symbol = bitcoder_read_bit (&s->bitcoder); + s->count = golombcoder_decode_number (&s->golomb_state[s->symbol], + &s->bitcoder) - 1; + if (s->bitcoder.eos) { + s->symbol = 0; + s->count = ~0; + } } -static inline void -rlecoder_encoder_done (RLECoderState * s) +static inline +void rlecoder_encoder_done (RLECoderState *s) { - bitcoder_encoder_done (&s->bitcoder); + bitcoder_encoder_done (&s->bitcoder); } #endif + diff --git a/ext/tarkin/tarkin.h b/ext/tarkin/tarkin.h index 680ba4b9..633f9a14 100644 --- a/ext/tarkin/tarkin.h +++ b/ext/tarkin/tarkin.h @@ -18,115 +18,105 @@ /* Theses determine what infos the packet comes with */ #define TARKIN_PACK_EXAMPLE 1 -typedef struct -{ - uint8_t *data; - uint32_t data_len; - uint32_t storage; -} TarkinPacket; - - -typedef enum -{ - TARKIN_GRAYSCALE, - TARKIN_RGB24, /* tight packed RGB */ - TARKIN_RGB32, /* 32bit, no alphachannel */ - TARKIN_RGBA, /* dito w/ alphachannel */ - TARKIN_YUV2, /* 16 bits YUV */ - TARKIN_YUV12, /* 12 bits YUV */ - TARKIN_FYUV, /* Tarkin's Fast YUV-like? */ +typedef struct { + uint8_t *data; + uint32_t data_len; + uint32_t storage; +} TarkinPacket; + + +typedef enum { + TARKIN_GRAYSCALE, + TARKIN_RGB24, /* tight packed RGB */ + TARKIN_RGB32, /* 32bit, no alphachannel */ + TARKIN_RGBA, /* dito w/ alphachannel */ + TARKIN_YUV2, /* 16 bits YUV */ + TARKIN_YUV12, /* 12 bits YUV */ + TARKIN_FYUV, /* Tarkin's Fast YUV-like? */ } TarkinColorFormat; #define TARKIN_INTERNAL_FORMAT TARKIN_FYUV -typedef enum -{ - TARKIN_OK = 0, - TARKIN_IO_ERROR, - TARKIN_SIGNATURE_NOT_FOUND, - TARKIN_INVALID_LAYER, - TARKIN_INVALID_COLOR_FORMAT, - TARKIN_VERSION, - TARKIN_BAD_HEADER, - TARKIN_NOT_TARKIN, - TARKIN_FAULT, - TARKIN_UNUSED, - TARKIN_NEED_MORE, - TARKIN_NOT_IMPLEMENTED +typedef enum { + TARKIN_OK = 0, + TARKIN_IO_ERROR, + TARKIN_SIGNATURE_NOT_FOUND, + TARKIN_INVALID_LAYER, + TARKIN_INVALID_COLOR_FORMAT, + TARKIN_VERSION, + TARKIN_BAD_HEADER, + TARKIN_NOT_TARKIN, + TARKIN_FAULT, + TARKIN_UNUSED, + TARKIN_NEED_MORE, + TARKIN_NOT_IMPLEMENTED } TarkinError; -typedef struct -{ - uint32_t width; - uint32_t height; - uint32_t a_moments; - uint32_t s_moments; - uint32_t frames_per_buf; - uint32_t bitstream_len; /* for all color components, bytes */ - TarkinColorFormat format; +typedef struct { + uint32_t width; + uint32_t height; + uint32_t a_moments; + uint32_t s_moments; + uint32_t frames_per_buf; + uint32_t bitstream_len; /* for all color components, bytes */ + TarkinColorFormat format; } TarkinVideoLayerDesc; -typedef struct -{ - TarkinVideoLayerDesc desc; - uint32_t n_comp; /* number of color components */ - Wavelet3DBuf **waveletbuf; - TarkinPacket *packet; - uint32_t current_frame_in_buf; - uint32_t frameno; +typedef struct { + TarkinVideoLayerDesc desc; + uint32_t n_comp; /* number of color components */ + Wavelet3DBuf **waveletbuf; + TarkinPacket *packet; + uint32_t current_frame_in_buf; + uint32_t frameno; - void (*color_fwd_xform) (uint8_t * rgba, Wavelet3DBuf * yuva[], - uint32_t count); - void (*color_inv_xform) (Wavelet3DBuf * yuva[], uint8_t * rgba, - uint32_t count); + void (*color_fwd_xform) (uint8_t *rgba, Wavelet3DBuf *yuva [], uint32_t count); + void (*color_inv_xform) (Wavelet3DBuf *yuva [], uint8_t *rgba, uint32_t count); } TarkinVideoLayer; -typedef struct -{ - uint32_t numerator; - uint32_t denominator; -} TarkinTime; /* Let's say the unit is 1 second */ - -typedef struct TarkinInfo -{ - int version; - int n_layers; - TarkinVideoLayer *layer; - TarkinTime inter; /* numerator == O if per-frame time info. */ - int frames_per_block; - int comp_per_block; /* AKA "packets per block" for now */ - uint32_t max_bitstream_len; +typedef struct { + uint32_t numerator; + uint32_t denominator; +} TarkinTime; /* Let's say the unit is 1 second */ + +typedef struct TarkinInfo { + int version; + int n_layers; + TarkinVideoLayer *layer; + TarkinTime inter; /* numerator == O if per-frame time info. */ + int frames_per_block; + int comp_per_block; /* AKA "packets per block" for now */ + uint32_t max_bitstream_len; /* The below bitrate declarations are *hints*. Combinations of the three values carry the following implications: - + all three set to the same value: - implies a fixed rate bitstream + implies a fixed rate bitstream only nominal set: - implies a VBR stream that averages the nominal bitrate. No hard - upper/lower limit + implies a VBR stream that averages the nominal bitrate. No hard + upper/lower limit upper and or lower set: - implies a VBR bitstream that obeys the bitrate limits. nominal - may also be set to give a nominal rate. + implies a VBR bitstream that obeys the bitrate limits. nominal + may also be set to give a nominal rate. none set: - the coder does not care to speculate. - */ + the coder does not care to speculate. + */ - long bitrate_upper; - long bitrate_nominal; - long bitrate_lower; - long bitrate_window; + long bitrate_upper; + long bitrate_nominal; + long bitrate_lower; + long bitrate_window; } TarkinInfo; /* This is used for encoding */ -typedef struct -{ - unsigned char *header; - unsigned char *header1; - unsigned char *header2; +typedef struct { + unsigned char *header; + unsigned char *header1; + unsigned char *header2; } tarkin_header_store; @@ -134,33 +124,31 @@ typedef struct /* Some of the fields in TarkinStream are redundent with TarkinInfo ones * and will probably get deleted, namely n_layers and frames_per_buf */ -typedef struct TarkinStream -{ - uint32_t n_layers; - TarkinVideoLayer *layer; - uint32_t current_frame; - uint32_t current_frame_in_buf; - ogg_int64_t packetno; - uint32_t frames_per_buf; - uint32_t max_bitstream_len; - TarkinInfo *ti; - tarkin_header_store headers; - /* These callbacks are only used for encoding */ - TarkinError (*free_frame) (void *tarkinstream, void *ptr); - /* These thing allows not to buffer but it needs global var in caller. */ - TarkinError (*packet_out) (void *tarkinstream, ogg_packet * ptr); - void *user_ptr; +typedef struct TarkinStream { + uint32_t n_layers; + TarkinVideoLayer *layer; + uint32_t current_frame; + uint32_t current_frame_in_buf; + ogg_int64_t packetno; + uint32_t frames_per_buf; + uint32_t max_bitstream_len; + TarkinInfo *ti; + tarkin_header_store headers; + /* These callbacks are only used for encoding */ + TarkinError (*free_frame)(void *tarkinstream, void *ptr); + /* These thing allows not to buffer but it needs global var in caller. */ + TarkinError (*packet_out)(void *tarkinstream, ogg_packet *ptr); + void * user_ptr; } TarkinStream; -typedef struct TarkinComment -{ +typedef struct TarkinComment{ /* unlimited user comment fields. libtarkin writes 'libtarkin' whatever vendor is set to in encode */ char **user_comments; - int *comment_lengths; - int comments; - char *vendor; + int *comment_lengths; + int comments; + char *vendor; } TarkinComment; @@ -173,17 +161,17 @@ typedef struct TarkinComment /* Theses are the very same than Vorbis versions, they could be shared. */ -extern TarkinStream *tarkin_stream_new (); -extern void tarkin_stream_destroy (TarkinStream * s); -extern void tarkin_info_init (TarkinInfo * vi); -extern void tarkin_info_clear (TarkinInfo * vi); -extern void tarkin_comment_init (TarkinComment * vc); -extern void tarkin_comment_add (TarkinComment * vc, char *comment); -extern void tarkin_comment_add_tag (TarkinComment * vc, - char *tag, char *contents); -extern char *tarkin_comment_query (TarkinComment * vc, char *tag, int count); -extern int tarkin_comment_query_count (TarkinComment * vc, char *tag); -extern void tarkin_comment_clear (TarkinComment * vc); +extern TarkinStream* tarkin_stream_new (); +extern void tarkin_stream_destroy (TarkinStream *s); +extern void tarkin_info_init(TarkinInfo *vi); +extern void tarkin_info_clear(TarkinInfo *vi); +extern void tarkin_comment_init(TarkinComment *vc); +extern void tarkin_comment_add(TarkinComment *vc, char *comment); +extern void tarkin_comment_add_tag(TarkinComment *vc, + char *tag, char *contents); +extern char *tarkin_comment_query(TarkinComment *vc, char *tag, int count); +extern int tarkin_comment_query_count(TarkinComment *vc, char *tag); +extern void tarkin_comment_clear(TarkinComment *vc); /* Tarkin PRIMITIVES: analysis layer ****************************/ /* Tarkin encoding is done this way : you init it passing a fresh @@ -193,50 +181,59 @@ extern void tarkin_comment_clear (TarkinComment * vc); * is called when a packet is ready. The pointers given as arguments to * these callback functions are of course only valid at the function call * time. The user_ptr is stored in s and can be used by packet_out(). */ -extern int tarkin_analysis_init (TarkinStream * s, - TarkinInfo * ti, - TarkinError (*free_frame) (void *tarkinstream, void *ptr), - TarkinError (*packet_out) (void *tarkinstream, ogg_packet * ptr), - void *user_ptr); +extern int tarkin_analysis_init(TarkinStream *s, + TarkinInfo *ti, + TarkinError (*free_frame)(void *tarkinstream, void *ptr), + TarkinError (*packet_out)(void *tarkinstream, ogg_packet *ptr), + void *user_ptr + ); /* Then you need to add at least a layer in your stream, passing a * TarkinVideoLayerDesc renseigned at least on the width, height and * format parameters. */ -extern int tarkin_analysis_add_layer (TarkinStream * s, - TarkinVideoLayerDesc * tvld); +extern int tarkin_analysis_add_layer(TarkinStream *s, + TarkinVideoLayerDesc *tvld); /* At that point you are ready to get headers out the lib by calling * tarkin_analysis_headerout() passing it a renseigned TarkinComment * structure. It does fill your 3 ogg_packet headers, which are valid * till next call */ -extern int TarkinCommentheader_out (TarkinComment * vc, ogg_packet * op); -extern TarkinError tarkin_analysis_headerout (TarkinStream * s, - TarkinComment * vc, - ogg_packet * op, ogg_packet * op_comm, ogg_packet * op_code); +extern int TarkinCommentheader_out(TarkinComment *vc, ogg_packet *op); +extern TarkinError tarkin_analysis_headerout(TarkinStream *s, + TarkinComment *vc, + ogg_packet *op, + ogg_packet *op_comm, + ogg_packet *op_code); /* You are now ready to pass in frames to the codec, however don't free * them before the codec told you so. It'll tell you when packets are * ready to be taken out. When you have no more frame, simply pass NULL. * If you encode multiple layers you have to do it synchronously, putting * one frame from each layer at a time. */ -extern uint32_t tarkin_analysis_framein (TarkinStream * s, uint8_t * frame, /* NULL for EOS */ - uint32_t layer, TarkinTime * date); +extern uint32_t tarkin_analysis_framein(TarkinStream *s, + uint8_t *frame, /* NULL for EOS */ + uint32_t layer, + TarkinTime *date); /* Tarkin PRIMITIVES: synthesis layer *******************************/ /* For decoding, you needs first to give the three first packet of the * stream to tarkin_synthesis_headerin() which will fill for you blank * TarkinInfo and TarkinComment. */ -extern TarkinError tarkin_synthesis_headerin (TarkinInfo * vi, - TarkinComment * vc, ogg_packet * op); +extern TarkinError tarkin_synthesis_headerin(TarkinInfo *vi,TarkinComment *vc, + ogg_packet *op); /* Then you can init your stream with your TarkinInfo struct. */ -extern TarkinError tarkin_synthesis_init (TarkinStream * s, TarkinInfo * ti); - +extern TarkinError tarkin_synthesis_init(TarkinStream *s,TarkinInfo *ti); /* All subsequent packets are to this be passed to tarkin_synthesis_packetin*/ -extern TarkinError tarkin_synthesis_packetin (TarkinStream * s, - ogg_packet * op); +extern TarkinError tarkin_synthesis_packetin(TarkinStream *s, ogg_packet *op); /* and then tarkin_synthesis_frameout gives you ptr on next frame, or NULL. It * also fills for you date. */ -extern TarkinError tarkin_synthesis_frameout (TarkinStream * s, - uint8_t ** frame, uint32_t layer_id, TarkinTime * date); +extern TarkinError tarkin_synthesis_frameout(TarkinStream *s, + uint8_t **frame, uint32_t layer_id, TarkinTime *date); /* When you're done with a frame, tell it to the codec with this. */ -extern int tarkin_synthesis_freeframe (TarkinStream * s, uint8_t * frame); +extern int tarkin_synthesis_freeframe(TarkinStream *s, uint8_t *frame); #endif + + + + + + diff --git a/ext/tarkin/wavelet.h b/ext/tarkin/wavelet.h index 13d84e8b..914c2799 100644 --- a/ext/tarkin/wavelet.h +++ b/ext/tarkin/wavelet.h @@ -4,25 +4,24 @@ #include <stdint.h> -typedef struct -{ - TYPE *data; - uint32_t width; - uint32_t height; - uint32_t frames; - uint32_t scales; - uint32_t *w; - uint32_t *h; - uint32_t *f; - uint32_t (*offset)[8]; - TYPE *scratchbuf; +typedef struct { + TYPE *data; + uint32_t width; + uint32_t height; + uint32_t frames; + uint32_t scales; + uint32_t *w; + uint32_t *h; + uint32_t *f; + uint32_t (*offset)[8]; + TYPE *scratchbuf; } Wavelet3DBuf; -extern Wavelet3DBuf *wavelet_3d_buf_new (uint32_t width, uint32_t height, - uint32_t frames); +extern Wavelet3DBuf* wavelet_3d_buf_new (uint32_t width, uint32_t height, + uint32_t frames); -extern void wavelet_3d_buf_destroy (Wavelet3DBuf * buf); +extern void wavelet_3d_buf_destroy (Wavelet3DBuf* buf); /** * transform buf->data @@ -30,21 +29,25 @@ extern void wavelet_3d_buf_destroy (Wavelet3DBuf * buf); * highpass filter, * s_moments the one of the synthesizing lowpass filter. */ -extern void wavelet_3d_buf_fwd_xform (Wavelet3DBuf * buf, - int a_moments, int s_moments); -extern void wavelet_3d_buf_inv_xform (Wavelet3DBuf * buf, - int a_moments, int s_moments); +extern void wavelet_3d_buf_fwd_xform (Wavelet3DBuf* buf, + int a_moments, int s_moments); +extern void wavelet_3d_buf_inv_xform (Wavelet3DBuf* buf, + int a_moments, int s_moments); -extern int wavelet_3d_buf_encode_coeff (const Wavelet3DBuf * buf, - uint8_t * bitstream, uint32_t limit); +extern int wavelet_3d_buf_encode_coeff (const Wavelet3DBuf* buf, + uint8_t *bitstream, + uint32_t limit); -extern void wavelet_3d_buf_decode_coeff (Wavelet3DBuf * buf, - uint8_t * bitstream, uint32_t limit); +extern void wavelet_3d_buf_decode_coeff (Wavelet3DBuf* buf, + uint8_t *bitstream, + uint32_t limit); #if defined(DBG_XFORM) extern void wavelet_3d_buf_dump (char *fmt, - uint32_t first_frame_in_buf, - uint32_t id, Wavelet3DBuf * buf, int16_t offset); + uint32_t first_frame_in_buf, + uint32_t id, + Wavelet3DBuf* buf, + int16_t offset); #else #define wavelet_3d_buf_dump(x...) #endif diff --git a/ext/tarkin/yuv.h b/ext/tarkin/yuv.h index 31711bc6..42ceb072 100644 --- a/ext/tarkin/yuv.h +++ b/ext/tarkin/yuv.h @@ -5,16 +5,17 @@ #include <stdint.h> #include "wavelet.h" -extern void rgb24_to_yuv (uint8_t * rgb, Wavelet3DBuf * yuv[], uint32_t frame); -extern void yuv_to_rgb24 (Wavelet3DBuf * yuv[], uint8_t * rgb, uint32_t frame); +extern void rgb24_to_yuv (uint8_t *rgb, Wavelet3DBuf *yuv [], uint32_t frame); +extern void yuv_to_rgb24 (Wavelet3DBuf *yuv [], uint8_t *rgb, uint32_t frame); -extern void rgb32_to_yuv (uint8_t * rgb, Wavelet3DBuf * yuv[], uint32_t frame); -extern void yuv_to_rgb32 (Wavelet3DBuf * yuv[], uint8_t * rgb, uint32_t frame); +extern void rgb32_to_yuv (uint8_t *rgb, Wavelet3DBuf *yuv [], uint32_t frame); +extern void yuv_to_rgb32 (Wavelet3DBuf *yuv [], uint8_t *rgb, uint32_t frame); -extern void rgba_to_yuv (uint8_t * rgba, Wavelet3DBuf * yuva[], uint32_t frame); -extern void yuv_to_rgba (Wavelet3DBuf * yuva[], uint8_t * rgba, uint32_t frame); +extern void rgba_to_yuv (uint8_t *rgba, Wavelet3DBuf *yuva [], uint32_t frame); +extern void yuv_to_rgba (Wavelet3DBuf *yuva [], uint8_t *rgba, uint32_t frame); -extern void grayscale_to_y (uint8_t * rgba, Wavelet3DBuf * y[], uint32_t frame); -extern void y_to_grayscale (Wavelet3DBuf * y[], uint8_t * rgba, uint32_t frame); +extern void grayscale_to_y (uint8_t *rgba, Wavelet3DBuf *y [], uint32_t frame); +extern void y_to_grayscale (Wavelet3DBuf *y [], uint8_t *rgba, uint32_t frame); #endif + diff --git a/ext/xine/gstxine.h b/ext/xine/gstxine.h index 53d40a23..61ab50ef 100644 --- a/ext/xine/gstxine.h +++ b/ext/xine/gstxine.h @@ -25,6 +25,7 @@ #include <xine/buffer.h> G_BEGIN_DECLS + #define GST_TYPE_XINE \ (gst_xine_get_type()) #define GST_XINE(obj) \ @@ -37,45 +38,47 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_XINE)) #define GST_IS_XINE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XINE)) -typedef struct _GstXine GstXine; + +typedef struct _GstXine GstXine; typedef struct _GstXineClass GstXineClass; struct _GstXine { - GstElement element; + GstElement element; - xine_stream_t *stream; - xine_ao_driver_t *audio_driver; - xine_vo_driver_t *video_driver; + xine_stream_t * stream; + xine_ao_driver_t * audio_driver; + xine_vo_driver_t * video_driver; }; -struct _GstXineClass +struct _GstXineClass { - GstElementClass parent_class; + GstElementClass parent_class; - xine_t *xine; + xine_t * xine; - xine_ao_driver_t *(*create_audio_driver) (GstXine * xine); - xine_vo_driver_t *(*create_video_driver) (GstXine * xine); + xine_ao_driver_t * (* create_audio_driver) (GstXine * xine); + xine_vo_driver_t * (* create_video_driver) (GstXine * xine); }; -GType gst_xine_get_type (void); +GType gst_xine_get_type (void); -xine_stream_t *gst_xine_get_stream (GstXine * xine); -void gst_xine_free_stream (GstXine * xine); +xine_stream_t * gst_xine_get_stream (GstXine *xine); +void gst_xine_free_stream (GstXine *xine); -void gst_buffer_to_xine_buffer (buf_element_t * element, GstBuffer * buffer); +void gst_buffer_to_xine_buffer (buf_element_t *element, GstBuffer *buffer); /* conversion functions from xinecaps.c */ -const gchar *gst_xine_get_caps_for_format (guint32 format); -guint32 gst_xine_get_format_for_caps (const GstCaps * caps); +const gchar * gst_xine_get_caps_for_format (guint32 format); +guint32 gst_xine_get_format_for_caps (const GstCaps *caps); /* init functions for the plugins */ -gboolean gst_xine_audio_sink_init_plugin (GstPlugin * plugin); -gboolean gst_xine_audio_dec_init_plugin (GstPlugin * plugin); -gboolean gst_xine_input_init_plugin (GstPlugin * plugin); - +gboolean gst_xine_audio_sink_init_plugin (GstPlugin *plugin); +gboolean gst_xine_audio_dec_init_plugin (GstPlugin *plugin); +gboolean gst_xine_input_init_plugin (GstPlugin *plugin); + G_END_DECLS + #endif /* __GST_XINE_H__ */ diff --git a/ext/xvid/gstxvid.h b/ext/xvid/gstxvid.h index e204ae4a..100f93b8 100644 --- a/ext/xvid/gstxvid.h +++ b/ext/xvid/gstxvid.h @@ -23,11 +23,13 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define gst_xvid_init_struct(s) \ do { \ memset (&s, 0, sizeof(s)); \ s.version = XVID_VERSION; \ } while (0); + #define RGB_24_32_STATIC_CAPS(bpp, r_mask,g_mask,b_mask) \ "video/x-raw-rgb, " \ "width = (int) [ 0, MAX ], " \ @@ -39,12 +41,14 @@ G_BEGIN_DECLS "red_mask = (int) " G_STRINGIFY (r_mask) ", " \ "green_mask = (int) " G_STRINGIFY (g_mask) ", " \ "blue_mask = (int) " G_STRINGIFY (b_mask) -extern gchar *gst_xvid_error (int errorcode); -extern gboolean gst_xvid_init (void); -extern gint gst_xvid_structure_to_csp (GstStructure * structure, - gint w, gint * stride, gint * bpp); -extern GstCaps *gst_xvid_csp_to_caps (gint csp, gint w, gint h, gdouble fps); +extern gchar * gst_xvid_error (int errorcode); +extern gboolean gst_xvid_init (void); + +extern gint gst_xvid_structure_to_csp (GstStructure *structure, + gint w, gint *stride, gint *bpp); +extern GstCaps *gst_xvid_csp_to_caps (gint csp, gint w, gint h, gdouble fps); G_END_DECLS + #endif /* __GST_XVID_H__ */ diff --git a/ext/xvid/gstxviddec.h b/ext/xvid/gstxviddec.h index 10538175..fa90d06a 100644 --- a/ext/xvid/gstxviddec.h +++ b/ext/xvid/gstxviddec.h @@ -24,9 +24,8 @@ #include "gstxvid.h" #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_XVIDDEC \ @@ -40,34 +39,32 @@ extern "C" #define GST_IS_XVIDDEC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XVIDDEC)) - typedef struct _GstXvidDec GstXvidDec; - typedef struct _GstXvidDecClass GstXvidDecClass; +typedef struct _GstXvidDec GstXvidDec; +typedef struct _GstXvidDecClass GstXvidDecClass; - struct _GstXvidDec - { - GstElement element; +struct _GstXvidDec { + GstElement element; - /* pads */ - GstPad *sinkpad, *srcpad; + /* pads */ + GstPad *sinkpad, *srcpad; - /* xvid handle */ - void *handle; + /* xvid handle */ + void *handle; - /* video (output) settings */ - gint csp, bpp, stride; - gint width, height; - double fps; - }; + /* video (output) settings */ + gint csp, bpp, stride; + gint width, height; + double fps; +}; - struct _GstXvidDecClass - { - GstElementClass parent_class; - }; +struct _GstXvidDecClass { + GstElementClass parent_class; +}; - GType gst_xviddec_get_type (void); +GType gst_xviddec_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_XVIDDEC_H__ */ +#endif /* __GST_XVIDDEC_H__ */ diff --git a/ext/xvid/gstxvidenc.h b/ext/xvid/gstxvidenc.h index fa786617..356ce53f 100644 --- a/ext/xvid/gstxvidenc.h +++ b/ext/xvid/gstxvidenc.h @@ -24,9 +24,8 @@ #include "gstxvid.h" #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_XVIDENC \ @@ -40,48 +39,46 @@ extern "C" #define GST_IS_XVIDENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XVIDENC)) - typedef struct _GstXvidEnc GstXvidEnc; - typedef struct _GstXvidEncClass GstXvidEncClass; +typedef struct _GstXvidEnc GstXvidEnc; +typedef struct _GstXvidEncClass GstXvidEncClass; - struct _GstXvidEnc - { - GstElement element; +struct _GstXvidEnc { + GstElement element; - /* pads */ - GstPad *sinkpad, *srcpad; + /* pads */ + GstPad *sinkpad, *srcpad; - /* encoding profile */ - gint profile; + /* encoding profile */ + gint profile; - /* quality of encoded image */ - gint bitrate; - gint buffer_size; + /* quality of encoded image */ + gint bitrate; + gint buffer_size; - /* max number of B frames between I/P */ - gint max_b_frames; + /* max number of B frames between I/P */ + gint max_b_frames; - /* max key interval */ - gint max_key_interval; + /* max key interval */ + gint max_key_interval; - /* xvid handle */ - void *handle; - gint csp; - gint width, height, stride; - gdouble fps; - }; + /* xvid handle */ + void *handle; + gint csp; + gint width, height, stride; + gdouble fps; +}; - struct _GstXvidEncClass - { - GstElementClass parent_class; +struct _GstXvidEncClass { + GstElementClass parent_class; - /* signals */ - void (*frame_encoded) (GstElement * element); - }; + /* signals */ + void (*frame_encoded) (GstElement *element); +}; - GType gst_xvidenc_get_type (void); +GType gst_xvidenc_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_XVIDENC_H__ */ +#endif /* __GST_XVIDENC_H__ */ diff --git a/gst-libs/gst/audio/audio.h b/gst-libs/gst/audio/audio.h index 5f21e018..4a3428dd 100644 --- a/gst-libs/gst/audio/audio.h +++ b/gst-libs/gst/audio/audio.h @@ -26,6 +26,7 @@ #define __GST_AUDIO_AUDIO_H__ G_BEGIN_DECLS + /* For people that are looking at this source: the purpose of these defines is * to make GstCaps a bit easier, in that you don't have to know all of the * properties that need to be defined. you can just use these macros. currently @@ -49,7 +50,9 @@ G_BEGIN_DECLS * * Andy Wingo, 18 August 2001 * Thomas, 6 September 2002 */ + #define GST_AUDIO_DEF_RATE 44100 + #define GST_AUDIO_INT_PAD_TEMPLATE_CAPS \ "audio/x-raw-int, " \ "rate = (int) [ 1, MAX ], " \ @@ -57,7 +60,9 @@ G_BEGIN_DECLS "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \ "width = (int) { 8, 16, 32 }, " \ "depth = (int) [ 1, 32 ], " \ - "signed = (boolean) { true, false }" + "signed = (boolean) { true, false }" + + /* "standard" int audio is native order, 16 bit stereo. */ #define GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS \ "audio/x-raw-int, " \ @@ -66,7 +71,8 @@ G_BEGIN_DECLS "endianness = (int) BYTE_ORDER, " \ "width = (int) 16, " \ "depth = (int) 16, " \ - "signed = (boolean) true" + "signed = (boolean) true" + #define GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS \ "audio/x-raw-float, " \ "rate = (int) [ 1, MAX ], " \ @@ -74,6 +80,7 @@ G_BEGIN_DECLS "endianness = (int) { LITTLE_ENDIAN , BIG_ENDIAN }, " \ "width = (int) { 32, 64 }, " \ "buffer-frames = (int) [ 1, MAX]" + /* "standard" float audio is native order, 32 bit mono. */ #define GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS \ "audio/x-raw-float, " \ @@ -81,42 +88,43 @@ G_BEGIN_DECLS "channels = (int) 1, " \ "endianness = (int) BYTE_ORDER, " \ "buffer-frames = (int) [ 1, MAX]" + /* * this library defines and implements some helper functions for audio * handling */ + /* get byte size of audio frame (based on caps of pad */ -int gst_audio_frame_byte_size (GstPad * pad); +int gst_audio_frame_byte_size (GstPad* pad); /* get length in frames of buffer */ -long gst_audio_frame_length (GstPad * pad, GstBuffer * buf); +long gst_audio_frame_length (GstPad* pad, GstBuffer* buf); /* get frame rate based on caps */ -long gst_audio_frame_rate (GstPad * pad); +long gst_audio_frame_rate (GstPad *pad); /* calculate length in seconds of audio buffer buf based on caps of pad */ -double gst_audio_length (GstPad * pad, GstBuffer * buf); +double gst_audio_length (GstPad* pad, GstBuffer* buf); /* calculate highest possible sample value based on capabilities of pad */ -long gst_audio_highest_sample_value (GstPad * pad); +long gst_audio_highest_sample_value (GstPad* pad); /* check if the buffer size is a whole multiple of the frame size */ -gboolean gst_audio_is_buffer_framed (GstPad * pad, GstBuffer * buf); +gboolean gst_audio_is_buffer_framed (GstPad* pad, GstBuffer* buf); /* functions useful for _getcaps functions */ -typedef enum -{ - GST_AUDIO_FIELD_RATE = (1 << 0), - GST_AUDIO_FIELD_CHANNELS = (1 << 1), - GST_AUDIO_FIELD_ENDIANNESS = (1 << 2), - GST_AUDIO_FIELD_WIDTH = (1 << 3), - GST_AUDIO_FIELD_DEPTH = (1 << 4), - GST_AUDIO_FIELD_SIGNED = (1 << 5), +typedef enum { + GST_AUDIO_FIELD_RATE = (1 << 0), + GST_AUDIO_FIELD_CHANNELS = (1 << 1), + GST_AUDIO_FIELD_ENDIANNESS = (1 << 2), + GST_AUDIO_FIELD_WIDTH = (1 << 3), + GST_AUDIO_FIELD_DEPTH = (1 << 4), + GST_AUDIO_FIELD_SIGNED = (1 << 5), GST_AUDIO_FIELD_BUFFER_FRAMES = (1 << 6) } GstAudioFieldFlag; -void gst_audio_structure_set_int (GstStructure * structure, - GstAudioFieldFlag flag); +void gst_audio_structure_set_int (GstStructure *structure, GstAudioFieldFlag flag); G_END_DECLS + #endif /* __GST_AUDIO_AUDIO_H__ */ diff --git a/gst-libs/gst/audio/audioclock.h b/gst-libs/gst/audio/audioclock.h index abb07541..17439242 100644 --- a/gst-libs/gst/audio/audioclock.h +++ b/gst-libs/gst/audio/audioclock.h @@ -27,6 +27,7 @@ #include <gst/gstsystemclock.h> G_BEGIN_DECLS + #define GST_TYPE_AUDIO_CLOCK \ (gst_audio_clock_get_type()) #define GST_AUDIO_CLOCK(obj) \ @@ -37,15 +38,14 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_CLOCK)) #define GST_IS_AUDIO_CLOCK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_CLOCK)) + typedef struct _GstAudioClock GstAudioClock; typedef struct _GstAudioClockClass GstAudioClockClass; -typedef GstClockTime (*GstAudioClockGetTimeFunc) (GstClock * clock, - gpointer user_data); +typedef GstClockTime (*GstAudioClockGetTimeFunc) (GstClock *clock, gpointer user_data); -struct _GstAudioClock -{ +struct _GstAudioClock { GstSystemClock clock; GstClockTime prev1, prev2; @@ -63,19 +63,19 @@ struct _GstAudioClock gpointer _gst_reserved[GST_PADDING]; }; -struct _GstAudioClockClass -{ +struct _GstAudioClockClass { GstSystemClockClass parent_class; gpointer _gst_reserved[GST_PADDING]; }; -GType gst_audio_clock_get_type (void); -GstClock *gst_audio_clock_new (gchar * name, GstAudioClockGetTimeFunc func, - gpointer user_data); -void gst_audio_clock_set_active (GstAudioClock * aclock, gboolean active); +GType gst_audio_clock_get_type (void); +GstClock* gst_audio_clock_new (gchar *name, GstAudioClockGetTimeFunc func, + gpointer user_data); +void gst_audio_clock_set_active (GstAudioClock *aclock, gboolean active); -void gst_audio_clock_update_time (GstAudioClock * aclock, GstClockTime time); +void gst_audio_clock_update_time (GstAudioClock *aclock, GstClockTime time); G_END_DECLS + #endif /* __GST_AUDIO_CLOCK_H__ */ diff --git a/gst-libs/gst/audio/gstaudiofilter.h b/gst-libs/gst/audio/gstaudiofilter.h index 534d4c6b..9786e16c 100644 --- a/gst-libs/gst/audio/gstaudiofilter.h +++ b/gst-libs/gst/audio/gstaudiofilter.h @@ -25,15 +25,17 @@ #include <gst/gst.h> -G_BEGIN_DECLS typedef struct _GstAudiofilter GstAudiofilter; +G_BEGIN_DECLS + +typedef struct _GstAudiofilter GstAudiofilter; typedef struct _GstAudiofilterClass GstAudiofilterClass; -typedef void (*GstAudiofilterFilterFunc) (GstAudiofilter * filter, - GstBuffer * outbuf, GstBuffer * inbuf); -typedef void (*GstAudiofilterInplaceFilterFunc) (GstAudiofilter * filter, - GstBuffer * buffer); +typedef void (*GstAudiofilterFilterFunc)(GstAudiofilter *filter, + GstBuffer *outbuf, GstBuffer *inbuf); +typedef void (*GstAudiofilterInplaceFilterFunc)(GstAudiofilter *filter, + GstBuffer *buffer); -typedef void (*GstAudiofilterSetupFunc) (GstAudiofilter * filter); +typedef void (*GstAudiofilterSetupFunc) (GstAudiofilter *filter); #define GST_TYPE_AUDIOFILTER \ @@ -47,11 +49,10 @@ typedef void (*GstAudiofilterSetupFunc) (GstAudiofilter * filter); #define GST_IS_AUDIOFILTER_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOFILTER)) -struct _GstAudiofilter -{ +struct _GstAudiofilter { GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; /* audio state */ gboolean inited; @@ -67,8 +68,7 @@ struct _GstAudiofilter int bytes_per_sample; }; -struct _GstAudiofilterClass -{ +struct _GstAudiofilterClass { GstElementClass parent_class; GstCaps *caps; @@ -77,10 +77,11 @@ struct _GstAudiofilterClass GstAudiofilterFilterFunc filter; }; -GType gst_audiofilter_get_type (void); +GType gst_audiofilter_get_type(void); -void gst_audiofilter_class_add_pad_templates (GstAudiofilterClass * - audiofilterclass, const GstCaps * caps); +void gst_audiofilter_class_add_pad_templates (GstAudiofilterClass *audiofilterclass, const GstCaps *caps); G_END_DECLS + #endif /* __GST_AUDIOFILTER_H__ */ + diff --git a/gst-libs/gst/colorbalance/colorbalance.h b/gst-libs/gst/colorbalance/colorbalance.h index d0347579..d7b92171 100644 --- a/gst-libs/gst/colorbalance/colorbalance.h +++ b/gst-libs/gst/colorbalance/colorbalance.h @@ -27,6 +27,7 @@ #include <gst/colorbalance/colorbalance-enumtypes.h> G_BEGIN_DECLS + #define GST_TYPE_COLOR_BALANCE \ (gst_color_balance_get_type ()) #define GST_COLOR_BALANCE(obj) \ @@ -41,48 +42,55 @@ G_BEGIN_DECLS (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE)) #define GST_COLOR_BALANCE_GET_CLASS(inst) \ (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_COLOR_BALANCE, GstColorBalanceClass)) + #define GST_COLOR_BALANCE_TYPE(klass) (klass->balance_type) -typedef struct _GstColorBalance GstColorBalance; +typedef struct _GstColorBalance GstColorBalance; + typedef enum { GST_COLOR_BALANCE_HARDWARE, GST_COLOR_BALANCE_SOFTWARE } GstColorBalanceType; -typedef struct _GstColorBalanceClass -{ +typedef struct _GstColorBalanceClass { GTypeInterface klass; GstColorBalanceType balance_type; - + /* virtual functions */ - const GList *(*list_channels) (GstColorBalance * balance); + const GList * (* list_channels) (GstColorBalance *balance); - void (*set_value) (GstColorBalance * balance, - GstColorBalanceChannel * channel, gint value); - gint (*get_value) (GstColorBalance * balance, - GstColorBalanceChannel * channel); + void (* set_value) (GstColorBalance *balance, + GstColorBalanceChannel *channel, + gint value); + gint (* get_value) (GstColorBalance *balance, + GstColorBalanceChannel *channel); /* signals */ - void (*value_changed) (GstColorBalance * balance, - GstColorBalanceChannel * channel, gint value); + void (* value_changed) (GstColorBalance *balance, + GstColorBalanceChannel *channel, + gint value); gpointer _gst_reserved[GST_PADDING]; } GstColorBalanceClass; -GType gst_color_balance_get_type (void); +GType gst_color_balance_get_type (void); /* virtual class function wrappers */ -const GList *gst_color_balance_list_channels (GstColorBalance * balance); -void gst_color_balance_set_value (GstColorBalance * balance, - GstColorBalanceChannel * channel, gint value); -gint gst_color_balance_get_value (GstColorBalance * balance, - GstColorBalanceChannel * channel); +const GList * + gst_color_balance_list_channels (GstColorBalance *balance); +void gst_color_balance_set_value (GstColorBalance *balance, + GstColorBalanceChannel *channel, + gint value); +gint gst_color_balance_get_value (GstColorBalance *balance, + GstColorBalanceChannel *channel); /* trigger signal */ -void gst_color_balance_value_changed (GstColorBalance * balance, - GstColorBalanceChannel * channel, gint value); +void gst_color_balance_value_changed (GstColorBalance *balance, + GstColorBalanceChannel *channel, + gint value); G_END_DECLS + #endif /* __GST_COLOR_BALANCE_H__ */ diff --git a/gst-libs/gst/colorbalance/colorbalancechannel.h b/gst-libs/gst/colorbalance/colorbalancechannel.h index 516fb72a..23f73f8e 100644 --- a/gst-libs/gst/colorbalance/colorbalancechannel.h +++ b/gst-libs/gst/colorbalance/colorbalancechannel.h @@ -25,6 +25,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_COLOR_BALANCE_CHANNEL \ (gst_color_balance_channel_get_type ()) #define GST_COLOR_BALANCE_CHANNEL(obj) \ @@ -37,25 +38,27 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_COLOR_BALANCE_CHANNEL)) #define GST_IS_COLOR_BALANCE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE_CHANNEL)) - typedef struct _GstColorBalanceChannel -{ + +typedef struct _GstColorBalanceChannel { GObject parent; - gchar *label; - gint min_value, max_value; + gchar *label; + gint min_value, + max_value; } GstColorBalanceChannel; -typedef struct _GstColorBalanceChannelClass -{ +typedef struct _GstColorBalanceChannelClass { GObjectClass parent; /* signals */ - void (*value_changed) (GstColorBalanceChannel * channel, gint value); + void (* value_changed) (GstColorBalanceChannel *channel, + gint value); gpointer _gst_reserved[GST_PADDING]; } GstColorBalanceChannelClass; -GType gst_color_balance_channel_get_type (void); +GType gst_color_balance_channel_get_type (void); G_END_DECLS + #endif /* __GST_COLOR_BALANCE_CHANNEL_H__ */ diff --git a/gst-libs/gst/floatcast/floatcast.h b/gst-libs/gst/floatcast/floatcast.h index 2951a810..ae87a43f 100644 --- a/gst-libs/gst/floatcast/floatcast.h +++ b/gst-libs/gst/floatcast/floatcast.h @@ -29,46 +29,53 @@ #include <glib/gtypes.h> G_BEGIN_DECLS + #if (HAVE_LRINT && HAVE_LRINTF) - /* These defines enable functionality introduced with the 1999 ISO C - ** standard. They must be defined before the inclusion of math.h to - ** engage them. If optimisation is enabled, these functions will be - ** inlined. With optimisation switched off, you have to link in the - ** maths library using -lm. - */ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC9X 1 -#define __USE_ISOC99 1 -#include <math.h> -#define gst_cast_float(x) ((gint)lrintf(x)) -#define gst_cast_double(x) ((gint)lrint(x)) + + /* These defines enable functionality introduced with the 1999 ISO C + ** standard. They must be defined before the inclusion of math.h to + ** engage them. If optimisation is enabled, these functions will be + ** inlined. With optimisation switched off, you have to link in the + ** maths library using -lm. + */ + + #define _ISOC9X_SOURCE 1 + #define _ISOC99_SOURCE 1 + + #define __USE_ISOC9X 1 + #define __USE_ISOC99 1 + + #include <math.h> + + #define gst_cast_float(x) ((gint)lrintf(x)) + #define gst_cast_double(x) ((gint)lrint(x)) + #else - /* use a standard c cast, but do rounding correctly */ -#define gst_cast_float(x) ((gint)floor((x)+0.5)) -#define gst_cast_double(x) ((gint)floor((x)+0.5)) + /* use a standard c cast, but do rounding correctly */ + #define gst_cast_float(x) ((gint)floor((x)+0.5)) + #define gst_cast_double(x) ((gint)floor((x)+0.5)) + #endif + inline static gfloat -GFLOAT_SWAP_LE_BE (gfloat in) +GFLOAT_SWAP_LE_BE(gfloat in) { gint32 swap; gfloat out; - - memcpy (&swap, &in, 4); + memcpy(&swap, &in, 4); swap = GUINT32_SWAP_LE_BE_CONSTANT (swap); - memcpy (&out, &swap, 4); + memcpy(&out, &swap, 4); return out; } inline static gdouble -GDOUBLE_SWAP_LE_BE (gdouble in) +GDOUBLE_SWAP_LE_BE(gdouble in) { gint64 swap; gdouble out; - - memcpy (&swap, &in, 8); + memcpy(&swap, &in, 8); swap = GUINT64_SWAP_LE_BE_CONSTANT (swap); - memcpy (&out, &swap, 8); + memcpy(&out, &swap, 8); return out; } @@ -94,4 +101,6 @@ GDOUBLE_SWAP_LE_BE (gdouble in) #define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val)) G_END_DECLS + #endif /* __FLOATCAST_H__ */ + diff --git a/gst-libs/gst/gconf/gconf.h b/gst-libs/gst/gconf/gconf.h index 79546a7a..70007f77 100644 --- a/gst-libs/gst/gconf/gconf.h +++ b/gst-libs/gst/gconf/gconf.h @@ -27,16 +27,17 @@ #include <gst/gst.h> #include <gconf/gconf-client.h> -gchar *gst_gconf_get_string (const gchar * key); -void gst_gconf_set_string (const gchar * key, const gchar * value); +gchar * gst_gconf_get_string (const gchar *key); +void gst_gconf_set_string (const gchar *key, + const gchar *value); -GstElement *gst_gconf_render_bin_from_key (const gchar * key); -GstElement *gst_gconf_render_bin_from_description (const gchar * description); +GstElement * gst_gconf_render_bin_from_key (const gchar *key); +GstElement * gst_gconf_render_bin_from_description (const gchar *description); -GstElement *gst_gconf_get_default_video_sink (void); -GstElement *gst_gconf_get_default_audio_sink (void); -GstElement *gst_gconf_get_default_video_src (void); -GstElement *gst_gconf_get_default_audio_src (void); -GstElement *gst_gconf_get_default_visualization_element (void); +GstElement * gst_gconf_get_default_video_sink (void); +GstElement * gst_gconf_get_default_audio_sink (void); +GstElement * gst_gconf_get_default_video_src (void); +GstElement * gst_gconf_get_default_audio_src (void); +GstElement * gst_gconf_get_default_visualization_element (void); #endif /* GST_GCONF_H */ diff --git a/gst-libs/gst/gst-i18n-plugin.h b/gst-libs/gst/gst-i18n-plugin.h index 846b1b0a..2c37a615 100644 --- a/gst-libs/gst/gst-i18n-plugin.h +++ b/gst-libs/gst/gst-i18n-plugin.h @@ -22,8 +22,8 @@ #ifndef __GST_I18N_PLUGIN_H__ #define __GST_I18N_PLUGIN_H__ -#include <locale.h> /* some people need it and some people don't */ -#include "gettext.h" /* included with gettext distribution and copied */ +#include <locale.h> /* some people need it and some people don't */ +#include "gettext.h" /* included with gettext distribution and copied */ #ifndef GETTEXT_PACKAGE #error You must define GETTEXT_PACKAGE before including this header. diff --git a/gst-libs/gst/idct/dct.h b/gst-libs/gst/idct/dct.h index c2e37449..efb3ddb3 100644 --- a/gst-libs/gst/idct/dct.h +++ b/gst-libs/gst/idct/dct.h @@ -16,7 +16,7 @@ typedef DCTELEM DCTBLOCK[DCTSIZE2]; typedef long INT32; /* must be at least 32 bits */ -extern void gst_idct_int_idct (); +extern void gst_idct_int_idct(); extern void gst_idct_init_fast_int_idct (void); extern void gst_idct_fast_int_idct (short *block); @@ -27,5 +27,6 @@ extern void gst_idct_mmx32_idct (short *block); extern void gst_idct_sse_idct (short *block); #endif /* HAVE_LIBMMX */ -extern void gst_idct_init_float_idct (void); +extern void gst_idct_init_float_idct(void); extern void gst_idct_float_idct (short *block); + diff --git a/gst-libs/gst/idct/idct.h b/gst-libs/gst/idct/idct.h index 37a2a0b9..fa6f62cd 100644 --- a/gst-libs/gst/idct/idct.h +++ b/gst-libs/gst/idct/idct.h @@ -23,24 +23,22 @@ #include <glib.h> -typedef enum -{ - GST_IDCT_DEFAULT, - GST_IDCT_INT, - GST_IDCT_FAST_INT, - GST_IDCT_FLOAT, - GST_IDCT_MMX, +typedef enum { + GST_IDCT_DEFAULT, + GST_IDCT_INT, + GST_IDCT_FAST_INT, + GST_IDCT_FLOAT, + GST_IDCT_MMX, GST_IDCT_MMX32, GST_IDCT_SSE, } GstIDCTMethod; typedef struct _GstIDCT GstIDCT; -typedef void (*GstIDCTFunction) (gshort * block); +typedef void (*GstIDCTFunction) (gshort *block); #define GST_IDCT_TRANSPOSE(idct) ((idct)->need_transpose) -struct _GstIDCT -{ +struct _GstIDCT { /* private */ GstIDCTFunction convert; GstIDCTFunction convert_sparse; @@ -48,10 +46,9 @@ struct _GstIDCT }; -GstIDCT *gst_idct_new (GstIDCTMethod method); - +GstIDCT *gst_idct_new(GstIDCTMethod method); #define gst_idct_convert(idct, blocks) (idct)->convert((blocks)) #define gst_idct_convert_sparse(idct, blocks) (idct)->convert_sparse((blocks)) -void gst_idct_destroy (GstIDCT * idct); +void gst_idct_destroy(GstIDCT *idct); #endif /* __GST_IDCT_H__ */ diff --git a/gst-libs/gst/media-info/media-info-priv.h b/gst-libs/gst/media-info/media-info-priv.h index 8f0f453f..81ee24ab 100644 --- a/gst-libs/gst/media-info/media-info-priv.h +++ b/gst-libs/gst/media-info/media-info-priv.h @@ -72,65 +72,69 @@ struct GstMediaInfoPriv gint metadata_iters; GstTagList *streaminfo; - GstElement *pipeline; /* will be != NULL during collection */ - gchar *pipeline_desc; /* will be != NULL during collection */ - GstElement *fakesink; /* so we can get caps from the - decoder sink pad */ - gchar *source_name; /* type of element used as source */ + GstElement *pipeline; /* will be != NULL during collection */ + gchar *pipeline_desc; /* will be != NULL during collection */ + GstElement *fakesink; /* so we can get caps from the + decoder sink pad */ + gchar *source_name; /* type of element used as source */ GstElement *source; - GstPad *source_pad; /* pad for querying encoded caps */ + GstPad *source_pad; /* pad for querying encoded caps */ GstElement *decoder; - GstPad *decoder_pad; /* pad for querying decoded caps */ - GstElement *decontainer; /* element to typefind in containers */ + GstPad *decoder_pad; /* pad for querying decoded caps */ + GstElement *decontainer; /* element to typefind in containers */ - GstMediaInfoState state; /* current state of state machine */ - gchar *location; /* location set on the info object */ - guint16 flags; /* flags supplied for detection */ - GstMediaInfoTrack *current_track; /* track pointer under inspection */ - glong current_track_num; /* current track under inspection */ + GstMediaInfoState state; /* current state of state machine */ + gchar *location; /* location set on the info object */ + guint16 flags; /* flags supplied for detection */ + GstMediaInfoTrack *current_track; /* track pointer under inspection */ + glong current_track_num; /* current track under inspection */ - GstMediaInfoStream *stream; /* total stream properties */ - char *cache; /* location of cache */ + GstMediaInfoStream *stream; /* total stream properties */ + char *cache; /* location of cache */ - GError *error; /* error for creation problems */ + GError *error; /* error for creation problems */ }; /* declarations */ -GstMediaInfoStream *gmi_stream_new (void); -void gmi_stream_free (GstMediaInfoStream * stream); - -GstMediaInfoTrack *gmi_track_new (void); - -void gmip_reset (GstMediaInfoPriv * priv); -gboolean gmip_init (GstMediaInfoPriv * priv, GError ** error); - -void gmi_clear_decoder (GstMediaInfo * info); - -gboolean gmi_seek_to_track (GstMediaInfo * info, long track); - -gboolean gmi_set_mime (GstMediaInfo * info, const char *mime); - -void deep_notify_callback (GObject * object, - GstObject * origin, GParamSpec * pspec, GstMediaInfoPriv * priv); -void found_tag_callback (GObject * pipeline, GstElement * source, - GstTagList * tags, GstMediaInfoPriv * priv); -void error_callback (GObject * element, GstElement * source, GError * error, - gchar * debug, GstMediaInfoPriv * priv); - -gboolean gmip_find_type_pre (GstMediaInfoPriv * priv, GError ** error); -gboolean gmip_find_type_post (GstMediaInfoPriv * priv); -gboolean gmip_find_type (GstMediaInfoPriv * priv, GError ** error); -gboolean gmip_find_stream_pre (GstMediaInfoPriv * priv); -gboolean gmip_find_stream_post (GstMediaInfoPriv * priv); -gboolean gmip_find_stream (GstMediaInfoPriv * priv); -gboolean gmip_find_track_metadata_pre (GstMediaInfoPriv * priv); -gboolean gmip_find_track_metadata_post (GstMediaInfoPriv * priv); -gboolean gmip_find_track_metadata (GstMediaInfoPriv * priv); -gboolean gmip_find_track_streaminfo_pre (GstMediaInfoPriv * priv); -gboolean gmip_find_track_streaminfo_post (GstMediaInfoPriv * priv); -gboolean gmip_find_track_streaminfo (GstMediaInfoPriv * priv); -gboolean gmip_find_track_format_pre (GstMediaInfoPriv * priv); -gboolean gmip_find_track_format_post (GstMediaInfoPriv * priv); -gboolean gmip_find_track_format (GstMediaInfoPriv * priv); +GstMediaInfoStream * + gmi_stream_new (void); +void gmi_stream_free (GstMediaInfoStream *stream); + +GstMediaInfoTrack * + gmi_track_new (void); + +void gmip_reset (GstMediaInfoPriv *priv); +gboolean gmip_init (GstMediaInfoPriv *priv, GError **error); + +void gmi_clear_decoder (GstMediaInfo *info); + +gboolean gmi_seek_to_track (GstMediaInfo *info, + long track); + +gboolean gmi_set_mime (GstMediaInfo *info, + const char *mime); + +void deep_notify_callback (GObject *object, + GstObject *origin, + GParamSpec *pspec, + GstMediaInfoPriv *priv); +void found_tag_callback (GObject *pipeline, GstElement *source, GstTagList *tags, GstMediaInfoPriv *priv); +void error_callback (GObject *element, GstElement *source, GError *error, gchar *debug, GstMediaInfoPriv *priv); + +gboolean gmip_find_type_pre (GstMediaInfoPriv *priv, GError **error); +gboolean gmip_find_type_post (GstMediaInfoPriv *priv); +gboolean gmip_find_type (GstMediaInfoPriv *priv, GError **error); +gboolean gmip_find_stream_pre (GstMediaInfoPriv *priv); +gboolean gmip_find_stream_post (GstMediaInfoPriv *priv); +gboolean gmip_find_stream (GstMediaInfoPriv *priv); +gboolean gmip_find_track_metadata_pre (GstMediaInfoPriv *priv); +gboolean gmip_find_track_metadata_post (GstMediaInfoPriv *priv); +gboolean gmip_find_track_metadata (GstMediaInfoPriv *priv); +gboolean gmip_find_track_streaminfo_pre (GstMediaInfoPriv *priv); +gboolean gmip_find_track_streaminfo_post (GstMediaInfoPriv *priv); +gboolean gmip_find_track_streaminfo (GstMediaInfoPriv *priv); +gboolean gmip_find_track_format_pre (GstMediaInfoPriv *priv); +gboolean gmip_find_track_format_post (GstMediaInfoPriv *priv); +gboolean gmip_find_track_format (GstMediaInfoPriv *priv); #endif /* __GST_MEDIA_INFO_PRIV_H__ */ diff --git a/gst-libs/gst/media-info/media-info.h b/gst-libs/gst/media-info/media-info.h index bbbcce2b..c134999d 100644 --- a/gst-libs/gst/media-info/media-info.h +++ b/gst-libs/gst/media-info/media-info.h @@ -23,9 +23,11 @@ #include <gst/gst.h> -G_BEGIN_DECLS typedef struct GstMediaInfoPriv GstMediaInfoPriv; -typedef struct _GstMediaInfo GstMediaInfo; -typedef struct _GstMediaInfoClass GstMediaInfoClass; +G_BEGIN_DECLS + +typedef struct GstMediaInfoPriv GstMediaInfoPriv; +typedef struct _GstMediaInfo GstMediaInfo; +typedef struct _GstMediaInfoClass GstMediaInfoClass; struct _GstMediaInfo { @@ -41,9 +43,8 @@ struct _GstMediaInfoClass GObjectClass parent_class; /* signals */ - void (*media_info_signal) (GstMediaInfo * gst_media_info); - void (*error_signal) (GstMediaInfo * gst_media_info, GError * error, - const gchar * debug); + void (*media_info_signal) (GstMediaInfo *gst_media_info); + void (*error_signal) (GstMediaInfo *gst_media_info, GError *error, const gchar *debug); gpointer _gst_reserved[GST_PADDING]; }; @@ -99,25 +100,34 @@ typedef struct #define GST_MEDIA_INFO_FORMAT 1 << 5 #define GST_MEDIA_INFO_ALL ((1 << 6) - 1) -GQuark gst_media_info_error_quark (void); - -void gst_media_info_init (void); -GType gst_media_info_get_type (void); - -GstMediaInfo *gst_media_info_new (GError ** error); - -gboolean gst_media_info_set_source (GstMediaInfo * info, - const char *source, GError ** error); -void gst_media_info_read_with_idler (GstMediaInfo * media_info, - const char *location, guint16 GST_MEDIA_INFO_FLAGS, GError ** error); -gboolean gst_media_info_read_idler (GstMediaInfo * media_info, - GstMediaInfoStream ** streamp, GError ** error); -GstMediaInfoStream *gst_media_info_read (GstMediaInfo * media_info, - const char *location, guint16 GST_MEDIA_INFO_FLAGS, GError ** error); -gboolean gst_media_info_read_many (GstMediaInfo * media_info, - GList * locations, guint16 GST_MEDIA_INFO_FLAGS, GError ** error); -GstCaps *gst_media_info_get_next (GstMediaInfo * media_info, GError ** error); - +GQuark gst_media_info_error_quark (void); + +void gst_media_info_init (void); +GType gst_media_info_get_type (void); + +GstMediaInfo * gst_media_info_new (GError **error); + +gboolean gst_media_info_set_source (GstMediaInfo *info, + const char *source, + GError **error); +void gst_media_info_read_with_idler (GstMediaInfo *media_info, + const char *location, + guint16 GST_MEDIA_INFO_FLAGS, + GError **error); +gboolean gst_media_info_read_idler (GstMediaInfo *media_info, + GstMediaInfoStream **streamp, + GError **error); +GstMediaInfoStream * + gst_media_info_read (GstMediaInfo *media_info, + const char *location, + guint16 GST_MEDIA_INFO_FLAGS, + GError **error); +gboolean gst_media_info_read_many (GstMediaInfo *media_info, + GList *locations, + guint16 GST_MEDIA_INFO_FLAGS, + GError **error); +GstCaps * gst_media_info_get_next (GstMediaInfo *media_info, + GError **error); /* * FIXME: reset ? gboolean gst_media_info_write (GstMediaInfo *media_info, @@ -126,4 +136,5 @@ gboolean gst_media_info_write (GstMediaInfo *media_info, */ G_END_DECLS + #endif /* __GST_MEDIA_INFO_H__ */ diff --git a/gst-libs/gst/mixer/mixer.h b/gst-libs/gst/mixer/mixer.h index 2caad164..50ba3fd8 100644 --- a/gst-libs/gst/mixer/mixer.h +++ b/gst-libs/gst/mixer/mixer.h @@ -27,6 +27,7 @@ #include <gst/mixer/mixer-enumtypes.h> G_BEGIN_DECLS + #define GST_TYPE_MIXER \ (gst_mixer_get_type ()) #define GST_MIXER(obj) \ @@ -39,7 +40,9 @@ G_BEGIN_DECLS (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER)) #define GST_MIXER_GET_CLASS(inst) \ (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_MIXER, GstMixerClass)) + #define GST_MIXER_TYPE(klass) (klass->mixer_type) + typedef struct _GstMixer GstMixer; typedef enum @@ -48,52 +51,70 @@ typedef enum GST_MIXER_SOFTWARE } GstMixerType; -typedef struct _GstMixerClass -{ +typedef struct _GstMixerClass { GTypeInterface klass; GstMixerType mixer_type; - + /* virtual functions */ - const GList *(*list_tracks) (GstMixer * mixer); + const GList * (* list_tracks) (GstMixer *mixer); - void (*set_volume) (GstMixer * mixer, GstMixerTrack * track, gint * volumes); - void (*get_volume) (GstMixer * mixer, GstMixerTrack * track, gint * volumes); + void (* set_volume) (GstMixer *mixer, + GstMixerTrack *track, + gint *volumes); + void (* get_volume) (GstMixer *mixer, + GstMixerTrack *track, + gint *volumes); - void (*set_mute) (GstMixer * mixer, GstMixerTrack * track, gboolean mute); - void (*set_record) (GstMixer * mixer, GstMixerTrack * track, gboolean record); + void (* set_mute) (GstMixer *mixer, + GstMixerTrack *track, + gboolean mute); + void (* set_record) (GstMixer *mixer, + GstMixerTrack *track, + gboolean record); /* signals */ - void (*mute_toggled) (GstMixer * mixer, - GstMixerTrack * channel, gboolean mute); - void (*record_toggled) (GstMixer * mixer, - GstMixerTrack * channel, gboolean record); - void (*volume_changed) (GstMixer * mixer, - GstMixerTrack * channel, gint * volumes); + void (* mute_toggled) (GstMixer *mixer, + GstMixerTrack *channel, + gboolean mute); + void (* record_toggled) (GstMixer *mixer, + GstMixerTrack *channel, + gboolean record); + void (* volume_changed) (GstMixer *mixer, + GstMixerTrack *channel, + gint *volumes); gpointer _gst_reserved[GST_PADDING]; } GstMixerClass; -GType gst_mixer_get_type (void); +GType gst_mixer_get_type (void); /* virtual class function wrappers */ -const GList *gst_mixer_list_tracks (GstMixer * mixer); -void gst_mixer_set_volume (GstMixer * mixer, - GstMixerTrack * track, gint * volumes); -void gst_mixer_get_volume (GstMixer * mixer, - GstMixerTrack * track, gint * volumes); -void gst_mixer_set_mute (GstMixer * mixer, - GstMixerTrack * track, gboolean mute); -void gst_mixer_set_record (GstMixer * mixer, - GstMixerTrack * track, gboolean record); +const GList * gst_mixer_list_tracks (GstMixer *mixer); +void gst_mixer_set_volume (GstMixer *mixer, + GstMixerTrack *track, + gint *volumes); +void gst_mixer_get_volume (GstMixer *mixer, + GstMixerTrack *track, + gint *volumes); +void gst_mixer_set_mute (GstMixer *mixer, + GstMixerTrack *track, + gboolean mute); +void gst_mixer_set_record (GstMixer *mixer, + GstMixerTrack *track, + gboolean record); /* trigger signals */ -void gst_mixer_mute_toggled (GstMixer * mixer, - GstMixerTrack * track, gboolean mute); -void gst_mixer_record_toggled (GstMixer * mixer, - GstMixerTrack * track, gboolean record); -void gst_mixer_volume_changed (GstMixer * mixer, - GstMixerTrack * track, gint * volumes); +void gst_mixer_mute_toggled (GstMixer *mixer, + GstMixerTrack *track, + gboolean mute); +void gst_mixer_record_toggled (GstMixer *mixer, + GstMixerTrack *track, + gboolean record); +void gst_mixer_volume_changed (GstMixer *mixer, + GstMixerTrack *track, + gint *volumes); G_END_DECLS + #endif /* __GST_MIXER_H__ */ diff --git a/gst-libs/gst/mixer/mixertrack.h b/gst-libs/gst/mixer/mixertrack.h index 872b0904..0e05d9cb 100644 --- a/gst-libs/gst/mixer/mixertrack.h +++ b/gst-libs/gst/mixer/mixertrack.h @@ -25,6 +25,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_MIXER_TRACK \ (gst_mixer_track_get_type ()) #define GST_MIXER_TRACK(obj) \ @@ -37,6 +38,7 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MIXER_TRACK)) #define GST_IS_MIXER_TRACK_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER_TRACK)) + /* * Naming: * @@ -52,41 +54,45 @@ G_BEGIN_DECLS * mixer, which means that setting this track will change * the hearable volume on any output. */ - typedef enum -{ - GST_MIXER_TRACK_INPUT = (1 << 0), - GST_MIXER_TRACK_OUTPUT = (1 << 1), - GST_MIXER_TRACK_MUTE = (1 << 2), - GST_MIXER_TRACK_RECORD = (1 << 3), - GST_MIXER_TRACK_MASTER = (1 << 4), - GST_MIXER_TRACK_SOFTWARE = (1 << 5) + +typedef enum { + GST_MIXER_TRACK_INPUT = (1<<0), + GST_MIXER_TRACK_OUTPUT = (1<<1), + GST_MIXER_TRACK_MUTE = (1<<2), + GST_MIXER_TRACK_RECORD = (1<<3), + GST_MIXER_TRACK_MASTER = (1<<4), + GST_MIXER_TRACK_SOFTWARE = (1<<5) } GstMixerTrackFlags; #define GST_MIXER_TRACK_HAS_FLAG(channel, flag) \ ((channel)->flags & flag) -typedef struct _GstMixerTrack -{ - GObject parent; +typedef struct _GstMixerTrack { + GObject parent; - gchar *label; + gchar *label; GstMixerTrackFlags flags; - gint num_channels, min_volume, max_volume; + gint num_channels, + min_volume, + max_volume; } GstMixerTrack; -typedef struct _GstMixerTrackClass -{ +typedef struct _GstMixerTrackClass { GObjectClass parent; /* signals */ - void (*mute_toggled) (GstMixerTrack * channel, gboolean mute); - void (*record_toggled) (GstMixerTrack * channel, gboolean record); - void (*volume_changed) (GstMixerTrack * channel, gint * volumes); + void (* mute_toggled) (GstMixerTrack *channel, + gboolean mute); + void (* record_toggled) (GstMixerTrack *channel, + gboolean record); + void (* volume_changed) (GstMixerTrack *channel, + gint *volumes); gpointer _gst_reserved[GST_PADDING]; } GstMixerTrackClass; -GType gst_mixer_track_get_type (void); +GType gst_mixer_track_get_type (void); G_END_DECLS + #endif /* __GST_MIXER_TRACK_H__ */ diff --git a/gst-libs/gst/navigation/navigation.h b/gst-libs/gst/navigation/navigation.h index 342ff9af..5ccaf748 100644 --- a/gst-libs/gst/navigation/navigation.h +++ b/gst-libs/gst/navigation/navigation.h @@ -26,6 +26,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_NAVIGATION \ (gst_navigation_get_type ()) #define GST_NAVIGATION(obj) \ @@ -34,28 +35,28 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NAVIGATION)) #define GST_NAVIGATION_GET_IFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_NAVIGATION, GstNavigationInterface)) + typedef struct _GstNavigation GstNavigation; -typedef struct _GstNavigationInterface -{ +typedef struct _GstNavigationInterface { GTypeInterface g_iface; /* virtual functions */ - void (*send_event) (GstNavigation * navigation, GstStructure * structure); - + void (*send_event) (GstNavigation *navigation, GstStructure *structure); + gpointer _gst_reserved[GST_PADDING]; } GstNavigationInterface; -GType gst_navigation_get_type (void); +GType gst_navigation_get_type (void); /* virtual class function wrappers */ -void gst_navigation_send_event (GstNavigation * navigation, - GstStructure * structure); +void gst_navigation_send_event (GstNavigation *navigation, GstStructure *structure); -void gst_navigation_send_key_event (GstNavigation * navigation, - const char *event, const char *key); -void gst_navigation_send_mouse_event (GstNavigation * navigation, - const char *event, int button, double x, double y); +void gst_navigation_send_key_event (GstNavigation *navigation, + const char *event, const char *key); +void gst_navigation_send_mouse_event (GstNavigation *navigation, + const char *event, int button, double x, double y); G_END_DECLS + #endif /* __GST_NAVIGATION_H__ */ diff --git a/gst-libs/gst/play/play.h b/gst-libs/gst/play/play.h index 36d8aca2..8ccf827d 100644 --- a/gst-libs/gst/play/play.h +++ b/gst-libs/gst/play/play.h @@ -16,7 +16,7 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ - + #ifndef __GST_PLAY_H__ #define __GST_PLAY_H__ @@ -46,43 +46,51 @@ typedef enum typedef struct _GstPlay GstPlay; typedef struct _GstPlayClass GstPlayClass; typedef struct _GstPlayPrivate GstPlayPrivate; - + struct _GstPlay { GstPipeline pipeline; - + GstPlayPrivate *priv; - + gpointer _gst_reserved[GST_PADDING]; }; - + struct _GstPlayClass { GstPipelineClass parent_class; - - void (*time_tick) (GstPlay * play, gint64 time_nanos); - void (*stream_length) (GstPlay * play, gint64 length_nanos); - void (*have_video_size) (GstPlay * play, gint width, gint height); - + + void (*time_tick) (GstPlay *play, gint64 time_nanos); + void (*stream_length) (GstPlay *play, gint64 length_nanos); + void (*have_video_size) (GstPlay *play, gint width, gint height); + gpointer _gst_reserved[GST_PADDING]; }; -GType gst_play_get_type (void); -GstPlay *gst_play_new (GError ** error); +GType gst_play_get_type (void); +GstPlay * gst_play_new (GError **error); -gboolean gst_play_set_data_src (GstPlay * play, GstElement * data_src); -gboolean gst_play_set_video_sink (GstPlay * play, GstElement * video_sink); -gboolean gst_play_set_audio_sink (GstPlay * play, GstElement * audio_sink); +gboolean gst_play_set_data_src (GstPlay *play, + GstElement *data_src); +gboolean gst_play_set_video_sink (GstPlay *play, + GstElement *video_sink); +gboolean gst_play_set_audio_sink (GstPlay *play, + GstElement *audio_sink); -gboolean gst_play_set_visualization (GstPlay * play, GstElement * element); -gboolean gst_play_connect_visualization (GstPlay * play, gboolean connect); +gboolean gst_play_set_visualization (GstPlay *play, + GstElement *element); +gboolean gst_play_connect_visualization (GstPlay *play, + gboolean connect); -gboolean gst_play_set_location (GstPlay * play, const char *location); -char *gst_play_get_location (GstPlay * play); +gboolean gst_play_set_location (GstPlay *play, + const char *location); +char * gst_play_get_location (GstPlay *play); -gboolean gst_play_seek_to_time (GstPlay * play, gint64 time_nanos); +gboolean gst_play_seek_to_time (GstPlay *play, + gint64 time_nanos); -GstElement *gst_play_get_sink_element (GstPlay * play, - GstElement * element, GstPlaySinkType sink_type); +GstElement * gst_play_get_sink_element (GstPlay *play, + GstElement *element, + GstPlaySinkType sink_type); #endif /* __GST_PLAY_H__ */ diff --git a/gst-libs/gst/propertyprobe/propertyprobe.h b/gst-libs/gst/propertyprobe/propertyprobe.h index 39250a32..695aa4da 100644 --- a/gst-libs/gst/propertyprobe/propertyprobe.h +++ b/gst-libs/gst/propertyprobe/propertyprobe.h @@ -25,6 +25,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_PROPERTY_PROBE \ (gst_property_probe_get_type ()) #define GST_PROPERTY_PROBE(obj) \ @@ -33,59 +34,64 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PROPERTY_PROBE)) #define GST_PROPERTY_PROBE_GET_IFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_PROPERTY_PROBE, GstPropertyProbeInterface)) -typedef struct _GstPropertyProbe GstPropertyProbe; /* dummy typedef */ -typedef struct _GstPropertyProbeInterface -{ +typedef struct _GstPropertyProbe GstPropertyProbe; /* dummy typedef */ + +typedef struct _GstPropertyProbeInterface { GTypeInterface klass; /* signals */ - void (*probe_needed) (GstPropertyProbe * probe, const GParamSpec * pspec); + void (*probe_needed) (GstPropertyProbe *probe, + const GParamSpec *pspec); /* virtual functions */ - const GList *(*get_properties) (GstPropertyProbe * probe); - gboolean (*needs_probe) (GstPropertyProbe * probe, - guint prop_id, const GParamSpec * pspec); - void (*probe_property) (GstPropertyProbe * probe, - guint prop_id, const GParamSpec * pspec); - GValueArray *(*get_values) (GstPropertyProbe * probe, - guint prop_id, const GParamSpec * pspec); + const GList * (*get_properties) (GstPropertyProbe *probe); + gboolean (*needs_probe) (GstPropertyProbe *probe, + guint prop_id, + const GParamSpec *pspec); + void (*probe_property) (GstPropertyProbe *probe, + guint prop_id, + const GParamSpec *pspec); + GValueArray * (*get_values) (GstPropertyProbe *probe, + guint prop_id, + const GParamSpec *pspec); gpointer _gst_reserved[GST_PADDING]; } GstPropertyProbeInterface; -GType gst_property_probe_get_type (void); +GType gst_property_probe_get_type (void); /* virtual class function wrappers */ /* returns list of GParamSpecs */ -const GList *gst_property_probe_get_properties (GstPropertyProbe * probe); -const GParamSpec *gst_property_probe_get_property (GstPropertyProbe * probe, - const gchar * name); +const GList * gst_property_probe_get_properties (GstPropertyProbe *probe); +const GParamSpec *gst_property_probe_get_property (GstPropertyProbe *probe, + const gchar *name); /* probe one property */ -void gst_property_probe_probe_property (GstPropertyProbe * probe, - const GParamSpec * pspec); -void gst_property_probe_probe_property_name (GstPropertyProbe * probe, - const gchar * name); +void gst_property_probe_probe_property (GstPropertyProbe *probe, + const GParamSpec *pspec); +void gst_property_probe_probe_property_name (GstPropertyProbe *probe, + const gchar *name); /* do we need a probe? */ -gboolean gst_property_probe_needs_probe (GstPropertyProbe * probe, - const GParamSpec * pspec); -gboolean gst_property_probe_needs_probe_name (GstPropertyProbe * probe, - const gchar * name); +gboolean gst_property_probe_needs_probe (GstPropertyProbe *probe, + const GParamSpec *pspec); +gboolean gst_property_probe_needs_probe_name (GstPropertyProbe *probe, + const gchar *name); /* returns list of GValues */ -GValueArray *gst_property_probe_get_values (GstPropertyProbe * probe, - const GParamSpec * pspec); -GValueArray *gst_property_probe_get_values_name (GstPropertyProbe * probe, - const gchar * name); +GValueArray * gst_property_probe_get_values (GstPropertyProbe *probe, + const GParamSpec *pspec); +GValueArray * gst_property_probe_get_values_name (GstPropertyProbe *probe, + const gchar *name); /* sugar */ -GValueArray *gst_property_probe_probe_and_get_values (GstPropertyProbe * probe, - const GParamSpec * pspec); -GValueArray *gst_property_probe_probe_and_get_values_name (GstPropertyProbe * - probe, const gchar * name); +GValueArray * gst_property_probe_probe_and_get_values (GstPropertyProbe *probe, + const GParamSpec *pspec); +GValueArray * gst_property_probe_probe_and_get_values_name (GstPropertyProbe *probe, + const gchar *name); G_END_DECLS + #endif /* __GST_PROPERTY_PROBE_H__ */ diff --git a/gst-libs/gst/resample/private.h b/gst-libs/gst/resample/private.h index a0d37f41..5791f580 100644 --- a/gst-libs/gst/resample/private.h +++ b/gst-libs/gst/resample/private.h @@ -23,71 +23,68 @@ #include "resample.h" -void gst_resample_nearest_s16 (gst_resample_t * r); -void gst_resample_bilinear_s16 (gst_resample_t * r); -void gst_resample_sinc_s16 (gst_resample_t * r); -void gst_resample_sinc_slow_s16 (gst_resample_t * r); -void gst_resample_sinc_ft_s16 (gst_resample_t * r); +void gst_resample_nearest_s16(gst_resample_t *r); +void gst_resample_bilinear_s16(gst_resample_t *r); +void gst_resample_sinc_s16(gst_resample_t *r); +void gst_resample_sinc_slow_s16(gst_resample_t *r); +void gst_resample_sinc_ft_s16(gst_resample_t * r); -void gst_resample_nearest_float (gst_resample_t * r); -void gst_resample_bilinear_float (gst_resample_t * r); -void gst_resample_sinc_float (gst_resample_t * r); -void gst_resample_sinc_slow_float (gst_resample_t * r); -void gst_resample_sinc_ft_float (gst_resample_t * r); +void gst_resample_nearest_float(gst_resample_t *r); +void gst_resample_bilinear_float(gst_resample_t *r); +void gst_resample_sinc_float(gst_resample_t *r); +void gst_resample_sinc_slow_float(gst_resample_t *r); +void gst_resample_sinc_ft_float(gst_resample_t * r); typedef struct functable_s functable_t; -struct functable_s -{ - double start; - double offset; - int len; +struct functable_s { + double start; + double offset; + int len; - double invoffset; + double invoffset; - double scale; - double scale2; + double scale; + double scale2; - double (*func_x) (void *, double x); - double (*func_dx) (void *, double x); + double (*func_x)(void *,double x); + double (*func_dx)(void *,double x); - double (*func2_x) (void *, double x); - double (*func2_dx) (void *, double x); + double (*func2_x)(void *,double x); + double (*func2_dx)(void *,double x); - double *fx; - double *fdx; + double *fx; + double *fdx; - void *priv; + void *priv; }; -void functable_init (functable_t * t); -double functable_eval (functable_t * t, double x); +void functable_init(functable_t *t); +double functable_eval(functable_t *t,double x); -double functable_fir (functable_t * t, double x0, int n, double *data, int len); -void functable_fir2 (functable_t * t, double *r0, double *r1, double x0, - int n, double *data, int len); +double functable_fir(functable_t *t,double x0,int n,double *data,int len); +void functable_fir2(functable_t *t,double *r0, double *r1, double x0, + int n,double *data,int len); -double functable_sinc (void *p, double x); -double functable_dsinc (void *p, double x); -double functable_window_std (void *p, double x); -double functable_window_dstd (void *p, double x); -double functable_window_boxcar (void *p, double x); -double functable_window_dboxcar (void *p, double x); +double functable_sinc(void *p, double x); +double functable_dsinc(void *p, double x); +double functable_window_std(void *p, double x); +double functable_window_dstd(void *p, double x); +double functable_window_boxcar(void *p, double x); +double functable_window_dboxcar(void *p, double x); /* math lib stuff */ -void conv_double_short_table (double *dest, short *src, int n); -void conv_double_short_unroll (double *dest, short *src, int n); -void conv_double_short_ref (double *dest, short *src, int n); - +void conv_double_short_table(double *dest, short *src, int n); +void conv_double_short_unroll(double *dest, short *src, int n); +void conv_double_short_ref(double *dest, short *src, int n); #ifdef HAVE_CPU_PPC -void conv_double_short_altivec (double *dest, short *src, int n); +void conv_double_short_altivec(double *dest, short *src, int n); #endif -void conv_short_double_ref (short *dest, double *src, int n); - +void conv_short_double_ref(short *dest, double *src, int n); #ifdef HAVE_CPU_PPC -void conv_short_double_ppcasm (short *dest, double *src, int n); +void conv_short_double_ppcasm(short *dest, double *src, int n); #endif #ifdef HAVE_CPU_PPC @@ -101,12 +98,12 @@ void conv_short_double_ppcasm (short *dest, double *src, int n); #define conv_double_float conv_double_float_ref #define conv_float_double conv_float_double_ref -void conv_double_short_dstr (double *dest, short *src, int n, int dstr); -void conv_short_double_sstr (short *dest, double *src, int n, int dstr); +void conv_double_short_dstr(double *dest, short *src, int n, int dstr); +void conv_short_double_sstr(short *dest, double *src, int n, int dstr); -void conv_double_float_ref (double *dest, float *src, int n); -void conv_float_double_ref (float *dest, double *src, int n); -void conv_double_float_dstr (double *dest, float *src, int n, int dstr); -void conv_float_double_sstr (float *dest, double *src, int n, int sstr); +void conv_double_float_ref(double *dest, float *src, int n); +void conv_float_double_ref(float *dest, double *src, int n); +void conv_double_float_dstr(double *dest, float *src, int n, int dstr); +void conv_float_double_sstr(float *dest, double *src, int n, int sstr); #endif /* __PRIVATE_H__ */ diff --git a/gst-libs/gst/resample/resample.h b/gst-libs/gst/resample/resample.h index 699d7d3b..1c4216b3 100644 --- a/gst-libs/gst/resample/resample.h +++ b/gst-libs/gst/resample/resample.h @@ -21,78 +21,76 @@ #ifndef __GST_RESAMPLE_H__ #define __GST_RESAMPLE_H__ -typedef enum -{ - GST_RESAMPLE_NEAREST = 0, - GST_RESAMPLE_BILINEAR, - GST_RESAMPLE_SINC_SLOW, - GST_RESAMPLE_SINC, +typedef enum { + GST_RESAMPLE_NEAREST = 0, + GST_RESAMPLE_BILINEAR, + GST_RESAMPLE_SINC_SLOW, + GST_RESAMPLE_SINC, } gst_resample_method; -typedef enum -{ - GST_RESAMPLE_S16 = 0, - GST_RESAMPLE_FLOAT +typedef enum { + GST_RESAMPLE_S16 = 0, + GST_RESAMPLE_FLOAT } gst_resample_format; typedef struct gst_resample_s gst_resample_t; -struct gst_resample_s -{ - /* parameters */ +struct gst_resample_s { + /* parameters */ - gst_resample_method method; - int channels; - int verbose; - gst_resample_format format; + gst_resample_method method; + int channels; + int verbose; + gst_resample_format format; - int filter_length; + int filter_length; - double i_rate; - double o_rate; + double i_rate; + double o_rate; - void *priv; + void *priv; - void *(*get_buffer) (void *priv, unsigned int size); + void *(*get_buffer)(void *priv, unsigned int size); - /* internal parameters */ + /* internal parameters */ - double halftaps; + double halftaps; - /* filter state */ + /* filter state */ - void *buffer; - int buffer_len; + void *buffer; + int buffer_len; - double i_start; - double o_start; + double i_start; + double o_start; - double i_start_buf; - double i_end_buf; + double i_start_buf; + double i_end_buf; - double i_inc; - double o_inc; + double i_inc; + double o_inc; - double i_end; - double o_end; + double i_end; + double o_end; - int i_samples; - int o_samples; + int i_samples; + int o_samples; - void *i_buf, *o_buf; + void *i_buf, *o_buf; - double acc[10]; + double acc[10]; - /* methods */ - void (*scale) (gst_resample_t * r); + /* methods */ + void (*scale)(gst_resample_t *r); - double ack; + double ack; }; -void gst_resample_init (gst_resample_t * r); +void gst_resample_init(gst_resample_t *r); -void gst_resample_reinit (gst_resample_t * r); +void gst_resample_reinit(gst_resample_t *r); -void gst_resample_scale (gst_resample_t * r, void *i_buf, unsigned int size); +void gst_resample_scale(gst_resample_t *r, void *i_buf, unsigned int size); #endif /* __GST_RESAMPLE_H__ */ + diff --git a/gst-libs/gst/riff/riff-ids.h b/gst-libs/gst/riff/riff-ids.h index 141cbab5..da465c2d 100644 --- a/gst-libs/gst/riff/riff-ids.h +++ b/gst-libs/gst/riff/riff-ids.h @@ -66,29 +66,29 @@ #define GST_RIFF_FCCH_MSVC GST_MAKE_FOURCC ('M','S','V','C') /* INFO types - see http://www.saettler.com/RIFFMCI/riffmci.html */ -#define GST_RIFF_INFO_IARL GST_MAKE_FOURCC ('I','A','R','L') /* location */ -#define GST_RIFF_INFO_IART GST_MAKE_FOURCC ('I','A','R','T') /* artist */ -#define GST_RIFF_INFO_ICMS GST_MAKE_FOURCC ('I','C','M','S') /* commissioned */ -#define GST_RIFF_INFO_ICMT GST_MAKE_FOURCC ('I','C','M','T') /* comment */ -#define GST_RIFF_INFO_ICOP GST_MAKE_FOURCC ('I','C','O','P') /* copyright */ -#define GST_RIFF_INFO_ICRD GST_MAKE_FOURCC ('I','C','R','D') /* creation date */ -#define GST_RIFF_INFO_ICRP GST_MAKE_FOURCC ('I','C','R','P') /* cropped */ -#define GST_RIFF_INFO_IDIM GST_MAKE_FOURCC ('I','D','I','M') /* dimensions */ -#define GST_RIFF_INFO_IDPI GST_MAKE_FOURCC ('I','D','P','I') /* dots-per-inch */ -#define GST_RIFF_INFO_IENG GST_MAKE_FOURCC ('I','E','N','G') /* engineer(s) */ -#define GST_RIFF_INFO_IGNR GST_MAKE_FOURCC ('I','G','N','R') /* genre */ -#define GST_RIFF_INFO_IKEY GST_MAKE_FOURCC ('I','K','E','Y') /* keywords */ -#define GST_RIFF_INFO_ILGT GST_MAKE_FOURCC ('I','L','G','T') /* lightness */ -#define GST_RIFF_INFO_IMED GST_MAKE_FOURCC ('I','M','E','D') /* medium */ -#define GST_RIFF_INFO_INAM GST_MAKE_FOURCC ('I','N','A','M') /* name */ -#define GST_RIFF_INFO_IPLT GST_MAKE_FOURCC ('I','P','L','T') /* palette setting */ -#define GST_RIFF_INFO_IPRD GST_MAKE_FOURCC ('I','P','R','D') /* product */ -#define GST_RIFF_INFO_ISBJ GST_MAKE_FOURCC ('I','S','B','J') /* subject */ -#define GST_RIFF_INFO_ISFT GST_MAKE_FOURCC ('I','S','F','T') /* software */ -#define GST_RIFF_INFO_ISHP GST_MAKE_FOURCC ('I','S','H','P') /* sharpness */ -#define GST_RIFF_INFO_ISRC GST_MAKE_FOURCC ('I','S','R','C') /* source */ -#define GST_RIFF_INFO_ISRF GST_MAKE_FOURCC ('I','S','R','F') /* source form */ -#define GST_RIFF_INFO_ITCH GST_MAKE_FOURCC ('I','T','C','H') /* technician(s) */ +#define GST_RIFF_INFO_IARL GST_MAKE_FOURCC ('I','A','R','L') /* location */ +#define GST_RIFF_INFO_IART GST_MAKE_FOURCC ('I','A','R','T') /* artist */ +#define GST_RIFF_INFO_ICMS GST_MAKE_FOURCC ('I','C','M','S') /* commissioned */ +#define GST_RIFF_INFO_ICMT GST_MAKE_FOURCC ('I','C','M','T') /* comment */ +#define GST_RIFF_INFO_ICOP GST_MAKE_FOURCC ('I','C','O','P') /* copyright */ +#define GST_RIFF_INFO_ICRD GST_MAKE_FOURCC ('I','C','R','D') /* creation date */ +#define GST_RIFF_INFO_ICRP GST_MAKE_FOURCC ('I','C','R','P') /* cropped */ +#define GST_RIFF_INFO_IDIM GST_MAKE_FOURCC ('I','D','I','M') /* dimensions */ +#define GST_RIFF_INFO_IDPI GST_MAKE_FOURCC ('I','D','P','I') /* dots-per-inch */ +#define GST_RIFF_INFO_IENG GST_MAKE_FOURCC ('I','E','N','G') /* engineer(s) */ +#define GST_RIFF_INFO_IGNR GST_MAKE_FOURCC ('I','G','N','R') /* genre */ +#define GST_RIFF_INFO_IKEY GST_MAKE_FOURCC ('I','K','E','Y') /* keywords */ +#define GST_RIFF_INFO_ILGT GST_MAKE_FOURCC ('I','L','G','T') /* lightness */ +#define GST_RIFF_INFO_IMED GST_MAKE_FOURCC ('I','M','E','D') /* medium */ +#define GST_RIFF_INFO_INAM GST_MAKE_FOURCC ('I','N','A','M') /* name */ +#define GST_RIFF_INFO_IPLT GST_MAKE_FOURCC ('I','P','L','T') /* palette setting */ +#define GST_RIFF_INFO_IPRD GST_MAKE_FOURCC ('I','P','R','D') /* product */ +#define GST_RIFF_INFO_ISBJ GST_MAKE_FOURCC ('I','S','B','J') /* subject */ +#define GST_RIFF_INFO_ISFT GST_MAKE_FOURCC ('I','S','F','T') /* software */ +#define GST_RIFF_INFO_ISHP GST_MAKE_FOURCC ('I','S','H','P') /* sharpness */ +#define GST_RIFF_INFO_ISRC GST_MAKE_FOURCC ('I','S','R','C') /* source */ +#define GST_RIFF_INFO_ISRF GST_MAKE_FOURCC ('I','S','R','F') /* source form */ +#define GST_RIFF_INFO_ITCH GST_MAKE_FOURCC ('I','T','C','H') /* technician(s) */ /*********Chunk Names***************/ #define GST_RIFF_FF00 GST_MAKE_FOURCC (0xFF,0xFF,0x00,0x00) @@ -167,7 +167,7 @@ #define GST_RIFF_v422 GST_MAKE_FOURCC ('v', '4', '2', '2') #define GST_RIFF_V422 GST_MAKE_FOURCC ('V', '4', '2', '2') #define GST_RIFF_mvi1 GST_MAKE_FOURCC ('m', 'v', 'i', '1') -#define GST_RIFF_MPIX GST_MAKE_FOURCC (0x04,0x00, 'i', '1') /* MotionPixels munged their id */ +#define GST_RIFF_MPIX GST_MAKE_FOURCC (0x04,0x00, 'i', '1') /* MotionPixels munged their id */ #define GST_RIFF_AURA GST_MAKE_FOURCC ('A', 'U', 'R', 'A') #define GST_RIFF_DMB1 GST_MAKE_FOURCC ('D', 'M', 'B', '1') #define GST_RIFF_dmb1 GST_MAKE_FOURCC ('d', 'm', 'b', '1') @@ -203,7 +203,7 @@ #define GST_RIFF_rpza GST_MAKE_FOURCC ('r', 'p', 'z', 'a') /* And this here's the mistakes that need to be supported */ -#define GST_RIFF_azpr GST_MAKE_FOURCC ('a', 'z', 'p', 'r') /* recognize Apple's rpza mangled? */ +#define GST_RIFF_azpr GST_MAKE_FOURCC ('a', 'z', 'p', 'r') /* recognize Apple's rpza mangled? */ /*********** FND in MJPG **********/ #define GST_RIFF_ISFT GST_MAKE_FOURCC ('I', 'S', 'F', 'T') @@ -216,28 +216,26 @@ #define GST_RIFF_rec GST_MAKE_FOURCC ('r', 'e', 'c', ' ') /* common data structures */ -typedef struct _gst_riff_strh -{ - guint32 type; /* stream type */ - guint32 fcc_handler; /* fcc_handler */ +typedef struct _gst_riff_strh { + guint32 type; /* stream type */ + guint32 fcc_handler; /* fcc_handler */ guint32 flags; /* flags values */ #define GST_RIFF_STRH_DISABLED 0x000000001 #define GST_RIFF_STRH_VIDEOPALCHANGES 0x000010000 guint32 priority; - guint32 init_frames; /* initial frames (???) */ + guint32 init_frames; /* initial frames (???) */ guint32 scale; guint32 rate; guint32 start; guint32 length; - guint32 bufsize; /* suggested buffer size */ + guint32 bufsize; /* suggested buffer size */ guint32 quality; guint32 samplesize; /* XXX 16 bytes ? */ } gst_riff_strh; -typedef struct _gst_riff_strf_vids -{ /* == BitMapInfoHeader */ +typedef struct _gst_riff_strf_vids { /* == BitMapInfoHeader */ guint32 size; guint32 width; guint32 height; @@ -247,14 +245,13 @@ typedef struct _gst_riff_strf_vids guint32 image_size; guint32 xpels_meter; guint32 ypels_meter; - guint32 num_colors; /* used colors */ - guint32 imp_colors; /* important colors */ + guint32 num_colors; /* used colors */ + guint32 imp_colors; /* important colors */ /* may be more for some codecs */ } gst_riff_strf_vids; -typedef struct _gst_riff_strf_auds -{ /* == WaveHeader (?) */ +typedef struct _gst_riff_strf_auds { /* == WaveHeader (?) */ guint16 format; /**** from public Microsoft RIFF docs ******/ #define GST_RIFF_WAVE_FORMAT_UNKNOWN (0x0000) @@ -293,8 +290,7 @@ typedef struct _gst_riff_strf_auds guint16 size; } gst_riff_strf_auds; -typedef struct _gst_riff_strf_iavs -{ +typedef struct _gst_riff_strf_iavs { guint32 DVAAuxSrc; guint32 DVAAuxCtl; guint32 DVAAuxSrc1; @@ -305,8 +301,7 @@ typedef struct _gst_riff_strf_iavs guint32 DVReserved2; } gst_riff_strf_iavs; -typedef struct _gst_riff_index_entry -{ +typedef struct _gst_riff_index_entry { guint32 id; guint32 flags; #define GST_RIFF_IF_LIST (0x00000001L) @@ -317,8 +312,7 @@ typedef struct _gst_riff_index_entry guint32 size; } gst_riff_index_entry; -typedef struct _gst_riff_dmlh -{ +typedef struct _gst_riff_dmlh { guint32 totalframes; } gst_riff_dmlh; diff --git a/gst-libs/gst/riff/riff-media.h b/gst-libs/gst/riff/riff-media.h index ca4a9434..220671af 100644 --- a/gst-libs/gst/riff/riff-media.h +++ b/gst-libs/gst/riff/riff-media.h @@ -27,15 +27,23 @@ #include "riff-ids.h" G_BEGIN_DECLS + /* * Create one caps. strh/strf can be NULL (for non-fixed caps). */ - GstCaps * gst_riff_create_video_caps (guint32 codec_fcc, - gst_riff_strh * strh, gst_riff_strf_vids * strf, char **codec_name); -GstCaps *gst_riff_create_audio_caps (guint16 codec_id, - gst_riff_strh * strh, gst_riff_strf_auds * strf, char **codec_name); -GstCaps *gst_riff_create_iavs_caps (guint32 codec_fcc, - gst_riff_strh * strh, gst_riff_strf_iavs * strf, char **codec_name); + +GstCaps *gst_riff_create_video_caps (guint32 codec_fcc, + gst_riff_strh *strh, + gst_riff_strf_vids *strf, + char **codec_name); +GstCaps *gst_riff_create_audio_caps (guint16 codec_id, + gst_riff_strh *strh, + gst_riff_strf_auds *strf, + char **codec_name); +GstCaps *gst_riff_create_iavs_caps (guint32 codec_fcc, + gst_riff_strh *strh, + gst_riff_strf_iavs *strf, + char **codec_name); /* * Create template caps (includes all known types). @@ -43,7 +51,8 @@ GstCaps *gst_riff_create_iavs_caps (guint32 codec_fcc, GstCaps *gst_riff_create_video_template_caps (void); GstCaps *gst_riff_create_audio_template_caps (void); -GstCaps *gst_riff_create_iavs_template_caps (void); +GstCaps *gst_riff_create_iavs_template_caps (void); G_END_DECLS + #endif /* __GST_RIFF_READ_H__ */ diff --git a/gst-libs/gst/riff/riff-read.h b/gst-libs/gst/riff/riff-read.h index 41ae89e3..9c663cca 100644 --- a/gst-libs/gst/riff/riff-read.h +++ b/gst-libs/gst/riff/riff-read.h @@ -27,6 +27,7 @@ #include <gst/bytestream/bytestream.h> G_BEGIN_DECLS + #define GST_TYPE_RIFF_READ \ (gst_riff_read_get_type ()) #define GST_RIFF_READ(obj) \ @@ -39,13 +40,13 @@ G_BEGIN_DECLS (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RIFF_READ)) #define GST_RIFF_READ_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RIFF_READ, GstRiffReadClass)) - typedef struct _GstRiffLevel -{ - guint64 start, length; + +typedef struct _GstRiffLevel { + guint64 start, + length; } GstRiffLevel; -typedef struct _GstRiffRead -{ +typedef struct _GstRiffRead { GstElement parent; GstPad *sinkpad; @@ -54,35 +55,43 @@ typedef struct _GstRiffRead GList *level; } GstRiffRead; -typedef struct _GstRiffReadClass -{ +typedef struct _GstRiffReadClass { GstElementClass parent; } GstRiffReadClass; -GType gst_riff_read_get_type (void); +GType gst_riff_read_get_type (void); -guint32 gst_riff_peek_tag (GstRiffRead * riff, guint * level_up); -guint32 gst_riff_peek_list (GstRiffRead * riff); +guint32 gst_riff_peek_tag (GstRiffRead *riff, + guint *level_up); +guint32 gst_riff_peek_list (GstRiffRead *riff); -GstEvent *gst_riff_read_seek (GstRiffRead * riff, guint64 offset); -gboolean gst_riff_read_skip (GstRiffRead * riff); -gboolean gst_riff_read_data (GstRiffRead * riff, - guint32 * tag, GstBuffer ** buf); -gboolean gst_riff_read_ascii (GstRiffRead * riff, guint32 * tag, gchar ** str); -gboolean gst_riff_read_list (GstRiffRead * riff, guint32 * tag); -gboolean gst_riff_read_header (GstRiffRead * read, guint32 * doctype); +GstEvent *gst_riff_read_seek (GstRiffRead *riff, + guint64 offset); +gboolean gst_riff_read_skip (GstRiffRead *riff); +gboolean gst_riff_read_data (GstRiffRead *riff, + guint32 *tag, + GstBuffer **buf); +gboolean gst_riff_read_ascii (GstRiffRead *riff, + guint32 *tag, + gchar **str); +gboolean gst_riff_read_list (GstRiffRead *riff, + guint32 *tag); +gboolean gst_riff_read_header (GstRiffRead *read, + guint32 *doctype); /* * Utility functions (including byteswapping). */ -gboolean gst_riff_read_strh (GstRiffRead * riff, gst_riff_strh ** header); -gboolean gst_riff_read_strf_vids (GstRiffRead * riff, - gst_riff_strf_vids ** header); -gboolean gst_riff_read_strf_auds (GstRiffRead * riff, - gst_riff_strf_auds ** header); -gboolean gst_riff_read_strf_iavs (GstRiffRead * riff, - gst_riff_strf_iavs ** header); -gboolean gst_riff_read_info (GstRiffRead * riff); +gboolean gst_riff_read_strh (GstRiffRead *riff, + gst_riff_strh **header); +gboolean gst_riff_read_strf_vids (GstRiffRead *riff, + gst_riff_strf_vids **header); +gboolean gst_riff_read_strf_auds (GstRiffRead *riff, + gst_riff_strf_auds **header); +gboolean gst_riff_read_strf_iavs (GstRiffRead *riff, + gst_riff_strf_iavs **header); +gboolean gst_riff_read_info (GstRiffRead *riff); G_END_DECLS + #endif /* __GST_RIFF_READ_H__ */ diff --git a/gst-libs/gst/tag/tag.h b/gst-libs/gst/tag/tag.h index bbab48c5..97eaf936 100644 --- a/gst-libs/gst/tag/tag.h +++ b/gst-libs/gst/tag/tag.h @@ -24,30 +24,39 @@ #include <gst/gst.h> G_BEGIN_DECLS + + /* functions for vorbis comment manipulation */ - G_CONST_RETURN gchar * gst_tag_from_vorbis_tag (const gchar * vorbis_tag); -G_CONST_RETURN gchar *gst_tag_to_vorbis_tag (const gchar * gst_tag); -void gst_vorbis_tag_add (GstTagList * list, - const gchar * tag, const gchar * value); -GList *gst_tag_to_vorbis_comments (const GstTagList * list, const gchar * tag); +G_CONST_RETURN gchar * gst_tag_from_vorbis_tag (const gchar * vorbis_tag); +G_CONST_RETURN gchar * gst_tag_to_vorbis_tag (const gchar * gst_tag); +void gst_vorbis_tag_add (GstTagList * list, + const gchar * tag, + const gchar * value); + +GList * gst_tag_to_vorbis_comments (const GstTagList * list, + const gchar * tag); /* functions to convert GstBuffers with vorbiscomment contents to GstTagLists and back */ -GstTagList *gst_tag_list_from_vorbiscomment_buffer (const GstBuffer * buffer, - const guint8 * id_data, const guint id_data_length, gchar ** vendor_string); -GstBuffer *gst_tag_list_to_vorbiscomment_buffer (const GstTagList * list, - const guint8 * id_data, - const guint id_data_length, const gchar * vendor_string); +GstTagList * gst_tag_list_from_vorbiscomment_buffer (const GstBuffer * buffer, + const guint8 * id_data, + const guint id_data_length, + gchar ** vendor_string); +GstBuffer * gst_tag_list_to_vorbiscomment_buffer (const GstTagList * list, + const guint8 * id_data, + const guint id_data_length, + const gchar * vendor_string); /* functions for ID3 tag manipulation */ -guint gst_tag_id3_genre_count (void); -G_CONST_RETURN gchar *gst_tag_id3_genre_get (const guint id); -GstTagList *gst_tag_list_new_from_id3v1 (const guint8 * data); +guint gst_tag_id3_genre_count (void); +G_CONST_RETURN gchar * gst_tag_id3_genre_get (const guint id); +GstTagList * gst_tag_list_new_from_id3v1 (const guint8 * data); -G_CONST_RETURN gchar *gst_tag_from_id3_tag (const gchar * vorbis_tag); -G_CONST_RETURN gchar *gst_tag_to_id3_tag (const gchar * gst_tag); +G_CONST_RETURN gchar * gst_tag_from_id3_tag (const gchar * vorbis_tag); +G_CONST_RETURN gchar * gst_tag_to_id3_tag (const gchar * gst_tag); G_END_DECLS + #endif /* __GST_TAG_TAG_H__ */ diff --git a/gst-libs/gst/tuner/tuner.h b/gst-libs/gst/tuner/tuner.h index cab3541d..8c935389 100644 --- a/gst-libs/gst/tuner/tuner.h +++ b/gst-libs/gst/tuner/tuner.h @@ -28,6 +28,7 @@ #include <gst/tuner/tuner-enumtypes.h> G_BEGIN_DECLS + #define GST_TYPE_TUNER \ (gst_tuner_get_type ()) #define GST_TUNER(obj) \ @@ -40,65 +41,87 @@ G_BEGIN_DECLS (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER)) #define GST_TUNER_GET_CLASS(inst) \ (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_TUNER, GstTunerClass)) + typedef struct _GstTuner GstTuner; -typedef struct _GstTunerClass -{ +typedef struct _GstTunerClass { GTypeInterface klass; /* virtual functions */ - const GList *(*list_channels) (GstTuner * tuner); - void (*set_channel) (GstTuner * tuner, GstTunerChannel * channel); - GstTunerChannel *(*get_channel) (GstTuner * tuner); - - const GList *(*list_norms) (GstTuner * tuner); - void (*set_norm) (GstTuner * tuner, GstTunerNorm * norm); - GstTunerNorm *(*get_norm) (GstTuner * tuner); - - void (*set_frequency) (GstTuner * tuner, - GstTunerChannel * channel, gulong frequency); - gulong (*get_frequency) (GstTuner * tuner, GstTunerChannel * channel); - gint (*signal_strength) (GstTuner * tuner, GstTunerChannel * channel); + const GList * (* list_channels) (GstTuner *tuner); + void (* set_channel) (GstTuner *tuner, + GstTunerChannel *channel); + GstTunerChannel * + (* get_channel) (GstTuner *tuner); + + const GList * (* list_norms) (GstTuner *tuner); + void (* set_norm) (GstTuner *tuner, + GstTunerNorm *norm); + GstTunerNorm *(* get_norm) (GstTuner *tuner); + + void (* set_frequency) (GstTuner *tuner, + GstTunerChannel *channel, + gulong frequency); + gulong (* get_frequency) (GstTuner *tuner, + GstTunerChannel *channel); + gint (* signal_strength) (GstTuner *tuner, + GstTunerChannel *channel); /* signals */ - void (*channel_changed) (GstTuner * tuner, GstTunerChannel * channel); - void (*norm_changed) (GstTuner * tuner, GstTunerNorm * norm); - void (*frequency_changed) (GstTuner * tuner, - GstTunerChannel * channel, gulong frequency); - void (*signal_changed) (GstTuner * tuner, - GstTunerChannel * channel, gint signal); + void (*channel_changed) (GstTuner *tuner, + GstTunerChannel *channel); + void (*norm_changed) (GstTuner *tuner, + GstTunerNorm *norm); + void (*frequency_changed) (GstTuner *tuner, + GstTunerChannel *channel, + gulong frequency); + void (*signal_changed) (GstTuner *tuner, + GstTunerChannel *channel, + gint signal); gpointer _gst_reserved[GST_PADDING]; } GstTunerClass; -GType gst_tuner_get_type (void); +GType gst_tuner_get_type (void); /* virtual class function wrappers */ -const GList *gst_tuner_list_channels (GstTuner * tuner); -void gst_tuner_set_channel (GstTuner * tuner, GstTunerChannel * channel); -GstTunerChannel *gst_tuner_get_channel (GstTuner * tuner); - -const GList *gst_tuner_list_norms (GstTuner * tuner); -void gst_tuner_set_norm (GstTuner * tuner, GstTunerNorm * channel); -GstTunerNorm *gst_tuner_get_norm (GstTuner * tuner); - -void gst_tuner_set_frequency (GstTuner * tuner, - GstTunerChannel * channel, gulong frequency); -gulong gst_tuner_get_frequency (GstTuner * tuner, GstTunerChannel * channel); -gint gst_tuner_signal_strength (GstTuner * tuner, GstTunerChannel * channel); +const GList * gst_tuner_list_channels (GstTuner *tuner); +void gst_tuner_set_channel (GstTuner *tuner, + GstTunerChannel *channel); +GstTunerChannel * + gst_tuner_get_channel (GstTuner *tuner); + +const GList * gst_tuner_list_norms (GstTuner *tuner); +void gst_tuner_set_norm (GstTuner *tuner, + GstTunerNorm *channel); +GstTunerNorm * gst_tuner_get_norm (GstTuner *tuner); + +void gst_tuner_set_frequency (GstTuner *tuner, + GstTunerChannel *channel, + gulong frequency); +gulong gst_tuner_get_frequency (GstTuner *tuner, + GstTunerChannel *channel); +gint gst_tuner_signal_strength (GstTuner *tuner, + GstTunerChannel *channel); /* helper functions */ -GstTunerNorm *gst_tuner_find_norm_by_name (GstTuner * tuner, gchar * norm); -GstTunerChannel *gst_tuner_find_channel_by_name (GstTuner * tuner, - gchar * channel); +GstTunerNorm * gst_tuner_find_norm_by_name (GstTuner *tuner, + gchar *norm); +GstTunerChannel *gst_tuner_find_channel_by_name (GstTuner *tuner, + gchar *channel); /* trigger signals */ -void gst_tuner_channel_changed (GstTuner * tuner, GstTunerChannel * channel); -void gst_tuner_norm_changed (GstTuner * tuner, GstTunerNorm * norm); -void gst_tuner_frequency_changed (GstTuner * tuner, - GstTunerChannel * channel, gulong frequency); -void gst_tuner_signal_changed (GstTuner * tuner, - GstTunerChannel * channel, gint signal); +void gst_tuner_channel_changed (GstTuner *tuner, + GstTunerChannel *channel); +void gst_tuner_norm_changed (GstTuner *tuner, + GstTunerNorm *norm); +void gst_tuner_frequency_changed (GstTuner *tuner, + GstTunerChannel *channel, + gulong frequency); +void gst_tuner_signal_changed (GstTuner *tuner, + GstTunerChannel *channel, + gint signal); G_END_DECLS + #endif /* __GST_TUNER_H__ */ diff --git a/gst-libs/gst/tuner/tunerchannel.h b/gst-libs/gst/tuner/tunerchannel.h index 663d682d..ee5654d0 100644 --- a/gst-libs/gst/tuner/tunerchannel.h +++ b/gst-libs/gst/tuner/tunerchannel.h @@ -25,6 +25,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_TUNER_CHANNEL \ (gst_tuner_channel_get_type ()) #define GST_TUNER_CHANNEL(obj) \ @@ -37,39 +38,42 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER_CHANNEL)) #define GST_IS_TUNER_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER_CHANNEL)) - typedef enum -{ - GST_TUNER_CHANNEL_INPUT = (1 << 0), - GST_TUNER_CHANNEL_OUTPUT = (1 << 1), - GST_TUNER_CHANNEL_FREQUENCY = (1 << 2), - GST_TUNER_CHANNEL_AUDIO = (1 << 3), + +typedef enum { + GST_TUNER_CHANNEL_INPUT = (1<<0), + GST_TUNER_CHANNEL_OUTPUT = (1<<1), + GST_TUNER_CHANNEL_FREQUENCY = (1<<2), + GST_TUNER_CHANNEL_AUDIO = (1<<3), } GstTunerChannelFlags; #define GST_TUNER_CHANNEL_HAS_FLAG(channel, flag) \ ((channel)->flags & flag) -typedef struct _GstTunerChannel -{ - GObject parent; +typedef struct _GstTunerChannel { + GObject parent; - gchar *label; + gchar *label; GstTunerChannelFlags flags; - gulong min_frequency, max_frequency; - gint min_signal, max_signal; + gulong min_frequency, + max_frequency; + gint min_signal, + max_signal; } GstTunerChannel; -typedef struct _GstTunerChannelClass -{ +typedef struct _GstTunerChannelClass { GObjectClass parent; /* signals */ - void (*frequency_changed) (GstTunerChannel * channel, gulong frequency); - void (*signal_changed) (GstTunerChannel * channel, gint signal); + void (*frequency_changed) (GstTunerChannel *channel, + gulong frequency); + void (*signal_changed) (GstTunerChannel *channel, + gint signal); gpointer _gst_reserved[GST_PADDING]; } GstTunerChannelClass; -GType gst_tuner_channel_get_type (void); +GType gst_tuner_channel_get_type (void); G_END_DECLS + #endif /* __GST_TUNER_CHANNEL_H__ */ diff --git a/gst-libs/gst/tuner/tunernorm.h b/gst-libs/gst/tuner/tunernorm.h index 94267b6e..cd89e1ee 100644 --- a/gst-libs/gst/tuner/tunernorm.h +++ b/gst-libs/gst/tuner/tunernorm.h @@ -25,6 +25,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_TUNER_NORM \ (gst_tuner_norm_get_type ()) #define GST_TUNER_NORM(obj) \ @@ -35,22 +36,22 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER_NORM)) #define GST_IS_TUNER_NORM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER_NORM)) - typedef struct _GstTunerNorm -{ + +typedef struct _GstTunerNorm { GObject parent; - gchar *label; - gfloat fps; + gchar *label; + gfloat fps; } GstTunerNorm; -typedef struct _GstTunerNormClass -{ +typedef struct _GstTunerNormClass { GObjectClass parent; gpointer _gst_reserved[GST_PADDING]; } GstTunerNormClass; -GType gst_tuner_norm_get_type (void); +GType gst_tuner_norm_get_type (void); G_END_DECLS + #endif /* __GST_TUNER_NORM_H__ */ diff --git a/gst-libs/gst/video/video.h b/gst-libs/gst/video/video.h index 5ebe444f..cb8727a9 100644 --- a/gst-libs/gst/video/video.h +++ b/gst-libs/gst/video/video.h @@ -98,31 +98,31 @@ #define GST_VIDEO_CAPS_RGBx \ __GST_VIDEO_CAPS_MAKE_32 (1, 2, 3) - + #define GST_VIDEO_CAPS_xRGB \ __GST_VIDEO_CAPS_MAKE_32 (2, 3, 4) - + #define GST_VIDEO_CAPS_BGRx \ __GST_VIDEO_CAPS_MAKE_32 (3, 2, 1) - + #define GST_VIDEO_CAPS_xBGR \ __GST_VIDEO_CAPS_MAKE_32 (4, 3, 2) /* note: the macro name uses the order on BE systems */ #if G_BYTE_ORDER == G_BIG_ENDIAN -#define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \ + #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \ GST_VIDEO_CAPS_xRGB -#define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \ + #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \ GST_VIDEO_CAPS_BGRx #else -#define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \ + #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \ GST_VIDEO_CAPS_BGRx -#define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \ + #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \ GST_VIDEO_CAPS_xRGB #endif - + /* 15/16 bit */ - + #define GST_VIDEO_CAPS_RGB_16 \ "video/x-raw-rgb, " \ "bpp = (int) 16, " \ @@ -155,7 +155,9 @@ "framerate = " GST_VIDEO_FPS_RANGE /* functions */ -gdouble gst_video_frame_rate (GstPad * pad); -gboolean gst_video_get_size (GstPad * pad, gint * width, gint * height); +gdouble gst_video_frame_rate (GstPad *pad); +gboolean gst_video_get_size (GstPad *pad, + gint *width, + gint *height); #endif /* __GST_VIDEO_H__ */ diff --git a/gst-libs/gst/video/videosink.h b/gst-libs/gst/video/videosink.h index 68de26fa..129a47d6 100644 --- a/gst-libs/gst/video/videosink.h +++ b/gst-libs/gst/video/videosink.h @@ -17,17 +17,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + #ifndef __GST_VIDEOSINK_H__ #define __GST_VIDEOSINK_H__ #include <gst/gst.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - +extern "C" { +#endif /* __cplusplus */ + #define GST_TYPE_VIDEOSINK (gst_videosink_get_type()) #define GST_VIDEOSINK(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEOSINK, GstVideoSink)) @@ -39,39 +38,37 @@ extern "C" (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VIDEOSINK)) #define GST_VIDEOSINK_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VIDEOSINK, GstVideoSinkClass)) - + #define GST_VIDEOSINK_PAD(obj) (GST_VIDEOSINK (obj)->sinkpad) #define GST_VIDEOSINK_WIDTH(obj) (GST_VIDEOSINK (obj)->width) #define GST_VIDEOSINK_HEIGHT(obj) (GST_VIDEOSINK (obj)->height) #define GST_VIDEOSINK_CLOCK(obj) (GST_VIDEOSINK (obj)->clock) - - typedef struct _GstVideoSink GstVideoSink; - typedef struct _GstVideoSinkClass GstVideoSinkClass; - - struct _GstVideoSink - { - GstElement element; - - GstPad *sinkpad; - - gint width, height; - - GstClock *clock; - - gpointer _gst_reserved[GST_PADDING]; - }; - - struct _GstVideoSinkClass - { - GstElementClass parent_class; - - gpointer _gst_reserved[GST_PADDING]; - }; - - GType gst_videosink_get_type (void); + +typedef struct _GstVideoSink GstVideoSink; +typedef struct _GstVideoSinkClass GstVideoSinkClass; + +struct _GstVideoSink { + GstElement element; + + GstPad *sinkpad; + + gint width, height; + + GstClock *clock; + + gpointer _gst_reserved[GST_PADDING]; +}; + +struct _GstVideoSinkClass { + GstElementClass parent_class; + + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_videosink_get_type (void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_VIDEOSINK_H__ */ +#endif /* __GST_VIDEOSINK_H__ */ diff --git a/gst-libs/gst/xoverlay/xoverlay.h b/gst-libs/gst/xoverlay/xoverlay.h index b1c90690..5318fef3 100644 --- a/gst-libs/gst/xoverlay/xoverlay.h +++ b/gst-libs/gst/xoverlay/xoverlay.h @@ -26,6 +26,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_X_OVERLAY \ (gst_x_overlay_get_type ()) #define GST_X_OVERLAY(obj) \ @@ -39,38 +40,42 @@ G_BEGIN_DECLS (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_X_OVERLAY)) #define GST_X_OVERLAY_GET_CLASS(inst) \ (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_X_OVERLAY, GstXOverlayClass)) + typedef struct _GstXOverlay GstXOverlay; -typedef struct _GstXOverlayClass -{ +typedef struct _GstXOverlayClass { GTypeInterface klass; /* virtual functions */ - void (*set_xwindow_id) (GstXOverlay * overlay, gulong xwindow_id); + void (* set_xwindow_id) (GstXOverlay *overlay, + gulong xwindow_id); /* optional virtual functions */ - void (*get_desired_size) (GstXOverlay * overlay, - guint * width, guint * height); - void (*expose) (GstXOverlay * overlay); - + void (* get_desired_size) (GstXOverlay *overlay, + guint *width, + guint *height); + void (* expose) (GstXOverlay *overlay); + /* signals */ - void (*have_xwindow_id) (GstXOverlay * overlay, gulong xwindow_id); - void (*desired_size) (GstXOverlay * overlay, guint width, guint height); + void (*have_xwindow_id) (GstXOverlay *overlay, + gulong xwindow_id); + void (* desired_size) (GstXOverlay *overlay, + guint width, + guint height); gpointer _gst_reserved[GST_PADDING]; } GstXOverlayClass; -GType gst_x_overlay_get_type (void); +GType gst_x_overlay_get_type (void); /* virtual class function wrappers */ -void gst_x_overlay_set_xwindow_id (GstXOverlay * overlay, gulong xwindow_id); -void gst_x_overlay_get_desired_size (GstXOverlay * overlay, guint * width, - guint * height); -void gst_x_overlay_expose (GstXOverlay * overlay); +void gst_x_overlay_set_xwindow_id (GstXOverlay *overlay, gulong xwindow_id); +void gst_x_overlay_get_desired_size (GstXOverlay *overlay, guint *width, guint *height); +void gst_x_overlay_expose (GstXOverlay *overlay); /* public methods to fire signals */ -void gst_x_overlay_got_xwindow_id (GstXOverlay * overlay, gulong xwindow_id); -void gst_x_overlay_got_desired_size (GstXOverlay * overlay, guint width, - guint height); +void gst_x_overlay_got_xwindow_id (GstXOverlay *overlay, gulong xwindow_id); +void gst_x_overlay_got_desired_size (GstXOverlay *overlay, guint width, guint height); G_END_DECLS + #endif /* __GST_X_OVERLAY_H__ */ diff --git a/gst-libs/gst/xwindowlistener/xwindowlistener.h b/gst-libs/gst/xwindowlistener/xwindowlistener.h index 1d893640..834be67c 100644 --- a/gst-libs/gst/xwindowlistener/xwindowlistener.h +++ b/gst-libs/gst/xwindowlistener/xwindowlistener.h @@ -26,6 +26,7 @@ #include <X11/Xlib.h> G_BEGIN_DECLS + #define GST_TYPE_X_WINDOW_LISTENER \ (gst_x_window_listener_get_type()) #define GST_X_WINDOW_LISTENER(obj) \ @@ -38,22 +39,28 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_X_WINDOW_LISTENER)) #define GST_IS_X_WINDOW_LISTENER_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_X_WINDOW_LISTENER)) -typedef struct _GstXWindowListener GstXWindowListener; -typedef struct _GstXWindowListenerClass GstXWindowListenerClass; -typedef struct _GstXWindowClip GstXWindowClip; -typedef void (*MapWindowFunc) (gpointer your_data, gboolean visible); -typedef void (*SetWindowFunc) (gpointer your_data, - gint x, gint y, gint w, gint h, GstXWindowClip * clips, gint num_clips); - -struct _GstXWindowClip -{ - gint32 x_offset, y_offset, width, height; + +typedef struct _GstXWindowListener GstXWindowListener; +typedef struct _GstXWindowListenerClass GstXWindowListenerClass; +typedef struct _GstXWindowClip GstXWindowClip; +typedef void (* MapWindowFunc) (gpointer your_data, + gboolean visible); +typedef void (* SetWindowFunc) (gpointer your_data, + gint x, gint y, + gint w, gint h, + GstXWindowClip *clips, + gint num_clips); + +struct _GstXWindowClip { + gint32 x_offset, + y_offset, + width, + height; gpointer data; }; -struct _GstXWindowListener -{ - GObject parent; +struct _GstXWindowListener { + GObject parent; /* "per-instance virtual functions" */ MapWindowFunc map_window_func; @@ -63,12 +70,12 @@ struct _GstXWindowListener gpointer private_data; /* general information of what we're doing */ - gchar *display_name; - XID xwindow_id; + gchar *display_name; + XID xwindow_id; /* one extra... */ Display *main_display; - GMutex *main_lock; + GMutex *main_lock; /* oh my g*d, this is going to be so horribly ugly */ GThread *thread; @@ -77,24 +84,33 @@ struct _GstXWindowListener /* the overlay window + own thread */ Display *display; Drawable child; - gboolean ov_conf, ov_map, ov_visible, ov_refresh, ov_move, ov_wmmap; - gint ov_visibility; - guint ov_conf_id, ov_refresh_id; - gint x, y, w, h; + gboolean ov_conf, + ov_map, + ov_visible, + ov_refresh, + ov_move, + ov_wmmap; + gint ov_visibility; + guint ov_conf_id, + ov_refresh_id; + gint x, y, w, h; GstXWindowClip *clips; - gint num_clips; + gint num_clips; }; -struct _GstXWindowListenerClass -{ +struct _GstXWindowListenerClass { GObjectClass parent; }; -GType gst_x_window_listener_get_type (void); -GstXWindowListener *gst_x_window_listener_new (gchar * display, - MapWindowFunc map_window_func, - SetWindowFunc set_window_func, gpointer private_data); -void gst_x_window_listener_set_xid (GstXWindowListener * xwin, XID id); +GType gst_x_window_listener_get_type (void); +GstXWindowListener * + gst_x_window_listener_new (gchar *display, + MapWindowFunc map_window_func, + SetWindowFunc set_window_func, + gpointer private_data); +void gst_x_window_listener_set_xid (GstXWindowListener *xwin, + XID id); G_END_DECLS + #endif /* __X_WINDOW_LISTENER_H__ */ diff --git a/gst/cdxaparse/gstcdxaparse.h b/gst/cdxaparse/gstcdxaparse.h index ef1475b2..32af5527 100644 --- a/gst/cdxaparse/gstcdxaparse.h +++ b/gst/cdxaparse/gstcdxaparse.h @@ -26,9 +26,8 @@ #include <gst/bytestream/bytestream.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_CDXA_PARSE \ (gst_cdxa_parse_get_type()) @@ -44,40 +43,38 @@ extern "C" #define CDXA_SECTOR_SIZE 2352 #define CDXA_DATA_SIZE 2324 - typedef enum - { - CDXA_PARSE_HEADER, - CDXA_PARSE_DATA, - } GstCDXAParseState; +typedef enum +{ + CDXA_PARSE_HEADER, + CDXA_PARSE_DATA, +} GstCDXAParseState; - typedef struct _GstCDXAParse GstCDXAParse; - typedef struct _GstCDXAParseClass GstCDXAParseClass; +typedef struct _GstCDXAParse GstCDXAParse; +typedef struct _GstCDXAParseClass GstCDXAParseClass; - struct _GstCDXAParse - { - GstElement element; +struct _GstCDXAParse { + GstElement element; - /* pads */ - GstPad *sinkpad, *srcpad; + /* pads */ + GstPad *sinkpad, *srcpad; - GstByteStream *bs; + GstByteStream *bs; - GstCDXAParseState state; + GstCDXAParseState state; - guint32 riff_size; - guint32 data_size; - guint32 sectors; - }; + guint32 riff_size; + guint32 data_size; + guint32 sectors; +}; - struct _GstCDXAParseClass - { - GstElementClass parent_class; - }; +struct _GstCDXAParseClass { + GstElementClass parent_class; +}; - GType gst_cdxa_parse_get_type (void); +GType gst_cdxa_parse_get_type (void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_CDXA_PARSE_H__ */ +#endif /* __GST_CDXA_PARSE_H__ */ diff --git a/gst/colorspace/gstcolorspace.h b/gst/colorspace/gstcolorspace.h index f777b41b..22e2f7ec 100644 --- a/gst/colorspace/gstcolorspace.h +++ b/gst/colorspace/gstcolorspace.h @@ -23,6 +23,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_COLORSPACE \ (gst_colorspace_get_type()) #define GST_COLORSPACE(obj) \ @@ -33,11 +34,11 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_COLORSPACE)) #define GST_IS_COLORSPACE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_COLORSPACE)) + typedef struct _GstColorspace GstColorspace; typedef struct _GstColorspaceClass GstColorspaceClass; -typedef enum -{ +typedef enum { GST_COLORSPACE_NONE, GST_COLORSPACE_HERMES, GST_COLORSPACE_YUV_RGB, @@ -47,11 +48,10 @@ typedef enum GST_COLORSPACE_420_SWAP, } GstColorSpaceConverterType; -struct _GstColorspace -{ +struct _GstColorspace { GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; int converter_index; @@ -60,7 +60,7 @@ struct _GstColorspace int src_size; int sink_size; - + int src_stride; int sink_stride; @@ -68,21 +68,18 @@ struct _GstColorspace gdouble fps; }; -struct _GstColorspaceClass -{ +struct _GstColorspaceClass { GstElementClass parent_class; }; -GType gst_colorspace_get_type (void); +GType gst_colorspace_get_type(void); -typedef struct _GstColorspaceFormat -{ +typedef struct _GstColorspaceFormat { GstStaticCaps caps; } GstColorspaceFormat; -typedef enum -{ +typedef enum { GST_COLORSPACE_I420, GST_COLORSPACE_YV12, GST_COLORSPACE_RGB32, @@ -90,13 +87,13 @@ typedef enum GST_COLORSPACE_RGB16, } GstColorSpaceFormatType; -typedef struct _GstColorspaceConverter -{ +typedef struct _GstColorspaceConverter { GstColorSpaceFormatType from; GstColorSpaceFormatType to; - void (*convert) (GstColorspace * colorspace, unsigned char *dest, - unsigned char *src); + void (*convert) (GstColorspace *colorspace, unsigned char *dest, unsigned char *src); } GstColorspaceConverter; G_END_DECLS + #endif + diff --git a/gst/colorspace/yuv2rgb.h b/gst/colorspace/yuv2rgb.h index ec987dfc..be173bca 100644 --- a/gst/colorspace/yuv2rgb.h +++ b/gst/colorspace/yuv2rgb.h @@ -26,11 +26,11 @@ #include <gstcolorspace.h> G_BEGIN_DECLS + #if 0 typedef struct _GstColorspaceYUVTables GstColorspaceYUVTables; -struct _GstColorspaceYUVTables -{ +struct _GstColorspaceYUVTables { int gammaCorrectFlag; double gammaCorrect; int chromaCorrectFlag; @@ -50,11 +50,9 @@ struct _GstColorspaceYUVTables typedef struct _GstColorspaceConverter GstColorspaceConverter; -typedef void (*GstColorspaceConvertFunction) (GstColorspaceConverter * space, - guchar * src, guchar * dest); +typedef void (*GstColorspaceConvertFunction) (GstColorspaceConverter *space, guchar *src, guchar *dest); -struct _GstColorspaceConverter -{ +struct _GstColorspaceConverter { guint width; guint height; guint insize; @@ -65,34 +63,35 @@ struct _GstColorspaceConverter }; #endif -void gst_colorspace_table_init (GstColorspace * space); +void gst_colorspace_table_init (GstColorspace *space); -void gst_colorspace_I420_to_rgb32 (GstColorspace * space, +void gst_colorspace_I420_to_rgb32(GstColorspace *space, unsigned char *src, unsigned char *dest); -void gst_colorspace_I420_to_rgb24 (GstColorspace * space, +void gst_colorspace_I420_to_rgb24(GstColorspace *space, unsigned char *src, unsigned char *dest); -void gst_colorspace_I420_to_rgb16 (GstColorspace * space, +void gst_colorspace_I420_to_rgb16(GstColorspace *space, unsigned char *src, unsigned char *dest); -void gst_colorspace_YV12_to_rgb32 (GstColorspace * space, +void gst_colorspace_YV12_to_rgb32(GstColorspace *space, unsigned char *src, unsigned char *dest); -void gst_colorspace_YV12_to_rgb24 (GstColorspace * space, +void gst_colorspace_YV12_to_rgb24(GstColorspace *space, unsigned char *src, unsigned char *dest); -void gst_colorspace_YV12_to_rgb16 (GstColorspace * space, +void gst_colorspace_YV12_to_rgb16(GstColorspace *space, unsigned char *src, unsigned char *dest); #if 0 -GstColorspaceYUVTables *gst_colorspace_init_yuv (long depth, +GstColorspaceYUVTables * gst_colorspace_init_yuv(long depth, long red_mask, long green_mask, long blue_mask); #endif #if 0 -GstColorspaceConverter *gst_colorspace_yuv2rgb_get_converter (const GstCaps * - from, const GstCaps * to); +GstColorspaceConverter* gst_colorspace_yuv2rgb_get_converter (const GstCaps *from, const GstCaps *to); #define gst_colorspace_convert(converter, src, dest) \ (converter)->convert((converter), (src), (dest)) -void gst_colorspace_converter_destroy (GstColorspaceConverter * space); +void gst_colorspace_converter_destroy (GstColorspaceConverter *space); #endif G_END_DECLS + #endif + diff --git a/gst/deinterlace/gstdeinterlace.h b/gst/deinterlace/gstdeinterlace.h index 13f3d66f..27207319 100644 --- a/gst/deinterlace/gstdeinterlace.h +++ b/gst/deinterlace/gstdeinterlace.h @@ -26,6 +26,7 @@ /* #include <gst/meta/audioraw.h> */ G_BEGIN_DECLS + #define GST_TYPE_DEINTERLACE \ (gst_deinterlace_get_type()) #define GST_DEINTERLACE(obj) \ @@ -36,11 +37,11 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DEINTERLACE)) #define GST_IS_DEINTERLACE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DEINTERLACE)) + typedef struct _GstDeInterlace GstDeInterlace; typedef struct _GstDeInterlaceClass GstDeInterlaceClass; -struct _GstDeInterlace -{ +struct _GstDeInterlace { GstElement element; GstPad *sinkpad, *srcpad; @@ -49,8 +50,8 @@ struct _GstDeInterlace gboolean show_deinterlaced_area_only; gboolean blend; - gint threshold_blend; /* here we start blending */ - gint threshold; /* here we start interpolating TODO FIXME */ + gint threshold_blend; /* here we start blending */ + gint threshold; /* here we start interpolating TODO FIXME */ gint edge_detect; gint picsize; @@ -58,10 +59,10 @@ struct _GstDeInterlace }; -struct _GstDeInterlaceClass -{ +struct _GstDeInterlaceClass { GstElementClass parent_class; }; G_END_DECLS + #endif /* __GST_DEINTERLACE_H__ */ diff --git a/gst/festival/gstfestival.h b/gst/festival/gstfestival.h index 6c649e17..ab463106 100644 --- a/gst/festival/gstfestival.h +++ b/gst/festival/gstfestival.h @@ -64,24 +64,23 @@ #include <gst/gst.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define FESTIVAL_DEFAULT_SERVER_HOST "localhost" #define FESTIVAL_DEFAULT_SERVER_PORT 1314 #define FESTIVAL_DEFAULT_TEXT_MODE "fundamental" - typedef struct FT_Info - { +typedef struct FT_Info +{ int encoding; char *server_host; int server_port; char *text_mode; - + int server_fd; - } FT_Info; +} FT_Info; #define GST_TYPE_FESTIVAL \ (gst_festival_get_type()) @@ -94,35 +93,32 @@ extern "C" #define GST_IS_FESTIVAL_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FESTIVAL)) - typedef enum - { - GST_FESTIVAL_OPEN = GST_ELEMENT_FLAG_LAST, +typedef enum { + GST_FESTIVAL_OPEN = GST_ELEMENT_FLAG_LAST, - GST_FESTIVAL_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, - } GstFestivalFlags; + GST_FESTIVAL_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, +} GstFestivalFlags; - typedef struct _GstFestival GstFestival; - typedef struct _GstFestivalClass GstFestivalClass; +typedef struct _GstFestival GstFestival; +typedef struct _GstFestivalClass GstFestivalClass; - struct _GstFestival - { - GstElement element; +struct _GstFestival { + GstElement element; - /* pads */ - GstPad *sinkpad, *srcpad; + /* pads */ + GstPad *sinkpad,*srcpad; - FT_Info *info; - }; + FT_Info *info; +}; - struct _GstFestivalClass - { - GstElementClass parent_class; - }; +struct _GstFestivalClass { + GstElementClass parent_class; +}; - GType gst_festival_get_type (void); +GType gst_festival_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_FESTIVAL_H__ */ +#endif /* __GST_FESTIVAL_H__ */ diff --git a/gst/filter/iir.h b/gst/filter/iir.h index 1cea5663..241cc1d2 100644 --- a/gst/filter/iir.h +++ b/gst/filter/iir.h @@ -19,8 +19,7 @@ #ifndef _V_IIR_H_ #define _V_IIR_H_ -typedef struct -{ +typedef struct { int stages; double *coeff_A; double *coeff_B; @@ -30,9 +29,9 @@ typedef struct double gain; } IIR_state; -void IIR_init (IIR_state * s, int stages, double gain, double *A, double *B); -void IIR_clear (IIR_state * s); -double IIR_filter (IIR_state * s, double in); -double IIR_filter_ChebBand (IIR_state * s, double in); +void IIR_init(IIR_state *s,int stages,double gain, double *A, double *B); +void IIR_clear(IIR_state *s); +double IIR_filter(IIR_state *s,double in); +double IIR_filter_ChebBand(IIR_state *s,double in); #endif diff --git a/gst/flx/flx_color.h b/gst/flx/flx_color.h index 2ad852fa..d423ab87 100644 --- a/gst/flx/flx_color.h +++ b/gst/flx/flx_color.h @@ -17,8 +17,7 @@ * Boston, MA 02111-1307, USA. */ -typedef enum -{ +typedef enum { FLX_COLORSPACE_RGB8, FLX_COLORSPACE_RGB32, } FlxColorSpaceType; @@ -26,20 +25,19 @@ typedef enum typedef struct _FlxColorSpaceConverter FlxColorSpaceConverter; -struct _FlxColorSpaceConverter -{ - guint width; - guint height; - guchar palvec[768]; +struct _FlxColorSpaceConverter { + guint width; + guint height; + guchar palvec[768]; }; -void flx_colorspace_converter_destroy (FlxColorSpaceConverter * flxpal); -void flx_colorspace_convert (FlxColorSpaceConverter * flxpal, guchar * src, - guchar * dest); -FlxColorSpaceConverter *flx_colorspace_converter_new (gint width, gint height); +void flx_colorspace_converter_destroy(FlxColorSpaceConverter *flxpal); +void flx_colorspace_convert(FlxColorSpaceConverter *flxpal, guchar *src, guchar *dest); +FlxColorSpaceConverter * flx_colorspace_converter_new(gint width, gint height); + +void flx_set_palette_vector(FlxColorSpaceConverter *flxpal, guint start, guint num, + guchar *newpal, gint scale); +void flx_set_color(FlxColorSpaceConverter *flxpal, guint colr, guint red, guint green, + guint blue, gint scale); -void flx_set_palette_vector (FlxColorSpaceConverter * flxpal, guint start, - guint num, guchar * newpal, gint scale); -void flx_set_color (FlxColorSpaceConverter * flxpal, guint colr, guint red, - guint green, guint blue, gint scale); diff --git a/gst/flx/flx_fmt.h b/gst/flx/flx_fmt.h index 1457551a..ac2062ed 100644 --- a/gst/flx/flx_fmt.h +++ b/gst/flx/flx_fmt.h @@ -24,114 +24,113 @@ #include <gst/gst.h> #ifdef __cplusplus -extern "C" +extern "C" { +#endif /* __cplusplus */ + +enum Flx_TypeChunk +{ + /* frame chunks */ + FLX_PREFIX_TYPE = 0xf100, + FLX_SCRIPT_CHUNK = 0xf1e0, + FLX_FRAME_TYPE = 0xf1fa, + FLX_SEGMENT_TABLE = 0xf1fb, + FLX_HUFFMAN_TABLE = 0xf1fc, + + /* sub chunks */ + FLX_CEL_DATA = 3, + FLX_COLOR256 = 4, + FLX_SS2 = 7, + FLX_COLOR64 = 11, + FLX_LC = 12, + FLX_BLACK = 13, + FLX_BRUN = 15, + FLX_COPY = 16, + FLX_MINI = 18, + FLX_DTA_RUN = 25, + FLX_DTA_COPY = 26, + FLX_DTA_LC = 27, + FLX_LABEL = 31, + FLX_BMP_MASK = 32, + FLX_MLEV_MASK = 33, + FLX_SEGMENT = 34, + FLX_KEY_IMAGE = 35, + FLX_KEY_PAL = 36, + FLX_REGION = 37, + FLX_WAVE = 38, + FLX_USERSTRING = 39, + FLX_RGN_MASK = 40, + +}; + +enum Flx_MagicHdr { -#endif /* __cplusplus */ - - enum Flx_TypeChunk - { - /* frame chunks */ - FLX_PREFIX_TYPE = 0xf100, - FLX_SCRIPT_CHUNK = 0xf1e0, - FLX_FRAME_TYPE = 0xf1fa, - FLX_SEGMENT_TABLE = 0xf1fb, - FLX_HUFFMAN_TABLE = 0xf1fc, - - /* sub chunks */ - FLX_CEL_DATA = 3, - FLX_COLOR256 = 4, - FLX_SS2 = 7, - FLX_COLOR64 = 11, - FLX_LC = 12, - FLX_BLACK = 13, - FLX_BRUN = 15, - FLX_COPY = 16, - FLX_MINI = 18, - FLX_DTA_RUN = 25, - FLX_DTA_COPY = 26, - FLX_DTA_LC = 27, - FLX_LABEL = 31, - FLX_BMP_MASK = 32, - FLX_MLEV_MASK = 33, - FLX_SEGMENT = 34, - FLX_KEY_IMAGE = 35, - FLX_KEY_PAL = 36, - FLX_REGION = 37, - FLX_WAVE = 38, - FLX_USERSTRING = 39, - FLX_RGN_MASK = 40, - - }; - - enum Flx_MagicHdr - { - FLX_MAGICHDR_FLI = 0xaf11, - FLX_MAGICHDR_FLC = 0xaf12, - FLX_MAGICHDR_FLX = 0xaf44, - FLX_MAGICHDR_HUFFBWT = 0xaf30, - }; - - - - typedef struct _FlxHeader - { - guint32 size; - guint16 type; - guint16 frames; - guint16 width, height, depth, flags; - guint32 speed; - guint16 reserved1; - /* FLC */ - guint32 created, creator, updated, updater; - guint16 aspect_dx, aspect_dy; - /* EGI */ - guint16 ext_flags, keyframes, totalframes; - guint32 req_memory; - guint16 max_regions, transp_num; - guchar reserved2[24]; - /* FLC */ - guint32 oframe1, oframe2; - guchar reserved3[40]; - } FlxHeader; + FLX_MAGICHDR_FLI = 0xaf11, + FLX_MAGICHDR_FLC = 0xaf12, + FLX_MAGICHDR_FLX = 0xaf44, + FLX_MAGICHDR_HUFFBWT = 0xaf30, +}; + + + +typedef struct _FlxHeader +{ + guint32 size; + guint16 type; + guint16 frames; + guint16 width,height,depth,flags; + guint32 speed; + guint16 reserved1; + /* FLC */ + guint32 created,creator,updated,updater; + guint16 aspect_dx, aspect_dy; + /* EGI */ + guint16 ext_flags,keyframes,totalframes; + guint32 req_memory; + guint16 max_regions,transp_num; + guchar reserved2[24]; + /* FLC */ + guint32 oframe1,oframe2; + guchar reserved3[40]; +} FlxHeader; #define FlxHeaderSize 128 - typedef struct _FlxFrameChunk - { - guint32 size; - guint16 id; - } FlxFrameChunk; +typedef struct _FlxFrameChunk +{ + guint32 size; + guint16 id; +} FlxFrameChunk; #define FlxFrameChunkSize 6 - typedef struct _FlxPrefixChunk - { - guint16 chunks; - guchar reserved[8]; - } FlxPrefixChunk; - - typedef struct _FlxSegmentTable - { - guint16 segments; - } FlxSegmentTable; - - typedef struct _FlxHuffmanTable - { - guint16 codelength; - guint16 numcodes; - guchar reserved[6]; - } FlxHuffmanTable; - - typedef struct _FlxFrameType - { - guint16 chunks; - guint16 delay; - guchar reserved[6]; - } FlxFrameType; +typedef struct _FlxPrefixChunk +{ + guint16 chunks; + guchar reserved[8]; +} FlxPrefixChunk; + +typedef struct _FlxSegmentTable +{ + guint16 segments; +} FlxSegmentTable; + +typedef struct _FlxHuffmanTable +{ + guint16 codelength; + guint16 numcodes; + guchar reserved[6]; +} FlxHuffmanTable; + +typedef struct _FlxFrameType +{ + guint16 chunks; + guint16 delay; + guchar reserved[6]; +} FlxFrameType; #define FlxFrameTypeSize 10 #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_FLX_FMT_H__ */ +#endif /* __GST_FLX_FMT_H__ */ diff --git a/gst/flx/gstflxdec.h b/gst/flx/gstflxdec.h index c5ce60ec..c7d6f386 100644 --- a/gst/flx/gstflxdec.h +++ b/gst/flx/gstflxdec.h @@ -27,46 +27,42 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - typedef enum - { - GST_FLXDEC_READ_HEADER, - GST_FLXDEC_PLAYING, - } GstFlxDecState; +extern "C" { +#endif /* __cplusplus */ +typedef enum { + GST_FLXDEC_READ_HEADER, + GST_FLXDEC_PLAYING, +} GstFlxDecState; + /* Definition of structure storing data for this element. */ - typedef struct _GstFlxDec GstFlxDec; +typedef struct _GstFlxDec GstFlxDec; - struct _GstFlxDec - { - GstElement element; +struct _GstFlxDec { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - gboolean active, new_meta; + gboolean active, new_meta; - GstBuffer *delta, *frame; - GstByteStream *bs; - gulong size; - GstFlxDecState state; - glong frame_time; - gint64 next_time; + GstBuffer *delta, *frame; + GstByteStream *bs; + gulong size; + GstFlxDecState state; + glong frame_time; + gint64 next_time; - FlxColorSpaceConverter *converter; + FlxColorSpaceConverter *converter; - FlxHeader hdr; - }; + FlxHeader hdr; +}; /* Standard definition defining a class for this element. */ - typedef struct _GstFlxDecClass GstFlxDecClass; - struct _GstFlxDecClass - { - GstElementClass parent_class; - }; +typedef struct _GstFlxDecClass GstFlxDecClass; +struct _GstFlxDecClass { + GstElementClass parent_class; +}; /* Standard macros for defining types for this element. */ #define GST_TYPE_FLXDEC \ @@ -81,12 +77,12 @@ extern "C" (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FLXDEC)) /* Standard function returning type information. */ - GType gst_flxdec_get_type (void); +GType gst_flxdec_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_FLX_DECODER_H__ */ +#endif /* __GST_FLX_DECODER_H__ */ diff --git a/gst/modplug/gstmodplug.h b/gst/modplug/gstmodplug.h index f32c9a9a..c4a98b86 100644 --- a/gst/modplug/gstmodplug.h +++ b/gst/modplug/gstmodplug.h @@ -22,16 +22,15 @@ #define __GST_MODPLUG_H__ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #include <gst/gst.h> #include <gst/bytestream/bytestream.h> - + #define GST_TYPE_MODPLUG \ (gst_modplug_get_type()) - + #define GST_MODPLUG(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MODPLUG,GstModPlug)) #define GST_MODPLUG_CLASS(klass) \ @@ -40,59 +39,57 @@ extern "C" (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MODPLUG)) #define GST_IS_MODPLUG_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MODPLUG)) - - struct _GstModPlug - { - GstElement element; - GstPad *sinkpad, *srcpad; - guint8 *buffer_in; - GstByteStream *bs; - - const gchar *songname; - gboolean reverb; - gint reverb_depth; - gint reverb_delay; - gboolean megabass; - gint megabass_amount; - gint megabass_range; - gboolean surround; - gint surround_depth; - gint surround_delay; - gboolean noise_reduction; - gboolean _16bit; - gboolean oversamp; - gint channel; - gint frequency; - - guchar *audiobuffer; - gint32 length; - guint state; - guint bitsPerSample; - gboolean need_discont; - gboolean eos; - gint64 seek_at; - guint64 song_size; - guint64 timestamp; - - CSoundFile *mSoundFile; - gboolean opened; /* set to TRUE when mSoundFile is created */ - }; - - struct _GstModPlugClass - { - GstElementClass parent_class; - }; - - typedef struct _GstModPlug GstModPlug; - typedef struct _GstModPlugClass GstModPlugClass; - - GstPad *srcpad; - int need_sync; - - GType gst_modplug_get_type (void); + +struct _GstModPlug { + GstElement element; + GstPad *sinkpad, *srcpad; + guint8 *buffer_in; + GstByteStream *bs; + + const gchar *songname; + gboolean reverb; + gint reverb_depth; + gint reverb_delay; + gboolean megabass; + gint megabass_amount; + gint megabass_range; + gboolean surround; + gint surround_depth; + gint surround_delay; + gboolean noise_reduction; + gboolean _16bit; + gboolean oversamp; + gint channel; + gint frequency; + + guchar *audiobuffer; + gint32 length; + guint state; + guint bitsPerSample; + gboolean need_discont; + gboolean eos; + gint64 seek_at; + guint64 song_size; + guint64 timestamp; + + CSoundFile *mSoundFile; + gboolean opened; /* set to TRUE when mSoundFile is created */ +}; + +struct _GstModPlugClass { + GstElementClass parent_class; +}; + +typedef struct _GstModPlug GstModPlug; +typedef struct _GstModPlugClass GstModPlugClass; + +GstPad *srcpad; +int need_sync; + +GType gst_modplug_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_MODPLUG_H__ */ +#endif /* __GST_MODPLUG_H__ */ diff --git a/gst/modplug/libmodplug/it_defs.h b/gst/modplug/libmodplug/it_defs.h index 48ff0b15..732ce45c 100644 --- a/gst/modplug/libmodplug/it_defs.h +++ b/gst/modplug/libmodplug/it_defs.h @@ -5,125 +5,125 @@ typedef struct tagITFILEHEADER { - DWORD id; /* 0x4D504D49 */ - CHAR songname[26]; - WORD reserved1; /* 0x1004 */ - WORD ordnum; - WORD insnum; - WORD smpnum; - WORD patnum; - WORD cwtv; - WORD cmwt; - WORD flags; - WORD special; - BYTE globalvol; - BYTE mv; - BYTE speed; - BYTE tempo; - BYTE sep; - BYTE zero; - WORD msglength; - DWORD msgoffset; - DWORD reserved2; - BYTE chnpan[64]; - BYTE chnvol[64]; + DWORD id; /* 0x4D504D49 */ + CHAR songname[26]; + WORD reserved1; /* 0x1004 */ + WORD ordnum; + WORD insnum; + WORD smpnum; + WORD patnum; + WORD cwtv; + WORD cmwt; + WORD flags; + WORD special; + BYTE globalvol; + BYTE mv; + BYTE speed; + BYTE tempo; + BYTE sep; + BYTE zero; + WORD msglength; + DWORD msgoffset; + DWORD reserved2; + BYTE chnpan[64]; + BYTE chnvol[64]; } ITFILEHEADER; typedef struct tagITENVELOPE { - BYTE flags; - BYTE num; - BYTE lpb; - BYTE lpe; - BYTE slb; - BYTE sle; - BYTE data[25 * 3]; - BYTE reserved; + BYTE flags; + BYTE num; + BYTE lpb; + BYTE lpe; + BYTE slb; + BYTE sle; + BYTE data[25*3]; + BYTE reserved; } ITENVELOPE; /* Old Impulse Instrument Format (cmwt < 0x200) */ typedef struct tagITOLDINSTRUMENT { - DWORD id; /* IMPI = 0x49504D49 */ - CHAR filename[12]; /* DOS file name */ - BYTE zero; - BYTE flags; - BYTE vls; - BYTE vle; - BYTE sls; - BYTE sle; - WORD reserved1; - WORD fadeout; - BYTE nna; - BYTE dnc; - WORD trkvers; - BYTE nos; - BYTE reserved2; - CHAR name[26]; - WORD reserved3[3]; - BYTE keyboard[240]; - BYTE volenv[200]; - BYTE nodes[50]; + DWORD id; /* IMPI = 0x49504D49 */ + CHAR filename[12]; /* DOS file name */ + BYTE zero; + BYTE flags; + BYTE vls; + BYTE vle; + BYTE sls; + BYTE sle; + WORD reserved1; + WORD fadeout; + BYTE nna; + BYTE dnc; + WORD trkvers; + BYTE nos; + BYTE reserved2; + CHAR name[26]; + WORD reserved3[3]; + BYTE keyboard[240]; + BYTE volenv[200]; + BYTE nodes[50]; } ITOLDINSTRUMENT; /* Impulse Instrument Format */ typedef struct tagITINSTRUMENT { - DWORD id; - CHAR filename[12]; - BYTE zero; - BYTE nna; - BYTE dct; - BYTE dca; - WORD fadeout; - signed char pps; - BYTE ppc; - BYTE gbv; - BYTE dfp; - BYTE rv; - BYTE rp; - WORD trkvers; - BYTE nos; - BYTE reserved1; - CHAR name[26]; - BYTE ifc; - BYTE ifr; - BYTE mch; - BYTE mpr; - WORD mbank; - BYTE keyboard[240]; - ITENVELOPE volenv; - ITENVELOPE panenv; - ITENVELOPE pitchenv; - BYTE dummy[4]; /* was 7, but IT v2.17 saves 554 bytes */ + DWORD id; + CHAR filename[12]; + BYTE zero; + BYTE nna; + BYTE dct; + BYTE dca; + WORD fadeout; + signed char pps; + BYTE ppc; + BYTE gbv; + BYTE dfp; + BYTE rv; + BYTE rp; + WORD trkvers; + BYTE nos; + BYTE reserved1; + CHAR name[26]; + BYTE ifc; + BYTE ifr; + BYTE mch; + BYTE mpr; + WORD mbank; + BYTE keyboard[240]; + ITENVELOPE volenv; + ITENVELOPE panenv; + ITENVELOPE pitchenv; + BYTE dummy[4]; /* was 7, but IT v2.17 saves 554 bytes */ } ITINSTRUMENT; /* IT Sample Format */ typedef struct ITSAMPLESTRUCT { - DWORD id; /* 0x53504D49 */ - CHAR filename[12]; - BYTE zero; - BYTE gvl; - BYTE flags; - BYTE vol; - CHAR name[26]; - BYTE cvt; - BYTE dfp; - DWORD length; - DWORD loopbegin; - DWORD loopend; - DWORD C5Speed; - DWORD susloopbegin; - DWORD susloopend; - DWORD samplepointer; - BYTE vis; - BYTE vid; - BYTE vir; - BYTE vit; + DWORD id; /* 0x53504D49 */ + CHAR filename[12]; + BYTE zero; + BYTE gvl; + BYTE flags; + BYTE vol; + CHAR name[26]; + BYTE cvt; + BYTE dfp; + DWORD length; + DWORD loopbegin; + DWORD loopend; + DWORD C5Speed; + DWORD susloopbegin; + DWORD susloopend; + DWORD samplepointer; + BYTE vis; + BYTE vid; + BYTE vir; + BYTE vit; } ITSAMPLESTRUCT; #pragma pack() diff --git a/gst/modplug/libmodplug/modplug.h b/gst/modplug/libmodplug/modplug.h index 877060d0..fd8ec02f 100644 --- a/gst/modplug/libmodplug/modplug.h +++ b/gst/modplug/libmodplug/modplug.h @@ -8,31 +8,30 @@ #define MODPLUG_H__INCLUDED #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif - struct _ModPlugFile; - typedef struct _ModPlugFile ModPlugFile; +struct _ModPlugFile; +typedef struct _ModPlugFile ModPlugFile; /* Load a mod file. [data] should point to a block of memory containing the complete * file, and [size] should be the size of that block. * Return the loaded mod file on success, or NULL on failure. */ - ModPlugFile *ModPlug_Load (const void *data, int size); +ModPlugFile* ModPlug_Load(const void* data, int size); /* Unload a mod file. */ - void ModPlug_Unload (ModPlugFile * file); +void ModPlug_Unload(ModPlugFile* file); /* Read sample data into the buffer. Returns the number of bytes read. If the end * of the mod has been reached, zero is returned. */ - int ModPlug_Read (ModPlugFile * file, void *buffer, int size); +int ModPlug_Read(ModPlugFile* file, void* buffer, int size); /* Get the name of the mod. The returned buffer is stored within the ModPlugFile * structure and will remain valid until you unload the file. */ - const char *ModPlug_GetName (ModPlugFile * file); +const char* ModPlug_GetName(ModPlugFile* file); /* Get the length of the mod, in milliseconds. Note that this result is not always * accurate, especially in the case of mods with loops. */ - int ModPlug_GetLength (ModPlugFile * file); +int ModPlug_GetLength(ModPlugFile* file); /* Seek to a particular position in the song. Note that seeking and MODs don't mix very * well. Some mods will be missing instruments for a short time after a seek, as ModPlug @@ -40,54 +39,54 @@ extern "C" * playing at that time. (Doing so would be difficult and not very reliable.) Also, * note that seeking is not very exact in some mods -- especially those for which * ModPlug_GetLength() does not report the full length. */ - void ModPlug_Seek (ModPlugFile * file, int millisecond); - - enum _ModPlug_Flags - { - MODPLUG_ENABLE_OVERSAMPLING = 1 << 0, /* Enable oversampling (*highly* recommended) */ - MODPLUG_ENABLE_NOISE_REDUCTION = 1 << 1, /* Enable noise reduction */ - MODPLUG_ENABLE_REVERB = 1 << 2, /* Enable reverb */ - MODPLUG_ENABLE_MEGABASS = 1 << 3, /* Enable megabass */ - MODPLUG_ENABLE_SURROUND = 1 << 4 /* Enable surround sound. */ - }; - - enum _ModPlug_ResamplingMode - { - MODPLUG_RESAMPLE_NEAREST = 0, /* No interpolation (very fast, extremely bad sound quality) */ - MODPLUG_RESAMPLE_LINEAR = 1, /* Linear interpolation (fast, good quality) */ - MODPLUG_RESAMPLE_SPLINE = 2, /* Cubic spline interpolation (high quality) */ - MODPLUG_RESAMPLE_FIR = 3 /* 8-tap fir filter (extremely high quality) */ - }; - - typedef struct _ModPlug_Settings - { - int mFlags; /* One or more of the MODPLUG_ENABLE_* flags above, bitwise-OR'ed */ +void ModPlug_Seek(ModPlugFile* file, int millisecond); - /* Note that ModPlug always decodes sound at 44100kHz, 32 bit, stereo and then - * down-mixes to the settings you choose. */ - int mChannels; /* Number of channels - 1 for mono or 2 for stereo */ - int mBits; /* Bits per sample - 8, 16, or 32 */ - int mFrequency; /* Sampling rate - 11025, 22050, or 44100 */ - int mResamplingMode; /* One of MODPLUG_RESAMPLE_*, above */ +enum _ModPlug_Flags +{ + MODPLUG_ENABLE_OVERSAMPLING = 1 << 0, /* Enable oversampling (*highly* recommended) */ + MODPLUG_ENABLE_NOISE_REDUCTION = 1 << 1, /* Enable noise reduction */ + MODPLUG_ENABLE_REVERB = 1 << 2, /* Enable reverb */ + MODPLUG_ENABLE_MEGABASS = 1 << 3, /* Enable megabass */ + MODPLUG_ENABLE_SURROUND = 1 << 4 /* Enable surround sound. */ +}; + +enum _ModPlug_ResamplingMode +{ + MODPLUG_RESAMPLE_NEAREST = 0, /* No interpolation (very fast, extremely bad sound quality) */ + MODPLUG_RESAMPLE_LINEAR = 1, /* Linear interpolation (fast, good quality) */ + MODPLUG_RESAMPLE_SPLINE = 2, /* Cubic spline interpolation (high quality) */ + MODPLUG_RESAMPLE_FIR = 3 /* 8-tap fir filter (extremely high quality) */ +}; - int mReverbDepth; /* Reverb level 0(quiet)-100(loud) */ - int mReverbDelay; /* Reverb delay in ms, usually 40-200ms */ - int mBassAmount; /* XBass level 0(quiet)-100(loud) */ - int mBassRange; /* XBass cutoff in Hz 10-100 */ - int mSurroundDepth; /* Surround level 0(quiet)-100(heavy) */ - int mSurroundDelay; /* Surround delay in ms, usually 5-40ms */ - int mLoopCount; /* Number of times to loop. Zero prevents looping. - -1 loops forever. */ - } ModPlug_Settings; +typedef struct _ModPlug_Settings +{ + int mFlags; /* One or more of the MODPLUG_ENABLE_* flags above, bitwise-OR'ed */ + + /* Note that ModPlug always decodes sound at 44100kHz, 32 bit, stereo and then + * down-mixes to the settings you choose. */ + int mChannels; /* Number of channels - 1 for mono or 2 for stereo */ + int mBits; /* Bits per sample - 8, 16, or 32 */ + int mFrequency; /* Sampling rate - 11025, 22050, or 44100 */ + int mResamplingMode; /* One of MODPLUG_RESAMPLE_*, above */ + + int mReverbDepth; /* Reverb level 0(quiet)-100(loud) */ + int mReverbDelay; /* Reverb delay in ms, usually 40-200ms */ + int mBassAmount; /* XBass level 0(quiet)-100(loud) */ + int mBassRange; /* XBass cutoff in Hz 10-100 */ + int mSurroundDepth; /* Surround level 0(quiet)-100(heavy) */ + int mSurroundDelay; /* Surround delay in ms, usually 5-40ms */ + int mLoopCount; /* Number of times to loop. Zero prevents looping. + -1 loops forever. */ +} ModPlug_Settings; /* Get and set the mod decoder settings. All options, except for channels, bits-per-sample, * sampling rate, and loop count, will take effect immediately. Those options which don't * take effect immediately will take effect the next time you load a mod. */ - void ModPlug_GetSettings (ModPlug_Settings * settings); - void ModPlug_SetSettings (const ModPlug_Settings * settings); +void ModPlug_GetSettings(ModPlug_Settings* settings); +void ModPlug_SetSettings(const ModPlug_Settings* settings); #ifdef __cplusplus -} /* extern "C" */ +} /* extern "C" */ #endif #endif diff --git a/gst/modplug/libmodplug/sndfile.h b/gst/modplug/libmodplug/sndfile.h index ebfd4afd..0fe6f459 100644 --- a/gst/modplug/libmodplug/sndfile.h +++ b/gst/modplug/libmodplug/sndfile.h @@ -9,7 +9,7 @@ #define __SNDFILE_H #ifndef LPCBYTE -typedef const BYTE *LPCBYTE; +typedef const BYTE * LPCBYTE; #endif #define MOD_AMIGAC2 0x1AB @@ -60,7 +60,7 @@ typedef const BYTE *LPCBYTE; #define MOD_TYPE_AMF0 0x200000 #define MOD_TYPE_PSM 0x400000 #define MOD_TYPE_J2B 0x800000 -#define MOD_TYPE_UMX 0x80000000 /* Fake type */ +#define MOD_TYPE_UMX 0x80000000 /* Fake type */ #define MAX_MODTYPE 23 @@ -202,9 +202,9 @@ typedef const BYTE *LPCBYTE; #define RS_STIPCM16U (RS_PCM16U|0x40|RSF_STEREO) /* stereo 16-bit unsigned */ #define RS_STIPCM16M (RS_PCM16M|0x40|RSF_STEREO) /* stereo 16-bit signed big endian */ /* 24-bit signed */ -#define RS_PCM24S (RS_PCM16S|0x80) /* mono 24-bit signed */ +#define RS_PCM24S (RS_PCM16S|0x80) /* mono 24-bit signed */ #define RS_STIPCM24S (RS_PCM16S|0x80|RSF_STEREO) /* stereo 24-bit signed */ -#define RS_PCM32S (RS_PCM16S|0xC0) /* mono 24-bit signed */ +#define RS_PCM32S (RS_PCM16S|0xC0) /* mono 24-bit signed */ #define RS_STIPCM32S (RS_PCM16S|0xC0|RSF_STEREO) /* stereo 24-bit signed */ /* NNA types */ @@ -269,178 +269,176 @@ typedef const BYTE *LPCBYTE; /* Reverb Types (GM2 Presets) */ -enum -{ - REVERBTYPE_SMALLROOM, - REVERBTYPE_MEDIUMROOM, - REVERBTYPE_LARGEROOM, - REVERBTYPE_SMALLHALL, - REVERBTYPE_MEDIUMHALL, - REVERBTYPE_LARGEHALL, - NUM_REVERBTYPES +enum { + REVERBTYPE_SMALLROOM, + REVERBTYPE_MEDIUMROOM, + REVERBTYPE_LARGEROOM, + REVERBTYPE_SMALLHALL, + REVERBTYPE_MEDIUMHALL, + REVERBTYPE_LARGEHALL, + NUM_REVERBTYPES }; -enum -{ - SRCMODE_NEAREST, - SRCMODE_LINEAR, - SRCMODE_SPLINE, - SRCMODE_POLYPHASE, - NUM_SRC_MODES +enum { + SRCMODE_NEAREST, + SRCMODE_LINEAR, + SRCMODE_SPLINE, + SRCMODE_POLYPHASE, + NUM_SRC_MODES }; /* Sample Struct */ typedef struct _MODINSTRUMENT { - UINT nLength, nLoopStart, nLoopEnd; - UINT nSustainStart, nSustainEnd; - signed char *pSample; - UINT nC4Speed; - WORD nPan; - WORD nVolume; - WORD nGlobalVol; - WORD uFlags; - signed char RelativeTone; - signed char nFineTune; - BYTE nVibType; - BYTE nVibSweep; - BYTE nVibDepth; - BYTE nVibRate; - CHAR name[22]; + UINT nLength,nLoopStart,nLoopEnd; + UINT nSustainStart, nSustainEnd; + signed char *pSample; + UINT nC4Speed; + WORD nPan; + WORD nVolume; + WORD nGlobalVol; + WORD uFlags; + signed char RelativeTone; + signed char nFineTune; + BYTE nVibType; + BYTE nVibSweep; + BYTE nVibDepth; + BYTE nVibRate; + CHAR name[22]; } MODINSTRUMENT; /* Instrument Struct */ typedef struct _INSTRUMENTHEADER { - UINT nFadeOut; - DWORD dwFlags; - WORD nGlobalVol; - WORD nPan; - WORD VolPoints[MAX_ENVPOINTS]; - WORD PanPoints[MAX_ENVPOINTS]; - WORD PitchPoints[MAX_ENVPOINTS]; - BYTE VolEnv[MAX_ENVPOINTS]; - BYTE PanEnv[MAX_ENVPOINTS]; - BYTE PitchEnv[MAX_ENVPOINTS]; - BYTE Keyboard[128]; - BYTE NoteMap[128]; - - BYTE nVolEnv; - BYTE nPanEnv; - BYTE nPitchEnv; - BYTE nVolLoopStart; - BYTE nVolLoopEnd; - BYTE nVolSustainBegin; - BYTE nVolSustainEnd; - BYTE nPanLoopStart; - BYTE nPanLoopEnd; - BYTE nPanSustainBegin; - BYTE nPanSustainEnd; - BYTE nPitchLoopStart; - BYTE nPitchLoopEnd; - BYTE nPitchSustainBegin; - BYTE nPitchSustainEnd; - BYTE nNNA; - BYTE nDCT; - BYTE nDNA; - BYTE nPanSwing; - BYTE nVolSwing; - BYTE nIFC; - BYTE nIFR; - WORD wMidiBank; - BYTE nMidiProgram; - BYTE nMidiChannel; - BYTE nMidiDrumKey; - signed char nPPS; - unsigned char nPPC; - CHAR name[32]; - CHAR filename[12]; + UINT nFadeOut; + DWORD dwFlags; + WORD nGlobalVol; + WORD nPan; + WORD VolPoints[MAX_ENVPOINTS]; + WORD PanPoints[MAX_ENVPOINTS]; + WORD PitchPoints[MAX_ENVPOINTS]; + BYTE VolEnv[MAX_ENVPOINTS]; + BYTE PanEnv[MAX_ENVPOINTS]; + BYTE PitchEnv[MAX_ENVPOINTS]; + BYTE Keyboard[128]; + BYTE NoteMap[128]; + + BYTE nVolEnv; + BYTE nPanEnv; + BYTE nPitchEnv; + BYTE nVolLoopStart; + BYTE nVolLoopEnd; + BYTE nVolSustainBegin; + BYTE nVolSustainEnd; + BYTE nPanLoopStart; + BYTE nPanLoopEnd; + BYTE nPanSustainBegin; + BYTE nPanSustainEnd; + BYTE nPitchLoopStart; + BYTE nPitchLoopEnd; + BYTE nPitchSustainBegin; + BYTE nPitchSustainEnd; + BYTE nNNA; + BYTE nDCT; + BYTE nDNA; + BYTE nPanSwing; + BYTE nVolSwing; + BYTE nIFC; + BYTE nIFR; + WORD wMidiBank; + BYTE nMidiProgram; + BYTE nMidiChannel; + BYTE nMidiDrumKey; + signed char nPPS; + unsigned char nPPC; + CHAR name[32]; + CHAR filename[12]; } INSTRUMENTHEADER; /* Channel Struct */ typedef struct _MODCHANNEL { - /* First 32-bytes: Most used mixing information: don't change it */ - signed char *pCurrentSample; - DWORD nPos; - DWORD nPosLo; /* actually 16-bit */ - LONG nInc; /* 16.16 */ - LONG nRightVol; - LONG nLeftVol; - LONG nRightRamp; - LONG nLeftRamp; - /* 2nd cache line */ - DWORD nLength; - DWORD dwFlags; - DWORD nLoopStart; - DWORD nLoopEnd; - LONG nRampRightVol; - LONG nRampLeftVol; - LONG nFilter_Y1, nFilter_Y2, nFilter_Y3, nFilter_Y4; - LONG nFilter_A0, nFilter_B0, nFilter_B1; - LONG nROfs, nLOfs; - LONG nRampLength; - /* Information not used in the mixer */ - signed char *pSample; - LONG nNewRightVol, nNewLeftVol; - LONG nRealVolume, nRealPan; - LONG nVolume, nPan, nFadeOutVol; - LONG nPeriod, nC4Speed, nPortamentoDest; - INSTRUMENTHEADER *pHeader; - MODINSTRUMENT *pInstrument; - DWORD nVolEnvPosition, nPanEnvPosition, nPitchEnvPosition; - DWORD nMasterChn, nVUMeter; - LONG nGlobalVol, nInsVol; - LONG nFineTune, nTranspose; - LONG nPortamentoSlide, nAutoVibDepth; - UINT nAutoVibPos, nVibratoPos, nTremoloPos, nPanbrelloPos; - /* 16-bit members */ - signed short nVolSwing, nPanSwing; - /* 8-bit members */ - BYTE nNote, nNNA; - BYTE nNewNote, nNewIns, nCommand, nArpeggio; - BYTE nOldVolumeSlide, nOldFineVolUpDown; - BYTE nOldPortaUpDown, nOldFinePortaUpDown; - BYTE nOldPanSlide, nOldChnVolSlide; - BYTE nVibratoType, nVibratoSpeed, nVibratoDepth; - BYTE nTremoloType, nTremoloSpeed, nTremoloDepth; - BYTE nPanbrelloType, nPanbrelloSpeed, nPanbrelloDepth; - BYTE nOldCmdEx, nOldVolParam, nOldTempo; - BYTE nOldOffset, nOldHiOffset; - BYTE nCutOff, nResonance; - BYTE nRetrigCount, nRetrigParam; - BYTE nTremorCount, nTremorParam; - BYTE nPatternLoop, nPatternLoopCount; - BYTE nRowNote, nRowInstr; - BYTE nRowVolCmd, nRowVolume; - BYTE nRowCommand, nRowParam; - BYTE nLeftVU, nRightVU; - BYTE nActiveMacro, nPadding; + /* First 32-bytes: Most used mixing information: don't change it */ + signed char * pCurrentSample; + DWORD nPos; + DWORD nPosLo; /* actually 16-bit */ + LONG nInc; /* 16.16 */ + LONG nRightVol; + LONG nLeftVol; + LONG nRightRamp; + LONG nLeftRamp; + /* 2nd cache line */ + DWORD nLength; + DWORD dwFlags; + DWORD nLoopStart; + DWORD nLoopEnd; + LONG nRampRightVol; + LONG nRampLeftVol; + LONG nFilter_Y1, nFilter_Y2, nFilter_Y3, nFilter_Y4; + LONG nFilter_A0, nFilter_B0, nFilter_B1; + LONG nROfs, nLOfs; + LONG nRampLength; + /* Information not used in the mixer */ + signed char * pSample; + LONG nNewRightVol, nNewLeftVol; + LONG nRealVolume, nRealPan; + LONG nVolume, nPan, nFadeOutVol; + LONG nPeriod, nC4Speed, nPortamentoDest; + INSTRUMENTHEADER *pHeader; + MODINSTRUMENT *pInstrument; + DWORD nVolEnvPosition, nPanEnvPosition, nPitchEnvPosition; + DWORD nMasterChn, nVUMeter; + LONG nGlobalVol, nInsVol; + LONG nFineTune, nTranspose; + LONG nPortamentoSlide, nAutoVibDepth; + UINT nAutoVibPos, nVibratoPos, nTremoloPos, nPanbrelloPos; + /* 16-bit members */ + signed short nVolSwing, nPanSwing; + /* 8-bit members */ + BYTE nNote, nNNA; + BYTE nNewNote, nNewIns, nCommand, nArpeggio; + BYTE nOldVolumeSlide, nOldFineVolUpDown; + BYTE nOldPortaUpDown, nOldFinePortaUpDown; + BYTE nOldPanSlide, nOldChnVolSlide; + BYTE nVibratoType, nVibratoSpeed, nVibratoDepth; + BYTE nTremoloType, nTremoloSpeed, nTremoloDepth; + BYTE nPanbrelloType, nPanbrelloSpeed, nPanbrelloDepth; + BYTE nOldCmdEx, nOldVolParam, nOldTempo; + BYTE nOldOffset, nOldHiOffset; + BYTE nCutOff, nResonance; + BYTE nRetrigCount, nRetrigParam; + BYTE nTremorCount, nTremorParam; + BYTE nPatternLoop, nPatternLoopCount; + BYTE nRowNote, nRowInstr; + BYTE nRowVolCmd, nRowVolume; + BYTE nRowCommand, nRowParam; + BYTE nLeftVU, nRightVU; + BYTE nActiveMacro, nPadding; } MODCHANNEL; typedef struct _MODCHANNELSETTINGS { - UINT nPan; - UINT nVolume; - DWORD dwFlags; - UINT nMixPlugin; - char szName[MAX_CHANNELNAME]; /* changed from CHAR */ + UINT nPan; + UINT nVolume; + DWORD dwFlags; + UINT nMixPlugin; + char szName[MAX_CHANNELNAME]; /* changed from CHAR */ } MODCHANNELSETTINGS; typedef struct _MODCOMMAND { - BYTE note; - BYTE instr; - BYTE volcmd; - BYTE command; - BYTE vol; - BYTE param; + BYTE note; + BYTE instr; + BYTE volcmd; + BYTE command; + BYTE vol; + BYTE param; } MODCOMMAND, *LPMODCOMMAND; /*////////////////////////////////////////////////////////////////// */ @@ -450,15 +448,14 @@ typedef struct _MODCOMMAND class IMixPlugin { public: - virtual int AddRef () = 0; - virtual int Release () = 0; - virtual void SaveAllParameters () = 0; - virtual void RestoreAllParameters () = 0; - virtual void Process (float *pOutL, float *pOutR, unsigned long nSamples) = 0; - virtual void Init (unsigned long nFreq, int bReset) = 0; - virtual void MidiSend (DWORD dwMidiCode) = 0; - virtual void MidiCommand (UINT nMidiCh, UINT nMidiProg, UINT note, UINT vol) = - 0; + virtual int AddRef() = 0; + virtual int Release() = 0; + virtual void SaveAllParameters() = 0; + virtual void RestoreAllParameters() = 0; + virtual void Process(float *pOutL, float *pOutR, unsigned long nSamples) = 0; + virtual void Init(unsigned long nFreq, int bReset) = 0; + virtual void MidiSend(DWORD dwMidiCode) = 0; + virtual void MidiCommand(UINT nMidiCh, UINT nMidiProg, UINT note, UINT vol) = 0; }; @@ -468,60 +465,59 @@ public: typedef struct _SNDMIXPLUGINSTATE { - DWORD dwFlags; /* MIXPLUG_XXXX */ - LONG nVolDecayL, nVolDecayR; /* Buffer click removal */ - int *pMixBuffer; /* Stereo effect send buffer */ - float *pOutBufferL; /* Temp storage for int -> float conversion */ - float *pOutBufferR; + DWORD dwFlags; /* MIXPLUG_XXXX */ + LONG nVolDecayL, nVolDecayR; /* Buffer click removal */ + int *pMixBuffer; /* Stereo effect send buffer */ + float *pOutBufferL; /* Temp storage for int -> float conversion */ + float *pOutBufferR; } SNDMIXPLUGINSTATE, *PSNDMIXPLUGINSTATE; typedef struct _SNDMIXPLUGININFO { - DWORD dwPluginId1; - DWORD dwPluginId2; - DWORD dwInputRouting; /* MIXPLUG_INPUTF_XXXX */ - DWORD dwOutputRouting; /* 0=mix 0x80+=fx */ - DWORD dwReserved[4]; /* Reserved for routing info */ - CHAR szName[32]; - CHAR szLibraryName[64]; /* original DLL name */ -} SNDMIXPLUGININFO, *PSNDMIXPLUGININFO; /* Size should be 128 */ + DWORD dwPluginId1; + DWORD dwPluginId2; + DWORD dwInputRouting; /* MIXPLUG_INPUTF_XXXX */ + DWORD dwOutputRouting; /* 0=mix 0x80+=fx */ + DWORD dwReserved[4]; /* Reserved for routing info */ + CHAR szName[32]; + CHAR szLibraryName[64]; /* original DLL name */ +} SNDMIXPLUGININFO, *PSNDMIXPLUGININFO; /* Size should be 128 */ typedef struct _SNDMIXPLUGIN { - IMixPlugin *pMixPlugin; - PSNDMIXPLUGINSTATE pMixState; - ULONG nPluginDataSize; - PVOID pPluginData; - SNDMIXPLUGININFO Info; + IMixPlugin *pMixPlugin; + PSNDMIXPLUGINSTATE pMixState; + ULONG nPluginDataSize; + PVOID pPluginData; + SNDMIXPLUGININFO Info; } SNDMIXPLUGIN, *PSNDMIXPLUGIN; -typedef BOOL (*PMIXPLUGINCREATEPROC) (PSNDMIXPLUGIN); +typedef BOOL (*PMIXPLUGINCREATEPROC)(PSNDMIXPLUGIN); /*////////////////////////////////////////////////////////////////// */ -enum -{ - MIDIOUT_START = 0, - MIDIOUT_STOP, - MIDIOUT_TICK, - MIDIOUT_NOTEON, - MIDIOUT_NOTEOFF, - MIDIOUT_VOLUME, - MIDIOUT_PAN, - MIDIOUT_BANKSEL, - MIDIOUT_PROGRAM +enum { + MIDIOUT_START=0, + MIDIOUT_STOP, + MIDIOUT_TICK, + MIDIOUT_NOTEON, + MIDIOUT_NOTEOFF, + MIDIOUT_VOLUME, + MIDIOUT_PAN, + MIDIOUT_BANKSEL, + MIDIOUT_PROGRAM }; typedef struct MODMIDICFG { - char szMidiGlb[9 * 32]; /* changed from CHAR */ - char szMidiSFXExt[16 * 32]; /* changed from CHAR */ - char szMidiZXXExt[128 * 32]; /* changed from CHAR */ + char szMidiGlb[9*32]; /* changed from CHAR */ + char szMidiSFXExt[16*32]; /* changed from CHAR */ + char szMidiZXXExt[128*32]; /* changed from CHAR */ } MODMIDICFG, *LPMODMIDICFG; -typedef VOID (*LPSNDMIXHOOKPROC) (int *, unsigned long, unsigned long); /* buffer, samples, channels */ +typedef VOID (* LPSNDMIXHOOKPROC)(int *, unsigned long, unsigned long); /* buffer, samples, channels */ @@ -529,343 +525,251 @@ typedef VOID (*LPSNDMIXHOOKPROC) (int *, unsigned long, unsigned long); /* buffe class CSoundFile /*============== */ { -public: /* Static Members */ - static UINT m_nXBassDepth, m_nXBassRange; - static UINT m_nReverbDepth, m_nReverbDelay, gnReverbType; - static UINT m_nProLogicDepth, m_nProLogicDelay; - static UINT m_nStereoSeparation; - static UINT m_nMaxMixChannels; - static LONG m_nStreamVolume; - static DWORD gdwSysInfo, gdwSoundSetup, gdwMixingFreq, gnBitsPerSample, - gnChannels; - static UINT gnAGC, gnVolumeRampSamples, gnVUMeter, gnCPUUsage; - static LPSNDMIXHOOKPROC gpSndMixHook; - static PMIXPLUGINCREATEPROC gpMixPluginCreateProc; - -public: /* for Editing */ - MODCHANNEL Chn[MAX_CHANNELS]; /* Channels */ - UINT ChnMix[MAX_CHANNELS]; /* Channels to be mixed */ - MODINSTRUMENT Ins[MAX_SAMPLES]; /* Instruments */ - INSTRUMENTHEADER *Headers[MAX_INSTRUMENTS]; /* Instrument Headers */ - MODCHANNELSETTINGS ChnSettings[MAX_BASECHANNELS]; /* Channels settings */ - MODCOMMAND *Patterns[MAX_PATTERNS]; /* Patterns */ - WORD PatternSize[MAX_PATTERNS]; /* Patterns Lengths */ - BYTE Order[MAX_ORDERS]; /* Pattern Orders */ - MODMIDICFG m_MidiCfg; /* Midi macro config table */ - SNDMIXPLUGIN m_MixPlugins[MAX_MIXPLUGINS]; /* Mix plugins */ - UINT m_nDefaultSpeed, m_nDefaultTempo, m_nDefaultGlobalVolume; - DWORD m_dwSongFlags; /* Song flags SONG_XXXX */ - UINT m_nChannels, m_nMixChannels, m_nMixStat, m_nBufferCount; - UINT m_nType, m_nSamples, m_nInstruments; - UINT m_nTickCount, m_nTotalCount, m_nPatternDelay, m_nFrameDelay; - UINT m_nMusicSpeed, m_nMusicTempo; - UINT m_nNextRow, m_nRow; - UINT m_nPattern, m_nCurrentPattern, m_nNextPattern, m_nRestartPos; - UINT m_nMasterVolume, m_nGlobalVolume, m_nSongPreAmp; - UINT m_nFreqFactor, m_nTempoFactor, m_nOldGlbVolSlide; - LONG m_nMinPeriod, m_nMaxPeriod, m_nRepeatCount, m_nInitialRepeatCount; - DWORD m_nGlobalFadeSamples, m_nGlobalFadeMaxSamples; - UINT m_nMaxOrderPosition; - UINT m_nPatternNames; - LPSTR m_lpszSongComments, m_lpszPatternNames; - char m_szNames[MAX_INSTRUMENTS][32]; /* changed from CHAR */ - CHAR CompressionTable[16]; +public: /* Static Members */ + static UINT m_nXBassDepth, m_nXBassRange; + static UINT m_nReverbDepth, m_nReverbDelay, gnReverbType; + static UINT m_nProLogicDepth, m_nProLogicDelay; + static UINT m_nStereoSeparation; + static UINT m_nMaxMixChannels; + static LONG m_nStreamVolume; + static DWORD gdwSysInfo, gdwSoundSetup, gdwMixingFreq, gnBitsPerSample, gnChannels; + static UINT gnAGC, gnVolumeRampSamples, gnVUMeter, gnCPUUsage; + static LPSNDMIXHOOKPROC gpSndMixHook; + static PMIXPLUGINCREATEPROC gpMixPluginCreateProc; + +public: /* for Editing */ + MODCHANNEL Chn[MAX_CHANNELS]; /* Channels */ + UINT ChnMix[MAX_CHANNELS]; /* Channels to be mixed */ + MODINSTRUMENT Ins[MAX_SAMPLES]; /* Instruments */ + INSTRUMENTHEADER *Headers[MAX_INSTRUMENTS]; /* Instrument Headers */ + MODCHANNELSETTINGS ChnSettings[MAX_BASECHANNELS]; /* Channels settings */ + MODCOMMAND *Patterns[MAX_PATTERNS]; /* Patterns */ + WORD PatternSize[MAX_PATTERNS]; /* Patterns Lengths */ + BYTE Order[MAX_ORDERS]; /* Pattern Orders */ + MODMIDICFG m_MidiCfg; /* Midi macro config table */ + SNDMIXPLUGIN m_MixPlugins[MAX_MIXPLUGINS]; /* Mix plugins */ + UINT m_nDefaultSpeed, m_nDefaultTempo, m_nDefaultGlobalVolume; + DWORD m_dwSongFlags; /* Song flags SONG_XXXX */ + UINT m_nChannels, m_nMixChannels, m_nMixStat, m_nBufferCount; + UINT m_nType, m_nSamples, m_nInstruments; + UINT m_nTickCount, m_nTotalCount, m_nPatternDelay, m_nFrameDelay; + UINT m_nMusicSpeed, m_nMusicTempo; + UINT m_nNextRow, m_nRow; + UINT m_nPattern,m_nCurrentPattern,m_nNextPattern,m_nRestartPos; + UINT m_nMasterVolume, m_nGlobalVolume, m_nSongPreAmp; + UINT m_nFreqFactor, m_nTempoFactor, m_nOldGlbVolSlide; + LONG m_nMinPeriod, m_nMaxPeriod, m_nRepeatCount, m_nInitialRepeatCount; + DWORD m_nGlobalFadeSamples, m_nGlobalFadeMaxSamples; + UINT m_nMaxOrderPosition; + UINT m_nPatternNames; + LPSTR m_lpszSongComments, m_lpszPatternNames; + char m_szNames[MAX_INSTRUMENTS][32]; /* changed from CHAR */ + CHAR CompressionTable[16]; public: - CSoundFile (); - ~CSoundFile (); + CSoundFile(); + ~CSoundFile(); public: - BOOL Create (LPCBYTE lpStream, DWORD dwMemLength = 0); - BOOL Destroy (); - UINT GetType () const - { - return m_nType; - } - UINT GetNumChannels () const; - UINT GetLogicalChannels () const - { - return m_nChannels; - } - BOOL SetMasterVolume (UINT vol, BOOL bAdjustAGC = FALSE); - UINT GetMasterVolume () const - { - return m_nMasterVolume; - } - UINT GetNumPatterns () const; - UINT GetNumInstruments () const; - UINT GetNumSamples () const - { - return m_nSamples; - } - UINT GetCurrentPos () const; - UINT GetCurrentPattern () const - { - return m_nPattern; - } - UINT GetCurrentOrder () const - { - return m_nCurrentPattern; - } - UINT GetSongComments (LPSTR s, UINT cbsize, UINT linesize = 32); - UINT GetRawSongComments (LPSTR s, UINT cbsize, UINT linesize = 32); - UINT GetMaxPosition () const; - void SetCurrentPos (UINT nPos); - void SetCurrentOrder (UINT nOrder); - void GetTitle (LPSTR s) const - { - lstrcpyn (s, m_szNames[0], 32); - } - LPCSTR GetTitle () const - { - return m_szNames[0]; - } - UINT GetSampleName (UINT nSample, LPSTR s = NULL) const; - UINT GetInstrumentName (UINT nInstr, LPSTR s = NULL) const; - UINT GetMusicSpeed () const - { - return m_nMusicSpeed; - } - UINT GetMusicTempo () const - { - return m_nMusicTempo; - } - DWORD GetLength (BOOL bAdjust, BOOL bTotal = FALSE); - DWORD GetSongTime () - { - return GetLength (FALSE, TRUE); - } - void SetRepeatCount (int n) - { - m_nRepeatCount = n; - m_nInitialRepeatCount = n; - } - int GetRepeatCount () const - { - return m_nRepeatCount; - } - BOOL IsPaused () const - { - return (m_dwSongFlags & SONG_PAUSED) ? TRUE : FALSE; - } - void LoopPattern (int nPat, int nRow = 0); - void CheckCPUUsage (UINT nCPU); - BOOL SetPatternName (UINT nPat, LPCSTR lpszName); - BOOL GetPatternName (UINT nPat, LPSTR lpszName, UINT cbSize = - MAX_PATTERNNAME) const; - /* Module Loaders */ - BOOL ReadXM (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadS3M (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadMod (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadMed (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadMTM (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadSTM (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadIT (LPCBYTE lpStream, DWORD dwMemLength); - BOOL Read669 (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadUlt (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadWav (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadDSM (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadFAR (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadAMS (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadAMS2 (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadMDL (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadOKT (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadDMF (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadPTM (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadDBM (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadAMF (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadMT2 (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadPSM (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadJ2B (LPCBYTE lpStream, DWORD dwMemLength); - BOOL ReadUMX (LPCBYTE lpStream, DWORD dwMemLength); - - /* Save Functions */ + BOOL Create(LPCBYTE lpStream, DWORD dwMemLength=0); + BOOL Destroy(); + UINT GetType() const { return m_nType; } + UINT GetNumChannels() const; + UINT GetLogicalChannels() const { return m_nChannels; } + BOOL SetMasterVolume(UINT vol, BOOL bAdjustAGC=FALSE); + UINT GetMasterVolume() const { return m_nMasterVolume; } + UINT GetNumPatterns() const; + UINT GetNumInstruments() const; + UINT GetNumSamples() const { return m_nSamples; } + UINT GetCurrentPos() const; + UINT GetCurrentPattern() const { return m_nPattern; } + UINT GetCurrentOrder() const { return m_nCurrentPattern; } + UINT GetSongComments(LPSTR s, UINT cbsize, UINT linesize=32); + UINT GetRawSongComments(LPSTR s, UINT cbsize, UINT linesize=32); + UINT GetMaxPosition() const; + void SetCurrentPos(UINT nPos); + void SetCurrentOrder(UINT nOrder); + void GetTitle(LPSTR s) const { lstrcpyn(s,m_szNames[0],32); } + LPCSTR GetTitle() const { return m_szNames[0]; } + UINT GetSampleName(UINT nSample,LPSTR s=NULL) const; + UINT GetInstrumentName(UINT nInstr,LPSTR s=NULL) const; + UINT GetMusicSpeed() const { return m_nMusicSpeed; } + UINT GetMusicTempo() const { return m_nMusicTempo; } + DWORD GetLength(BOOL bAdjust, BOOL bTotal=FALSE); + DWORD GetSongTime() { return GetLength(FALSE, TRUE); } + void SetRepeatCount(int n) { m_nRepeatCount = n; m_nInitialRepeatCount = n; } + int GetRepeatCount() const { return m_nRepeatCount; } + BOOL IsPaused() const { return (m_dwSongFlags & SONG_PAUSED) ? TRUE : FALSE; } + void LoopPattern(int nPat, int nRow=0); + void CheckCPUUsage(UINT nCPU); + BOOL SetPatternName(UINT nPat, LPCSTR lpszName); + BOOL GetPatternName(UINT nPat, LPSTR lpszName, UINT cbSize=MAX_PATTERNNAME) const; + /* Module Loaders */ + BOOL ReadXM(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadS3M(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadMod(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadMed(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadMTM(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadSTM(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadIT(LPCBYTE lpStream, DWORD dwMemLength); + BOOL Read669(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadUlt(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadWav(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadDSM(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadFAR(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadAMS(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadAMS2(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadMDL(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadOKT(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadDMF(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadPTM(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadDBM(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadAMF(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadMT2(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadPSM(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadJ2B(LPCBYTE lpStream, DWORD dwMemLength); + BOOL ReadUMX(LPCBYTE lpStream, DWORD dwMemLength); + /* Save Functions */ #ifndef MODPLUG_NO_FILESAVE - UINT WriteSample (FILE * f, MODINSTRUMENT * pins, UINT nFlags, UINT nMaxLen = - 0); - BOOL SaveXM (LPCSTR lpszFileName, UINT nPacking = 0); - BOOL SaveS3M (LPCSTR lpszFileName, UINT nPacking = 0); - BOOL SaveMod (LPCSTR lpszFileName, UINT nPacking = 0); - BOOL SaveIT (LPCSTR lpszFileName, UINT nPacking = 0); + UINT WriteSample(FILE *f, MODINSTRUMENT *pins, UINT nFlags, UINT nMaxLen=0); + BOOL SaveXM(LPCSTR lpszFileName, UINT nPacking=0); + BOOL SaveS3M(LPCSTR lpszFileName, UINT nPacking=0); + BOOL SaveMod(LPCSTR lpszFileName, UINT nPacking=0); + BOOL SaveIT(LPCSTR lpszFileName, UINT nPacking=0); #endif /* MODPLUG_NO_FILESAVE */ - /* MOD Convert function */ - UINT GetBestSaveFormat () const; - UINT GetSaveFormats () const; - void ConvertModCommand (MODCOMMAND *) const; - void S3MConvert (MODCOMMAND * m, BOOL bIT) const; - void S3MSaveConvert (UINT * pcmd, UINT * pprm, BOOL bIT) const; - WORD ModSaveCommand (const MODCOMMAND * m, BOOL bXM) const; + /* MOD Convert function */ + UINT GetBestSaveFormat() const; + UINT GetSaveFormats() const; + void ConvertModCommand(MODCOMMAND *) const; + void S3MConvert(MODCOMMAND *m, BOOL bIT) const; + void S3MSaveConvert(UINT *pcmd, UINT *pprm, BOOL bIT) const; + WORD ModSaveCommand(const MODCOMMAND *m, BOOL bXM) const; public: - /* Real-time sound functions */ - VOID ResetChannels (); - - UINT Read (LPVOID lpBuffer, UINT cbBuffer); - UINT CreateStereoMix (int count); - BOOL FadeSong (UINT msec); - BOOL GlobalFadeSong (UINT msec); - UINT GetTotalTickCount () const - { - return m_nTotalCount; - } - VOID ResetTotalTickCount () - { - m_nTotalCount = 0; - } + /* Real-time sound functions */ + VOID ResetChannels(); -public: - /* Mixer Config */ - static BOOL InitPlayer (BOOL bReset = FALSE); - static BOOL SetWaveConfig (UINT nRate, UINT nBits, UINT nChannels, BOOL bMMX = - FALSE); - static BOOL SetResamplingMode (UINT nMode); /* SRCMODE_XXXX */ - static BOOL IsStereo () - { - return (gnChannels > 1) ? TRUE : FALSE; - } - static DWORD GetSampleRate () - { - return gdwMixingFreq; - } - static DWORD GetBitsPerSample () - { - return gnBitsPerSample; - } - static DWORD InitSysInfo (); - static DWORD GetSysInfo () - { - return gdwSysInfo; - } - /* AGC */ - static BOOL GetAGC () - { - return (gdwSoundSetup & SNDMIX_AGC) ? TRUE : FALSE; - } - static void SetAGC (BOOL b); - static void ResetAGC (); - static void ProcessAGC (int count); - - /*GCCFIX -- added these functions back in! */ - static BOOL SetWaveConfigEx (BOOL bSurround, BOOL bNoOverSampling, - BOOL bReverb, BOOL hqido, BOOL bMegaBass, BOOL bNR, BOOL bEQ); - /* DSP Effects */ - static void InitializeDSP (BOOL bReset); - static void ProcessStereoDSP (int count); - static void ProcessMonoDSP (int count); - - /* [Reverb level 0(quiet)-100(loud)], [delay in ms, usually 40-200ms] */ - static BOOL SetReverbParameters (UINT nDepth, UINT nDelay); - - /* [XBass level 0(quiet)-100(loud)], [cutoff in Hz 10-100] */ - static BOOL SetXBassParameters (UINT nDepth, UINT nRange); - - /* [Surround level 0(quiet)-100(heavy)] [delay in ms, usually 5-40ms] */ - static BOOL SetSurroundParameters (UINT nDepth, UINT nDelay); + UINT Read(LPVOID lpBuffer, UINT cbBuffer); + UINT CreateStereoMix(int count); + BOOL FadeSong(UINT msec); + BOOL GlobalFadeSong(UINT msec); + UINT GetTotalTickCount() const { return m_nTotalCount; } + VOID ResetTotalTickCount() { m_nTotalCount = 0; } public: - BOOL ReadNote (); - BOOL ProcessRow (); - BOOL ProcessEffects (); - UINT GetNNAChannel (UINT nChn) const; - void CheckNNA (UINT nChn, UINT instr, int note, BOOL bForceCut); - void NoteChange (UINT nChn, int note, BOOL bPorta = FALSE, BOOL bResetEnv = - TRUE); - void InstrumentChange (MODCHANNEL * pChn, UINT instr, BOOL bPorta = - FALSE, BOOL bUpdVol = TRUE, BOOL bResetEnv = TRUE); - /* Channel Effects */ - void PortamentoUp (MODCHANNEL * pChn, UINT param); - void PortamentoDown (MODCHANNEL * pChn, UINT param); - void FinePortamentoUp (MODCHANNEL * pChn, UINT param); - void FinePortamentoDown (MODCHANNEL * pChn, UINT param); - void ExtraFinePortamentoUp (MODCHANNEL * pChn, UINT param); - void ExtraFinePortamentoDown (MODCHANNEL * pChn, UINT param); - void TonePortamento (MODCHANNEL * pChn, UINT param); - void Vibrato (MODCHANNEL * pChn, UINT param); - void FineVibrato (MODCHANNEL * pChn, UINT param); - void VolumeSlide (MODCHANNEL * pChn, UINT param); - void PanningSlide (MODCHANNEL * pChn, UINT param); - void ChannelVolSlide (MODCHANNEL * pChn, UINT param); - void FineVolumeUp (MODCHANNEL * pChn, UINT param); - void FineVolumeDown (MODCHANNEL * pChn, UINT param); - void Tremolo (MODCHANNEL * pChn, UINT param); - void Panbrello (MODCHANNEL * pChn, UINT param); - void RetrigNote (UINT nChn, UINT param); - void NoteCut (UINT nChn, UINT nTick); - void KeyOff (UINT nChn); - int PatternLoop (MODCHANNEL *, UINT param); - void ExtendedMODCommands (UINT nChn, UINT param); - void ExtendedS3MCommands (UINT nChn, UINT param); - void ExtendedChannelEffect (MODCHANNEL *, UINT param); - void ProcessMidiMacro (UINT nChn, LPCSTR pszMidiMacro, UINT param = 0); - void SetupChannelFilter (MODCHANNEL * pChn, BOOL bReset, int flt_modifier = - 256) const; - /* Low-Level effect processing */ - void DoFreqSlide (MODCHANNEL * pChn, LONG nFreqSlide); - - /* Global Effects */ - void SetTempo (UINT param); - void SetSpeed (UINT param); - void GlobalVolSlide (UINT param); - DWORD IsSongFinished (UINT nOrder, UINT nRow) const; - BOOL IsValidBackwardJump (UINT nStartOrder, UINT nStartRow, UINT nJumpOrder, - UINT nJumpRow) const; - /* Read/Write sample functions */ - signed char GetDeltaValue (signed char prev, UINT n) const - { - return (signed char) (prev + CompressionTable[n & 0x0F]); - } - UINT PackSample (int &sample, int next); - BOOL CanPackSample (LPSTR pSample, UINT nLen, UINT nPacking, BYTE * result = - NULL); - UINT ReadSample (MODINSTRUMENT * pIns, UINT nFlags, LPCSTR pMemFile, - DWORD dwMemLength); - BOOL DestroySample (UINT nSample); - BOOL DestroyInstrument (UINT nInstr); - BOOL IsSampleUsed (UINT nSample); - BOOL IsInstrumentUsed (UINT nInstr); - BOOL RemoveInstrumentSamples (UINT nInstr); - UINT DetectUnusedSamples (BOOL *); - BOOL RemoveSelectedSamples (BOOL *); - void AdjustSampleLoop (MODINSTRUMENT * pIns); - - /* I/O from another sound file */ - BOOL ReadInstrumentFromSong (UINT nInstr, CSoundFile *, UINT nSrcInstrument); - BOOL ReadSampleFromSong (UINT nSample, CSoundFile *, UINT nSrcSample); - - /* Period/Note functions */ - UINT GetNoteFromPeriod (UINT period) const; - UINT GetPeriodFromNote (UINT note, int nFineTune, UINT nC4Speed) const; - UINT GetFreqFromPeriod (UINT period, UINT nC4Speed, int nPeriodFrac = - 0) const; - /* Misc functions */ - MODINSTRUMENT *GetSample (UINT n) - { - return Ins + n; - } - void ResetMidiCfg (); - UINT MapMidiInstrument (DWORD dwProgram, UINT nChannel, UINT nNote); - BOOL ITInstrToMPT (const void *p, INSTRUMENTHEADER * penv, UINT trkvers); - UINT SaveMixPlugins (FILE * f = NULL, BOOL bUpdate = TRUE); - UINT LoadMixPlugins (const void *pData, UINT nLen); - + /* Mixer Config */ + static BOOL InitPlayer(BOOL bReset=FALSE); + static BOOL SetWaveConfig(UINT nRate,UINT nBits,UINT nChannels,BOOL bMMX=FALSE); + static BOOL SetResamplingMode(UINT nMode); /* SRCMODE_XXXX */ + static BOOL IsStereo() { return (gnChannels > 1) ? TRUE : FALSE; } + static DWORD GetSampleRate() { return gdwMixingFreq; } + static DWORD GetBitsPerSample() { return gnBitsPerSample; } + static DWORD InitSysInfo(); + static DWORD GetSysInfo() { return gdwSysInfo; } + /* AGC */ + static BOOL GetAGC() { return (gdwSoundSetup & SNDMIX_AGC) ? TRUE : FALSE; } + static void SetAGC(BOOL b); + static void ResetAGC(); + static void ProcessAGC(int count); + + /*GCCFIX -- added these functions back in! */ + static BOOL SetWaveConfigEx(BOOL bSurround,BOOL bNoOverSampling,BOOL bReverb,BOOL hqido,BOOL bMegaBass,BOOL bNR,BOOL bEQ); + /* DSP Effects */ + static void InitializeDSP(BOOL bReset); + static void ProcessStereoDSP(int count); + static void ProcessMonoDSP(int count); + /* [Reverb level 0(quiet)-100(loud)], [delay in ms, usually 40-200ms] */ + static BOOL SetReverbParameters(UINT nDepth, UINT nDelay); + /* [XBass level 0(quiet)-100(loud)], [cutoff in Hz 10-100] */ + static BOOL SetXBassParameters(UINT nDepth, UINT nRange); + /* [Surround level 0(quiet)-100(heavy)] [delay in ms, usually 5-40ms] */ + static BOOL SetSurroundParameters(UINT nDepth, UINT nDelay); +public: + BOOL ReadNote(); + BOOL ProcessRow(); + BOOL ProcessEffects(); + UINT GetNNAChannel(UINT nChn) const; + void CheckNNA(UINT nChn, UINT instr, int note, BOOL bForceCut); + void NoteChange(UINT nChn, int note, BOOL bPorta=FALSE, BOOL bResetEnv=TRUE); + void InstrumentChange(MODCHANNEL *pChn, UINT instr, BOOL bPorta=FALSE,BOOL bUpdVol=TRUE,BOOL bResetEnv=TRUE); + /* Channel Effects */ + void PortamentoUp(MODCHANNEL *pChn, UINT param); + void PortamentoDown(MODCHANNEL *pChn, UINT param); + void FinePortamentoUp(MODCHANNEL *pChn, UINT param); + void FinePortamentoDown(MODCHANNEL *pChn, UINT param); + void ExtraFinePortamentoUp(MODCHANNEL *pChn, UINT param); + void ExtraFinePortamentoDown(MODCHANNEL *pChn, UINT param); + void TonePortamento(MODCHANNEL *pChn, UINT param); + void Vibrato(MODCHANNEL *pChn, UINT param); + void FineVibrato(MODCHANNEL *pChn, UINT param); + void VolumeSlide(MODCHANNEL *pChn, UINT param); + void PanningSlide(MODCHANNEL *pChn, UINT param); + void ChannelVolSlide(MODCHANNEL *pChn, UINT param); + void FineVolumeUp(MODCHANNEL *pChn, UINT param); + void FineVolumeDown(MODCHANNEL *pChn, UINT param); + void Tremolo(MODCHANNEL *pChn, UINT param); + void Panbrello(MODCHANNEL *pChn, UINT param); + void RetrigNote(UINT nChn, UINT param); + void NoteCut(UINT nChn, UINT nTick); + void KeyOff(UINT nChn); + int PatternLoop(MODCHANNEL *, UINT param); + void ExtendedMODCommands(UINT nChn, UINT param); + void ExtendedS3MCommands(UINT nChn, UINT param); + void ExtendedChannelEffect(MODCHANNEL *, UINT param); + void ProcessMidiMacro(UINT nChn, LPCSTR pszMidiMacro, UINT param=0); + void SetupChannelFilter(MODCHANNEL *pChn, BOOL bReset, int flt_modifier=256) const; + /* Low-Level effect processing */ + void DoFreqSlide(MODCHANNEL *pChn, LONG nFreqSlide); + /* Global Effects */ + void SetTempo(UINT param); + void SetSpeed(UINT param); + void GlobalVolSlide(UINT param); + DWORD IsSongFinished(UINT nOrder, UINT nRow) const; + BOOL IsValidBackwardJump(UINT nStartOrder, UINT nStartRow, UINT nJumpOrder, UINT nJumpRow) const; + /* Read/Write sample functions */ + signed char GetDeltaValue(signed char prev, UINT n) const { return (signed char)(prev + CompressionTable[n & 0x0F]); } + UINT PackSample(int &sample, int next); + BOOL CanPackSample(LPSTR pSample, UINT nLen, UINT nPacking, BYTE *result=NULL); + UINT ReadSample(MODINSTRUMENT *pIns, UINT nFlags, LPCSTR pMemFile, DWORD dwMemLength); + BOOL DestroySample(UINT nSample); + BOOL DestroyInstrument(UINT nInstr); + BOOL IsSampleUsed(UINT nSample); + BOOL IsInstrumentUsed(UINT nInstr); + BOOL RemoveInstrumentSamples(UINT nInstr); + UINT DetectUnusedSamples(BOOL *); + BOOL RemoveSelectedSamples(BOOL *); + void AdjustSampleLoop(MODINSTRUMENT *pIns); + /* I/O from another sound file */ + BOOL ReadInstrumentFromSong(UINT nInstr, CSoundFile *, UINT nSrcInstrument); + BOOL ReadSampleFromSong(UINT nSample, CSoundFile *, UINT nSrcSample); + /* Period/Note functions */ + UINT GetNoteFromPeriod(UINT period) const; + UINT GetPeriodFromNote(UINT note, int nFineTune, UINT nC4Speed) const; + UINT GetFreqFromPeriod(UINT period, UINT nC4Speed, int nPeriodFrac=0) const; + /* Misc functions */ + MODINSTRUMENT *GetSample(UINT n) { return Ins+n; } + void ResetMidiCfg(); + UINT MapMidiInstrument(DWORD dwProgram, UINT nChannel, UINT nNote); + BOOL ITInstrToMPT(const void *p, INSTRUMENTHEADER *penv, UINT trkvers); + UINT SaveMixPlugins(FILE *f=NULL, BOOL bUpdate=TRUE); + UINT LoadMixPlugins(const void *pData, UINT nLen); #ifndef NO_FILTER - DWORD CutOffToFrequency (UINT nCutOff, int flt_modifier = 256) const; /* [0-255] => [1-10KHz] */ + DWORD CutOffToFrequency(UINT nCutOff, int flt_modifier=256) const; /* [0-255] => [1-10KHz] */ #endif - /* Static helper functions */ + /* Static helper functions */ public: - static DWORD TransposeToFrequency (int transp, int ftune = 0); - static int FrequencyToTranspose (DWORD freq); - static void FrequencyToTranspose (MODINSTRUMENT * psmp); + static DWORD TransposeToFrequency(int transp, int ftune=0); + static int FrequencyToTranspose(DWORD freq); + static void FrequencyToTranspose(MODINSTRUMENT *psmp); - /* System-Dependant functions */ + /* System-Dependant functions */ public: - static MODCOMMAND *AllocatePattern (UINT rows, UINT nchns); - static signed char *AllocateSample (UINT nbytes); - static void FreePattern (LPVOID pat); - static void FreeSample (LPVOID p); - static UINT Normalize24BitBuffer (LPBYTE pbuffer, UINT cbsizebytes, - DWORD lmax24, DWORD dwByteInc); + static MODCOMMAND *AllocatePattern(UINT rows, UINT nchns); + static signed char* AllocateSample(UINT nbytes); + static void FreePattern(LPVOID pat); + static void FreeSample(LPVOID p); + static UINT Normalize24BitBuffer(LPBYTE pbuffer, UINT cbsizebytes, DWORD lmax24, DWORD dwByteInc); }; @@ -908,88 +812,88 @@ public: typedef struct WAVEFILEHEADER { - DWORD id_RIFF; /* "RIFF" */ - DWORD filesize; /* file length-8 */ - DWORD id_WAVE; + DWORD id_RIFF; /* "RIFF" */ + DWORD filesize; /* file length-8 */ + DWORD id_WAVE; } WAVEFILEHEADER; typedef struct WAVEFORMATHEADER { - DWORD id_fmt; /* "fmt " */ - DWORD hdrlen; /* 16 */ - WORD format; /* 1 */ - WORD channels; /* 1:mono, 2:stereo */ - DWORD freqHz; /* sampling freq */ - DWORD bytessec; /* bytes/sec=freqHz*samplesize */ - WORD samplesize; /* sizeof(sample) */ - WORD bitspersample; /* bits per sample (8/16) */ + DWORD id_fmt; /* "fmt " */ + DWORD hdrlen; /* 16 */ + WORD format; /* 1 */ + WORD channels; /* 1:mono, 2:stereo */ + DWORD freqHz; /* sampling freq */ + DWORD bytessec; /* bytes/sec=freqHz*samplesize */ + WORD samplesize; /* sizeof(sample) */ + WORD bitspersample; /* bits per sample (8/16) */ } WAVEFORMATHEADER; typedef struct WAVEDATAHEADER { - DWORD id_data; /* "data" */ - DWORD length; /* length of data */ + DWORD id_data; /* "data" */ + DWORD length; /* length of data */ } WAVEDATAHEADER; typedef struct WAVESMPLHEADER { - /* SMPL */ - DWORD smpl_id; /* "smpl" -> 0x6C706D73 */ - DWORD smpl_len; /* length of smpl: 3Ch (54h with sustain loop) */ - DWORD dwManufacturer; - DWORD dwProduct; - DWORD dwSamplePeriod; /* 1000000000/freqHz */ - DWORD dwBaseNote; /* 3Ch = C-4 -> 60 + RelativeTone */ - DWORD dwPitchFraction; - DWORD dwSMPTEFormat; - DWORD dwSMPTEOffset; - DWORD dwSampleLoops; /* number of loops */ - DWORD cbSamplerData; + /* SMPL */ + DWORD smpl_id; /* "smpl" -> 0x6C706D73 */ + DWORD smpl_len; /* length of smpl: 3Ch (54h with sustain loop) */ + DWORD dwManufacturer; + DWORD dwProduct; + DWORD dwSamplePeriod; /* 1000000000/freqHz */ + DWORD dwBaseNote; /* 3Ch = C-4 -> 60 + RelativeTone */ + DWORD dwPitchFraction; + DWORD dwSMPTEFormat; + DWORD dwSMPTEOffset; + DWORD dwSampleLoops; /* number of loops */ + DWORD cbSamplerData; } WAVESMPLHEADER; typedef struct SAMPLELOOPSTRUCT { - DWORD dwIdentifier; - DWORD dwLoopType; /* 0=normal, 1=bidi */ - DWORD dwLoopStart; - DWORD dwLoopEnd; /* Byte offset ? */ - DWORD dwFraction; - DWORD dwPlayCount; /* Loop Count, 0=infinite */ + DWORD dwIdentifier; + DWORD dwLoopType; /* 0=normal, 1=bidi */ + DWORD dwLoopStart; + DWORD dwLoopEnd; /* Byte offset ? */ + DWORD dwFraction; + DWORD dwPlayCount; /* Loop Count, 0=infinite */ } SAMPLELOOPSTRUCT; typedef struct WAVESAMPLERINFO { - WAVESMPLHEADER wsiHdr; - SAMPLELOOPSTRUCT wsiLoops[2]; + WAVESMPLHEADER wsiHdr; + SAMPLELOOPSTRUCT wsiLoops[2]; } WAVESAMPLERINFO; typedef struct WAVELISTHEADER { - DWORD list_id; /* "LIST" -> 0x5453494C */ - DWORD list_len; - DWORD info; /* "INFO" */ + DWORD list_id; /* "LIST" -> 0x5453494C */ + DWORD list_len; + DWORD info; /* "INFO" */ } WAVELISTHEADER; typedef struct WAVEEXTRAHEADER { - DWORD xtra_id; /* "xtra" -> 0x61727478 */ - DWORD xtra_len; - DWORD dwFlags; - WORD wPan; - WORD wVolume; - WORD wGlobalVol; - WORD wReserved; - BYTE nVibType; - BYTE nVibSweep; - BYTE nVibDepth; - BYTE nVibRate; + DWORD xtra_id; /* "xtra" -> 0x61727478 */ + DWORD xtra_len; + DWORD dwFlags; + WORD wPan; + WORD wVolume; + WORD wGlobalVol; + WORD wReserved; + BYTE nVibType; + BYTE nVibSweep; + BYTE nVibDepth; + BYTE nVibRate; } WAVEEXTRAHEADER; #pragma pack() @@ -1019,8 +923,8 @@ typedef struct WAVEEXTRAHEADER #define MOD2XMFineTune(k) ((int)( (signed char)((k)<<4) )) #define XM2MODFineTune(k) ((int)( (k>>4)&0x0f )) -int _muldiv (long a, long b, long c); -int _muldivr (long a, long b, long c); +int _muldiv(long a, long b, long c); +int _muldivr(long a, long b, long c); /* Byte swapping functions from the GNU C Library and libsdl */ @@ -1050,8 +954,8 @@ bswap_16 (unsigned short int __bsx) static inline unsigned int bswap_32 (unsigned int __bsx) { - return ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) | - (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24)); + return ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) | + (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24)); } #endif diff --git a/gst/modplug/libmodplug/stdafx.h b/gst/modplug/libmodplug/stdafx.h index 76b8f67f..dc71ea8f 100644 --- a/gst/modplug/libmodplug/stdafx.h +++ b/gst/modplug/libmodplug/stdafx.h @@ -19,10 +19,7 @@ #include <mmsystem.h> #include <stdio.h> -inline void -ProcessPlugins (int n) -{ -} +inline void ProcessPlugins(int n) {} #else @@ -32,7 +29,7 @@ ProcessPlugins (int n) typedef signed char CHAR; typedef unsigned char UCHAR; -typedef unsigned char *PUCHAR; +typedef unsigned char* PUCHAR; typedef unsigned short USHORT; typedef unsigned long ULONG; typedef unsigned long UINT; @@ -40,24 +37,23 @@ typedef unsigned long DWORD; typedef long LONG; typedef unsigned short WORD; typedef unsigned char BYTE; -typedef unsigned char *LPBYTE; +typedef unsigned char * LPBYTE; typedef bool BOOL; -typedef char *LPSTR; -typedef void *LPVOID; -typedef long *LPLONG; -typedef unsigned long *LPDWORD; -typedef unsigned short *LPWORD; -typedef const char *LPCSTR; +typedef char * LPSTR; +typedef void * LPVOID; +typedef long * LPLONG; +typedef unsigned long * LPDWORD; +typedef unsigned short * LPWORD; +typedef const char * LPCSTR; typedef long long LONGLONG; -typedef void *PVOID; +typedef void * PVOID; typedef void VOID; -inline LONG -MulDiv (long a, long b, long c) +inline LONG MulDiv (long a, long b, long c) { /* if (!c) return 0; */ - return ((unsigned long long) a * (unsigned long long) b) / c; + return ((unsigned long long) a * (unsigned long long) b ) / c; } #define MODPLUG_NO_FILESAVE @@ -71,20 +67,15 @@ MulDiv (long a, long b, long c) #define GHND 0 -inline signed char * -GlobalAllocPtr (unsigned int, size_t size) +inline signed char * GlobalAllocPtr(unsigned int, size_t size) { - signed char *p = (signed char *) malloc (size); + signed char * p = (signed char *) malloc(size); - if (p != NULL) - memset (p, 0, size); + if (p != NULL) memset(p, 0, size); return p; } -inline void -ProcessPlugins (int n) -{ -} +inline void ProcessPlugins(int n) {} #define GlobalFreePtr(p) free((void *)(p)) @@ -102,3 +93,6 @@ ProcessPlugins (int n) #endif /* MSC_VER */ #endif + + + diff --git a/gst/mpeg1sys/buffer.h b/gst/mpeg1sys/buffer.h index 2a9fb71f..0624c3aa 100644 --- a/gst/mpeg1sys/buffer.h +++ b/gst/mpeg1sys/buffer.h @@ -24,9 +24,8 @@ #include <gst/gst.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define MPEG1MUX_BUFFER_QUEUED(mb) (g_list_length((mb)->timecode_list)) #define MPEG1MUX_BUFFER_SPACE(mb) ((mb)->length) @@ -42,104 +41,101 @@ extern "C" #define FRAME_TYPE_PFRAME 3 #define FRAME_TYPE_AUDIO 4 - typedef struct _Mpeg1MuxBuffer Mpeg1MuxBuffer; - typedef struct _Mpeg1MuxTimecode Mpeg1MuxTimecode; - - typedef struct video_struc /* Informationen ueber Video Stream */ - { - unsigned int stream_length; - unsigned int num_sequence; - unsigned int num_seq_end; - unsigned int num_pictures; - unsigned int num_groups; - unsigned int num_frames[4]; - unsigned int avg_frames[4]; - - unsigned int horizontal_size; - unsigned int vertical_size; - unsigned int aspect_ratio; - unsigned int picture_rate; - unsigned int bit_rate; - unsigned int comp_bit_rate; - unsigned int vbv_buffer_size; - unsigned int CSPF; - - guint64 PTS; - guint64 DTS; - - guint64 current_PTS; - guint64 current_DTS; - guchar current_type; - - double secs_per_frame; - gulong group_order, decoding_order; - } Video_struc; - - typedef struct audio_struc /* Informationen ueber Audio Stream */ - { - unsigned int stream_length; - unsigned int num_syncword; - unsigned int num_frames[2]; - unsigned int framesize; - unsigned int layer; - unsigned int protection; - unsigned int bit_rate; - unsigned int frequency; - unsigned int mode; - unsigned int mode_extension; - unsigned int copyright; - unsigned int original_copy; - unsigned int emphasis; - - guint64 PTS; - - guint64 current_PTS; - - double samples_per_second; - gulong decoding_order; - } Audio_struc; - - struct _Mpeg1MuxTimecode - { - gulong length; - gulong original_length; - guchar frame_type; - guint64 PTS; - guint64 DTS; - }; - - struct _Mpeg1MuxBuffer - { - unsigned char *buffer; - gulong length; - gulong base; - gulong scan_pos; - gulong last_pos; - gulong current_start; - guchar buffer_type; - guchar stream_id; - gboolean new_frame; - guint64 next_frame_time; - - union - { - Video_struc video; - Audio_struc audio; - } info; - - GList *timecode_list; - GList *queued_list; - }; - - Mpeg1MuxBuffer *mpeg1mux_buffer_new (guchar type, guchar id); - - void mpeg1mux_buffer_queue (Mpeg1MuxBuffer * mb, GstBuffer * buf); - void mpeg1mux_buffer_shrink (Mpeg1MuxBuffer * mb, gulong size); - gulong mpeg1mux_buffer_update_queued (Mpeg1MuxBuffer * mb, guint64 scr); +typedef struct _Mpeg1MuxBuffer Mpeg1MuxBuffer; +typedef struct _Mpeg1MuxTimecode Mpeg1MuxTimecode; + +typedef struct video_struc /* Informationen ueber Video Stream */ +{ + unsigned int stream_length ; + unsigned int num_sequence ; + unsigned int num_seq_end ; + unsigned int num_pictures ; + unsigned int num_groups ; + unsigned int num_frames[4] ; + unsigned int avg_frames[4] ; + + unsigned int horizontal_size; + unsigned int vertical_size ; + unsigned int aspect_ratio ; + unsigned int picture_rate ; + unsigned int bit_rate ; + unsigned int comp_bit_rate ; + unsigned int vbv_buffer_size; + unsigned int CSPF ; + + guint64 PTS; + guint64 DTS; + + guint64 current_PTS; + guint64 current_DTS; + guchar current_type; + + double secs_per_frame; + gulong group_order, decoding_order; +} Video_struc; + +typedef struct audio_struc /* Informationen ueber Audio Stream */ +{ + unsigned int stream_length ; + unsigned int num_syncword ; + unsigned int num_frames [2] ; + unsigned int framesize ; + unsigned int layer ; + unsigned int protection ; + unsigned int bit_rate ; + unsigned int frequency ; + unsigned int mode ; + unsigned int mode_extension ; + unsigned int copyright ; + unsigned int original_copy ; + unsigned int emphasis ; + + guint64 PTS; + + guint64 current_PTS; + + double samples_per_second; + gulong decoding_order; +} Audio_struc; + +struct _Mpeg1MuxTimecode { + gulong length; + gulong original_length; + guchar frame_type; + guint64 PTS; + guint64 DTS; +}; + +struct _Mpeg1MuxBuffer { + unsigned char *buffer; + gulong length; + gulong base; + gulong scan_pos; + gulong last_pos; + gulong current_start; + guchar buffer_type; + guchar stream_id; + gboolean new_frame; + guint64 next_frame_time; + + union { + Video_struc video; + Audio_struc audio; + } info; + + GList *timecode_list; + GList *queued_list; +}; + +Mpeg1MuxBuffer *mpeg1mux_buffer_new(guchar type, guchar id); + +void mpeg1mux_buffer_queue(Mpeg1MuxBuffer *mb, GstBuffer *buf); +void mpeg1mux_buffer_shrink(Mpeg1MuxBuffer *mb, gulong size); +gulong mpeg1mux_buffer_update_queued(Mpeg1MuxBuffer *mb, guint64 scr); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __BUFFER_H__ */ +#endif /* __BUFFER_H__ */ diff --git a/gst/mpeg1sys/gstmpeg1systemencode.h b/gst/mpeg1sys/gstmpeg1systemencode.h index 0580cedc..44555332 100644 --- a/gst/mpeg1sys/gstmpeg1systemencode.h +++ b/gst/mpeg1sys/gstmpeg1systemencode.h @@ -29,9 +29,8 @@ #include "main.h" #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_SYSTEM_ENCODE \ @@ -45,68 +44,66 @@ extern "C" #define GST_IS_SYSTEM_ENCODE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SYSTEM_ENCODE)) - typedef struct _GstMPEG1SystemEncode GstMPEG1SystemEncode; - typedef struct _GstMPEG1SystemEncodeClass GstMPEG1SystemEncodeClass; +typedef struct _GstMPEG1SystemEncode GstMPEG1SystemEncode; +typedef struct _GstMPEG1SystemEncodeClass GstMPEG1SystemEncodeClass; - struct _GstMPEG1SystemEncode - { - GstElement element; +struct _GstMPEG1SystemEncode { + GstElement element; - GstPad *srcpad; + GstPad *srcpad; - gboolean have_setup; + gboolean have_setup; - GMutex *lock; + GMutex *lock; - guint num_audio_pads; - guint num_video_pads; + guint num_audio_pads; + guint num_video_pads; - Mpeg1MuxBuffer *audio_buffer; - Mpeg1MuxBuffer *video_buffer; + Mpeg1MuxBuffer *audio_buffer; + Mpeg1MuxBuffer *video_buffer; - Pack_struc *pack; - Sys_header_struc *sys_header; - Sector_struc *sector; + Pack_struc *pack; + Sys_header_struc *sys_header; + Sector_struc *sector; - guint data_rate, video_rate, audio_rate; - gdouble delay, audio_delay, video_delay; - gdouble clock_cycles; - gulong sectors_delay, video_delay_ms, audio_delay_ms; - gulong startup_delay; - gulong audio_buffer_size; - gulong video_buffer_size; - gulong mux_rate, dmux_rate; - guint64 SCR; - gint which_streams; + guint data_rate, video_rate, audio_rate; + gdouble delay, audio_delay, video_delay; + gdouble clock_cycles; + gulong sectors_delay, video_delay_ms, audio_delay_ms; + gulong startup_delay; + gulong audio_buffer_size; + gulong video_buffer_size; + gulong mux_rate, dmux_rate; + guint64 SCR; + gint which_streams; - gint current_pack; - gulong min_packet_data; - gulong max_packet_data; - gint packets_per_pack; - gulong packet_size; - gulong bytes_output; + gint current_pack; + gulong min_packet_data; + gulong max_packet_data; + gint packets_per_pack; + gulong packet_size; + gulong bytes_output; - GList *mta; + GList *mta; - /* stream input pads */ - GstPad *private_1_pad[8]; /* up to 8 ac3 audio tracks <grumble> */ - GstPad *private_2_pad; - GstPad *video_pad[16]; - GstPad *audio_pad[32]; - }; + /* stream input pads */ + GstPad *private_1_pad[8]; /* up to 8 ac3 audio tracks <grumble> */ + GstPad *private_2_pad; + GstPad *video_pad[16]; + GstPad *audio_pad[32]; +}; - struct _GstMPEG1SystemEncodeClass - { - GstElementClass parent_class; - }; +struct _GstMPEG1SystemEncodeClass { + GstElementClass parent_class; +}; - GType gst_mpeg1_system_encode_get_type (void); +GType gst_mpeg1_system_encode_get_type(void); /* multplex.c */ #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __SYSTEM_ENCODE_H__ */ +#endif /* __SYSTEM_ENCODE_H__ */ diff --git a/gst/mpeg1sys/main.h b/gst/mpeg1sys/main.h index c09fc41b..434f57f5 100644 --- a/gst/mpeg1sys/main.h +++ b/gst/mpeg1sys/main.h @@ -45,82 +45,79 @@ #define ISO11172_END 0x000001b9 #define PACKET_START 0x000001 -#define CLOCKS 90000.0 /* System Clock Hertz */ +#define CLOCKS 90000.0 /* System Clock Hertz */ -#define AFTER_PACKET_LENGTH 15 /* No of non-data-bytes */ - /* following the packet */ - /* length field */ -#define LAST_SCR_BYTE_IN_PACK 9 /* No of bytes in pack */ - /* preceding, and */ - /* including, the SCR */ +#define AFTER_PACKET_LENGTH 15 /* No of non-data-bytes */ + /* following the packet */ + /* length field */ +#define LAST_SCR_BYTE_IN_PACK 9 /* No of bytes in pack */ + /* preceding, and */ + /* including, the SCR */ /* The following values for sys_header_length & size are only valid for */ /* System streams consisting of two basic streams. When wrapping around */ /* the system layer on a single video or a single audio stream, those */ /* values get decreased by 3. */ -#define SYS_HEADER_LENGTH 12 /* length of Sys Header */ - /* after start code and */ - /* length field */ +#define SYS_HEADER_LENGTH 12 /* length of Sys Header */ + /* after start code and */ + /* length field */ -#define SYS_HEADER_SIZE 18 /* incl. start code and */ - /* length field */ +#define SYS_HEADER_SIZE 18 /* incl. start code and */ + /* length field */ #define PACK_HEADER_SIZE 12 #define PACKET_HEADER_SIZE 6 -#define MAX_SECTOR_SIZE 0x20000 /* Max Sektor Groesse */ +#define MAX_SECTOR_SIZE 0x20000 /* Max Sektor Groesse */ #define STREAMS_VIDEO 1 #define STREAMS_AUDIO 2 #define STREAMS_BOTH 3 -#define AUDIO_STREAMS 0xb8 /* Marker Audio Streams */ -#define VIDEO_STREAMS 0xb9 /* Marker Video Streams */ -#define AUDIO_STR_0 0xc0 /* Marker Audio Stream0 */ -#define VIDEO_STR_0 0xe0 /* Marker Video Stream0 */ -#define PADDING_STR 0xbe /* Marker Padding Stream */ +#define AUDIO_STREAMS 0xb8 /* Marker Audio Streams */ +#define VIDEO_STREAMS 0xb9 /* Marker Video Streams */ +#define AUDIO_STR_0 0xc0 /* Marker Audio Stream0 */ +#define VIDEO_STR_0 0xe0 /* Marker Video Stream0 */ +#define PADDING_STR 0xbe /* Marker Padding Stream*/ #define ZERO_STUFFING_BYTE 0 #define STUFFING_BYTE 0xff #define RESERVED_BYTE 0xff -#define TIMESTAMPS_NO 0 /* Flag NO timestamps */ -#define TIMESTAMPS_PTS 1 /* Flag PTS timestamp */ -#define TIMESTAMPS_PTS_DTS 2 /* Flag BOTH timestamps */ +#define TIMESTAMPS_NO 0 /* Flag NO timestamps */ +#define TIMESTAMPS_PTS 1 /* Flag PTS timestamp */ +#define TIMESTAMPS_PTS_DTS 2 /* Flag BOTH timestamps */ -#define MARKER_SCR 2 /* Marker SCR */ -#define MARKER_JUST_PTS 2 /* Marker only PTS */ -#define MARKER_PTS 3 /* Marker PTS */ -#define MARKER_DTS 1 /* Marker DTS */ -#define MARKER_NO_TIMESTAMPS 0x0f /* Marker NO timestamps */ +#define MARKER_SCR 2 /* Marker SCR */ +#define MARKER_JUST_PTS 2 /* Marker only PTS */ +#define MARKER_PTS 3 /* Marker PTS */ +#define MARKER_DTS 1 /* Marker DTS */ +#define MARKER_NO_TIMESTAMPS 0x0f /* Marker NO timestamps */ -#define STATUS_AUDIO_END 0 /* Statusmessage A end */ -#define STATUS_VIDEO_END 1 /* Statusmessage V end */ -#define STATUS_AUDIO_TIME_OUT 2 /* Statusmessage A out */ -#define STATUS_VIDEO_TIME_OUT 3 /* Statusmessage V out */ +#define STATUS_AUDIO_END 0 /* Statusmessage A end */ +#define STATUS_VIDEO_END 1 /* Statusmessage V end */ +#define STATUS_AUDIO_TIME_OUT 2 /* Statusmessage A out */ +#define STATUS_VIDEO_TIME_OUT 3 /* Statusmessage V out */ /************************************************************************* Typ- und Strukturdefinitionen *************************************************************************/ -typedef struct sector_struc /* A sector, can contain pack, sys header */ - /* and packet. */ -{ - unsigned char buf[MAX_SECTOR_SIZE]; - unsigned int length_of_sector; - unsigned int length_of_packet_data; - guint64 TS; +typedef struct sector_struc /* A sector, can contain pack, sys header */ + /* and packet. */ +{ unsigned char buf [MAX_SECTOR_SIZE] ; + unsigned int length_of_sector ; + unsigned int length_of_packet_data ; + guint64 TS ; } Sector_struc; -typedef struct pack_struc /* Pack Info */ -{ - unsigned char buf[PACK_HEADER_SIZE]; - guint64 SCR; +typedef struct pack_struc /* Pack Info */ +{ unsigned char buf [PACK_HEADER_SIZE]; + guint64 SCR; } Pack_struc; -typedef struct sys_header_struc /* System Header Info */ -{ - unsigned char buf[SYS_HEADER_SIZE]; +typedef struct sys_header_struc /* System Header Info */ +{ unsigned char buf [SYS_HEADER_SIZE]; } Sys_header_struc; /************************************************************************* @@ -128,20 +125,16 @@ typedef struct sys_header_struc /* System Header Info */ *************************************************************************/ /* systems.c */ -void create_sector (Sector_struc * sector, Pack_struc * pack, - Sys_header_struc * sys_header, unsigned int packet_size, - unsigned char *inputbuffer, unsigned char type, unsigned char buffer_scale, - unsigned int buffer_size, unsigned char buffers, guint64 PTS, guint64 DTS, - unsigned char timestamps, unsigned int which_streams); - -void create_pack (Pack_struc * pack, guint64 SCR, unsigned int mux_rate); - -void create_sys_header (Sys_header_struc * sys_header, unsigned int rate_bound, - unsigned char audio_bound, unsigned char fixed, unsigned char CSPS, - unsigned char audio_lock, unsigned char video_lock, - unsigned char video_bound, unsigned char stream1, - unsigned char buffer1_scale, unsigned int buffer1_size, - unsigned char stream2, unsigned char buffer2_scale, - unsigned int buffer2_size, unsigned int which_streams); +void create_sector (Sector_struc *sector, Pack_struc *pack, Sys_header_struc *sys_header, + unsigned int packet_size, unsigned char *inputbuffer, unsigned char type, unsigned char buffer_scale, + unsigned int buffer_size, unsigned char buffers, guint64 PTS, guint64 DTS, + unsigned char timestamps, unsigned int which_streams); + +void create_pack (Pack_struc *pack, guint64 SCR, unsigned int mux_rate); + +void create_sys_header (Sys_header_struc *sys_header, unsigned int rate_bound, unsigned char audio_bound, + unsigned char fixed, unsigned char CSPS, unsigned char audio_lock, unsigned char video_lock, + unsigned char video_bound, unsigned char stream1, unsigned char buffer1_scale, unsigned int buffer1_size, + unsigned char stream2, unsigned char buffer2_scale, unsigned int buffer2_size, unsigned int which_streams); #endif diff --git a/gst/mpeg1videoparse/gstmp1videoparse.h b/gst/mpeg1videoparse/gstmp1videoparse.h index 0fb4f161..b8b4f016 100644 --- a/gst/mpeg1videoparse/gstmp1videoparse.h +++ b/gst/mpeg1videoparse/gstmp1videoparse.h @@ -26,9 +26,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_MP1VIDEOPARSE \ @@ -42,37 +41,35 @@ extern "C" #define GST_IS_MP1VIDEOPARSE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MP1VIDEOPARSE)) - typedef struct _Mp1VideoParse Mp1VideoParse; - typedef struct _Mp1VideoParseClass Mp1VideoParseClass; +typedef struct _Mp1VideoParse Mp1VideoParse; +typedef struct _Mp1VideoParseClass Mp1VideoParseClass; - struct _Mp1VideoParse - { - GstElement element; +struct _Mp1VideoParse { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - GstBuffer *partialbuf; /* previous buffer (if carryover) */ - gulong next_buffer_offset; - gboolean need_resync; - gboolean in_flush; - guint64 last_pts; - gint picture_in_buffer; + GstBuffer *partialbuf; /* previous buffer (if carryover) */ + gulong next_buffer_offset; + gboolean need_resync; + gboolean in_flush; + guint64 last_pts; + gint picture_in_buffer; - gint width, height; - gfloat fps, asr; - }; + gint width, height; + gfloat fps, asr; +}; - struct _Mp1VideoParseClass - { - GstElementClass parent_class; - }; +struct _Mp1VideoParseClass { + GstElementClass parent_class; +}; - GType gst_mp1videoparse_get_type (void); +GType gst_mp1videoparse_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __MP1VIDEOPARSE_H__ */ +#endif /* __MP1VIDEOPARSE_H__ */ diff --git a/gst/mpeg2sub/gstmpeg2subt.h b/gst/mpeg2sub/gstmpeg2subt.h index 5cde7058..29f60b27 100644 --- a/gst/mpeg2sub/gstmpeg2subt.h +++ b/gst/mpeg2sub/gstmpeg2subt.h @@ -26,9 +26,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_MPEG2SUBT \ @@ -42,43 +41,41 @@ extern "C" #define GST_IS_MPEG2SUBT_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MPEG2SUBT)) - typedef struct _GstMpeg2Subt GstMpeg2Subt; - typedef struct _GstMpeg2SubtClass GstMpeg2SubtClass; +typedef struct _GstMpeg2Subt GstMpeg2Subt; +typedef struct _GstMpeg2SubtClass GstMpeg2SubtClass; - struct _GstMpeg2Subt - { - GstElement element; +struct _GstMpeg2Subt { + GstElement element; - GstPad *videopad, *subtitlepad, *srcpad; + GstPad *videopad,*subtitlepad,*srcpad; - GstBuffer *partialbuf; /* previous buffer (if carryover) */ + GstBuffer *partialbuf; /* previous buffer (if carryover) */ - gboolean have_title; + gboolean have_title; - guint16 packet_size; - guint16 data_size; + guint16 packet_size; + guint16 data_size; - gint offset[2]; - guchar color[5]; - guchar trans[4]; + gint offset[2]; + guchar color[5]; + guchar trans[4]; - guint duration; + guint duration; - gint width, height; + gint width, height; - }; +}; - struct _GstMpeg2SubtClass - { - GstElementClass parent_class; - }; +struct _GstMpeg2SubtClass { + GstElementClass parent_class; +}; - GType gst_mpeg2subt_get_type (void); +GType gst_mpeg2subt_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_MPEG2SUBT_H__ */ +#endif /* __GST_MPEG2SUBT_H__ */ diff --git a/gst/mpegaudioparse/gstmpegaudioparse.h b/gst/mpegaudioparse/gstmpegaudioparse.h index 812a6d56..ce8121a0 100644 --- a/gst/mpegaudioparse/gstmpegaudioparse.h +++ b/gst/mpegaudioparse/gstmpegaudioparse.h @@ -26,9 +26,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_MP3PARSE \ @@ -42,33 +41,31 @@ extern "C" #define GST_IS_MP3PARSE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MP3PARSE)) - typedef struct _GstMPEGAudioParse GstMPEGAudioParse; - typedef struct _GstMPEGAudioParseClass GstMPEGAudioParseClass; +typedef struct _GstMPEGAudioParse GstMPEGAudioParse; +typedef struct _GstMPEGAudioParseClass GstMPEGAudioParseClass; - struct _GstMPEGAudioParse - { - GstElement element; +struct _GstMPEGAudioParse { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - GstBuffer *partialbuf; /* previous buffer (if carryover) */ - guint skip; /* number of frames to skip */ - guint bit_rate; - gint channels, rate, layer; - gboolean in_flush; - }; + GstBuffer *partialbuf; /* previous buffer (if carryover) */ + guint skip; /* number of frames to skip */ + guint bit_rate; + gint channels, rate, layer; + gboolean in_flush; +}; - struct _GstMPEGAudioParseClass - { - GstElementClass parent_class; - }; +struct _GstMPEGAudioParseClass { + GstElementClass parent_class; +}; - GType gst_mp3parse_get_type (void); +GType gst_mp3parse_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __MP3PARSE_H__ */ +#endif /* __MP3PARSE_H__ */ diff --git a/gst/overlay/gstoverlay.h b/gst/overlay/gstoverlay.h index 377a2590..523656e0 100644 --- a/gst/overlay/gstoverlay.h +++ b/gst/overlay/gstoverlay.h @@ -37,32 +37,30 @@ typedef struct _GstOverlay GstOverlay; typedef struct _GstOverlayClass GstOverlayClass; -struct _GstOverlay -{ - GstElement element; +struct _GstOverlay { + GstElement element; - GstPad *srcpad; - GstPad *sinkpad1; - GstPad *sinkpad2; - GstPad *sinkpad3; + GstPad *srcpad; + GstPad *sinkpad1; + GstPad *sinkpad2; + GstPad *sinkpad3; - gint format; - gint width; - gint height; + gint format; + gint width; + gint height; - gint duration; - gint position; + gint duration; + gint position; - gint type; - gint fps; - gint border; - gint depth; + gint type; + gint fps; + gint border; + gint depth; - gdouble framerate; + gdouble framerate; }; -struct _GstOverlayClass -{ +struct _GstOverlayClass { GstElementClass parent_class; }; diff --git a/gst/passthrough/gstpassthrough.h b/gst/passthrough/gstpassthrough.h index c8da5dea..0b6f9d58 100644 --- a/gst/passthrough/gstpassthrough.h +++ b/gst/passthrough/gstpassthrough.h @@ -25,6 +25,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_PASSTHROUGH \ (gst_passthrough_get_type()) #define GST_PASSTHROUGH(obj) \ @@ -35,18 +36,17 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PASSTHROUGH)) #define GST_IS_PASSTHROUGH_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PASSTHROUGH)) + typedef struct _GstPassthrough GstPassthrough; typedef struct _GstPassthroughClass GstPassthroughClass; -typedef enum _GstPassthroughFormat GstPassthroughFormat; +typedef enum _GstPassthroughFormat GstPassthroughFormat; -enum _GstPassthroughFormat -{ +enum _GstPassthroughFormat { GST_PASSTHROUGH_FORMAT_INT, GST_PASSTHROUGH_FORMAT_FLOAT }; -struct _GstPassthrough -{ +struct _GstPassthrough { GstElement element; GstPad *sinkpad, *srcpad; @@ -66,12 +66,12 @@ struct _GstPassthrough gboolean is_signed; }; -struct _GstPassthroughClass -{ +struct _GstPassthroughClass { GstElementClass parent_class; }; -GType gst_passthrough_get_type (void); +GType gst_passthrough_get_type(void); G_END_DECLS + #endif /* __GST_PASSTHROUGH_H__ */ diff --git a/gst/playondemand/gstplayondemand.h b/gst/playondemand/gstplayondemand.h index a838d758..c99c8165 100644 --- a/gst/playondemand/gstplayondemand.h +++ b/gst/playondemand/gstplayondemand.h @@ -29,6 +29,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_PLAYONDEMAND \ (gst_play_on_demand_get_type()) #define GST_PLAYONDEMAND(obj) \ @@ -39,59 +40,58 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYONDEMAND)) #define GST_IS_PLAYONDEMAND_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYONDEMAND)) -typedef struct _GstPlayOnDemand GstPlayOnDemand; -typedef struct _GstPlayOnDemandClass GstPlayOnDemandClass; -typedef enum _GstPlayOnDemandFormat GstPlayOnDemandFormat; -enum _GstPlayOnDemandFormat -{ +typedef struct _GstPlayOnDemand GstPlayOnDemand; +typedef struct _GstPlayOnDemandClass GstPlayOnDemandClass; +typedef enum _GstPlayOnDemandFormat GstPlayOnDemandFormat; + +enum _GstPlayOnDemandFormat { GST_PLAYONDEMAND_FORMAT_INT, GST_PLAYONDEMAND_FORMAT_FLOAT }; -struct _GstPlayOnDemand -{ +struct _GstPlayOnDemand { GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad, *srcpad; GstClock *clock; /* filter properties */ - gboolean mute; - gfloat buffer_time; - guint max_plays; - gfloat tick_rate; - guint total_ticks; - guint32 *ticks; + gboolean mute; + gfloat buffer_time; + guint max_plays; + gfloat tick_rate; + guint total_ticks; + guint32 *ticks; /* internal buffer info */ - gchar *buffer; - guint buffer_bytes; - gboolean eos; + gchar *buffer; + guint buffer_bytes; + gboolean eos; /* play pointers == internal buffer offsets for producing output sound */ - guint *plays; - guint write; + guint *plays; + guint write; /* audio format info (used to calculate buffer_samples) */ GstPlayOnDemandFormat format; - guint rate; - guint channels; - guint width; + guint rate; + guint channels; + guint width; }; -struct _GstPlayOnDemandClass -{ +struct _GstPlayOnDemandClass { GstElementClass parent_class; - void (*play) (GstElement * elem); - void (*clear) (GstElement * elem); - void (*reset) (GstElement * elem); - void (*played) (GstElement * elem); - void (*stopped) (GstElement * elem); + void (*play) (GstElement *elem); + void (*clear) (GstElement *elem); + void (*reset) (GstElement *elem); + void (*played) (GstElement *elem); + void (*stopped) (GstElement *elem); }; -GType gst_play_on_demand_get_type (void); +GType gst_play_on_demand_get_type(void); G_END_DECLS + #endif /* __GST_PLAYONDEMAND_H__ */ diff --git a/gst/qtdemux/qtdemux.h b/gst/qtdemux/qtdemux.h index ed0f3154..249ef216 100644 --- a/gst/qtdemux/qtdemux.h +++ b/gst/qtdemux/qtdemux.h @@ -26,9 +26,8 @@ #include <gst/getbits/getbits.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_QTDEMUX \ @@ -44,45 +43,43 @@ extern "C" #define GST_QTDEMUX_MAX_STREAMS 8 - typedef struct _GstQTDemux GstQTDemux; - typedef struct _GstQTDemuxClass GstQTDemuxClass; - typedef struct _QtDemuxStream QtDemuxStream; +typedef struct _GstQTDemux GstQTDemux; +typedef struct _GstQTDemuxClass GstQTDemuxClass; +typedef struct _QtDemuxStream QtDemuxStream; - struct _GstQTDemux - { - GstElement element; +struct _GstQTDemux { + GstElement element; - /* pads */ - GstPad *sinkpad; + /* pads */ + GstPad *sinkpad; - QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS]; - int n_streams; - int n_video_streams; - int n_audio_streams; + QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS]; + int n_streams; + int n_video_streams; + int n_audio_streams; - GstByteStream *bs; + GstByteStream *bs; - GNode *moov_node; - GNode *moov_node_compressed; + GNode *moov_node; + GNode *moov_node_compressed; - guint32 timescale; - guint32 duration; + guint32 timescale; + guint32 duration; - int state; + int state; - int offset; + int offset; - /* track stuff */ + /* track stuff */ - }; +}; - struct _GstQTDemuxClass - { - GstElementClass parent_class; - }; +struct _GstQTDemuxClass { + GstElementClass parent_class; +}; #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_QTDEMUX_H__ */ +#endif /* __GST_QTDEMUX_H__ */ diff --git a/gst/rtjpeg/RTjpeg.h b/gst/rtjpeg/RTjpeg.h index 3c90408f..92b35242 100644 --- a/gst/rtjpeg/RTjpeg.h +++ b/gst/rtjpeg/RTjpeg.h @@ -23,32 +23,30 @@ #include <inttypes.h> -typedef uint8_t __u8; +typedef uint8_t __u8; typedef uint32_t __u32; -typedef int8_t __s8; +typedef int8_t __s8; typedef uint16_t __u16; -extern void RTjpeg_init_Q (__u8 Q); -extern void RTjpeg_init_compress (long unsigned int *buf, int width, int height, - __u8 Q); -extern void RTjpeg_init_decompress (long unsigned int *buf, int width, - int height); -extern int RTjpeg_compressYUV420 (__s8 * sp, unsigned char *bp); -extern int RTjpeg_compressYUV422 (__s8 * sp, unsigned char *bp); -extern void RTjpeg_decompressYUV420 (__s8 * sp, __u8 * bp); -extern void RTjpeg_decompressYUV422 (__s8 * sp, __u8 * bp); -extern int RTjpeg_compress8 (__s8 * sp, unsigned char *bp); -extern void RTjpeg_decompress8 (__s8 * sp, __u8 * bp); - -extern void RTjpeg_init_mcompress (void); -extern int RTjpeg_mcompress (__s8 * sp, unsigned char *bp, __u16 lmask, - __u16 cmask); -extern int RTjpeg_mcompress8 (__s8 * sp, unsigned char *bp, __u16 lmask); -extern void RTjpeg_set_test (int i); - -extern void RTjpeg_yuv420rgb (__u8 * buf, __u8 * rgb); -extern void RTjpeg_yuv422rgb (__u8 * buf, __u8 * rgb); -extern void RTjpeg_yuvrgb8 (__u8 * buf, __u8 * rgb); -extern void RTjpeg_yuvrgb16 (__u8 * buf, __u8 * rgb); -extern void RTjpeg_yuvrgb24 (__u8 * buf, __u8 * rgb); -extern void RTjpeg_yuvrgb32 (__u8 * buf, __u8 * rgb); +extern void RTjpeg_init_Q(__u8 Q); +extern void RTjpeg_init_compress(long unsigned int *buf, int width, int height, __u8 Q); +extern void RTjpeg_init_decompress(long unsigned int *buf, int width, int height); +extern int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp); +extern int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp); +extern void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp); +extern void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp); +extern int RTjpeg_compress8(__s8 *sp, unsigned char *bp); +extern void RTjpeg_decompress8(__s8 *sp, __u8 *bp); + +extern void RTjpeg_init_mcompress(void); +extern int RTjpeg_mcompress(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask); +extern int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask); +extern void RTjpeg_set_test(int i); + +extern void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb); +extern void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb); +extern void RTjpeg_yuvrgb8(__u8 *buf, __u8 *rgb); +extern void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb); +extern void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb); +extern void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb); + diff --git a/gst/rtjpeg/gstrtjpegdec.h b/gst/rtjpeg/gstrtjpegdec.h index 23ddce44..2214ebd8 100644 --- a/gst/rtjpeg/gstrtjpegdec.h +++ b/gst/rtjpeg/gstrtjpegdec.h @@ -26,9 +26,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_RTJPEGDEC \ @@ -42,32 +41,30 @@ extern "C" #define GST_IS_RTJPEGDEC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTJPEGDEC))) - typedef struct _GstRTJpegDec GstRTJpegDec; - typedef struct _GstRTJpegDecClass GstRTJpegDecClass; +typedef struct _GstRTJpegDec GstRTJpegDec; +typedef struct _GstRTJpegDecClass GstRTJpegDecClass; - struct _GstRTJpegDec - { - GstElement element; +struct _GstRTJpegDec { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - gint width, height; - gint quality; - gint quant[128]; + gint width,height; + gint quality; + gint quant[128]; - }; +}; - struct _GstRTJpegDecClass - { - GstElementClass parent_class; - }; +struct _GstRTJpegDecClass { + GstElementClass parent_class; +}; - GType gst_rtjpegdec_get_type (void); +GType gst_rtjpegdec_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __RTJPEGDEC_H__ */ +#endif /* __RTJPEGDEC_H__ */ diff --git a/gst/rtjpeg/gstrtjpegenc.h b/gst/rtjpeg/gstrtjpegenc.h index 34c143b2..61303b7b 100644 --- a/gst/rtjpeg/gstrtjpegenc.h +++ b/gst/rtjpeg/gstrtjpegenc.h @@ -28,9 +28,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_RTJPEGENC \ @@ -44,31 +43,29 @@ extern "C" #define GST_IS_RTJPEGENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTJPEGENC)) - typedef struct _GstRTJpegEnc GstRTJpegEnc; - typedef struct _GstRTJpegEncClass GstRTJpegEncClass; +typedef struct _GstRTJpegEnc GstRTJpegEnc; +typedef struct _GstRTJpegEncClass GstRTJpegEncClass; - struct _GstRTJpegEnc - { - GstElement element; +struct _GstRTJpegEnc { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - gint width, height; - gint quality; - gint quant[128]; - }; + gint width,height; + gint quality; + gint quant[128]; +}; - struct _GstRTJpegEncClass - { - GstElementClass parent_class; - }; +struct _GstRTJpegEncClass { + GstElementClass parent_class; +}; - GType gst_rtjpegenc_get_type (void); +GType gst_rtjpegenc_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __RTJPEGENC_H__ */ +#endif /* __RTJPEGENC_H__ */ diff --git a/gst/smooth/gstsmooth.h b/gst/smooth/gstsmooth.h index aae3cc21..eb32de36 100644 --- a/gst/smooth/gstsmooth.h +++ b/gst/smooth/gstsmooth.h @@ -25,9 +25,8 @@ #include <gst/gst.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_SMOOTH \ @@ -41,36 +40,34 @@ extern "C" #define GST_IS_SMOOTH_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMOOTH)) - typedef struct _GstSmooth GstSmooth; - typedef struct _GstSmoothClass GstSmoothClass; +typedef struct _GstSmooth GstSmooth; +typedef struct _GstSmoothClass GstSmoothClass; - struct _GstSmooth - { - GstElement element; +struct _GstSmooth { + GstElement element; - int format; - int width; - int height; + int format; + int width; + int height; - gboolean active; - int tolerance; - int filtersize; - gboolean lum_only; + gboolean active; + int tolerance; + int filtersize; + gboolean lum_only; - GstPad *sinkpad, *srcpad; - }; + GstPad *sinkpad,*srcpad; +}; - struct _GstSmoothClass - { - GstElementClass parent_class; - }; +struct _GstSmoothClass { + GstElementClass parent_class; +}; - GType gst_smooth_get_type (void); +GType gst_smooth_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_SMOOTH_H__ */ +#endif /* __GST_SMOOTH_H__ */ diff --git a/gst/smoothwave/gstsmoothwave.h b/gst/smoothwave/gstsmoothwave.h index df4d8763..87165131 100644 --- a/gst/smoothwave/gstsmoothwave.h +++ b/gst/smoothwave/gstsmoothwave.h @@ -26,9 +26,8 @@ #include <gtk/gtk.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_SMOOTHWAVE \ @@ -42,33 +41,31 @@ extern "C" #define GST_IS_SMOOTHWAVE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMOOTHWAVE)) - typedef struct _GstSmoothWave GstSmoothWave; - typedef struct _GstSmoothWaveClass GstSmoothWaveClass; +typedef struct _GstSmoothWave GstSmoothWave; +typedef struct _GstSmoothWaveClass GstSmoothWaveClass; - struct _GstSmoothWave - { - GstElement element; +struct _GstSmoothWave { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - gint width, height; + gint width,height; - GdkRgbCmap *cmap; - GtkWidget *image; - guchar *imagebuffer; - }; + GdkRgbCmap *cmap; + GtkWidget *image; + guchar *imagebuffer; +}; - struct _GstSmoothWaveClass - { - GstElementClass parent_class; - }; +struct _GstSmoothWaveClass { + GstElementClass parent_class; +}; - GType gst_smoothwave_get_type (void); +GType gst_smoothwave_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_SMOOTHWAVE_H__ */ +#endif /* __GST_SMOOTHWAVE_H__ */ diff --git a/gst/smpte/gstmask.h b/gst/smpte/gstmask.h index 6f82078f..6131c624 100644 --- a/gst/smpte/gstmask.h +++ b/gst/smpte/gstmask.h @@ -27,39 +27,37 @@ typedef struct _GstMask GstMask; typedef struct _GstMaskDefinition GstMaskDefinition; -typedef void (*GstMaskDrawFunc) (GstMask * mask); -typedef void (*GstMaskDestroyFunc) (GstMask * mask); - -struct _GstMaskDefinition -{ - gint type; - gchar *short_name; - gchar *long_name; - GstMaskDrawFunc draw_func; - GstMaskDestroyFunc destroy_func; - gpointer user_data; +typedef void (*GstMaskDrawFunc) (GstMask *mask); +typedef void (*GstMaskDestroyFunc) (GstMask *mask); + +struct _GstMaskDefinition { + gint type; + gchar *short_name; + gchar *long_name; + GstMaskDrawFunc draw_func; + GstMaskDestroyFunc destroy_func; + gpointer user_data; }; -struct _GstMask -{ - gint type; - guint32 *data; - gpointer user_data; +struct _GstMask { + gint type; + guint32 *data; + gpointer user_data; - gint width; - gint height; - gint bpp; + gint width; + gint height; + gint bpp; - GstMaskDestroyFunc destroy_func; + GstMaskDestroyFunc destroy_func; }; -void _gst_mask_init (void); -void _gst_mask_register (GstMaskDefinition * definition); +void _gst_mask_init (void); +void _gst_mask_register (GstMaskDefinition *definition); -void _gst_mask_default_destroy (GstMask * mask); +void _gst_mask_default_destroy (GstMask *mask); -const GList *gst_mask_get_definitions (void); -GstMask *gst_mask_factory_new (gint type, gint bpp, gint width, gint height); -void gst_mask_destroy (GstMask * mask); +const GList* gst_mask_get_definitions (void); +GstMask* gst_mask_factory_new (gint type, gint bpp, gint width, gint height); +void gst_mask_destroy (GstMask *mask); #endif /* __GST_MASK_H__ */ diff --git a/gst/smpte/gstsmpte.h b/gst/smpte/gstsmpte.h index 762eebf8..40844209 100644 --- a/gst/smpte/gstsmpte.h +++ b/gst/smpte/gstsmpte.h @@ -38,28 +38,28 @@ typedef struct _GstSMPTE GstSMPTE; typedef struct _GstSMPTEClass GstSMPTEClass; -struct _GstSMPTE -{ - GstElement element; +struct _GstSMPTE { + GstElement element; - gint format; - gint width; - gint height; - gdouble fps; + gint format; + gint width; + gint height; + gdouble fps; - gint duration; - gint position; + gint duration; + gint position; - GstPad *srcpad, *sinkpad1, *sinkpad2; + GstPad *srcpad, + *sinkpad1, + *sinkpad2; - gint type; - gint border; - gint depth; - GstMask *mask; + gint type; + gint border; + gint depth; + GstMask *mask; }; -struct _GstSMPTEClass -{ +struct _GstSMPTEClass { GstElementClass parent_class; }; diff --git a/gst/smpte/paint.h b/gst/smpte/paint.h index aa9fd425..4c34cf92 100644 --- a/gst/smpte/paint.h +++ b/gst/smpte/paint.h @@ -22,21 +22,26 @@ #include <glib.h> -void gst_smpte_paint_vbox (guint32 * dest, gint stride, - gint x0, gint y0, gint c0, gint x1, gint y1, gint c1); -void gst_smpte_paint_hbox (guint32 * dest, gint stride, - gint x0, gint y0, gint c0, gint x1, gint y1, gint c1); +void gst_smpte_paint_vbox (guint32 *dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1); +void gst_smpte_paint_hbox (guint32 *dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1); -void gst_smpte_paint_triangle_linear (guint32 * dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1, gint x2, gint y2, gint c2); +void gst_smpte_paint_triangle_linear (guint32 *dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1, + gint x2, gint y2, gint c2); -void gst_smpte_paint_triangle_clock (guint32 * dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1, gint x2, gint y2, gint c2); +void gst_smpte_paint_triangle_clock (guint32 *dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1, + gint x2, gint y2, gint c2); -void gst_smpte_paint_box_clock (guint32 * dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1, gint x2, gint y2, gint c2); +void gst_smpte_paint_box_clock (guint32 *dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1, + gint x2, gint y2, gint c2); #endif /* __GST_SMPTE_PAINT_H__ */ diff --git a/gst/spectrum/gstspectrum.h b/gst/spectrum/gstspectrum.h index 23c4ef4b..8cc546ec 100644 --- a/gst/spectrum/gstspectrum.h +++ b/gst/spectrum/gstspectrum.h @@ -26,9 +26,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_SPECTRUM \ @@ -42,29 +41,27 @@ extern "C" #define GST_IS_SPECTRUM_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SPECTRUM)) - typedef struct _GstSpectrum GstSpectrum; - typedef struct _GstSpectrumClass GstSpectrumClass; +typedef struct _GstSpectrum GstSpectrum; +typedef struct _GstSpectrumClass GstSpectrumClass; - struct _GstSpectrum - { - GstElement element; +struct _GstSpectrum { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - gint width; - }; + gint width; +}; - struct _GstSpectrumClass - { - GstElementClass parent_class; - }; +struct _GstSpectrumClass { + GstElementClass parent_class; +}; - GType gst_spectrum_get_type (void); +GType gst_spectrum_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_SPECTRUM_H__ */ +#endif /* __GST_SPECTRUM_H__ */ diff --git a/gst/speed/gstspeed.h b/gst/speed/gstspeed.h index d86d1fce..2bbb0e6c 100644 --- a/gst/speed/gstspeed.h +++ b/gst/speed/gstspeed.h @@ -25,6 +25,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_SPEED \ (gst_speed_get_type()) #define GST_SPEED(obj) \ @@ -35,18 +36,17 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SPEED)) #define GST_IS_SPEED_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SPEED)) + typedef struct _GstSpeed GstSpeed; typedef struct _GstSpeedClass GstSpeedClass; typedef enum _GstSpeedFormat GstSpeedFormat; -enum _GstSpeedFormat -{ +enum _GstSpeedFormat { GST_SPEED_FORMAT_INT, GST_SPEED_FORMAT_FLOAT }; -struct _GstSpeed -{ +struct _GstSpeed { GstElement element; GstPad *sinkpad, *srcpad; @@ -66,12 +66,12 @@ struct _GstSpeed gboolean is_signed; }; -struct _GstSpeedClass -{ +struct _GstSpeedClass { GstElementClass parent_class; }; -GType gst_speed_get_type (void); +GType gst_speed_get_type(void); G_END_DECLS + #endif /* __GST_SPEED_H__ */ diff --git a/gst/stereo/gststereo.h b/gst/stereo/gststereo.h index b665432b..8b78f25e 100644 --- a/gst/stereo/gststereo.h +++ b/gst/stereo/gststereo.h @@ -26,9 +26,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_STEREO \ @@ -42,29 +41,27 @@ extern "C" #define GST_IS_STEREO_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STEREO)) - typedef struct _GstStereo GstStereo; - typedef struct _GstStereoClass GstStereoClass; +typedef struct _GstStereo GstStereo; +typedef struct _GstStereoClass GstStereoClass; - struct _GstStereo - { - GstElement element; +struct _GstStereo { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - gint8 active; - gfloat stereo; - }; + gint8 active; + gfloat stereo; +}; - struct _GstStereoClass - { - GstElementClass parent_class; - }; +struct _GstStereoClass { + GstElementClass parent_class; +}; - GType gst_stereo_get_type (void); +GType gst_stereo_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_STEREO_H__ */ +#endif /* __GST_STEREO_H__ */ diff --git a/gst/switch/gstswitch.h b/gst/switch/gstswitch.h index bd8e3739..59d66aeb 100644 --- a/gst/switch/gstswitch.h +++ b/gst/switch/gstswitch.h @@ -16,13 +16,14 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ - + #ifndef __GST_SWITCH_H__ #define __GST_SWITCH_H__ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_SWITCH \ (gst_switch_get_type()) #define GST_SWITCH(obj) \ @@ -33,36 +34,35 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_SWITCH)) #define GST_IS_SWITCH_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_SWITCH)) + typedef struct _GstSwitchPad GstSwitchPad; typedef struct _GstSwitch GstSwitch; typedef struct _GstSwitchClass GstSwitchClass; -struct _GstSwitchPad -{ +struct _GstSwitchPad { GstPad *sinkpad; GstData *data; gboolean forwarded; gboolean eos; }; -struct _GstSwitch -{ +struct _GstSwitch { GstElement element; - + GList *sinkpads; GstPad *srcpad; - + guint nb_sinkpads; guint active_sinkpad; }; -struct _GstSwitchClass -{ +struct _GstSwitchClass { GstElementClass parent_class; }; GType gst_switch_get_type (void); G_END_DECLS + #endif /* __GST_SWITCH_H__ */ diff --git a/gst/vbidec/gstvbidec.h b/gst/vbidec/gstvbidec.h index e495f25c..8a5ea7e5 100644 --- a/gst/vbidec/gstvbidec.h +++ b/gst/vbidec/gstvbidec.h @@ -19,4 +19,4 @@ typedef struct _GstVBIDec GstVBIDec; -void gst_vbidec_show_text (GstVBIDec * vbidec, char *text, int len); +void gst_vbidec_show_text (GstVBIDec *vbidec, char *text, int len); diff --git a/gst/vbidec/vbidata.h b/gst/vbidec/vbidata.h index 78d902af..66b2cc3c 100644 --- a/gst/vbidec/vbidata.h +++ b/gst/vbidec/vbidata.h @@ -44,16 +44,16 @@ typedef struct vbidata_s vbidata_t; #define CAPTURE_T3 8 #define CAPTURE_T4 9 -vbidata_t *vbidata_new_file (const char *filename, vbiscreen_t * vs, - /*tvtime_osd_t* osd, */ int verbose); -vbidata_t *vbidata_new_line (vbiscreen_t * vs, int verbose); +vbidata_t *vbidata_new_file( const char *filename, vbiscreen_t *vs, + /*tvtime_osd_t* osd,*/ int verbose ); +vbidata_t *vbidata_new_line( vbiscreen_t *vs, int verbose ); -void vbidata_delete (vbidata_t * vbi); -void vbidata_reset (vbidata_t * vbi); -void vbidata_set_verbose (vbidata_t * vbi, int verbose); -void vbidata_capture_mode (vbidata_t * vbi, int mode); -void vbidata_process_frame (vbidata_t * vbi, int printdebug); -void vbidata_process_line (vbidata_t * vbi, unsigned char *s, int bottom); -void vbidata_process_16b (vbidata_t * vbi, int bottom, int w); +void vbidata_delete( vbidata_t *vbi ); +void vbidata_reset( vbidata_t *vbi ); +void vbidata_set_verbose( vbidata_t *vbi, int verbose ); +void vbidata_capture_mode( vbidata_t *vbi, int mode ); +void vbidata_process_frame( vbidata_t *vbi, int printdebug ); +void vbidata_process_line( vbidata_t *vbi, unsigned char *s, int bottom ); +void vbidata_process_16b( vbidata_t *vbi, int bottom, int w ); #endif /* VBIDATA_H_INCLUDED */ diff --git a/gst/vbidec/vbiscreen.h b/gst/vbidec/vbiscreen.h index f3c81fbf..9afe2843 100644 --- a/gst/vbidec/vbiscreen.h +++ b/gst/vbidec/vbiscreen.h @@ -25,24 +25,26 @@ typedef struct vbiscreen_s vbiscreen_t; -vbiscreen_t *vbiscreen_new (int video_width, int video_height, - double video_aspect, int verbose, void *user_data); -void vbiscreen_delete (vbiscreen_t * vs); -void vbiscreen_set_verbose (vbiscreen_t * vs, int verbose); -void vbiscreen_set_mode (vbiscreen_t * vs, int caption, int style); -void vbiscreen_new_caption (vbiscreen_t * vs, int indent, int ital, - unsigned int colour, int row); -void vbiscreen_tab (vbiscreen_t * vs, int cols); -void vbiscreen_delete_to_end (vbiscreen_t * vs); -void vbiscreen_backspace (vbiscreen_t * vs); -void vbiscreen_erase_displayed (vbiscreen_t * vs); -void vbiscreen_erase_non_displayed (vbiscreen_t * vs); -void vbiscreen_carriage_return (vbiscreen_t * vs); -void vbiscreen_end_of_caption (vbiscreen_t * vs); -void vbiscreen_print (vbiscreen_t * vs, char c1, char c2); -void vbiscreen_composite_packed422_scanline (vbiscreen_t * vs, - unsigned char *output, int width, int xpos, int scanline); -void vbiscreen_dump_screen_text (vbiscreen_t * vs); -void vbiscreen_reset (vbiscreen_t * vs); +vbiscreen_t *vbiscreen_new( int video_width, int video_height, + double video_aspect, int verbose, void *user_data ); +void vbiscreen_delete( vbiscreen_t *vs ); +void vbiscreen_set_verbose( vbiscreen_t *vs, int verbose ); +void vbiscreen_set_mode( vbiscreen_t *vs, int caption, int style); +void vbiscreen_new_caption( vbiscreen_t *vs, int indent, int ital, + unsigned int colour, int row ); +void vbiscreen_tab( vbiscreen_t *vs, int cols ); +void vbiscreen_delete_to_end( vbiscreen_t *vs ); +void vbiscreen_backspace( vbiscreen_t *vs ); +void vbiscreen_erase_displayed( vbiscreen_t *vs ); +void vbiscreen_erase_non_displayed( vbiscreen_t *vs ); +void vbiscreen_carriage_return( vbiscreen_t *vs ); +void vbiscreen_end_of_caption( vbiscreen_t *vs ); +void vbiscreen_print( vbiscreen_t *vs, char c1, char c2 ); +void vbiscreen_composite_packed422_scanline( vbiscreen_t *vs, + unsigned char *output, + int width, int xpos, + int scanline ); +void vbiscreen_dump_screen_text( vbiscreen_t *vs ); +void vbiscreen_reset( vbiscreen_t *vs ); #endif diff --git a/gst/videodrop/gstvideodrop.h b/gst/videodrop/gstvideodrop.h index 913c91b5..20f954a4 100644 --- a/gst/videodrop/gstvideodrop.h +++ b/gst/videodrop/gstvideodrop.h @@ -23,6 +23,7 @@ #include <gst/gst.h> G_BEGIN_DECLS + #define GST_TYPE_VIDEODROP \ (gst_videodrop_get_type()) #define GST_VIDEODROP(obj) \ @@ -33,28 +34,29 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEODROP)) #define GST_IS_VIDEODROP_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEODROP)) + typedef struct _GstVideodrop GstVideodrop; typedef struct _GstVideodropClass GstVideodropClass; -struct _GstVideodrop -{ +struct _GstVideodrop { GstElement element; GstPad *sinkpad, *srcpad; /* video state */ gboolean inited; - gfloat from_fps, to_fps; + gfloat from_fps, + to_fps; gfloat speed; guint64 pass, total, time_adjust; }; -struct _GstVideodropClass -{ +struct _GstVideodropClass { GstElementClass parent_class; }; -GType gst_videodrop_get_type (void); +GType gst_videodrop_get_type(void); G_END_DECLS + #endif /* __GST_VIDEODROP_H__ */ diff --git a/gst/virtualdub/gstvirtualdub.h b/gst/virtualdub/gstvirtualdub.h index 286aa39d..f55d85e8 100644 --- a/gst/virtualdub/gstvirtualdub.h +++ b/gst/virtualdub/gstvirtualdub.h @@ -18,12 +18,12 @@ #include <gst/gst.h> -typedef unsigned int Pixel; -typedef unsigned int Pixel32; -typedef unsigned char Pixel8; -typedef int PixCoord; -typedef int PixDim; -typedef int PixOffset; +typedef unsigned int Pixel; +typedef unsigned int Pixel32; +typedef unsigned char Pixel8; +typedef int PixCoord; +typedef int PixDim; +typedef int PixOffset; #define R_MASK (0x00ff0000) diff --git a/gst/y4m/gsty4mencode.h b/gst/y4m/gsty4mencode.h index 607b3e6d..07d369cc 100644 --- a/gst/y4m/gsty4mencode.h +++ b/gst/y4m/gsty4mencode.h @@ -27,9 +27,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_Y4MENCODE \ @@ -43,32 +42,30 @@ extern "C" #define GST_IS_Y4MENCODE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_Y4MENCODE)) - typedef struct _GstY4mEncode GstY4mEncode; - typedef struct _GstY4mEncodeClass GstY4mEncodeClass; +typedef struct _GstY4mEncode GstY4mEncode; +typedef struct _GstY4mEncodeClass GstY4mEncodeClass; - struct _GstY4mEncode - { - GstElement element; +struct _GstY4mEncode { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - gint width, height; - gfloat fps_idx; + gint width, height; + gfloat fps_idx; - gboolean init; + gboolean init; - }; +}; - struct _GstY4mEncodeClass - { - GstElementClass parent_class; - }; +struct _GstY4mEncodeClass { + GstElementClass parent_class; +}; - GType gst_y4mencode_get_type (void); +GType gst_y4mencode_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_Y4MENCODE_H__ */ +#endif /* __GST_Y4MENCODE_H__ */ diff --git a/sys/cdrom/gstcdplayer.h b/sys/cdrom/gstcdplayer.h index 60d0b606..7c6c4bf9 100644 --- a/sys/cdrom/gstcdplayer.h +++ b/sys/cdrom/gstcdplayer.h @@ -35,31 +35,30 @@ typedef struct _CDPlayer CDPlayer; typedef struct _CDPlayerClass CDPlayerClass; -struct _CDPlayer -{ - GstBin element; +struct _CDPlayer { + GstBin element; + + /* properties */ + gchar *device; + gint num_tracks; + gint start_track; + gint end_track; + gint current_track; + guint32 cddb_discid; - /* properties */ - gchar *device; - gint num_tracks; - gint start_track; - gint end_track; - gint current_track; - guint32 cddb_discid; - - /* private */ - struct cd cd; - gboolean paused; + /* private */ + struct cd cd; + gboolean paused; }; -struct _CDPlayerClass -{ - GstBinClass parent_class; +struct _CDPlayerClass { + GstBinClass parent_class; - /* signal callbacks */ - void (*track_change) (GstElement * element, guint track); + /* signal callbacks */ + void (*track_change) (GstElement *element,guint track); }; -GType cdplayer_get_type (void); +GType cdplayer_get_type(void); + +#endif -#endif diff --git a/sys/cdrom/gstcdplayer_ioctl.h b/sys/cdrom/gstcdplayer_ioctl.h index 5998276e..65bc2c66 100644 --- a/sys/cdrom/gstcdplayer_ioctl.h +++ b/sys/cdrom/gstcdplayer_ioctl.h @@ -28,40 +28,37 @@ #define CDPLAYER_MAX_TRACKS 128 -typedef enum -{ - CD_PLAYING, - CD_COMPLETED, - CD_ERROR +typedef enum { + CD_PLAYING, + CD_COMPLETED, + CD_ERROR } CDStatus; -struct cd_msf -{ - guint8 minute; - guint8 second; - guint8 frame; +struct cd_msf { + guint8 minute; + guint8 second; + guint8 frame; - gboolean data_track; + gboolean data_track; }; -struct cd -{ - gint fd; - gint num_tracks; - struct cd_msf tracks[CDPLAYER_MAX_TRACKS]; +struct cd { + gint fd; + gint num_tracks; + struct cd_msf tracks[CDPLAYER_MAX_TRACKS]; }; /* these are defined by the different cdrom type header files */ -gboolean cd_init (struct cd *cd, const gchar * device); -gboolean cd_start (struct cd *cd, gint start_track, gint end_track); -gboolean cd_pause (struct cd *cd); -gboolean cd_resume (struct cd *cd); -gboolean cd_stop (struct cd *cd); -CDStatus cd_status (struct cd *cd); -gint cd_current_track (struct cd *cd); -gboolean cd_close (struct cd *cd); +gboolean cd_init(struct cd *cd,const gchar *device); +gboolean cd_start(struct cd *cd,gint start_track,gint end_track); +gboolean cd_pause(struct cd *cd); +gboolean cd_resume(struct cd *cd); +gboolean cd_stop(struct cd *cd); +CDStatus cd_status(struct cd *cd); +gint cd_current_track(struct cd *cd); +gboolean cd_close(struct cd *cd); -guint32 cd_cddb_discid (struct cd *cd); +guint32 cd_cddb_discid(struct cd *cd); #endif diff --git a/sys/cdrom/gstcdplayer_ioctl_bsd.h b/sys/cdrom/gstcdplayer_ioctl_bsd.h index 34c2d9aa..f8a94cd7 100644 --- a/sys/cdrom/gstcdplayer_ioctl_bsd.h +++ b/sys/cdrom/gstcdplayer_ioctl_bsd.h @@ -17,337 +17,329 @@ * Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CDROM_BSD_NETBSD /* net & open */ +#ifdef HAVE_CDROM_BSD_NETBSD /* net & open */ #ifndef CDIOREADTOCHDR #define CDIOREADTOCHDR CDIOREADTOCHEADER #endif -gboolean -cd_init (struct cd *cd, const gchar * device) +gboolean cd_init(struct cd *cd,const gchar *device) { - struct ioc_toc_header toc_header; - struct ioc_read_toc_entry toc_entry; - struct cd_toc_entry toc_entry_data; - guint i; - - cd->fd = open (device, O_RDONLY | O_NONBLOCK); - - if (cd->fd == -1) { - return FALSE; - } - - /* get the toc header information */ - if (ioctl (cd->fd, CDIOREADTOCHDR, &toc_header) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - /* read each entry in the toc header */ - for (i = 1; i <= toc_header.ending_track; i++) { - toc_entry.address_format = CD_MSF_FORMAT; - toc_entry.starting_track = i; - toc_entry.data = &toc_entry_data; - toc_entry.data_len = sizeof (toc_entry_data); - - if (ioctl (cd->fd, CDIOREADTOCENTRYS, &toc_entry) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - cd->tracks[i].minute = toc_entry.data->addr.msf.minute; - cd->tracks[i].second = toc_entry.data->addr.msf.second; - cd->tracks[i].frame = toc_entry.data->addr.msf.frame; - cd->tracks[i].data_track = (toc_entry.data->control & 4) == 4; - } - - /* read the leadout */ - toc_entry.address_format = CD_MSF_FORMAT; - toc_entry.starting_track = 0xAA; /* leadout */ - toc_entry.data = &toc_entry_data; - toc_entry.data_len = sizeof (toc_entry_data); - - if (ioctl (cd->fd, CDIOREADTOCENTRYS, &toc_entry) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - cd->tracks[LEADOUT].minute = toc_entry.data->addr.msf.minute; - cd->tracks[LEADOUT].second = toc_entry.data->addr.msf.second; - cd->tracks[LEADOUT].frame = toc_entry.data->addr.msf.frame; - - cd->num_tracks = toc_header.ending_track; - - return TRUE; + struct ioc_toc_header toc_header; + struct ioc_read_toc_entry toc_entry; + struct cd_toc_entry toc_entry_data; + guint i; + + cd->fd = open(device,O_RDONLY | O_NONBLOCK); + + if (cd->fd == -1) { + return FALSE; + } + + /* get the toc header information */ + if (ioctl(cd->fd,CDIOREADTOCHDR,&toc_header) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + /* read each entry in the toc header */ + for (i = 1; i <= toc_header.ending_track; i++) { + toc_entry.address_format = CD_MSF_FORMAT; + toc_entry.starting_track = i; + toc_entry.data = &toc_entry_data; + toc_entry.data_len = sizeof(toc_entry_data); + + if (ioctl(cd->fd,CDIOREADTOCENTRYS,&toc_entry) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + cd->tracks[i].minute = toc_entry.data->addr.msf.minute; + cd->tracks[i].second = toc_entry.data->addr.msf.second; + cd->tracks[i].frame = toc_entry.data->addr.msf.frame; + cd->tracks[i].data_track = (toc_entry.data->control & 4) == 4; + } + + /* read the leadout */ + toc_entry.address_format = CD_MSF_FORMAT; + toc_entry.starting_track = 0xAA; /* leadout */ + toc_entry.data = &toc_entry_data; + toc_entry.data_len = sizeof(toc_entry_data); + + if (ioctl(cd->fd,CDIOREADTOCENTRYS,&toc_entry) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + cd->tracks[LEADOUT].minute = toc_entry.data->addr.msf.minute; + cd->tracks[LEADOUT].second = toc_entry.data->addr.msf.second; + cd->tracks[LEADOUT].frame = toc_entry.data->addr.msf.frame; + + cd->num_tracks = toc_header.ending_track; + + return TRUE; } #elif defined HAVE_CDROM_BSD_DARWIN -gboolean -cd_init (struct cd *cd, const gchar * device) +gboolean cd_init(struct cd *cd,const gchar *device) { - struct ioc_toc_header toc_header; - struct ioc_read_toc_entry toc_entry; - guint i; - - cd->fd = open (device, O_RDONLY | O_NONBLOCK); - - if (cd->fd == -1) { - return FALSE; - } - - /* get the toc header information */ - if (ioctl (cd->fd, CDIOREADTOCHDR, &toc_header) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - /* read each entry in the toc header */ - for (i = 1; i <= toc_header.ending_track; i++) { - toc_entry.address_format = CD_MSF_FORMAT; - toc_entry.starting_track = i; - - if (ioctl (cd->fd, CDIOREADTOCENTRYS, &toc_entry) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - cd->tracks[i].minute = toc_entry.data->addr[1]; - cd->tracks[i].second = toc_entry.data->addr[2]; - cd->tracks[i].frame = toc_entry.data->addr[3]; - cd->tracks[i].data_track = (toc_entry.data->control & 4) == 4; - } - - /* read the leadout */ - toc_entry.address_format = CD_MSF_FORMAT; - toc_entry.starting_track = 0xAA; /* leadout */ - toc_entry.data = &toc_entry_data; - toc_entry.data_len = sizeof (toc_entry_data); - - if (ioctl (cd->fd, CDIOREADTOCENTRYS, &toc_entry) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - cd->tracks[LEADOUT].minute = toc_entry.data->addr[1]; - cd->tracks[LEADOUT].second = toc_entry.data->addr[2]; - cd->tracks[LEADOUT].frame = toc_entry.data->addr[3]; - - cd->num_tracks = toc_header.ending_track; - - return TRUE; + struct ioc_toc_header toc_header; + struct ioc_read_toc_entry toc_entry; + guint i; + + cd->fd = open(device,O_RDONLY | O_NONBLOCK); + + if (cd->fd == -1) { + return FALSE; + } + + /* get the toc header information */ + if (ioctl(cd->fd,CDIOREADTOCHDR,&toc_header) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + /* read each entry in the toc header */ + for (i = 1; i <= toc_header.ending_track; i++) { + toc_entry.address_format = CD_MSF_FORMAT; + toc_entry.starting_track = i; + + if (ioctl(cd->fd,CDIOREADTOCENTRYS,&toc_entry) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + cd->tracks[i].minute = toc_entry.data->addr[1]; + cd->tracks[i].second = toc_entry.data->addr[2]; + cd->tracks[i].frame = toc_entry.data->addr[3]; + cd->tracks[i].data_track = (toc_entry.data->control & 4) == 4; + } + + /* read the leadout */ + toc_entry.address_format = CD_MSF_FORMAT; + toc_entry.starting_track = 0xAA; /* leadout */ + toc_entry.data = &toc_entry_data; + toc_entry.data_len = sizeof(toc_entry_data); + + if (ioctl(cd->fd,CDIOREADTOCENTRYS,&toc_entry) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + cd->tracks[LEADOUT].minute = toc_entry.data->addr[1]; + cd->tracks[LEADOUT].second = toc_entry.data->addr[2]; + cd->tracks[LEADOUT].frame = toc_entry.data->addr[3]; + + cd->num_tracks = toc_header.ending_track; + + return TRUE; } #else /* free */ -gboolean -cd_init (struct cd *cd, const gchar * device) +gboolean cd_init(struct cd *cd,const gchar *device) { - struct ioc_toc_header toc_header; - struct ioc_read_toc_entry toc_entry; - guint i; - - cd->fd = open (device, O_RDONLY | O_NONBLOCK); - - if (cd->fd == -1) { - return FALSE; - } - - /* get the toc header information */ - if (ioctl (cd->fd, CDIOREADTOCHDR, &toc_header) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - /* read each entry in the toc header */ - for (i = 1; i <= toc_header.ending_track; i++) { - toc_entry.address_format = CD_MSF_FORMAT; - toc_entry.starting_track = i; - - if (ioctl (cd->fd, CDIOREADTOCENTRYS, &toc_entry) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - cd->tracks[i].minute = toc_entry.entry.addr.msf.minute; - cd->tracks[i].second = toc_entry.entry.addr.msf.second; - cd->tracks[i].frame = toc_entry.entry.addr.msf.frame; - cd->tracks[i].data_track = (toc_entry.data->control & 4) == 4; - } - - /* read the leadout */ - toc_entry.address_format = CD_MSF_FORMAT; - toc_entry.starting_track = 0xAA; /* leadout */ - toc_entry.data = &toc_entry_data; - toc_entry.data_len = sizeof (toc_entry_data); - - if (ioctl (cd->fd, CDIOREADTOCENTRYS, &toc_entry) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - cd->tracks[LEADOUT].minute = toc_entry.entry.addr.msf.minute; - cd->tracks[LEADOUT].second = toc_entry.entry.addr.msf.second; - cd->tracks[LEADOUT].frame = toc_entry.entry.addr.msf.frame; - - cd->num_tracks = toc_header.ending_track; - - return TRUE; + struct ioc_toc_header toc_header; + struct ioc_read_toc_entry toc_entry; + guint i; + + cd->fd = open(device,O_RDONLY | O_NONBLOCK); + + if (cd->fd == -1) { + return FALSE; + } + + /* get the toc header information */ + if (ioctl(cd->fd,CDIOREADTOCHDR,&toc_header) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + /* read each entry in the toc header */ + for (i = 1; i <= toc_header.ending_track; i++) { + toc_entry.address_format = CD_MSF_FORMAT; + toc_entry.starting_track = i; + + if (ioctl(cd->fd,CDIOREADTOCENTRYS,&toc_entry) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + cd->tracks[i].minute = toc_entry.entry.addr.msf.minute; + cd->tracks[i].second = toc_entry.entry.addr.msf.second; + cd->tracks[i].frame = toc_entry.entry.addr.msf.frame; + cd->tracks[i].data_track = (toc_entry.data->control & 4) == 4; + } + + /* read the leadout */ + toc_entry.address_format = CD_MSF_FORMAT; + toc_entry.starting_track = 0xAA; /* leadout */ + toc_entry.data = &toc_entry_data; + toc_entry.data_len = sizeof(toc_entry_data); + + if (ioctl(cd->fd,CDIOREADTOCENTRYS,&toc_entry) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + cd->tracks[LEADOUT].minute = toc_entry.entry.addr.msf.minute; + cd->tracks[LEADOUT].second = toc_entry.entry.addr.msf.second; + cd->tracks[LEADOUT].frame = toc_entry.entry.addr.msf.frame; + + cd->num_tracks = toc_header.ending_track; + + return TRUE; } #endif -gboolean -cd_start (struct cd * cd, gint start_track, gint end_track) +gboolean cd_start(struct cd *cd,gint start_track,gint end_track) { - struct ioc_play_msf msf; + struct ioc_play_msf msf; - if (cd->fd == -1) { - return FALSE; - } + if (cd->fd == -1) { + return FALSE; + } - cd_fix_track_range (cd, &start_track, &end_track); + cd_fix_track_range(cd,&start_track,&end_track); - msf.start_m = cd->tracks[start_track].minute; - msf.start_s = cd->tracks[start_track].second; - msf.start_f = cd->tracks[start_track].frame; + msf.start_m = cd->tracks[start_track].minute; + msf.start_s = cd->tracks[start_track].second; + msf.start_f = cd->tracks[start_track].frame; - if (end_track == LEADOUT) { - msf.end_m = cd->tracks[end_track].minute; - msf.end_s = cd->tracks[end_track].second; - msf.end_f = cd->tracks[end_track].frame; - } else { - msf.end_m = cd->tracks[end_track + 1].minute; - msf.end_s = cd->tracks[end_track + 1].second; - msf.end_f = cd->tracks[end_track + 1].frame; - } + if (end_track == LEADOUT) { + msf.end_m = cd->tracks[end_track].minute; + msf.end_s = cd->tracks[end_track].second; + msf.end_f = cd->tracks[end_track].frame; + } else { + msf.end_m = cd->tracks[end_track+1].minute; + msf.end_s = cd->tracks[end_track+1].second; + msf.end_f = cd->tracks[end_track+1].frame; + } - if (ioctl (cd->fd, CDIOCPLAYMSF, &msf) != 0) { - return FALSE; - } + if (ioctl(cd->fd,CDIOCPLAYMSF,&msf) != 0) { + return FALSE; + } } -gboolean -cd_pause (struct cd * cd) +gboolean cd_pause(struct cd *cd) { - if (cd->fd == -1) { - return FALSE; - } + if (cd->fd == -1) { + return FALSE; + } - if (ioctl (cd->fd, CDIOCPAUSE, NULL) != 0) { - return FALSE; - } + if (ioctl(cd->fd,CDIOCPAUSE,NULL) != 0) { + return FALSE; + } - return TRUE; + return TRUE; } -gboolean -cd_resume (struct cd * cd) +gboolean cd_resume(struct cd *cd) { - if (cd->fd == -1) { - return FALSE; - } + if (cd->fd == -1) { + return FALSE; + } - if (ioctl (cd->fd, CDIOCRESUME, NULL) != 0) { - return FALSE; - } + if (ioctl(cd->fd,CDIOCRESUME,NULL) != 0) { + return FALSE; + } - return TRUE; + return TRUE; } -gboolean -cd_stop (struct cd * cd) +gboolean cd_stop(struct cd *cd) { - if (cd->fd == -1) { - return FALSE; - } + if (cd->fd == -1) { + return FALSE; + } - if (ioctl (cd->fd, CDIOCSTOP, NULL) != 0) { - return FALSE; - } + if (ioctl(cd->fd,CDIOCSTOP,NULL) != 0) { + return FALSE; + } - return TRUE; + return TRUE; } /* -1 for error, 0 for not playing, 1 for playing */ -CDStatus -cd_status (struct cd * cd) +CDStatus cd_status(struct cd *cd) { - struct ioc_read_subchannel sub_channel; - struct cd_sub_channel_info sub_channel_info; - - if (cd->fd == -1) { - return -1; - } - - sub_channel.address_format = CD_MSF_FORMAT; - sub_channel.data_format = CD_CURRENT_POSITION; - sub_channel.track = 0; - sub_channel.data = &sub_channel_info; - sub_channel.data_len = sizeof (sub_channel_info); - - if (ioctl (cd->fd, CDIOCREADSUBCHANNEL, &sub_channel) != 0) { - return FALSE; - } - - switch (sub_channel.data->header.audio_status) { - case CD_AS_PLAY_IN_PROGRESS: - case CD_AS_PLAY_PAUSED: - return CD_PLAYING; - break; - case CD_AS_PLAY_COMPLETED: - return CD_COMPLETED; - break; - case CD_AS_AUDIO_INVALID: - case CD_AS_PLAY_ERROR: - default: - return CD_ERROR; - break; - - } + struct ioc_read_subchannel sub_channel; + struct cd_sub_channel_info sub_channel_info; + + if (cd->fd == -1) { + return -1; + } + + sub_channel.address_format = CD_MSF_FORMAT; + sub_channel.data_format = CD_CURRENT_POSITION; + sub_channel.track = 0; + sub_channel.data = &sub_channel_info; + sub_channel.data_len = sizeof(sub_channel_info); + + if (ioctl(cd->fd,CDIOCREADSUBCHANNEL,&sub_channel) != 0) { + return FALSE; + } + + switch (sub_channel.data->header.audio_status) { + case CD_AS_PLAY_IN_PROGRESS: + case CD_AS_PLAY_PAUSED: + return CD_PLAYING; + break; + case CD_AS_PLAY_COMPLETED: + return CD_COMPLETED; + break; + case CD_AS_AUDIO_INVALID: + case CD_AS_PLAY_ERROR: + default: + return CD_ERROR; + break; + + } } -gint -cd_current_track (struct cd *cd) +gint cd_current_track(struct cd *cd) { - struct ioc_read_subchannel sub_channel; - struct cd_sub_channel_info sub_channel_info; - - if (cd->fd == -1) { - return -1; - } - - sub_channel.address_format = CD_MSF_FORMAT; - sub_channel.data_format = CD_TRACK_INFO; - sub_channel.track = 0; - sub_channel.data = &sub_channel_info; - sub_channel.data_len = sizeof (sub_channel_info); - - if (ioctl (cd->fd, CDIOCREADSUBCHANNEL, &sub_channel) != 0) { - return -1; - } + struct ioc_read_subchannel sub_channel; + struct cd_sub_channel_info sub_channel_info; + + if (cd->fd == -1) { + return -1; + } + + sub_channel.address_format = CD_MSF_FORMAT; + sub_channel.data_format = CD_TRACK_INFO; + sub_channel.track = 0; + sub_channel.data = &sub_channel_info; + sub_channel.data_len = sizeof(sub_channel_info); + + if (ioctl(cd->fd,CDIOCREADSUBCHANNEL,&sub_channel) != 0) { + return -1; + } + #ifdef __NetBSD__ - return sub_channel.data->what.track_info.track_number; + return sub_channel.data->what.track_info.track_number; #else - return sub_channel.data->track_number; + return sub_channel.data->track_number; #endif } -gboolean -cd_close (struct cd * cd) +gboolean cd_close(struct cd *cd) { - if (cd->fd == -1) { - return TRUE; - } + if (cd->fd == -1) { + return TRUE; + } - if (close (cd->fd) != 0) { - return FALSE; - } + if (close(cd->fd) != 0) { + return FALSE; + } - cd->fd = -1; + cd->fd = -1; - return TRUE; + return TRUE; } + diff --git a/sys/cdrom/gstcdplayer_ioctl_irix.h b/sys/cdrom/gstcdplayer_ioctl_irix.h index fb18c489..2f6be35c 100644 --- a/sys/cdrom/gstcdplayer_ioctl_irix.h +++ b/sys/cdrom/gstcdplayer_ioctl_irix.h @@ -22,95 +22,88 @@ #define CDPLAYER(x) ((CDPlayer *)x) #define FD(x) ((int)x) -gboolean -cd_init (struct cd *cd, const gchar * device) +gboolean cd_init(struct cd *cd,const gchar *device) { - CDPLAYER *cdplayer; - CDSTATUS status; - CDTRACKINFO info; - guint i; + CDPLAYER *cdplayer; + CDSTATUS status; + CDTRACKINFO info; + guint i; - cdplayer = CDOpen (device, "r"); + cdplayer = CDOpen(device,"r"); - if (cdplayer == NULL) { - return FALSE; - } + if (cdplayer == NULL) { + return FALSE; + } - cd->fd = FD (cdplayer); + cd->fd = FD(cdplayer); - if (CDgetstatus (cdplayer, &status) == 0) { - CDclose (cdplayer); - cd->fd = 0; - return FALSE; - } + if (CDgetstatus(cdplayer,&status) == 0) { + CDclose(cdplayer); + cd->fd = 0; + return FALSE; + } - for (i = 1; i < status.last; i++) { - if (CDgettrackinfo (cdplayer, i, &info) == 0) { - CDclose (cdplayer); - cd->fd = 0; - return FALSE; - } + for (i = 1; i < status.last; i++) { + if (CDgettrackinfo(cdplayer,i,&info) == 0) { + CDclose(cdplayer); + cd->fd = 0; + return FALSE; + } - cd->tracks[i].minute = info.start_min; - cd->tracks[i].second = info.start_sec; - cd->tracks[i].frame = info.start_frame; + cd->tracks[i].minute = info.start_min; + cd->tracks[i].second = info.start_sec; + cd->tracks[i].frame = info.start_frame; - } + } - /* there is no leadout information */ + /* there is no leadout information */ + + cd->num_tracks = status.last; - cd->num_tracks = status.last; - - return TRUE; + return TRUE; } -gboolean -cd_start (struct cd * cd, gint start_track, gint end_track) +gboolean cd_start(struct cd *cd,gint start_track,gint end_track) { - if (cd->fd == 0) { - return FALSE; - } - - cd_fix_track_range (cd, &start_track, &end_track); + if (cd->fd == 0) { + return FALSE; + } + cd_fix_track_range(cd,&start_track,&end_track); + } -gboolean -cd_pause (struct cd * cd) +gboolean cd_pause(struct cd *cd) { } -gboolean -cd_resume (struct cd *cd) +gboolean cd_resume(struct cd *cd) { } -gboolean -cd_stop (struct cd *cd) +gboolean cd_stop(struct cd *cd) { } /* -1 for error, 0 for not playing, 1 for playing */ -CDStatus -cd_status (struct cd *cd) +CDStatus cd_status(struct cd *cd) { } -gint -cd_current_track (struct cd *cd) +gint cd_current_track(struct cd *cd) { } -gboolean -cd_close (struct cd *cd) +gboolean cd_close(struct cd *cd) { } + diff --git a/sys/cdrom/gstcdplayer_ioctl_solaris.h b/sys/cdrom/gstcdplayer_ioctl_solaris.h index dd91e127..868fb251 100644 --- a/sys/cdrom/gstcdplayer_ioctl_solaris.h +++ b/sys/cdrom/gstcdplayer_ioctl_solaris.h @@ -17,195 +17,188 @@ * Boston, MA 02111-1307, USA. */ -gboolean -cd_init (struct cd *cd, const gchar * device) +gboolean cd_init(struct cd *cd,const gchar *device) { - struct cdrom_tochdr toc_header; - struct cdrom_tocentry toc_entry; - guint i; - - cd->fd = open (device, O_RDONLY | O_NONBLOCK); - - if (cd->fd == -1) { - return FALSE; - } - - /* get the toc header information */ - if (ioctl (cd->fd, CDROMREADTOCHDR, &toc_header) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - /* read each entry in the toc header */ - for (i = 1; i <= toc_header.cdth_trk1; i++) { - toc_entry.cdte_format = CDROM_MSF; - toc_entry.cdte_track = i; - - if (ioctl (cd->fd, CDROMREADTOCENTRY, &toc_entry) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - - cd->tracks[i].minute = toc_entry.cdte_addr.msf.minute; - cd->tracks[i].second = toc_entry.cdte_addr.msf.second; - cd->tracks[i].frame = toc_entry.cdte_addr.msf.frame; - cd->tracks[i].data_track = (toc_entry.cdte_ctrl == CDROM_DATA_TRACK); - } - - /* read the leadout */ - toc_entry.cdte_track = CDROM_LEADOUT; - toc_entry.cdte_format = CDROM_MSF; - if (ioctl (cd->fd, CDROMREADTOCENTRY, &toc_entry) != 0) { - close (cd->fd); - cd->fd = -1; - return FALSE; - } - cd->tracks[LEADOUT].minute = toc_entry.cdte_addr.msf.minute; - cd->tracks[LEADOUT].second = toc_entry.cdte_addr.msf.second; - cd->tracks[LEADOUT].frame = toc_entry.cdte_addr.msf.frame; - - cd->num_tracks = toc_header.cdth_trk1; - - return TRUE; + struct cdrom_tochdr toc_header; + struct cdrom_tocentry toc_entry; + guint i; + + cd->fd = open(device,O_RDONLY | O_NONBLOCK); + + if (cd->fd == -1) { + return FALSE; + } + + /* get the toc header information */ + if (ioctl(cd->fd,CDROMREADTOCHDR,&toc_header) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + /* read each entry in the toc header */ + for (i = 1; i <= toc_header.cdth_trk1; i++) { + toc_entry.cdte_format = CDROM_MSF; + toc_entry.cdte_track = i; + + if (ioctl(cd->fd,CDROMREADTOCENTRY,&toc_entry) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + + cd->tracks[i].minute = toc_entry.cdte_addr.msf.minute; + cd->tracks[i].second = toc_entry.cdte_addr.msf.second; + cd->tracks[i].frame = toc_entry.cdte_addr.msf.frame; + cd->tracks[i].data_track = (toc_entry.cdte_ctrl == CDROM_DATA_TRACK); + } + + /* read the leadout */ + toc_entry.cdte_track = CDROM_LEADOUT; + toc_entry.cdte_format = CDROM_MSF; + if (ioctl(cd->fd,CDROMREADTOCENTRY,&toc_entry) != 0) { + close(cd->fd); + cd->fd = -1; + return FALSE; + } + cd->tracks[LEADOUT].minute = toc_entry.cdte_addr.msf.minute; + cd->tracks[LEADOUT].second = toc_entry.cdte_addr.msf.second; + cd->tracks[LEADOUT].frame = toc_entry.cdte_addr.msf.frame; + + cd->num_tracks = toc_header.cdth_trk1; + + return TRUE; } -gboolean -cd_start (struct cd * cd, gint start_track, gint end_track) +gboolean cd_start(struct cd *cd,gint start_track,gint end_track) { - struct cdrom_msf msf; + struct cdrom_msf msf; - if (cd->fd == -1) { - return FALSE; - } + if (cd->fd == -1) { + return FALSE; + } - cd_fix_track_range (cd, &start_track, &end_track); + cd_fix_track_range(cd,&start_track,&end_track); - msf.cdmsf_min0 = cd->tracks[start_track].minute; - msf.cdmsf_sec0 = cd->tracks[start_track].second; - msf.cdmsf_frame0 = cd->tracks[start_track].frame; + msf.cdmsf_min0 = cd->tracks[start_track].minute; + msf.cdmsf_sec0 = cd->tracks[start_track].second; + msf.cdmsf_frame0 = cd->tracks[start_track].frame; - if (end_track == LEADOUT) { - msf.cdmsf_min1 = cd->tracks[end_track].minute; - msf.cdmsf_sec1 = cd->tracks[end_track].second; - msf.cdmsf_frame1 = cd->tracks[end_track].frame; - } else { - msf.cdmsf_min1 = cd->tracks[end_track + 1].minute; - msf.cdmsf_sec1 = cd->tracks[end_track + 1].second; - msf.cdmsf_frame1 = cd->tracks[end_track + 1].frame; - } + if (end_track == LEADOUT) { + msf.cdmsf_min1 = cd->tracks[end_track].minute; + msf.cdmsf_sec1 = cd->tracks[end_track].second; + msf.cdmsf_frame1 = cd->tracks[end_track].frame; + } else { + msf.cdmsf_min1 = cd->tracks[end_track+1].minute; + msf.cdmsf_sec1 = cd->tracks[end_track+1].second; + msf.cdmsf_frame1 = cd->tracks[end_track+1].frame; + } - if (ioctl (cd->fd, CDROMPLAYMSF, &msf) != 0) { - return FALSE; - } + if (ioctl(cd->fd,CDROMPLAYMSF,&msf) != 0) { + return FALSE; + } - return TRUE; + return TRUE; } -gboolean -cd_pause (struct cd * cd) +gboolean cd_pause(struct cd *cd) { - if (cd->fd == -1) { - return FALSE; - } + if (cd->fd == -1) { + return FALSE; + } - if (ioctl (cd->fd, CDROMPAUSE, NULL) != 0) { - return FALSE; - } + if (ioctl(cd->fd,CDROMPAUSE,NULL) != 0) { + return FALSE; + } - return TRUE; + return TRUE; } -gboolean -cd_resume (struct cd * cd) +gboolean cd_resume(struct cd *cd) { - if (cd->fd == -1) { - return FALSE; - } + if (cd->fd == -1) { + return FALSE; + } - if (ioctl (cd->fd, CDROMRESUME, NULL) != 0) { - return FALSE; - } + if (ioctl(cd->fd,CDROMRESUME,NULL) != 0) { + return FALSE; + } - return TRUE; + return TRUE; } -gboolean -cd_stop (struct cd * cd) +gboolean cd_stop(struct cd *cd) { - if (cd->fd == -1) { - return FALSE; - } + if (cd->fd == -1) { + return FALSE; + } - if (ioctl (cd->fd, CDROMSTOP, NULL) != 0) { - return FALSE; - } + if (ioctl(cd->fd,CDROMSTOP,NULL) != 0) { + return FALSE; + } - return TRUE; + return TRUE; } /* -1 for error, 0 for not playing, 1 for playing */ -CDStatus -cd_status (struct cd * cd) +CDStatus cd_status(struct cd *cd) { - struct cdrom_subchnl sub_channel; - - if (cd->fd == -1) { - return -1; - } - - sub_channel.cdsc_format = CDROM_MSF; - - if (ioctl (cd->fd, CDROMSUBCHNL, &sub_channel) != 0) { - return -1; - } - - switch (sub_channel.cdsc_audiostatus) { - case CDROM_AUDIO_COMPLETED: - return CD_COMPLETED; - break; - case CDROM_AUDIO_PLAY: - case CDROM_AUDIO_PAUSED: - return CD_PLAYING; - break; - case CDROM_AUDIO_ERROR: - default: - return CD_ERROR; - } + struct cdrom_subchnl sub_channel; + + if (cd->fd == -1) { + return -1; + } + + sub_channel.cdsc_format = CDROM_MSF; + + if (ioctl(cd->fd,CDROMSUBCHNL,&sub_channel) != 0) { + return -1; + } + + switch (sub_channel.cdsc_audiostatus) { + case CDROM_AUDIO_COMPLETED: + return CD_COMPLETED; + break; + case CDROM_AUDIO_PLAY: + case CDROM_AUDIO_PAUSED: + return CD_PLAYING; + break; + case CDROM_AUDIO_ERROR: + default: + return CD_ERROR; + } } -gint -cd_current_track (struct cd * cd) +gint cd_current_track(struct cd *cd) { - struct cdrom_subchnl sub_channel; + struct cdrom_subchnl sub_channel; - if (cd->fd == -1) { - return -1; - } + if (cd->fd == -1) { + return -1; + } - sub_channel.cdsc_format = CDROM_MSF; + sub_channel.cdsc_format = CDROM_MSF; - if (ioctl (cd->fd, CDROMSUBCHNL, &sub_channel) != 0) { - return -1; - } + if (ioctl(cd->fd,CDROMSUBCHNL,&sub_channel) != 0) { + return -1; + } - return sub_channel.cdsc_trk; + return sub_channel.cdsc_trk; } -gboolean -cd_close (struct cd * cd) +gboolean cd_close(struct cd *cd) { - if (cd->fd == -1) { - return TRUE; - } + if (cd->fd == -1) { + return TRUE; + } - if (close (cd->fd) != 0) { - return FALSE; - } + if (close(cd->fd) != 0) { + return FALSE; + } - cd->fd = -1; + cd->fd = -1; - return TRUE; + return TRUE; } + diff --git a/sys/dxr3/ac3_padder.h b/sys/dxr3/ac3_padder.h index f2ca2faa..c9a7447e 100644 --- a/sys/dxr3/ac3_padder.h +++ b/sys/dxr3/ac3_padder.h @@ -34,8 +34,7 @@ /* An IEC958 padded AC3 frame. */ -typedef struct -{ +typedef struct { /* IEC header. */ guchar header[AC3P_IEC_HEADER_SIZE]; @@ -48,9 +47,9 @@ typedef struct guchar bsidmod; guchar acmod; /* End of AC3 header. */ - - unsigned char data[AC3P_IEC_FRAME_SIZE - AC3P_IEC_HEADER_SIZE - - AC3P_AC3_HEADER_SIZE]; + + unsigned char data[AC3P_IEC_FRAME_SIZE - AC3P_IEC_HEADER_SIZE + - AC3P_AC3_HEADER_SIZE]; } ac3p_iec958_burst_frame; @@ -75,37 +74,39 @@ typedef struct /* The internal state for the padder. */ -typedef struct -{ - guint state; /* State of the reading automaton. */ +typedef struct { + guint state; /* State of the reading automaton. */ - guchar *in_ptr; /* Input pointer, marking the current - postion in the input buffer. */ - guint remaining; /* The number of bytes remaining in the current - reading buffer. */ + guchar *in_ptr; /* Input pointer, marking the current + postion in the input buffer. */ + guint remaining; /* The number of bytes remaining in the current + reading buffer. */ - guchar *out_ptr; /* Output pointer, marking the current - position in the output frame. */ + guchar *out_ptr; /* Output pointer, marking the current + position in the output frame. */ guint bytes_to_copy; - /* Number of bytes that still must be copied - to the output frame *during this reading - stage*. */ + /* Number of bytes that still must be copied + to the output frame *during this reading + stage*. */ guint ac3_frame_size; - /* The size in bytes of the pure AC3 portion - of the current frame. */ + /* The size in bytes of the pure AC3 portion + of the current frame. */ ac3p_iec958_burst_frame frame; - /* The current output frame. */ + /* The current output frame. */ } ac3_padder; -extern void ac3p_init (ac3_padder * padder); +extern void +ac3p_init(ac3_padder *padder); -extern void ac3p_push_data (ac3_padder * padder, guchar * data, guint size); +extern void +ac3p_push_data(ac3_padder *padder, guchar *data, guint size); -extern int ac3p_parse (ac3_padder * padder); +extern int +ac3p_parse(ac3_padder *padder); /** diff --git a/sys/dxr3/dxr3audiosink.h b/sys/dxr3/dxr3audiosink.h index 07527d9f..28bb34ec 100644 --- a/sys/dxr3/dxr3audiosink.h +++ b/sys/dxr3/dxr3audiosink.h @@ -27,6 +27,8 @@ #include "ac3_padder.h" G_BEGIN_DECLS + + #define GST_TYPE_DXR3AUDIOSINK \ (dxr3audiosink_get_type()) #define DXR3AUDIOSINK(obj) \ @@ -37,77 +39,75 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DXR3AUDIOSINK)) #define GST_IS_DXR3AUDIOSINK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DXR3AUDIOSINK)) + + typedef struct _Dxr3AudioSink Dxr3AudioSink; typedef struct _Dxr3AudioSinkClass Dxr3AudioSinkClass; -typedef enum -{ +typedef enum { DXR3AUDIOSINK_OPEN = GST_ELEMENT_FLAG_LAST, - DXR3AUDIOSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, + DXR3AUDIOSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, } Dxr3AudioSinkFlags; /* PCM or AC3? */ -typedef enum -{ - DXR3AUDIOSINK_MODE_NONE, /* No mode set. */ - DXR3AUDIOSINK_MODE_AC3, /* AC3 out. */ - DXR3AUDIOSINK_MODE_PCM, /* PCM out. */ +typedef enum { + DXR3AUDIOSINK_MODE_NONE, /* No mode set. */ + DXR3AUDIOSINK_MODE_AC3, /* AC3 out. */ + DXR3AUDIOSINK_MODE_PCM, /* PCM out. */ } Dxr3AudioSinkMode; /* Information for a delayed SCR set operation. */ -typedef struct -{ +typedef struct { struct _Dxr3AudioSink *sink; guint32 scr; } Dxr3AudioSinkDelayedSCR; -struct _Dxr3AudioSink -{ +struct _Dxr3AudioSink { GstElement element; - GstPad *pcm_sinkpad; /* The AC3 audio sink pad. */ - GstPad *ac3_sinkpad; /* The PCM audio sink pad. */ + GstPad *pcm_sinkpad; /* The AC3 audio sink pad. */ + GstPad *ac3_sinkpad; /* The PCM audio sink pad. */ - int card_number; /* The number of the card to open. */ + int card_number; /* The number of the card to open. */ - gchar *audio_filename; /* File name for the audio device. */ - int audio_fd; /* File descriptor for the audio device. */ + gchar *audio_filename; /* File name for the audio device. */ + int audio_fd; /* File descriptor for the audio device. */ - gchar *control_filename; /* File name for the control device. */ - int control_fd; /* File descriptor for the control - device. */ + gchar *control_filename; /* File name for the control device. */ + int control_fd; /* File descriptor for the control + device. */ - guint64 scr; /* The current System Reference Clock value - for the audio stream. */ + guint64 scr; /* The current System Reference Clock value + for the audio stream. */ - gboolean digital_pcm; /* Should PCM use the digital or the - analog output? */ + gboolean digital_pcm; /* Should PCM use the digital or the + analog output? */ - Dxr3AudioSinkMode mode; /* The current sound output mode. */ + Dxr3AudioSinkMode mode; /* The current sound output mode. */ - gint rate; /* The sampling rate for PCM sound. */ + gint rate; /* The sampling rate for PCM sound. */ - ac3_padder *padder; /* AC3 to SPDIF padder object. */ + ac3_padder *padder; /* AC3 to SPDIF padder object. */ - GstClock *clock; /* The clock for this element. */ + GstClock *clock; /* The clock for this element. */ }; -struct _Dxr3AudioSinkClass -{ +struct _Dxr3AudioSinkClass { GstElementClass parent_class; /* signals */ - void (*flushed) (Dxr3AudioSink * sink); + void (*flushed) (Dxr3AudioSink *sink); }; -extern GType dxr3audiosink_get_type (void); -extern gboolean dxr3audiosink_factory_init (GstPlugin * plugin); +extern GType dxr3audiosink_get_type (void); +extern gboolean dxr3audiosink_factory_init (GstPlugin *plugin); G_END_DECLS + #endif /* __DXR3AUDIOINK_H__ */ diff --git a/sys/dxr3/dxr3spusink.h b/sys/dxr3/dxr3spusink.h index 51bfa39e..e2551714 100644 --- a/sys/dxr3/dxr3spusink.h +++ b/sys/dxr3/dxr3spusink.h @@ -25,6 +25,8 @@ #include <gst/gst.h> G_BEGIN_DECLS + + #define GST_TYPE_DXR3SPUSINK \ (dxr3spusink_get_type()) #define DXR3SPUSINK(obj) \ @@ -35,49 +37,51 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DXR3SPUSINK)) #define GST_IS_DXR3SPUSINK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DXR3SPUSINK)) + + typedef struct _Dxr3SpuSink Dxr3SpuSink; typedef struct _Dxr3SpuSinkClass Dxr3SpuSinkClass; -typedef enum -{ +typedef enum { DXR3SPUSINK_OPEN = GST_ELEMENT_FLAG_LAST, - DXR3SPUSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, + DXR3SPUSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, } Dxr3SpuSinkFlags; -struct _Dxr3SpuSink -{ +struct _Dxr3SpuSink { GstElement element; - int card_number; /* The number of the card to open. */ + int card_number; /* The number of the card to open. */ - gchar *spu_filename; /* File name for the spu device. */ - int spu_fd; /* File descriptor for the spu device. */ + gchar *spu_filename; /* File name for the spu device. */ + int spu_fd; /* File descriptor for the spu device. */ gchar *control_filename; /* File name for the control device. */ int control_fd; /* File descriptor for the control - device. */ + device. */ GstClock *clock; /* The clock for this element. */ }; -struct _Dxr3SpuSinkClass -{ +struct _Dxr3SpuSinkClass { GstElementClass parent_class; /* Signals */ - void (*set_clut) (Dxr3SpuSink * sink, const guint32 * clut); - void (*highlight_on) (Dxr3SpuSink * sink, unsigned palette, - unsigned sx, unsigned sy, unsigned ex, unsigned ey, unsigned pts); - void (*highlight_off) (Dxr3SpuSink * sink); - void (*flushed) (Dxr3SpuSink * sink); + void (*set_clut) (Dxr3SpuSink *sink, const guint32 *clut); + void (*highlight_on) (Dxr3SpuSink *sink, unsigned palette, + unsigned sx, unsigned sy, + unsigned ex, unsigned ey, + unsigned pts); + void (*highlight_off) (Dxr3SpuSink *sink); + void (*flushed) (Dxr3SpuSink *sink); }; -extern GType dxr3spusink_get_type (void); -extern gboolean dxr3spusink_factory_init (GstPlugin * plugin); +extern GType dxr3spusink_get_type (void); +extern gboolean dxr3spusink_factory_init (GstPlugin *plugin); G_END_DECLS + #endif /* __DXR3SPUSINK_H__ */ diff --git a/sys/dxr3/dxr3videosink.h b/sys/dxr3/dxr3videosink.h index 03aa8c36..b0e5cadf 100644 --- a/sys/dxr3/dxr3videosink.h +++ b/sys/dxr3/dxr3videosink.h @@ -25,6 +25,8 @@ #include <gst/gst.h> G_BEGIN_DECLS + + #define GST_TYPE_DXR3VIDEOSINK \ (dxr3videosink_get_type()) #define DXR3VIDEOSINK(obj) \ @@ -35,19 +37,19 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DXR3VIDEOSINK)) #define GST_IS_DXR3VIDEOSINK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DXR3VIDEOSINK)) + + typedef struct _Dxr3VideoSink Dxr3VideoSink; typedef struct _Dxr3VideoSinkClass Dxr3VideoSinkClass; -typedef enum -{ +typedef enum { DXR3VIDEOSINK_OPEN = GST_ELEMENT_FLAG_LAST, - DXR3VIDEOSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, + DXR3VIDEOSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, } Dxr3VideoSinkFlags; -struct _Dxr3VideoSink -{ +struct _Dxr3VideoSink { GstElement element; int card_number; /* The number of the card to open. */ @@ -56,40 +58,40 @@ struct _Dxr3VideoSink int video_fd; /* File descriptor for the video device. */ gchar *control_filename; /* File name for the control device. */ - int control_fd; /* File descriptor for the control - device. */ + int control_fd; /* File descriptor for the control + device. */ GstClock *clock; /* The clock for this element. */ GstClockTime last_ts; /* Last timestamp received. */ GstBuffer *cur_buf; /* The buffer we are currently - building. */ + building. */ GstClockTime cur_ts; /* Timestamp associated to the - current buffer. */ + current buffer. */ guchar scan_state; /* The current state of the MPEG start - code scanner. */ + code scanner. */ guint scan_pos; /* The current position of the MPEG - start code scanner (with respect to - the start of the current buffer. */ + start code scanner (with respect to + the start of the current buffer. */ guchar parse_state; /* The current state of the MPEG - sequence parser. */ + sequence parser. */ }; -struct _Dxr3VideoSinkClass -{ +struct _Dxr3VideoSinkClass { GstElementClass parent_class; /* signals */ - void (*flushed) (Dxr3VideoSink * sink); + void (*flushed) (Dxr3VideoSink *sink); }; -extern GType dxr3videosink_get_type (void); -extern gboolean dxr3videosink_factory_init (GstPlugin * plugin); +extern GType dxr3videosink_get_type (void); +extern gboolean dxr3videosink_factory_init (GstPlugin *plugin); G_END_DECLS + #endif /* __DXR3VIDEOSINK_H__ */ diff --git a/sys/glsink/ARB_multitexture.h b/sys/glsink/ARB_multitexture.h index 6718e2fc..36dcf011 100644 --- a/sys/glsink/ARB_multitexture.h +++ b/sys/glsink/ARB_multitexture.h @@ -7,42 +7,42 @@ * *
* version 1.0ß *
* *
- *************************************************************/
-
+ *************************************************************/
+
#ifndef __ARB_MULTITEXTURE_H_
#define __ARB_MULTITEXTURE_H_
-
+
/*
* GLOBAL SWITCHES - enable/disable advanced features of this header
*
- */
-#define ARB_MULTITEXTURE_INITIALIZE 1 // enable generic init-routines
+ */
+#define ARB_MULTITEXTURE_INITIALIZE 1 // enable generic init-routines
#ifndef _WIN32
#define GL_GLEXT_PROTOTYPES 1
-#endif /*
*/ -
+#endif
+
#ifdef __cplusplus
-extern "C" -{ -
-#endif /*
*/ -
+extern "C" {
+#endif
+
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
-#endif /*
*/ -
+#endif
+
#ifndef APIENTRY
#define APIENTRY
-#endif /*
*/ -
+#endif
+
+
// Header file version number, required by OpenGL ABI for Linux
//#define GL_GLEXT_VERSION 7
-
+
+
/*
* NEW TOKENS TO OPENGL 1.2.1
*
- */
+ */
#ifndef GL_ARB_multitexture
#define GL_TEXTURE0_ARB 0x84C0
#define GL_TEXTURE1_ARB 0x84C1
@@ -80,421 +80,232 @@ extern "C" #define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
#define GL_ARB_multitexture 1
-#endif /*
*/ -
+#endif
+
#ifndef _WIN32
#ifdef GL_GLEXT_PROTOTYPES
- extern void APIENTRY glActiveTextureARB (GLenum); -
extern void APIENTRY glClientActiveTextureARB (GLenum); -
extern void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); -
extern void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); -
extern void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); -
extern void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); -
extern void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); -
extern void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); -
extern void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); -
extern void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); -
extern void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); -
extern void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); -
extern void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); -
extern void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); -
extern void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); -
extern void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); -
extern void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); -
extern void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); -
extern void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, - GLdouble); -
extern void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); -
extern void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, - GLfloat); -
extern void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); -
extern void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); -
extern void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); -
extern void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, - GLshort); -
extern void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); -
extern void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, - GLdouble, GLdouble); -
extern void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); -
extern void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, - GLfloat, GLfloat); -
extern void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); -
extern void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, - GLint); -
extern void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); -
extern void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, - GLshort, GLshort); -
extern void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); -
-#endif // GL_GLEXT_PROTOTYPES
-#else // not _WIN32
- typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -
typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, - GLdouble s); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, - const GLdouble * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, - GLfloat s); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, - const GLfloat * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, - GLint s); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, - const GLint * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, - GLshort s); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, - const GLshort * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, - GLdouble s, GLdouble t); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, - const GLdouble * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, - GLfloat s, GLfloat t); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, - const GLfloat * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, - GLint s, GLint t); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, - const GLint * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, - GLshort s, GLshort t); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, - const GLshort * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, - GLdouble s, GLdouble t, GLdouble r); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, - const GLdouble * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, - GLfloat s, GLfloat t, GLfloat r); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, - const GLfloat * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, - GLint s, GLint t, GLint r); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, - const GLint * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, - GLshort s, GLshort t, GLshort r); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, - const GLshort * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, - GLdouble s, GLdouble t, GLdouble r, GLdouble q); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, - const GLdouble * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, - GLfloat s, GLfloat t, GLfloat r, GLfloat q); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, - const GLfloat * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, - GLint s, GLint t, GLint r, GLint q); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, - const GLint * v); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, - GLshort s, GLshort t, GLshort r, GLshort q); -
typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, - const GLshort * v); -
-#endif // _WIN32
-
+extern void APIENTRY glActiveTextureARB (GLenum);
+extern void APIENTRY glClientActiveTextureARB (GLenum);
+extern void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
+extern void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
+extern void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
+extern void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
+extern void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
+extern void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
+extern void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
+extern void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
+extern void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
+extern void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
+extern void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
+extern void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
+extern void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
+extern void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
+extern void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
+extern void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
+extern void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
+extern void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
+extern void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
+extern void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
+extern void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
+extern void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
+extern void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
+extern void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
+extern void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+extern void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
+extern void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+extern void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
+extern void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
+extern void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
+extern void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
+extern void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
+#endif // GL_GLEXT_PROTOTYPES
+#else // not _WIN32
+typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+#endif // _WIN32
+
#ifdef ARB_MULTITEXTURE_INITIALIZE
#include<string.h> // string manipulation for runtime-check
-
+
#ifdef _WIN32
- PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = NULL; -
PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB = NULL; -
PFNGLMULTITEXCOORD1DARBPROC glMultiTexCoord1dARB = NULL; -
PFNGLMULTITEXCOORD1DVARBPROC glMultiTexCoord1dvARB = NULL; -
PFNGLMULTITEXCOORD1FARBPROC glMultiTexCoord1fARB = NULL; -
PFNGLMULTITEXCOORD1FVARBPROC glMultiTexCoord1fvARB = NULL; -
PFNGLMULTITEXCOORD1IARBPROC glMultiTexCoord1iARB = NULL; -
PFNGLMULTITEXCOORD1IVARBPROC glMultiTexCoord1ivARB = NULL; -
PFNGLMULTITEXCOORD1SARBPROC glMultiTexCoord1sARB = NULL; -
PFNGLMULTITEXCOORD1SVARBPROC glMultiTexCoord1svARB = NULL; -
PFNGLMULTITEXCOORD2DARBPROC glMultiTexCoord2dARB = NULL; -
PFNGLMULTITEXCOORD2DVARBPROC glMultiTexCoord2dvARB = NULL; -
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL; -
PFNGLMULTITEXCOORD2FVARBPROC glMultiTexCoord2fvARB = NULL; -
PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB = NULL; -
PFNGLMULTITEXCOORD2IVARBPROC glMultiTexCoord2ivARB = NULL; -
PFNGLMULTITEXCOORD2SARBPROC glMultiTexCoord2sARB = NULL; -
PFNGLMULTITEXCOORD2SVARBPROC glMultiTexCoord2svARB = NULL; -
PFNGLMULTITEXCOORD3DARBPROC glMultiTexCoord3dARB = NULL; -
PFNGLMULTITEXCOORD3DVARBPROC glMultiTexCoord3dvARB = NULL; -
PFNGLMULTITEXCOORD3FARBPROC glMultiTexCoord3fARB = NULL; -
PFNGLMULTITEXCOORD3FVARBPROC glMultiTexCoord3fvARB = NULL; -
PFNGLMULTITEXCOORD3IARBPROC glMultiTexCoord3iARB = NULL; -
PFNGLMULTITEXCOORD3IVARBPROC glMultiTexCoord3ivARB = NULL; -
PFNGLMULTITEXCOORD3SARBPROC glMultiTexCoord3sARB = NULL; -
PFNGLMULTITEXCOORD3SVARBPROC glMultiTexCoord3svARB = NULL; -
PFNGLMULTITEXCOORD4DARBPROC glMultiTexCoord4dARB = NULL; -
PFNGLMULTITEXCOORD4DVARBPROC glMultiTexCoord4dvARB = NULL; -
PFNGLMULTITEXCOORD4FARBPROC glMultiTexCoord4fARB = NULL; -
PFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB = NULL; -
PFNGLMULTITEXCOORD4IARBPROC glMultiTexCoord4iARB = NULL; -
PFNGLMULTITEXCOORD4IVARBPROC glMultiTexCoord4ivARB = NULL; -
PFNGLMULTITEXCOORD4SARBPROC glMultiTexCoord4sARB = NULL; -
PFNGLMULTITEXCOORD4SVARBPROC glMultiTexCoord4svARB = NULL; -
-#endif // _WIN32
-
int CheckForARBMultitextureSupport (void) - { -
const char search[] = "GL_ARB_multitexture"; -
int i, pos = 0; -
int maxpos = strlen (search) - 1; -
char extensions[10000]; -
printf ("Getting GLstring, context is %p\n", glXGetCurrentContext ()); -
strcpy (extensions, (const char *) glGetString (GL_EXTENSIONS)); -
printf ("Examinig GLstring\n"); -
int len = strlen (extensions); -
for (i = 0; i < len; i++) - { -
if ((i == 0) || ((i > 1) && extensions[i - 1] == ' ')) { -
pos = 0; -
while (extensions[i] != ' ') - { -
if (extensions[i] == search[pos]) - pos++; -
if ((pos > maxpos) && extensions[i + 1] == ' ') { -
- //if (debug)
- { -
- //fprintf(stderr, search);
- //fprintf(stderr, " supported.\n");
- } -
return 1; -
} -
++i; -
} -
} -
} -
- //printf(search);
- //printf(" not supported.\n");
- return 0; -
} -
int GL_ARB_multitexture_Init (void) - { -
if (!CheckForARBMultitextureSupport ()) - return 0; -
+PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = NULL;
+PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB = NULL;
+PFNGLMULTITEXCOORD1DARBPROC glMultiTexCoord1dARB = NULL;
+PFNGLMULTITEXCOORD1DVARBPROC glMultiTexCoord1dvARB = NULL;
+PFNGLMULTITEXCOORD1FARBPROC glMultiTexCoord1fARB = NULL;
+PFNGLMULTITEXCOORD1FVARBPROC glMultiTexCoord1fvARB = NULL;
+PFNGLMULTITEXCOORD1IARBPROC glMultiTexCoord1iARB = NULL;
+PFNGLMULTITEXCOORD1IVARBPROC glMultiTexCoord1ivARB = NULL;
+PFNGLMULTITEXCOORD1SARBPROC glMultiTexCoord1sARB = NULL;
+PFNGLMULTITEXCOORD1SVARBPROC glMultiTexCoord1svARB = NULL;
+PFNGLMULTITEXCOORD2DARBPROC glMultiTexCoord2dARB = NULL;
+PFNGLMULTITEXCOORD2DVARBPROC glMultiTexCoord2dvARB = NULL;
+PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;
+PFNGLMULTITEXCOORD2FVARBPROC glMultiTexCoord2fvARB = NULL;
+PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB = NULL;
+PFNGLMULTITEXCOORD2IVARBPROC glMultiTexCoord2ivARB = NULL;
+PFNGLMULTITEXCOORD2SARBPROC glMultiTexCoord2sARB = NULL;
+PFNGLMULTITEXCOORD2SVARBPROC glMultiTexCoord2svARB = NULL;
+PFNGLMULTITEXCOORD3DARBPROC glMultiTexCoord3dARB = NULL;
+PFNGLMULTITEXCOORD3DVARBPROC glMultiTexCoord3dvARB = NULL;
+PFNGLMULTITEXCOORD3FARBPROC glMultiTexCoord3fARB = NULL;
+PFNGLMULTITEXCOORD3FVARBPROC glMultiTexCoord3fvARB = NULL;
+PFNGLMULTITEXCOORD3IARBPROC glMultiTexCoord3iARB = NULL;
+PFNGLMULTITEXCOORD3IVARBPROC glMultiTexCoord3ivARB = NULL;
+PFNGLMULTITEXCOORD3SARBPROC glMultiTexCoord3sARB = NULL;
+PFNGLMULTITEXCOORD3SVARBPROC glMultiTexCoord3svARB = NULL;
+PFNGLMULTITEXCOORD4DARBPROC glMultiTexCoord4dARB = NULL;
+PFNGLMULTITEXCOORD4DVARBPROC glMultiTexCoord4dvARB = NULL;
+PFNGLMULTITEXCOORD4FARBPROC glMultiTexCoord4fARB = NULL;
+PFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB = NULL;
+PFNGLMULTITEXCOORD4IARBPROC glMultiTexCoord4iARB = NULL;
+PFNGLMULTITEXCOORD4IVARBPROC glMultiTexCoord4ivARB = NULL;
+PFNGLMULTITEXCOORD4SARBPROC glMultiTexCoord4sARB = NULL;
+PFNGLMULTITEXCOORD4SVARBPROC glMultiTexCoord4svARB = NULL;
+#endif // _WIN32
+
+int CheckForARBMultitextureSupport(void) {
+ const char search[]="GL_ARB_multitexture";
+ int i, pos=0;
+ int maxpos=strlen(search)-1;
+ char extensions[10000];
+ printf("Getting GLstring, context is %p\n", glXGetCurrentContext());
+ strcpy(extensions,(const char *)glGetString(GL_EXTENSIONS));
+ printf("Examinig GLstring\n");
+ int len=strlen(extensions);
+ for ( i=0; i<len; i++) {
+ if ((i==0) || ((i>1) && extensions[i-1]==' ')) {
+ pos=0;
+ while(extensions[i]!=' ') {
+ if (extensions[i]==search[pos]) pos++;
+ if ((pos>maxpos) && extensions[i+1]==' ') {
+ //if (debug)
+ {
+ //fprintf(stderr, search);
+ //fprintf(stderr, " supported.\n");
+ }
+ return 1;
+ }
+ ++i;
+ }
+ }
+ }
+ //printf(search);
+ //printf(" not supported.\n");
+ return 0;
+}
+
+int GL_ARB_multitexture_Init(void) {
+ if (!CheckForARBMultitextureSupport()) return 0;
#ifdef _WIN32
- glActiveTextureARB = - (PFNGLACTIVETEXTUREARBPROC) wglGetProcAddress ("glActiveTextureARB"); -
if (glActiveTextureARB == NULL) { - fprintf (stderr, "glActiveTextureARB not found.\n"); - return 0; - } -
glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC) - wglGetProcAddress ("glClientActiveTextureARB"); -
if (glClientActiveTextureARB == NULL) { - fprintf (stderr, "glClientActiveTextureARB not found.\n"); - return 0; - } -
glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC) - wglGetProcAddress ("glMultiTexCoord1dARB"); -
if (glMultiTexCoord1dARB == NULL) { - fprintf (stderr, "glMultiTexCoord1dARB not found.\n"); - return 0; - } -
glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC) - wglGetProcAddress ("glMultiTexCoord1dvARB"); -
if (glMultiTexCoord1dvARB == NULL) { - fprintf (stderr, "glMultiTexCoord1dAvRB not found.\n"); - return 0; - } -
glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC) - wglGetProcAddress ("glMultiTexCoord1fARB"); -
if (glMultiTexCoord1fARB == NULL) { - fprintf (stderr, "glMultiTexCoord1fARB not found.\n"); - return 0; - } -
glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC) - wglGetProcAddress ("glMultiTexCoord1fvARB"); -
if (glMultiTexCoord1fvARB == NULL) { - fprintf (stderr, "glMultiTexCoord1fvARB not found.\n"); - return 0; - } -
glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC) - wglGetProcAddress ("glMultiTexCoord1iARB"); -
if (glMultiTexCoord1iARB == NULL) { - fprintf (stderr, "glMultiTexCoord1iARB not found.\n"); - return 0; - } -
glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC) - wglGetProcAddress ("glMultiTexCoord1ivARB"); -
if (glMultiTexCoord1ivARB == NULL) { - fprintf (stderr, "glMultiTexCoord1ivARB not found.\n"); - return 0; - } -
glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC) - wglGetProcAddress ("glMultiTexCoord1sARB"); -
if (glMultiTexCoord1sARB == NULL) { - fprintf (stderr, "glMultiTexCoord1sARB not found.\n"); - return 0; - } -
glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC) - wglGetProcAddress ("glMultiTexCoord1svARB"); -
if (glMultiTexCoord1svARB == NULL) { - fprintf (stderr, "glMultiTexCoord1svARB not found.\n"); - return 0; - } -
glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC) - wglGetProcAddress ("glMultiTexCoord2dARB"); -
if (glMultiTexCoord2dARB == NULL) { - fprintf (stderr, "glMultiTexCoord2dARB not found.\n"); - return 0; - } -
glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC) - wglGetProcAddress ("glMultiTexCoord2dvARB"); -
if (glMultiTexCoord2dvARB == NULL) { - fprintf (stderr, "glMultiTexCoord2dAvRB not found.\n"); - return 0; - } -
glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC) - wglGetProcAddress ("glMultiTexCoord2fARB"); -
if (glMultiTexCoord2fARB == NULL) { - fprintf (stderr, "glMultiTexCoord2fARB not found.\n"); - return 0; - } -
glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC) - wglGetProcAddress ("glMultiTexCoord2fvARB"); -
if (glMultiTexCoord2fvARB == NULL) { - fprintf (stderr, "glMultiTexCoord2fvARB not found.\n"); - return 0; - } -
glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC) - wglGetProcAddress ("glMultiTexCoord2iARB"); -
if (glMultiTexCoord2iARB == NULL) { - fprintf (stderr, "glMultiTexCoord2iARB not found.\n"); - return 0; - } -
glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC) - wglGetProcAddress ("glMultiTexCoord2ivARB"); -
if (glMultiTexCoord2ivARB == NULL) { - fprintf (stderr, "glMultiTexCoord2ivARB not found.\n"); - return 0; - } -
glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC) - wglGetProcAddress ("glMultiTexCoord2sARB"); -
if (glMultiTexCoord2sARB == NULL) { - fprintf (stderr, "glMultiTexCoord2sARB not found.\n"); - return 0; - } -
glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC) - wglGetProcAddress ("glMultiTexCoord2svARB"); -
if (glMultiTexCoord2svARB == NULL) { - fprintf (stderr, "glMultiTexCoord2svARB not found.\n"); - return 0; - } -
glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC) - wglGetProcAddress ("glMultiTexCoord3dARB"); -
if (glMultiTexCoord3dARB == NULL) { - fprintf (stderr, "glMultiTexCoord3dARB not found.\n"); - return 0; - } -
glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC) - wglGetProcAddress ("glMultiTexCoord3dvARB"); -
if (glMultiTexCoord3dvARB == NULL) { - fprintf (stderr, "glMultiTexCoord3dAvRB not found.\n"); - return 0; - } -
glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC) - wglGetProcAddress ("glMultiTexCoord3fARB"); -
if (glMultiTexCoord3fARB == NULL) { - fprintf (stderr, "glMultiTexCoord3fARB not found.\n"); - return 0; - } -
glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC) - wglGetProcAddress ("glMultiTexCoord3fvARB"); -
if (glMultiTexCoord3fvARB == NULL) { - fprintf (stderr, "glMultiTexCoord3fvARB not found.\n"); - return 0; - } -
glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC) - wglGetProcAddress ("glMultiTexCoord3iARB"); -
if (glMultiTexCoord3iARB == NULL) { - fprintf (stderr, "glMultiTexCoord3iARB not found.\n"); - return 0; - } -
glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC) - wglGetProcAddress ("glMultiTexCoord3ivARB"); -
if (glMultiTexCoord3ivARB == NULL) { - fprintf (stderr, "glMultiTexCoord3ivARB not found.\n"); - return 0; - } -
glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC) - wglGetProcAddress ("glMultiTexCoord3sARB"); -
if (glMultiTexCoord3sARB == NULL) { - fprintf (stderr, "glMultiTexCoord3sARB not found.\n"); - return 0; - } -
glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC) - wglGetProcAddress ("glMultiTexCoord3svARB"); -
if (glMultiTexCoord3svARB == NULL) { - fprintf (stderr, "glMultiTexCoord3svARB not found.\n"); - return 0; - } -
glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC) - wglGetProcAddress ("glMultiTexCoord4dARB"); -
if (glMultiTexCoord4dARB == NULL) { - fprintf (stderr, "glMultiTexCoord4dARB not found.\n"); - return 0; - } -
glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC) - wglGetProcAddress ("glMultiTexCoord4dvARB"); -
if (glMultiTexCoord4dvARB == NULL) { - fprintf (stderr, "glMultiTexCoord4dAvRB not found.\n"); - return 0; - } -
glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC) - wglGetProcAddress ("glMultiTexCoord4fARB"); -
if (glMultiTexCoord4fARB == NULL) { - fprintf (stderr, "glMultiTexCoord4fARB not found.\n"); - return 0; - } -
glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC) - wglGetProcAddress ("glMultiTexCoord4fvARB"); -
if (glMultiTexCoord4fvARB == NULL) { - fprintf (stderr, "glMultiTexCoord4fvARB not found.\n"); - return 0; - } -
glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC) - wglGetProcAddress ("glMultiTexCoord4iARB"); -
if (glMultiTexCoord4iARB == NULL) { - fprintf (stderr, "glMultiTexCoord4iARB not found.\n"); - return 0; - } -
glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC) - wglGetProcAddress ("glMultiTexCoord4ivARB"); -
if (glMultiTexCoord4ivARB == NULL) { - fprintf (stderr, "glMultiTexCoord4ivARB not found.\n"); - return 0; - } -
glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC) - wglGetProcAddress ("glMultiTexCoord4sARB"); -
if (glMultiTexCoord4sARB == NULL) { - fprintf (stderr, "glMultiTexCoord4sARB not found.\n"); - return 0; - } -
glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC) - wglGetProcAddress ("glMultiTexCoord4svARB"); -
if (glMultiTexCoord4svARB == NULL) { - fprintf (stderr, "glMultiTexCoord4svARB not found.\n"); - return 0; - } -
+ glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) wglGetProcAddress("glActiveTextureARB");
+ if (glActiveTextureARB==NULL) {fprintf(stderr,"glActiveTextureARB not found.\n"); return 0; }
+ glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC) wglGetProcAddress("glClientActiveTextureARB");
+ if (glClientActiveTextureARB==NULL) {fprintf(stderr,"glClientActiveTextureARB not found.\n"); return 0; }
+ glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC) wglGetProcAddress("glMultiTexCoord1dARB");
+ if (glMultiTexCoord1dARB==NULL) {fprintf(stderr,"glMultiTexCoord1dARB not found.\n"); return 0; }
+ glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC) wglGetProcAddress("glMultiTexCoord1dvARB");
+ if (glMultiTexCoord1dvARB==NULL) {fprintf(stderr,"glMultiTexCoord1dAvRB not found.\n"); return 0; }
+ glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC) wglGetProcAddress("glMultiTexCoord1fARB");
+ if (glMultiTexCoord1fARB==NULL) {fprintf(stderr,"glMultiTexCoord1fARB not found.\n"); return 0; }
+ glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC) wglGetProcAddress("glMultiTexCoord1fvARB");
+ if (glMultiTexCoord1fvARB==NULL) {fprintf(stderr,"glMultiTexCoord1fvARB not found.\n"); return 0; }
+ glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC) wglGetProcAddress("glMultiTexCoord1iARB");
+ if (glMultiTexCoord1iARB==NULL) {fprintf(stderr,"glMultiTexCoord1iARB not found.\n"); return 0; }
+ glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC) wglGetProcAddress("glMultiTexCoord1ivARB");
+ if (glMultiTexCoord1ivARB==NULL) {fprintf(stderr,"glMultiTexCoord1ivARB not found.\n"); return 0; }
+ glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC) wglGetProcAddress("glMultiTexCoord1sARB");
+ if (glMultiTexCoord1sARB==NULL) {fprintf(stderr,"glMultiTexCoord1sARB not found.\n"); return 0; }
+ glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC) wglGetProcAddress("glMultiTexCoord1svARB");
+ if (glMultiTexCoord1svARB==NULL) {fprintf(stderr,"glMultiTexCoord1svARB not found.\n"); return 0; }
+ glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC) wglGetProcAddress("glMultiTexCoord2dARB");
+ if (glMultiTexCoord2dARB==NULL) {fprintf(stderr,"glMultiTexCoord2dARB not found.\n"); return 0; }
+ glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC) wglGetProcAddress("glMultiTexCoord2dvARB");
+ if (glMultiTexCoord2dvARB==NULL) {fprintf(stderr,"glMultiTexCoord2dAvRB not found.\n"); return 0; }
+ glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC) wglGetProcAddress("glMultiTexCoord2fARB");
+ if (glMultiTexCoord2fARB==NULL) {fprintf(stderr,"glMultiTexCoord2fARB not found.\n"); return 0; }
+ glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC) wglGetProcAddress("glMultiTexCoord2fvARB");
+ if (glMultiTexCoord2fvARB==NULL) {fprintf(stderr,"glMultiTexCoord2fvARB not found.\n"); return 0; }
+ glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC) wglGetProcAddress("glMultiTexCoord2iARB");
+ if (glMultiTexCoord2iARB==NULL) {fprintf(stderr,"glMultiTexCoord2iARB not found.\n"); return 0; }
+ glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC) wglGetProcAddress("glMultiTexCoord2ivARB");
+ if (glMultiTexCoord2ivARB==NULL) {fprintf(stderr,"glMultiTexCoord2ivARB not found.\n"); return 0; }
+ glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC) wglGetProcAddress("glMultiTexCoord2sARB");
+ if (glMultiTexCoord2sARB==NULL) {fprintf(stderr,"glMultiTexCoord2sARB not found.\n"); return 0; }
+ glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC) wglGetProcAddress("glMultiTexCoord2svARB");
+ if (glMultiTexCoord2svARB==NULL) {fprintf(stderr,"glMultiTexCoord2svARB not found.\n"); return 0; }
+ glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC) wglGetProcAddress("glMultiTexCoord3dARB");
+ if (glMultiTexCoord3dARB==NULL) {fprintf(stderr,"glMultiTexCoord3dARB not found.\n"); return 0; }
+ glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC) wglGetProcAddress("glMultiTexCoord3dvARB");
+ if (glMultiTexCoord3dvARB==NULL) {fprintf(stderr,"glMultiTexCoord3dAvRB not found.\n"); return 0; }
+ glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC) wglGetProcAddress("glMultiTexCoord3fARB");
+ if (glMultiTexCoord3fARB==NULL) {fprintf(stderr,"glMultiTexCoord3fARB not found.\n"); return 0; }
+ glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC) wglGetProcAddress("glMultiTexCoord3fvARB");
+ if (glMultiTexCoord3fvARB==NULL) {fprintf(stderr,"glMultiTexCoord3fvARB not found.\n"); return 0; }
+ glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC) wglGetProcAddress("glMultiTexCoord3iARB");
+ if (glMultiTexCoord3iARB==NULL) {fprintf(stderr,"glMultiTexCoord3iARB not found.\n"); return 0; }
+ glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC) wglGetProcAddress("glMultiTexCoord3ivARB");
+ if (glMultiTexCoord3ivARB==NULL) {fprintf(stderr,"glMultiTexCoord3ivARB not found.\n"); return 0; }
+ glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC) wglGetProcAddress("glMultiTexCoord3sARB");
+ if (glMultiTexCoord3sARB==NULL) {fprintf(stderr,"glMultiTexCoord3sARB not found.\n"); return 0; }
+ glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC) wglGetProcAddress("glMultiTexCoord3svARB");
+ if (glMultiTexCoord3svARB==NULL) {fprintf(stderr,"glMultiTexCoord3svARB not found.\n"); return 0; }
+ glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC) wglGetProcAddress("glMultiTexCoord4dARB");
+ if (glMultiTexCoord4dARB==NULL) {fprintf(stderr,"glMultiTexCoord4dARB not found.\n"); return 0; }
+ glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC) wglGetProcAddress("glMultiTexCoord4dvARB");
+ if (glMultiTexCoord4dvARB==NULL) {fprintf(stderr,"glMultiTexCoord4dAvRB not found.\n"); return 0; }
+ glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC) wglGetProcAddress("glMultiTexCoord4fARB");
+ if (glMultiTexCoord4fARB==NULL) {fprintf(stderr,"glMultiTexCoord4fARB not found.\n"); return 0; }
+ glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC) wglGetProcAddress("glMultiTexCoord4fvARB");
+ if (glMultiTexCoord4fvARB==NULL) {fprintf(stderr,"glMultiTexCoord4fvARB not found.\n"); return 0; }
+ glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC) wglGetProcAddress("glMultiTexCoord4iARB");
+ if (glMultiTexCoord4iARB==NULL) {fprintf(stderr,"glMultiTexCoord4iARB not found.\n"); return 0; }
+ glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC) wglGetProcAddress("glMultiTexCoord4ivARB");
+ if (glMultiTexCoord4ivARB==NULL) {fprintf(stderr,"glMultiTexCoord4ivARB not found.\n"); return 0; }
+ glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC) wglGetProcAddress("glMultiTexCoord4sARB");
+ if (glMultiTexCoord4sARB==NULL) {fprintf(stderr,"glMultiTexCoord4sARB not found.\n"); return 0; }
+ glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC) wglGetProcAddress("glMultiTexCoord4svARB");
+ if (glMultiTexCoord4svARB==NULL) {fprintf(stderr,"glMultiTexCoord4svARB not found.\n"); return 0; }
#endif // _WIN32
- return 1; -
} -
+ return 1;
+}
+
#endif // ARB_MULTITEXTURE_INITIALIZE
-
+
#ifdef __cplusplus
-} - +}
+#endif
-#endif /*
*/ -
#endif // not __ARB_MULTITEXTURE_H_
diff --git a/sys/glsink/EXT_paletted_texture.h b/sys/glsink/EXT_paletted_texture.h index 7cc3e5d9..37e9a9bf 100644 --- a/sys/glsink/EXT_paletted_texture.h +++ b/sys/glsink/EXT_paletted_texture.h @@ -7,42 +7,42 @@ * *
* version 1.0ß *
* *
- *************************************************************/
-
+ *************************************************************/
+
#ifndef __EXT_paletted_texture_H_
#define __EXT_paletted_texture_H_
-
+
/*
* GLOBAL SWITCHES - enable/disable advanced features of this header
*
- */
-#define EXT_PALETTED_TEXTURE_INITIALIZE 1 // enable generic init-routines
+ */
+#define EXT_PALETTED_TEXTURE_INITIALIZE 1 // enable generic init-routines
#ifndef _WIN32
#define GL_GLEXT_PROTOTYPES 1
-#endif /*
*/ -
+#endif
+
#ifdef __cplusplus
-extern "C" -{ -
-#endif /*
*/ -
+extern "C" {
+#endif
+
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
-#endif /*
*/ -
+#endif
+
#ifndef APIENTRY
#define APIENTRY
-#endif /*
*/ -
+#endif
+
+
// Header file version number, required by OpenGL ABI for Linux
//#define GL_GLEXT_VERSION 7
-
+
+
/*
* NEW TOKENS TO OPENGL 1.2.1
*
- */
+ */
#ifndef GL_EXT_paletted_texture
#define GL_COLOR_INDEX1_EXT 0x80E2
#define GL_COLOR_INDEX2_EXT 0x80E3
@@ -60,128 +60,83 @@ extern "C" #define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF
#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
#define GL_EXT_paletted_texture 1
-#endif /*
*/ -
+#endif
+
#ifndef _WIN32
#ifdef GL_GLEXT_PROTOTYPES
- extern void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, - const GLvoid *); -
extern void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, - GLenum, const GLvoid *); -
extern void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); -
extern void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, - GLint *); -
extern void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, - GLfloat *); -
-#endif // GL_GLEXT_PROTOTYPES
-#else // _WIN32
- typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, - GLenum internalFormat, GLsizei width, GLenum format, GLenum type, - const GLvoid * data); -
typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, - GLsizei start, GLsizei count, GLenum format, GLenum type, - const GLvoid * data); -
typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, - GLenum format, GLenum type, GLvoid * data); -
typedef void (APIENTRY * - PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, - GLint * params); -
typedef void (APIENTRY * - PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, - GLfloat * params); -
-#endif // not _WIN32
-
+extern void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+extern void APIENTRY glColorSubTableEXT(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+extern void APIENTRY glGetColorTableEXT(GLenum, GLenum, GLenum, GLvoid *);
+extern void APIENTRY glGetColorTableParameterivEXT(GLenum, GLenum, GLint *);
+extern void APIENTRY glGetColorTableParameterfvEXT(GLenum, GLenum, GLfloat *);
+#endif // GL_GLEXT_PROTOTYPES
+#else // _WIN32
+typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC)(GLenum target, GLenum format, GLenum type, GLvoid *data);
+typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat *params);
+#endif // not _WIN32
+
#ifdef EXT_PALETTED_TEXTURE_INITIALIZE
-#include<string.h> // string manipulation for runtime-check
-
+#include<string.h> // string manipulation for runtime-check
+
#ifdef _WIN32
- PFNGLCOLORTABLEEXTPROC glColorTableEXT = NULL; -
PFNGLCOLORSUBTABLEEXTPROC glColorSubTableEXT = NULL; -
PFNGLGETCOLORTABLEEXTPROC glGetColorTableEXT = NULL; -
PFNGLGETCOLORTABLEPARAMETERIVEXTPROC glGetColorTableParameterivEXT = NULL; -
PFNGLGETCOLORTABLEPARAMETERFVEXTPROC glGetColorTableParameterfvEXT = NULL; -
-#endif // _WIN32
-
int CheckForEXTPalettedTextureSupport (void) - { -
const char search[] = "GL_EXT_paletted_texture"; -
int i, pos = 0; -
int maxpos = strlen (search) - 1; -
char extensions[10000]; -
strcpy (extensions, (const char *) glGetString (GL_EXTENSIONS)); -
int len = strlen (extensions); -
for (i = 0; i < len; i++) - { -
if ((i == 0) || ((i > 1) && extensions[i - 1] == ' ')) { -
pos = 0; -
while (extensions[i] != ' ') - { -
if (extensions[i] == search[pos]) - pos++; -
if ((pos > maxpos) && extensions[i + 1] == ' ') { -
- //printf(search);
- //printf(" supported.\n");
- return 1; -
} -
i++; -
} -
} -
} -
- //printf(search);
- //printf(" not supported.\n");
- return 0; -
} -
int GL_EXT_paletted_texture_Init (void) - { -
if (!CheckForEXTPalettedTextureSupport ()) - return 0; -
+PFNGLCOLORTABLEEXTPROC glColorTableEXT = NULL;
+PFNGLCOLORSUBTABLEEXTPROC glColorSubTableEXT = NULL;
+PFNGLGETCOLORTABLEEXTPROC glGetColorTableEXT = NULL;
+PFNGLGETCOLORTABLEPARAMETERIVEXTPROC glGetColorTableParameterivEXT = NULL;
+PFNGLGETCOLORTABLEPARAMETERFVEXTPROC glGetColorTableParameterfvEXT = NULL;
+#endif // _WIN32
+
+int CheckForEXTPalettedTextureSupport(void) {
+ const char search[]="GL_EXT_paletted_texture";
+ int i, pos=0;
+ int maxpos=strlen(search)-1;
+ char extensions[10000];
+ strcpy(extensions,(const char *)glGetString(GL_EXTENSIONS));
+ int len=strlen(extensions);
+ for (i=0; i<len; i++) {
+ if ((i==0) || ((i>1) && extensions[i-1]==' ')) {
+ pos=0;
+ while(extensions[i]!=' ') {
+ if (extensions[i]==search[pos]) pos++;
+ if ((pos>maxpos) && extensions[i+1]==' ') {
+ //printf(search);
+ //printf(" supported.\n");
+ return 1;
+ }
+ i++;
+ }
+ }
+ }
+ //printf(search);
+ //printf(" not supported.\n");
+ return 0;
+}
+
+int GL_EXT_paletted_texture_Init(void) {
+ if (!CheckForEXTPalettedTextureSupport()) return 0;
+
#ifdef _WIN32
- glColorTableEXT = - (PFNGLCOLORTABLEEXTPROC) wglGetProcAddress ("glColorTableEXT"); -
if (glColorTableEXT == NULL) { - fprintf (stderr, "glColorTableEXT not found.\n"); - return 0; - } -
glColorSubTableEXT = - (PFNGLCOLORSUBTABLEEXTPROC) wglGetProcAddress ("glColorSubTableEXT"); -
if (glColorSubTableEXT == NULL) { - fprintf (stderr, "glColorSubTableEXT not found.\n"); - return 0; - } -
glGetColorTableEXT = - (PFNGLGETCOLORTABLEEXTPROC) wglGetProcAddress ("glGetColorTableEXT"); -
if (glGetColorTableEXT == NULL) { - fprintf (stderr, "glGetColorTableEXT not found.\n"); - return 0; - } -
glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) - wglGetProcAddress ("glGetColorTableParameterivEXT"); -
if (glGetColorTableParameterivEXT == NULL) { - fprintf (stderr, "glGetColorTableParameterivEXT not found.\n"); - return 0; - } -
glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) - wglGetProcAddress ("glGetColorTableParameterfvEXT"); -
if (glGetColorTableParameterfvEXT == NULL) { - fprintf (stderr, "glGetColorTableParameterfvEXT not found.\n"); - return 0; - } -
+ glColorTableEXT = (PFNGLCOLORTABLEEXTPROC) wglGetProcAddress("glColorTableEXT");
+ if (glColorTableEXT==NULL) {fprintf(stderr,"glColorTableEXT not found.\n"); return 0;}
+ glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC) wglGetProcAddress("glColorSubTableEXT");
+ if (glColorSubTableEXT==NULL) {fprintf(stderr,"glColorSubTableEXT not found.\n"); return 0;}
+ glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC) wglGetProcAddress("glGetColorTableEXT");
+ if (glGetColorTableEXT==NULL) {fprintf(stderr,"glGetColorTableEXT not found.\n"); return 0;}
+ glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) wglGetProcAddress("glGetColorTableParameterivEXT");
+ if (glGetColorTableParameterivEXT==NULL) {fprintf(stderr,"glGetColorTableParameterivEXT not found.\n"); return 0;}
+ glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) wglGetProcAddress("glGetColorTableParameterfvEXT");
+ if (glGetColorTableParameterfvEXT==NULL) {fprintf(stderr,"glGetColorTableParameterfvEXT not found.\n"); return 0;}
#endif // _WIN32
- return 1; -
} -
+ return 1;
+}
+
#endif // EXT_PALETTED_TEXTURE_INITIALIZE
-
+
#ifdef __cplusplus
-} - +}
+#endif
-#endif /*
*/ -
#endif // not __EXT_PALETTED_TEXTURE_H_
diff --git a/sys/glsink/NV_register_combiners.h b/sys/glsink/NV_register_combiners.h index 83f33edc..52b74c39 100644 --- a/sys/glsink/NV_register_combiners.h +++ b/sys/glsink/NV_register_combiners.h @@ -7,42 +7,42 @@ * *
* version 2.0ß *
* *
- *************************************************************/
-
+ *************************************************************/
+
#ifndef __NV_register_combiners_H_
#define __NV_register_combiners_H_
-
+
/*
* GLOBAL SWITCHES - enable/disable advanced features of this header
*
- */
-#define NV_REGISTER_COMBINERS_INITIALIZE 1 // enable generic init-routines
+ */
+#define NV_REGISTER_COMBINERS_INITIALIZE 1 // enable generic init-routines
#ifndef _WIN32
#define GL_GLEXT_PROTOTYPES 1
-#endif /*
*/ -
+#endif
+
#ifdef __cplusplus
-extern "C" -{ -
-#endif /*
*/ -
+extern "C" {
+#endif
+
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
-#endif /*
*/ -
+#endif
+
#ifndef APIENTRY
#define APIENTRY
-#endif /*
*/ -
+#endif
+
+
// Header file version number, required by OpenGL ABI for Linux
//#define GL_GLEXT_VERSION 7
-
+
+
/*
* NEW TOKENS TO OPENGL 1.2.1
*
- */
+ */
#ifndef GL_NV_register_combiners
#define GL_REGISTER_COMBINERS_NV 0x8522
#define GL_COMBINER0_NV 0x8550
@@ -96,228 +96,123 @@ extern "C" #define GL_COLOR_SUM_CLAMP_NV 0x854F
#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
#define GL_NV_register_combiners 1
-#endif /*
*/ -
+#endif
+
#ifndef _WIN32
#ifdef GL_GLEXT_PROTOTYPES
- extern void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); -
extern void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); -
extern void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); -
extern void APIENTRY glCombinerParameteriNV (GLenum, GLint); -
extern void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, - GLenum, GLenum); -
extern void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, - GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); -
extern void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, - GLenum); -
extern void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, - GLenum, GLenum, GLfloat *); -
extern void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, - GLenum, GLenum, GLint *); -
extern void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, - GLenum, GLfloat *); -
extern void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, - GLenum, GLint *); -
extern void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, - GLfloat *); -
extern void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, - GLint *); -
-#endif // GL_GLEXT_PROTOTYPES
-#else // _WIN32
- typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, - const GLfloat * params); -
typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, - const GLint * params); -
typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, - GLfloat param); -
typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, - GLint param); -
typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, - GLenum portion, GLenum variable, GLenum input, GLenum mapping, - GLenum componentUsage); -
typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, - GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, - GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, - GLboolean muxSum); -
typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, - GLenum input, GLenum mapping, GLenum componentUsage); -
typedef void (APIENTRY * - PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, - GLenum variable, GLenum pname, GLfloat * params); -
typedef void (APIENTRY * - PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, - GLenum variable, GLenum pname, GLint * params); -
typedef void (APIENTRY * - PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, - GLenum pname, GLfloat * params); -
typedef void (APIENTRY * - PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, - GLenum pname, GLint * params); -
typedef void (APIENTRY * - PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, - GLenum pname, GLfloat * params); -
typedef void (APIENTRY * - PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, - GLenum pname, GLint * params); -
-#endif // not _WIN32
-
+extern void APIENTRY glCombinerParameterfvNV(GLenum, const GLfloat *);
+extern void APIENTRY glCombinerParameterivNV(GLenum, const GLint *);
+extern void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
+extern void APIENTRY glCombinerParameteriNV (GLenum, GLint);
+extern void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
+extern void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
+extern void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
+extern void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
+extern void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
+extern void APIENTRY glGetCombinerOutputParameterfvNV(GLenum, GLenum, GLenum, GLfloat *);
+extern void APIENTRY glGetCombinerOutputParameterivNV(GLenum, GLenum, GLenum, GLint *);
+extern void APIENTRY glGetFinalCombinerInputParameterfvNV(GLenum, GLenum, GLfloat *);
+extern void APIENTRY glGetFinalCombinerInputParameterivNV(GLenum, GLenum, GLint *);
+#endif // GL_GLEXT_PROTOTYPES
+#else // _WIN32
+typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)(GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)(GLenum stage, GLenum portion, GLenum pname, GLint *params);
+typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)(GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)(GLenum variable, GLenum pname, GLint *params);
+#endif // not _WIN32
+
#ifdef NV_REGISTER_COMBINERS_INITIALIZE
-#include<string.h> // string manipulation for runtime-check
-
+#include<string.h> // string manipulation for runtime-check
+
#ifdef _WIN32
- PFNGLCOMBINERPARAMETERFVNVPROC glCombinerParameterfvNV = NULL; -
PFNGLCOMBINERPARAMETERIVNVPROC glCombinerParameterivNV = NULL; -
PFNGLCOMBINERPARAMETERFNVPROC glCombinerParameterfNV = NULL; -
PFNGLCOMBINERPARAMETERINVPROC glCombinerParameteriNV = NULL; -
PFNGLCOMBINERINPUTNVPROC glCombinerInputNV = NULL; -
PFNGLCOMBINEROUTPUTNVPROC glCombinerOutputNV = NULL; -
PFNGLFINALCOMBINERINPUTNVPROC glFinalCombinerInputNV = NULL; -
PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC glGetCombinerInputParameterfvNV = - NULL; -
PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC glGetCombinerInputParameterivNV = - NULL; -
PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC glGetCombinerOutputParameterfvNV = - NULL; -
PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC glGetCombinerOutputParameterivNV = - NULL; -
PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC - glGetFinalCombinerInputParameterfvNV = NULL; -
PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC - glGetFinalCombinerInputParameterivNV = NULL; -
-#endif // _WIN32
-
int CheckForNVRegisterCombinersSupport (void) - { -
const char search[] = "GL_NV_register_combiners"; -
int i, pos = 0; -
int maxpos = strlen (search) - 1; -
char extensions[10000]; -
strcpy (extensions, (const char *) glGetString (GL_EXTENSIONS)); -
int len = strlen (extensions); -
for (i = 0; i < len; i++) - { -
if ((i == 0) || ((i > 1) && extensions[i - 1] == ' ')) { -
pos = 0; -
while (extensions[i] != ' ') - { -
if (extensions[i] == search[pos]) - pos++; -
if ((pos > maxpos) && extensions[i + 1] == ' ') { -
- //printf(search);
- // printf(" supported.\n");
- return 1; -
} -
i++; -
} -
} -
} -
- //printf(search);
- //printf(" not supported.\n");
- return 0; -
} -
int GL_NV_register_combiners_Init (void) - { -
if (!CheckForNVRegisterCombinersSupport ()) - return 0; -
+PFNGLCOMBINERPARAMETERFVNVPROC glCombinerParameterfvNV = NULL;
+PFNGLCOMBINERPARAMETERIVNVPROC glCombinerParameterivNV = NULL;
+PFNGLCOMBINERPARAMETERFNVPROC glCombinerParameterfNV = NULL;
+PFNGLCOMBINERPARAMETERINVPROC glCombinerParameteriNV = NULL;
+PFNGLCOMBINERINPUTNVPROC glCombinerInputNV = NULL;
+PFNGLCOMBINEROUTPUTNVPROC glCombinerOutputNV = NULL;
+PFNGLFINALCOMBINERINPUTNVPROC glFinalCombinerInputNV = NULL;
+PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC glGetCombinerInputParameterfvNV = NULL;
+PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC glGetCombinerInputParameterivNV = NULL;
+PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC glGetCombinerOutputParameterfvNV = NULL;
+PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC glGetCombinerOutputParameterivNV = NULL;
+PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC glGetFinalCombinerInputParameterfvNV = NULL;
+PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC glGetFinalCombinerInputParameterivNV = NULL;
+#endif // _WIN32
+
+int CheckForNVRegisterCombinersSupport(void) {
+ const char search[]="GL_NV_register_combiners";
+ int i, pos=0;
+ int maxpos=strlen(search)-1;
+ char extensions[10000];
+ strcpy(extensions,(const char *)glGetString(GL_EXTENSIONS));
+ int len=strlen(extensions);
+ for (i=0; i<len; i++) {
+ if ((i==0) || ((i>1) && extensions[i-1]==' ')) {
+ pos=0;
+ while(extensions[i]!=' ') {
+ if (extensions[i]==search[pos]) pos++;
+ if ((pos>maxpos) && extensions[i+1]==' ') {
+ //printf(search);
+ // printf(" supported.\n");
+ return 1;
+ }
+ i++;
+ }
+ }
+ }
+ //printf(search);
+ //printf(" not supported.\n");
+ return 0;
+}
+
+int GL_NV_register_combiners_Init(void) {
+ if (!CheckForNVRegisterCombinersSupport()) return 0;
+
#ifdef _WIN32
- glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC) - wglGetProcAddress ("glCombinerParameterfvNV"); -
if (glCombinerParameterfvNV == NULL) { - fprintf (stderr, "glCombinerParameterfvNV not found.\n"); - return 0; - } -
glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC) - wglGetProcAddress ("glCombinerParameterivNV"); -
if (glCombinerParameterivNV == NULL) { - fprintf (stderr, "glCombinerParameterivNV not found.\n"); - return 0; - } -
glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC) - wglGetProcAddress ("glCombinerParameterfNV"); -
if (glCombinerParameterfvNV == NULL) { - fprintf (stderr, "glCombinerParameterfNV not found.\n"); - return 0; - } -
glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC) - wglGetProcAddress ("glCombinerParameteriNV"); -
if (glCombinerParameterivNV == NULL) { - fprintf (stderr, "glCombinerParameteriNV not found.\n"); - return 0; - } -
glCombinerInputNV = - (PFNGLCOMBINERINPUTNVPROC) wglGetProcAddress ("glCombinerInputNV"); -
if (glCombinerInputNV == NULL) { - fprintf (stderr, "glCombinerInputNV not found.\n"); - return 0; - } -
glCombinerOutputNV = - (PFNGLCOMBINEROUTPUTNVPROC) wglGetProcAddress ("glCombinerOutputNV"); -
if (glCombinerOutputNV == NULL) { - fprintf (stderr, "glCombinerOutputNV not found.\n"); - return 0; - } -
glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC) - wglGetProcAddress ("glFinalCombinerInputNV"); -
if (glFinalCombinerInputNV == NULL) { - fprintf (stderr, "glFinalCombinerInputNV not found.\n"); - return 0; - } -
glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) - wglGetProcAddress ("glGetCombinerInputParameterfvNV"); -
if (glGetCombinerInputParameterfvNV == NULL) { - fprintf (stderr, "glGetCombinerInputParameterfvNV not found.\n"); - return 0; - } -
glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) - wglGetProcAddress ("glGetCombinerInputParameterivNV"); -
if (glGetCombinerInputParameterivNV == NULL) { - fprintf (stderr, "glGetCombinerInputParameterivNV not found.\n"); - return 0; - } -
glGetCombinerOutputParameterfvNV = - (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) - wglGetProcAddress ("glGetCombinerOutputParameterfvNV"); -
if (glGetCombinerOutputParameterfvNV == NULL) { - fprintf (stderr, "glGetCombinerOutputParameterfvNV not found.\n"); - return 0; - } -
glGetCombinerOutputParameterivNV = - (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) - wglGetProcAddress ("glGetCombinerOutputParameterivNV"); -
if (glGetCombinerOutputParameterivNV == NULL) { - fprintf (stderr, "glGetCombinerOutputParameterivNV not found.\n"); - return 0; - } -
glGetFinalCombinerInputParameterfvNV = - (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) - wglGetProcAddress ("glGetFinalCombinerInputParameterfvNV"); -
if (glGetFinalCombinerInputParameterfvNV == NULL) { - fprintf (stderr, "glGetFinalCombinerInputParameterfvNV not found.\n"); - return 0; - } -
glGetFinalCombinerInputParameterivNV = - (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) - wglGetProcAddress ("glGetFinalCombinerInputParameterivNV"); -
if (glGetFinalCombinerInputParameterivNV == NULL) { - fprintf (stderr, "glGetFinalCombinerInputParameterivNV not found.\n"); - return 0; - } -
+ glCombinerParameterfvNV=(PFNGLCOMBINERPARAMETERFVNVPROC) wglGetProcAddress("glCombinerParameterfvNV");
+ if (glCombinerParameterfvNV==NULL) {fprintf(stderr,"glCombinerParameterfvNV not found.\n"); return 0;}
+ glCombinerParameterivNV=(PFNGLCOMBINERPARAMETERIVNVPROC) wglGetProcAddress("glCombinerParameterivNV");
+ if (glCombinerParameterivNV==NULL) {fprintf(stderr,"glCombinerParameterivNV not found.\n"); return 0;}
+ glCombinerParameterfNV=(PFNGLCOMBINERPARAMETERFNVPROC) wglGetProcAddress("glCombinerParameterfNV");
+ if (glCombinerParameterfvNV==NULL) {fprintf(stderr,"glCombinerParameterfNV not found.\n"); return 0;}
+ glCombinerParameteriNV=(PFNGLCOMBINERPARAMETERINVPROC) wglGetProcAddress("glCombinerParameteriNV");
+ if (glCombinerParameterivNV==NULL) {fprintf(stderr,"glCombinerParameteriNV not found.\n"); return 0;}
+ glCombinerInputNV=(PFNGLCOMBINERINPUTNVPROC) wglGetProcAddress("glCombinerInputNV");
+ if (glCombinerInputNV==NULL) {fprintf(stderr,"glCombinerInputNV not found.\n"); return 0;}
+ glCombinerOutputNV=(PFNGLCOMBINEROUTPUTNVPROC) wglGetProcAddress("glCombinerOutputNV");
+ if (glCombinerOutputNV==NULL) {fprintf(stderr,"glCombinerOutputNV not found.\n"); return 0;}
+ glFinalCombinerInputNV=(PFNGLFINALCOMBINERINPUTNVPROC) wglGetProcAddress("glFinalCombinerInputNV");
+ if (glFinalCombinerInputNV==NULL) {fprintf(stderr,"glFinalCombinerInputNV not found.\n"); return 0;}
+ glGetCombinerInputParameterfvNV=(PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) wglGetProcAddress("glGetCombinerInputParameterfvNV");
+ if (glGetCombinerInputParameterfvNV==NULL) {fprintf(stderr,"glGetCombinerInputParameterfvNV not found.\n"); return 0;}
+ glGetCombinerInputParameterivNV=(PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) wglGetProcAddress("glGetCombinerInputParameterivNV");
+ if (glGetCombinerInputParameterivNV==NULL) {fprintf(stderr,"glGetCombinerInputParameterivNV not found.\n"); return 0;}
+ glGetCombinerOutputParameterfvNV=(PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) wglGetProcAddress("glGetCombinerOutputParameterfvNV");
+ if (glGetCombinerOutputParameterfvNV==NULL) {fprintf(stderr,"glGetCombinerOutputParameterfvNV not found.\n"); return 0;}
+ glGetCombinerOutputParameterivNV=(PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) wglGetProcAddress("glGetCombinerOutputParameterivNV");
+ if (glGetCombinerOutputParameterivNV==NULL) {fprintf(stderr,"glGetCombinerOutputParameterivNV not found.\n"); return 0;}
+ glGetFinalCombinerInputParameterfvNV=(PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) wglGetProcAddress("glGetFinalCombinerInputParameterfvNV");
+ if (glGetFinalCombinerInputParameterfvNV==NULL) {fprintf(stderr,"glGetFinalCombinerInputParameterfvNV not found.\n"); return 0;}
+ glGetFinalCombinerInputParameterivNV=(PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) wglGetProcAddress("glGetFinalCombinerInputParameterivNV");
+ if (glGetFinalCombinerInputParameterivNV==NULL) {fprintf(stderr,"glGetFinalCombinerInputParameterivNV not found.\n"); return 0;}
#endif // _WIN32
- return 1; -
} -
+ return 1;
+}
+
#endif // NV_REGISTER_COMBINERS_INITIALIZE
-
+
#ifdef __cplusplus
-} - +}
+#endif
-#endif /*
*/ -
#endif // not __NV_REGISTER_COMBINERS_H_
diff --git a/sys/glsink/gstglsink.h b/sys/glsink/gstglsink.h index 036ee78d..8a34df9a 100644 --- a/sys/glsink/gstglsink.h +++ b/sys/glsink/gstglsink.h @@ -25,81 +25,72 @@ #include <gst/gst.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define MAX_FLIP_BUFFERS 1 - typedef struct _GstImageInfo GstImageInfo; - struct _GstImageInfo - { - gulong id; - int demo; - int dumpvideo; - void (*free_info) (GstImageInfo * info); - }; - - - typedef struct _GstImageData GstImageData; - struct _GstImageData - { - gint size; - gchar *data; - }; - - typedef struct _GstImageConnection GstImageConnection; - struct _GstImageConnection - { - void (*open_conn) (GstImageConnection * conn, GstImageInfo * info); - void (*close_conn) (GstImageConnection * conn, GstImageInfo * info); - void (*free_conn) (GstImageConnection * conn); - }; - - typedef GstCaps *(*GstImagePluginGetCapsFunc) (GstImageInfo * info); - typedef GstImageConnection *(*GstImagePluginSetCapsFunc) (GstImageInfo * info, - GstCaps * caps); - typedef GstImageData *(*GstImagePluginGetImageFunc) (GstImageInfo * info, - GstImageConnection * conn); - typedef void (*GstImagePluginPutImageFunc) (GstImageInfo * info, - GstImageData * image); - typedef void (*GstImagePluginFreeImageFunc) (GstImageData * image); - - typedef struct _GstImagePlugin GstImagePlugin; - struct _GstImagePlugin - { - GstImagePluginGetCapsFunc get_caps; - GstImagePluginSetCapsFunc set_caps; - GstImagePluginGetImageFunc get_image; - GstImagePluginPutImageFunc put_image; - GstImagePluginFreeImageFunc free_image; - }; - - typedef struct _GstGLImageInfo GstGLImageInfo; +typedef struct _GstImageInfo GstImageInfo; +struct _GstImageInfo { + gulong id; + int demo; + int dumpvideo; + void (*free_info) (GstImageInfo *info); +}; + + +typedef struct _GstImageData GstImageData; +struct _GstImageData { + gint size; + gchar *data; +}; + +typedef struct _GstImageConnection GstImageConnection; +struct _GstImageConnection { + void (*open_conn) (GstImageConnection *conn, GstImageInfo *info); + void (*close_conn) (GstImageConnection *conn, GstImageInfo *info); + void (*free_conn) (GstImageConnection *conn); +}; + +typedef GstCaps * (*GstImagePluginGetCapsFunc) (GstImageInfo *info); +typedef GstImageConnection * (*GstImagePluginSetCapsFunc) (GstImageInfo *info, GstCaps *caps); +typedef GstImageData* (*GstImagePluginGetImageFunc) (GstImageInfo *info, GstImageConnection *conn); +typedef void (*GstImagePluginPutImageFunc) (GstImageInfo *info, GstImageData *image); +typedef void (*GstImagePluginFreeImageFunc) (GstImageData *image); + +typedef struct _GstImagePlugin GstImagePlugin; +struct _GstImagePlugin { + GstImagePluginGetCapsFunc get_caps; + GstImagePluginSetCapsFunc set_caps; + GstImagePluginGetImageFunc get_image; + GstImagePluginPutImageFunc put_image; + GstImagePluginFreeImageFunc free_image; +}; + +typedef struct _GstGLImageInfo GstGLImageInfo; /* stuff about our window grouped together */ - struct _GstGLImageInfo - { - GstImageInfo info; - Display *dpy; - int screen; - Window win; - GLXContext ctx; - XSetWindowAttributes attr; - Bool fs; - //XF86VidModeModeInfo deskMode; - int x, y; - unsigned int width, height; - unsigned int depth; - /* window specific from here */ - GstElement *sink; - gulong handler_id; - float rotX, rotY, zoom, zoomdir; - }; +struct _GstGLImageInfo { + GstImageInfo info; + Display *dpy; + int screen; + Window win; + GLXContext ctx; + XSetWindowAttributes attr; + Bool fs; + //XF86VidModeModeInfo deskMode; + int x, y; + unsigned int width, height; + unsigned int depth; + /* window specific from here */ + GstElement *sink; + gulong handler_id; + float rotX,rotY,zoom, zoomdir; +}; #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_VIDEOSINK_H__ */ +#endif /* __GST_VIDEOSINK_H__ */ diff --git a/sys/qcam/gstqcamsrc.h b/sys/qcam/gstqcamsrc.h index c6e763d4..0bd201c8 100644 --- a/sys/qcam/gstqcamsrc.h +++ b/sys/qcam/gstqcamsrc.h @@ -25,9 +25,8 @@ #include <gst/gst.h> #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ /** QuickCam include files */ #include "qcam.h" @@ -45,38 +44,35 @@ extern "C" (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QCAMSRC)) /* NOTE: per-element flags start with 16 for now */ - typedef enum - { - GST_QCAMSRC_OPEN = GST_ELEMENT_FLAG_LAST, +typedef enum { + GST_QCAMSRC_OPEN = GST_ELEMENT_FLAG_LAST, - GST_QCAMSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, - } GstQCamSrcFlags; + GST_QCAMSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST+2, +} GstQCamSrcFlags; - typedef struct _GstQCamSrc GstQCamSrc; - typedef struct _GstQCamSrcClass GstQCamSrcClass; +typedef struct _GstQCamSrc GstQCamSrc; +typedef struct _GstQCamSrcClass GstQCamSrcClass; - struct _GstQCamSrc - { - GstElement element; +struct _GstQCamSrc { + GstElement element; - /* pads */ - GstPad *srcpad; + /* pads */ + GstPad *srcpad; - struct qcam *qcam; - gboolean autoexposure; - gint port; - }; + struct qcam *qcam; + gboolean autoexposure; + gint port; +}; - struct _GstQCamSrcClass - { - GstElementClass parent_class; - }; +struct _GstQCamSrcClass { + GstElementClass parent_class; +}; - GType gst_qcamsrc_get_type (void); +GType gst_qcamsrc_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_QCAMSRC_H__ */ +#endif /* __GST_QCAMSRC_H__ */ diff --git a/sys/qcam/qcam-Linux.h b/sys/qcam/qcam-Linux.h index 06c1cb20..46dcbe51 100644 --- a/sys/qcam/qcam-Linux.h +++ b/sys/qcam/qcam-Linux.h @@ -28,3 +28,5 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ + + diff --git a/sys/qcam/qcam-os.h b/sys/qcam/qcam-os.h index 06c1cb20..46dcbe51 100644 --- a/sys/qcam/qcam-os.h +++ b/sys/qcam/qcam-os.h @@ -28,3 +28,5 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ + + diff --git a/sys/qcam/qcam.h b/sys/qcam/qcam.h index 4697befd..35b2dc26 100644 --- a/sys/qcam/qcam.h +++ b/sys/qcam/qcam.h @@ -54,8 +54,7 @@ OTHER DEALINGS IN THE SOFTWARE. #define MAX_HEIGHT 243 #define MAX_WIDTH 336 -struct qcam -{ +struct qcam { int width, height; int bpp; int mode; @@ -64,72 +63,72 @@ struct qcam int port_mode; int transfer_scale; int top, left; - int fd; /* lock file descriptor - * It was, unfortunately, necessary to add this member to the - * struct qcam to conveniently implement POSIX fcntl-style locking. - * We need a seperate lock file for each struct qcam, for instance, - * if the same process (using qcam-lib) is accessing multiple - * QuickCams on (of course) multiple ports. - * - Dave Plonka (plonka@carroll1.cc.edu) - */ + int fd; /* lock file descriptor + * It was, unfortunately, necessary to add this member to the + * struct qcam to conveniently implement POSIX fcntl-style locking. + * We need a seperate lock file for each struct qcam, for instance, + * if the same process (using qcam-lib) is accessing multiple + * QuickCams on (of course) multiple ports. + * - Dave Plonka (plonka@carroll1.cc.edu) + */ }; typedef unsigned char scanbuf; /* General QuickCam handling routines */ -int qc_getbrightness (const struct qcam *q); -int qc_setbrightness (struct qcam *q, int val); -int qc_getcontrast (const struct qcam *q); -int qc_setcontrast (struct qcam *q, int val); -int qc_getwhitebal (const struct qcam *q); -int qc_setwhitebal (struct qcam *q, int val); -void qc_getresolution (const struct qcam *q, int *x, int *y); -int qc_setresolution (struct qcam *q, int x, int y); -int qc_getbitdepth (const struct qcam *q); -int qc_setbitdepth (struct qcam *q, int val); -int qc_getheight (const struct qcam *q); -int qc_setheight (struct qcam *q, int y); -int qc_getwidth (const struct qcam *q); -int qc_setwidth (struct qcam *q, int x); -int qc_gettop (const struct qcam *q); -int qc_settop (struct qcam *q, int val); -int qc_getleft (const struct qcam *q); -int qc_setleft (struct qcam *q, int val); -int qc_gettransfer_scale (const struct qcam *q); -int qc_settransfer_scale (struct qcam *q, int val); -int qc_calibrate (struct qcam *q); -int qc_forceunidir (struct qcam *q); -void qc_dump (const struct qcam *q, char *file); - -struct qcam *qc_init (void); -int qc_initfile (struct qcam *q, char *fname); -int qc_open (struct qcam *q); -int qc_close (struct qcam *q); -int qc_detect (const struct qcam *q); -void qc_reset (struct qcam *q); -void qc_set (struct qcam *q); -scanbuf *qc_scan (const struct qcam *q); -scanbuf *qc_convertscan (struct qcam *q, scanbuf * scan); -void qc_writepgm (const struct qcam *q, FILE * f, scanbuf * scan); -void qc_wait (int val); +int qc_getbrightness(const struct qcam *q); +int qc_setbrightness(struct qcam *q, int val); +int qc_getcontrast(const struct qcam *q); +int qc_setcontrast(struct qcam *q, int val); +int qc_getwhitebal(const struct qcam *q); +int qc_setwhitebal(struct qcam *q, int val); +void qc_getresolution(const struct qcam *q, int *x, int *y); +int qc_setresolution(struct qcam *q, int x, int y); +int qc_getbitdepth(const struct qcam *q); +int qc_setbitdepth(struct qcam *q, int val); +int qc_getheight(const struct qcam *q); +int qc_setheight(struct qcam *q, int y); +int qc_getwidth(const struct qcam *q); +int qc_setwidth(struct qcam *q, int x); +int qc_gettop(const struct qcam *q); +int qc_settop(struct qcam *q, int val); +int qc_getleft(const struct qcam *q); +int qc_setleft(struct qcam *q, int val); +int qc_gettransfer_scale(const struct qcam *q); +int qc_settransfer_scale(struct qcam *q, int val); +int qc_calibrate(struct qcam *q); +int qc_forceunidir(struct qcam *q); +void qc_dump(const struct qcam *q, char *file); + +struct qcam *qc_init(void); +int qc_initfile(struct qcam *q, char *fname); +int qc_open(struct qcam *q); +int qc_close(struct qcam *q); +int qc_detect(const struct qcam *q); +void qc_reset(struct qcam *q); +void qc_set(struct qcam *q); +scanbuf *qc_scan(const struct qcam *q); +scanbuf *qc_convertscan(struct qcam *q, scanbuf *scan); +void qc_writepgm(const struct qcam *q, FILE *f, scanbuf *scan); +void qc_wait(int val); /* OS/hardware specific routines */ -int read_lpstatus (const struct qcam *q); -int read_lpcontrol (const struct qcam *q); -int read_lpdata (const struct qcam *q); -void write_lpdata (const struct qcam *q, int d); -void write_lpcontrol (const struct qcam *q, int d); -int enable_ports (const struct qcam *q); -int disable_ports (const struct qcam *q); -int qc_unlock (struct qcam *q); -int qc_lock (struct qcam *q); -void qc_wait (int val); -int qc_probe (struct qcam *q); +int read_lpstatus(const struct qcam *q); +int read_lpcontrol(const struct qcam *q); +int read_lpdata(const struct qcam *q); +void write_lpdata(const struct qcam *q, int d); +void write_lpcontrol(const struct qcam *q, int d); +int enable_ports(const struct qcam *q); +int disable_ports(const struct qcam *q); +int qc_unlock(struct qcam *q); +int qc_lock(struct qcam *q); +void qc_wait(int val); +int qc_probe(struct qcam *q); /* Image processing routines */ -int fixdark (const struct qcam *q, scanbuf * scan); -int qc_edge_detect (const struct qcam *q, scanbuf * scan, int tolerance); +int fixdark(const struct qcam *q, scanbuf *scan); +int qc_edge_detect(const struct qcam *q, scanbuf *scan, int tolerance); -#endif /*! _QCAM_H */ +#endif /*! _QCAM_H*/ diff --git a/sys/qcam/qcamip.h b/sys/qcam/qcamip.h index e3bc5c2e..3bab6faf 100644 --- a/sys/qcam/qcamip.h +++ b/sys/qcam/qcamip.h @@ -55,13 +55,13 @@ SOFTWARE. /* Prototypes for image processing routines */ -int qcip_autoexposure (struct qcam *q, scanbuf * scan); -int qcip_set_luminance_target (struct qcam *q, int val); -int qcip_set_luminance_tolerance (struct qcam *q, int val); -int qcip_set_luminance_std_target (struct qcam *q, int val); -int qcip_set_luminance_std_tolerance (struct qcam *q, int val); -int qcip_set_autoexposure_mode (int val); -void qcip_histogram (struct qcam *q, scanbuf * scan, int *histogram); -void qcip_display_histogram (struct qcam *q, scanbuf * scan); +int qcip_autoexposure(struct qcam *q, scanbuf *scan); +int qcip_set_luminance_target(struct qcam *q, int val); +int qcip_set_luminance_tolerance(struct qcam *q, int val); +int qcip_set_luminance_std_target(struct qcam *q, int val); +int qcip_set_luminance_std_tolerance(struct qcam *q, int val); +int qcip_set_autoexposure_mode(int val); +void qcip_histogram(struct qcam *q, scanbuf *scan, int *histogram); +void qcip_display_histogram(struct qcam *q, scanbuf *scan); -#endif /*! _QCAMIP_H */ +#endif /*! _QCAMIP_H*/ diff --git a/sys/v4l2/gstv4l2colorbalance.h b/sys/v4l2/gstv4l2colorbalance.h index f0de44ce..4003203b 100644 --- a/sys/v4l2/gstv4l2colorbalance.h +++ b/sys/v4l2/gstv4l2colorbalance.h @@ -27,6 +27,7 @@ #include "v4l2_calls.h" G_BEGIN_DECLS + #define GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL \ (gst_v4l2_color_balance_channel_get_type ()) #define GST_V4L2_COLOR_BALANCE_CHANNEL(obj) \ @@ -39,20 +40,19 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL)) #define GST_IS_V4L2_COLOR_BALANCE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL)) - typedef struct _GstV4l2ColorBalanceChannel -{ + +typedef struct _GstV4l2ColorBalanceChannel { GstColorBalanceChannel parent; guint32 index; } GstV4l2ColorBalanceChannel; -typedef struct _GstV4l2ColorBalanceChannelClass -{ +typedef struct _GstV4l2ColorBalanceChannelClass { GstColorBalanceChannelClass parent; } GstV4l2ColorBalanceChannelClass; -GType gst_v4l2_color_balance_channel_get_type (void); +GType gst_v4l2_color_balance_channel_get_type (void); -void gst_v4l2_color_balance_interface_init (GstColorBalanceClass * klass); +void gst_v4l2_color_balance_interface_init (GstColorBalanceClass *klass); #endif /* __GST_V4L2_COLOR_BALANCE_H__ */ diff --git a/sys/v4l2/gstv4l2element.h b/sys/v4l2/gstv4l2element.h index 7dcd6846..e46b2440 100644 --- a/sys/v4l2/gstv4l2element.h +++ b/sys/v4l2/gstv4l2element.h @@ -55,53 +55,53 @@ (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_V4L2ELEMENT, GstV4l2ElementClass)) -typedef struct _GstV4l2Element GstV4l2Element; -typedef struct _GstV4l2ElementClass GstV4l2ElementClass; +typedef struct _GstV4l2Element GstV4l2Element; +typedef struct _GstV4l2ElementClass GstV4l2ElementClass; -struct _GstV4l2Element -{ - GstElement element; +struct _GstV4l2Element { + GstElement element; - /* the video device */ - char *device; + /* the video device */ + char *device; - /* the video-device's file descriptor */ - gint video_fd; + /* the video-device's file descriptor */ + gint video_fd; - /* the video buffer (mmap()'ed) */ - guint8 **buffer; + /* the video buffer (mmap()'ed) */ + guint8 **buffer; - /* the video-device's capabilities */ - struct v4l2_capability vcap; + /* the video-device's capabilities */ + struct v4l2_capability vcap; - /* the toys available to us */ - GList *channels; - GList *norms; - GList *colors; + /* the toys available to us */ + GList *channels; + GList *norms; + GList *colors; - /* X-overlay */ - GstXWindowListener *overlay; - XID xwindow_id; + /* X-overlay */ + GstXWindowListener *overlay; + XID xwindow_id; - /* properties */ - gchar *norm; - gchar *channel; - gulong frequency; + /* properties */ + gchar *norm; + gchar *channel; + gulong frequency; - /* caching values */ - gchar *display; + /* caching values */ + gchar *display; }; -struct _GstV4l2ElementClass -{ - GstElementClass parent_class; +struct _GstV4l2ElementClass { + GstElementClass parent_class; - /* probed devices */ - GList *devices; + /* probed devices */ + GList *devices; - /* signals */ - void (*open) (GstElement * element, const gchar * device); - void (*close) (GstElement * element, const gchar * device); + /* signals */ + void (*open) (GstElement *element, + const gchar *device); + void (*close) (GstElement *element, + const gchar *device); }; diff --git a/sys/v4l2/gstv4l2src.h b/sys/v4l2/gstv4l2src.h index d68f9cf8..ca528d1e 100644 --- a/sys/v4l2/gstv4l2src.h +++ b/sys/v4l2/gstv4l2src.h @@ -38,75 +38,72 @@ GST_DEBUG_CATEGORY_EXTERN (v4l2src_debug); #define GST_IS_V4L2SRC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_V4L2SRC)) -typedef struct _GstV4l2BufferPool GstV4l2BufferPool; -typedef struct _GstV4l2Buffer GstV4l2Buffer; -typedef struct _GstV4l2Src GstV4l2Src; -typedef struct _GstV4l2SrcClass GstV4l2SrcClass; +typedef struct _GstV4l2BufferPool GstV4l2BufferPool; +typedef struct _GstV4l2Buffer GstV4l2Buffer; +typedef struct _GstV4l2Src GstV4l2Src; +typedef struct _GstV4l2SrcClass GstV4l2SrcClass; /* global info */ -struct _GstV4l2BufferPool -{ - GstAtomicInt refcount; /* number of users: 1 for every buffer, 1 for element */ - gint video_fd; - guint buffer_count; - GstV4l2Buffer *buffers; +struct _GstV4l2BufferPool { + GstAtomicInt refcount; /* number of users: 1 for every buffer, 1 for element */ + gint video_fd; + guint buffer_count; + GstV4l2Buffer * buffers; }; -struct _GstV4l2Buffer -{ - struct v4l2_buffer buffer; - guint8 *start; - guint length; - GstAtomicInt refcount; /* add 1 if in use by element, add 1 if in use by GstBuffer */ - GstV4l2BufferPool *pool; +struct _GstV4l2Buffer { + struct v4l2_buffer buffer; + guint8 * start; + guint length; + GstAtomicInt refcount; /* add 1 if in use by element, add 1 if in use by GstBuffer */ + GstV4l2BufferPool * pool; }; -struct _GstV4l2Src -{ - GstV4l2Element v4l2element; +struct _GstV4l2Src { + GstV4l2Element v4l2element; - /* pads */ - GstPad *srcpad; + /* pads */ + GstPad *srcpad; - /* internal lists */ - GSList *formats; /* list of available capture formats */ + /* internal lists */ + GSList *formats; /* list of available capture formats */ - /* buffers */ - GstV4l2BufferPool *pool; + /* buffers */ + GstV4l2BufferPool *pool; - struct v4l2_requestbuffers breq; - struct v4l2_format format; + struct v4l2_requestbuffers breq; + struct v4l2_format format; - /* True if we want to stop */ - gboolean quit; + /* True if we want to stop */ + gboolean quit; - /* A/V sync... frame counter and internal cache */ - gulong handled; - gint need_writes; - GstBuffer *cached_buffer; - gulong last_seq; + /* A/V sync... frame counter and internal cache */ + gulong handled; + gint need_writes; + GstBuffer *cached_buffer; + gulong last_seq; - /* clock */ - GstClock *clock; + /* clock */ + GstClock *clock; + + /* time to substract from clock time to get back to timestamp */ + GstClockTime substract_time; - /* time to substract from clock time to get back to timestamp */ - GstClockTime substract_time; - - /* how are we going to push buffers? */ - gboolean use_fixed_fps; + /* how are we going to push buffers? */ + gboolean use_fixed_fps; }; -struct _GstV4l2SrcClass -{ - GstV4l2ElementClass parent_class; +struct _GstV4l2SrcClass { + GstV4l2ElementClass parent_class; - void (*frame_capture) (GObject * object); - void (*frame_drop) (GObject * object); - void (*frame_insert) (GObject * object); - void (*frame_lost) (GObject * object, gint num_lost); + void (*frame_capture) (GObject *object); + void (*frame_drop) (GObject *object); + void (*frame_insert) (GObject *object); + void (*frame_lost) (GObject *object, + gint num_lost); }; -GType gst_v4l2src_get_type (void); +GType gst_v4l2src_get_type(void); #endif /* __GST_V4L2SRC_H__ */ diff --git a/sys/v4l2/gstv4l2tuner.h b/sys/v4l2/gstv4l2tuner.h index 729fe221..a768ea2f 100644 --- a/sys/v4l2/gstv4l2tuner.h +++ b/sys/v4l2/gstv4l2tuner.h @@ -28,6 +28,7 @@ #include "gstv4l2element.h" G_BEGIN_DECLS + #define GST_TYPE_V4L2_TUNER_CHANNEL \ (gst_v4l2_tuner_channel_get_type ()) #define GST_V4L2_TUNER_CHANNEL(obj) \ @@ -40,17 +41,16 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_V4L2_TUNER_CHANNEL)) #define GST_IS_V4L2_TUNER_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_TUNER_CHANNEL)) - typedef struct _GstV4l2TunerChannel -{ + +typedef struct _GstV4l2TunerChannel { GstTunerChannel parent; - guint32 index; - guint32 tuner; - guint32 audio; + guint32 index; + guint32 tuner; + guint32 audio; } GstV4l2TunerChannel; -typedef struct _GstV4l2TunerChannelClass -{ +typedef struct _GstV4l2TunerChannelClass { GstTunerChannelClass parent; } GstV4l2TunerChannelClass; @@ -67,21 +67,19 @@ typedef struct _GstV4l2TunerChannelClass #define GST_IS_V4L2_TUNER_NORM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_TUNER_NORM)) -typedef struct _GstV4l2TunerNorm -{ +typedef struct _GstV4l2TunerNorm { GstTunerNorm parent; - v4l2_std_id index; + v4l2_std_id index; } GstV4l2TunerNorm; -typedef struct _GstV4l2TunerNormClass -{ +typedef struct _GstV4l2TunerNormClass { GstTunerNormClass parent; } GstV4l2TunerNormClass; -GType gst_v4l2_tuner_channel_get_type (void); -GType gst_v4l2_tuner_norm_get_type (void); +GType gst_v4l2_tuner_channel_get_type (void); +GType gst_v4l2_tuner_norm_get_type (void); -void gst_v4l2_tuner_interface_init (GstTunerClass * klass); +void gst_v4l2_tuner_interface_init (GstTunerClass *klass); #endif /* __GST_V4L2_TUNER_H__ */ diff --git a/sys/v4l2/gstv4l2xoverlay.h b/sys/v4l2/gstv4l2xoverlay.h index d5cb7796..cfcdfd35 100644 --- a/sys/v4l2/gstv4l2xoverlay.h +++ b/sys/v4l2/gstv4l2xoverlay.h @@ -27,13 +27,16 @@ #include "gstv4l2element.h" -G_BEGIN_DECLS void gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass); +G_BEGIN_DECLS -GstXWindowListener *gst_v4l2_xoverlay_new (GstV4l2Element * v4l2element); -void gst_v4l2_xoverlay_free (GstV4l2Element * v4l2element); +void gst_v4l2_xoverlay_interface_init (GstXOverlayClass *klass); + +GstXWindowListener * + gst_v4l2_xoverlay_new (GstV4l2Element *v4l2element); +void gst_v4l2_xoverlay_free (GstV4l2Element *v4l2element); /* signal handlers */ -void gst_v4l2_xoverlay_open (GstV4l2Element * v4l2element); -void gst_v4l2_xoverlay_close (GstV4l2Element * v4l2element); +void gst_v4l2_xoverlay_open (GstV4l2Element *v4l2element); +void gst_v4l2_xoverlay_close (GstV4l2Element *v4l2element); #endif /* __GST_V4L2_X_OVERLAY_H__ */ diff --git a/sys/v4l2/v4l2_calls.h b/sys/v4l2/v4l2_calls.h index 488e7bca..428c57aa 100644 --- a/sys/v4l2/v4l2_calls.h +++ b/sys/v4l2/v4l2_calls.h @@ -82,36 +82,50 @@ /* open/close the device */ -gboolean gst_v4l2_open (GstV4l2Element * v4l2element); -gboolean gst_v4l2_close (GstV4l2Element * v4l2element); +gboolean gst_v4l2_open (GstV4l2Element *v4l2element); +gboolean gst_v4l2_close (GstV4l2Element *v4l2element); /* norm/input/output */ -gboolean gst_v4l2_get_norm (GstV4l2Element * v4l2element, v4l2_std_id * norm); -gboolean gst_v4l2_set_norm (GstV4l2Element * v4l2element, v4l2_std_id norm); -gboolean gst_v4l2_get_input (GstV4l2Element * v4l2element, gint * input); -gboolean gst_v4l2_set_input (GstV4l2Element * v4l2element, gint input); -gboolean gst_v4l2_get_output (GstV4l2Element * v4l2element, gint * output); -gboolean gst_v4l2_set_output (GstV4l2Element * v4l2element, gint output); +gboolean gst_v4l2_get_norm (GstV4l2Element *v4l2element, + v4l2_std_id *norm); +gboolean gst_v4l2_set_norm (GstV4l2Element *v4l2element, + v4l2_std_id norm); +gboolean gst_v4l2_get_input (GstV4l2Element *v4l2element, + gint *input); +gboolean gst_v4l2_set_input (GstV4l2Element *v4l2element, + gint input); +gboolean gst_v4l2_get_output (GstV4l2Element *v4l2element, + gint *output); +gboolean gst_v4l2_set_output (GstV4l2Element *v4l2element, + gint output); /* frequency control */ -gboolean gst_v4l2_get_frequency (GstV4l2Element * v4l2element, - gint tunernum, gulong * frequency); -gboolean gst_v4l2_set_frequency (GstV4l2Element * v4l2element, - gint tunernum, gulong frequency); -gboolean gst_v4l2_signal_strength (GstV4l2Element * v4l2element, - gint tunernum, gulong * signal); +gboolean gst_v4l2_get_frequency (GstV4l2Element *v4l2element, + gint tunernum, + gulong *frequency); +gboolean gst_v4l2_set_frequency (GstV4l2Element *v4l2element, + gint tunernum, + gulong frequency); +gboolean gst_v4l2_signal_strength (GstV4l2Element *v4l2element, + gint tunernum, + gulong *signal); /* attribute control */ -gboolean gst_v4l2_get_attribute (GstV4l2Element * v4l2element, - int attribute, int *value); -gboolean gst_v4l2_set_attribute (GstV4l2Element * v4l2element, - int attribute, const int value); +gboolean gst_v4l2_get_attribute (GstV4l2Element *v4l2element, + int attribute, + int *value); +gboolean gst_v4l2_set_attribute (GstV4l2Element *v4l2element, + int attribute, + const int value); /* overlay */ -gboolean gst_v4l2_set_display (GstV4l2Element * v4l2element); -gboolean gst_v4l2_set_window (GstElement * element, - gint x, gint y, gint w, gint h, struct v4l2_clip *clips, gint num_clips); -gboolean gst_v4l2_enable_overlay (GstV4l2Element * v4l2element, - gboolean enable); +gboolean gst_v4l2_set_display (GstV4l2Element *v4l2element); +gboolean gst_v4l2_set_window (GstElement *element, + gint x, gint y, + gint w, gint h, + struct v4l2_clip *clips, + gint num_clips); +gboolean gst_v4l2_enable_overlay (GstV4l2Element *v4l2element, + gboolean enable); #endif /* __V4L2_CALLS_H__ */ diff --git a/sys/v4l2/v4l2src_calls.h b/sys/v4l2/v4l2src_calls.h index 043dddf0..dc5fca0c 100644 --- a/sys/v4l2/v4l2src_calls.h +++ b/sys/v4l2/v4l2src_calls.h @@ -24,25 +24,30 @@ #include "v4l2_calls.h" -gboolean gst_v4l2src_get_capture (GstV4l2Src * v4l2src); -gboolean gst_v4l2src_set_capture (GstV4l2Src * v4l2src, - struct v4l2_fmtdesc *fmt, gint width, gint height); -gboolean gst_v4l2src_capture_init (GstV4l2Src * v4l2src); -gboolean gst_v4l2src_capture_start (GstV4l2Src * v4l2src); -gint gst_v4l2src_grab_frame (GstV4l2Src * v4l2src); -guint8 *gst_v4l2src_get_buffer (GstV4l2Src * v4l2src, gint num); -gboolean gst_v4l2src_queue_frame (GstV4l2Src * v4l2src, guint i); -gboolean gst_v4l2src_capture_stop (GstV4l2Src * v4l2src); -gboolean gst_v4l2src_capture_deinit (GstV4l2Src * v4l2src); - -gboolean gst_v4l2src_fill_format_list (GstV4l2Src * v4l2src); -gboolean gst_v4l2src_clear_format_list (GstV4l2Src * v4l2src); +gboolean gst_v4l2src_get_capture (GstV4l2Src *v4l2src); +gboolean gst_v4l2src_set_capture (GstV4l2Src *v4l2src, + struct v4l2_fmtdesc *fmt, + gint width, + gint height); +gboolean gst_v4l2src_capture_init (GstV4l2Src *v4l2src); +gboolean gst_v4l2src_capture_start (GstV4l2Src *v4l2src); +gint gst_v4l2src_grab_frame (GstV4l2Src *v4l2src); +guint8 * gst_v4l2src_get_buffer (GstV4l2Src *v4l2src, + gint num); +gboolean gst_v4l2src_queue_frame (GstV4l2Src *v4l2src, + guint i); +gboolean gst_v4l2src_capture_stop (GstV4l2Src *v4l2src); +gboolean gst_v4l2src_capture_deinit (GstV4l2Src *v4l2src); + +gboolean gst_v4l2src_fill_format_list (GstV4l2Src *v4l2src); +gboolean gst_v4l2src_clear_format_list (GstV4l2Src *v4l2src); /* hacky */ -gboolean gst_v4l2src_get_size_limits (GstV4l2Src * v4l2src, - struct v4l2_fmtdesc *fmt, - gint * min_w, gint * max_w, gint * min_h, gint * max_h); - -void gst_v4l2src_free_buffer (GstBuffer * buffer); +gboolean gst_v4l2src_get_size_limits (GstV4l2Src *v4l2src, + struct v4l2_fmtdesc *fmt, + gint *min_w, gint *max_w, + gint *min_h, gint *max_h); +void gst_v4l2src_free_buffer (GstBuffer *buffer); + #endif /* __V4L2SRC_CALLS_H__ */ diff --git a/sys/vcd/vcdsrc.h b/sys/vcd/vcdsrc.h index 5026cd78..ab2c74da 100644 --- a/sys/vcd/vcdsrc.h +++ b/sys/vcd/vcdsrc.h @@ -28,9 +28,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define VCD_BYTES_PER_SECTOR 2352 @@ -47,54 +46,51 @@ extern "C" (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VCDSRC)) /* NOTE: per-element flags start with 16 for now */ - typedef enum - { - VCDSRC_OPEN = GST_ELEMENT_FLAG_LAST, +typedef enum { + VCDSRC_OPEN = GST_ELEMENT_FLAG_LAST, - VCDSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, - } VCDSrcFlags; + VCDSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST+2, +} VCDSrcFlags; - typedef struct _VCDSrc VCDSrc; - typedef struct _VCDSrcClass VCDSrcClass; +typedef struct _VCDSrc VCDSrc; +typedef struct _VCDSrcClass VCDSrcClass; - struct _VCDSrc - { - GstElement element; - /* pads */ - GstPad *srcpad; +struct _VCDSrc { + GstElement element; + /* pads */ + GstPad *srcpad; - /* device */ - gchar *device; - /* track number */ - gint track; - /* fd */ - gint fd; + /* device */ + gchar *device; + /* track number */ + gint track; + /* fd */ + gint fd; - struct cdrom_tochdr tochdr; - gint numtracks; - struct cdrom_tocentry *tracks; + struct cdrom_tochdr tochdr; + gint numtracks; + struct cdrom_tocentry *tracks; - /* current time offset */ - gulong trackoffset; - gulong frameoffset; + /* current time offset */ + gulong trackoffset; + gulong frameoffset; - gulong curoffset; /* current offset in file */ - gulong bytes_per_read; /* bytes per read */ + gulong curoffset; /* current offset in file */ + gulong bytes_per_read; /* bytes per read */ - gulong seq; /* buffer sequence number */ - int max_errors; - }; + gulong seq; /* buffer sequence number */ + int max_errors; +}; - struct _VCDSrcClass - { - GstElementClass parent_class; - }; +struct _VCDSrcClass { + GstElementClass parent_class; +}; - GType vcdsrc_get_type (void); +GType vcdsrc_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __VCDSRC_H__ */ +#endif /* __VCDSRC_H__ */ |