*.h: Revert indenting

Original commit message from CVS:
* *.h: Revert indenting
This commit is contained in:
Johan Dahlin 2004-03-15 16:32:54 +00:00
parent 1633bd8693
commit 39fd8a2dbd
137 changed files with 4772 additions and 5187 deletions

View file

@ -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> 2004-03-15 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac: * configure.ac:

View file

@ -28,9 +28,8 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_ARTS \ #define GST_TYPE_ARTS \
(gst_arts_get_type()) (gst_arts_get_type())
@ -43,26 +42,24 @@ extern "C"
#define GST_IS_ARTS_CLASS(obj) \ #define GST_IS_ARTS_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ARTS)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ARTS))
typedef struct _GstARTS GstARTS; typedef struct _GstARTS GstARTS;
typedef struct _GstARTSClass GstARTSClass; typedef struct _GstARTSClass GstARTSClass;
struct _GstARTS struct _GstARTS {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
void *wrapper; void *wrapper;
}; };
struct _GstARTSClass struct _GstARTSClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_ARTS_H__ */ #endif /* __GST_ARTS_H__ */

View file

@ -1,14 +1,14 @@
#include <gst/gst.h> #include <gst/gst.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
void *gst_arts_wrapper_new (GstPad * sinkpad, GstPad * sourcepad); void *gst_arts_wrapper_new(GstPad *sinkpad, GstPad *sourcepad);
void gst_arts_wrapper_free (void *wrapper); void gst_arts_wrapper_free(void *wrapper);
void gst_arts_wrapper_do (void *wrapper); void gst_arts_wrapper_do(void *wrapper);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */

View file

@ -25,9 +25,8 @@
#include <artsc.h> #include <artsc.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_ARTSDSINK \ #define GST_TYPE_ARTSDSINK \
@ -41,42 +40,39 @@ extern "C"
#define GST_IS_ARTSDSINK_CLASS(obj) \ #define GST_IS_ARTSDSINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ARTSDSINK)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ARTSDSINK))
typedef enum typedef enum {
{ GST_ARTSDSINK_OPEN = GST_ELEMENT_FLAG_LAST,
GST_ARTSDSINK_OPEN = GST_ELEMENT_FLAG_LAST, GST_ARTSDSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST+2,
GST_ARTSDSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, } GstArtsdSinkFlags;
} GstArtsdSinkFlags;
typedef struct _GstArtsdsink GstArtsdsink; typedef struct _GstArtsdsink GstArtsdsink;
typedef struct _GstArtsdsinkClass GstArtsdsinkClass; typedef struct _GstArtsdsinkClass GstArtsdsinkClass;
struct _GstArtsdsink struct _GstArtsdsink {
{ GstElement element;
GstElement element;
GstPad *sinkpad; GstPad *sinkpad;
gboolean connected; gboolean connected;
arts_stream_t stream; arts_stream_t stream;
gboolean mute; gboolean mute;
gboolean signd; gboolean signd;
gint depth; gint depth;
gint channels; gint channels;
gint frequency; gint frequency;
gchar *connect_name; gchar* connect_name;
}; };
struct _GstArtsdsinkClass struct _GstArtsdsinkClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_artsdsink_get_type (void); GType gst_artsdsink_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_ARTSDSINK_H__ */ #endif /* __GST_ARTSDSINK_H__ */

View file

@ -27,14 +27,13 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/bytestream/bytestream.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> #include <af_vfs.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
/*GstElementDetails gst_afparse_details;*/ /*GstElementDetails gst_afparse_details;*/
@ -51,58 +50,55 @@ extern "C"
#define GST_IS_AFPARSE_CLASS(obj) \ #define GST_IS_AFPARSE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AFPARSE)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AFPARSE))
typedef struct _GstAFParse GstAFParse; typedef struct _GstAFParse GstAFParse;
typedef struct _GstAFParseClass GstAFParseClass; typedef struct _GstAFParseClass GstAFParseClass;
typedef enum typedef enum {
{ GST_AFPARSE_OPEN = GST_ELEMENT_FLAG_LAST,
GST_AFPARSE_OPEN = GST_ELEMENT_FLAG_LAST,
GST_AFPARSE_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, GST_AFPARSE_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
} GstAFParseFlags; } GstAFParseFlags;
struct _GstAFParse struct _GstAFParse {
{ GstElement element;
GstElement element; GstPad *srcpad;
GstPad *srcpad; GstPad *sinkpad;
GstPad *sinkpad;
AFvirtualfile *vfile; AFvirtualfile *vfile;
AFfilehandle file; AFfilehandle file;
int format; int format;
int channels; int channels;
int width; int width;
unsigned int rate; unsigned int rate;
gboolean is_signed; gboolean is_signed;
int type; /* type of output, compare to audiofile.h int type; /* type of output, compare to audiofile.h
* RAW, AIFF, AIFFC, NEXTSND, WAVE * RAW, AIFF, AIFFC, NEXTSND, WAVE
*/ */
/* blocking */ /* blocking */
gulong curoffset; gulong curoffset;
gulong bytes_per_read; gulong bytes_per_read;
gint frames_per_read; gint frames_per_read;
gulong seq; gulong seq;
gint64 timestamp; gint64 timestamp;
/* FIXME : endianness is a little cryptic at this point */ /* FIXME : endianness is a little cryptic at this point */
int endianness_data; /* 4321 or 1234 */ int endianness_data; /* 4321 or 1234 */
int endianness_wanted; /* same thing, but what the output format wants */ int endianness_wanted; /* same thing, but what the output format wants */
int endianness_output; /* what the output endianness will be */ int endianness_output; /* what the output endianness will be */
}; };
struct _GstAFParseClass struct _GstAFParseClass {
{ GstElementClass parent_class;
GstElementClass parent_class;
/* signals */ /* signals */
void (*handoff) (GstElement * element, GstPad * pad); void (*handoff) (GstElement *element,GstPad *pad);
}; };
gboolean gst_afparse_plugin_init (GstPlugin * plugin); gboolean gst_afparse_plugin_init (GstPlugin *plugin);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_AFPARSE_H__ */ #endif /* __GST_AFPARSE_H__ */

View file

@ -26,13 +26,12 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <audiofile.h> /* what else are we to do */ #include <audiofile.h> /* what else are we to do */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
/*GstElementDetails gst_afsink_details;*/ /*GstElementDetails gst_afsink_details;*/
@ -49,56 +48,53 @@ extern "C"
#define GST_IS_AFSINK_CLASS(obj) \ #define GST_IS_AFSINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AFSINK)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AFSINK))
typedef struct _GstAFSink GstAFSink; typedef struct _GstAFSink GstAFSink;
typedef struct _GstAFSinkClass GstAFSinkClass; typedef struct _GstAFSinkClass GstAFSinkClass;
typedef enum typedef enum {
{ GST_AFSINK_OPEN = GST_ELEMENT_FLAG_LAST,
GST_AFSINK_OPEN = GST_ELEMENT_FLAG_LAST,
GST_AFSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, GST_AFSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
} GstAFSinkFlags; } GstAFSinkFlags;
struct _GstAFSink struct _GstAFSink {
{ GstElement element;
GstElement element; GstPad *sinkpad;
GstPad *sinkpad;
gchar *filename; gchar *filename;
/* FILE *file; */ /* FILE *file; */
/* AFfilesetup outfilesetup; */ /* AFfilesetup outfilesetup; */
AFfilehandle file; AFfilehandle file;
int format; int format;
int channels; int channels;
int width; int width;
unsigned int rate; unsigned int rate;
gboolean is_signed; gboolean is_signed;
int type; /* type of output, compare to audiofile.h int type; /* type of output, compare to audiofile.h
* RAW, AIFF, AIFFC, NEXTSND, WAVE * RAW, AIFF, AIFFC, NEXTSND, WAVE
*/ */
/* FIXME : endianness is a little cryptic at this point */ /* FIXME : endianness is a little cryptic at this point */
int endianness_data; /* 4321 or 1234 */ int endianness_data; /* 4321 or 1234 */
int endianness_wanted; /* same thing, but what the output format wants */ int endianness_wanted; /* same thing, but what the output format wants */
int endianness_output; /* what the output endianness will be */ int endianness_output; /* what the output endianness will be */
}; };
struct _GstAFSinkClass struct _GstAFSinkClass {
{ GstElementClass parent_class;
GstElementClass parent_class;
/* signals */ /* signals */
void (*handoff) (GstElement * element, GstPad * pad); void (*handoff) (GstElement *element,GstPad *pad);
}; };
GType gst_afsink_get_type (void); GType gst_afsink_get_type (void);
gboolean gst_afsink_plugin_init (GstPlugin * plugin); gboolean gst_afsink_plugin_init (GstPlugin *plugin);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_AFSINK_H__ */ #endif /* __GST_AFSINK_H__ */

View file

@ -26,13 +26,12 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <audiofile.h> /* what else are we to do */ #include <audiofile.h> /* what else are we to do */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
/*GstElementDetails gst_afsrc_details;*/ /*GstElementDetails gst_afsrc_details;*/
@ -49,63 +48,60 @@ extern "C"
#define GST_IS_AFSRC_CLASS(obj) \ #define GST_IS_AFSRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AFSRC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AFSRC))
typedef struct _GstAFSrc GstAFSrc; typedef struct _GstAFSrc GstAFSrc;
typedef struct _GstAFSrcClass GstAFSrcClass; typedef struct _GstAFSrcClass GstAFSrcClass;
typedef enum typedef enum {
{ GST_AFSRC_OPEN = GST_ELEMENT_FLAG_LAST,
GST_AFSRC_OPEN = GST_ELEMENT_FLAG_LAST,
GST_AFSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, GST_AFSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
} GstAFSrcFlags; } GstAFSrcFlags;
struct _GstAFSrc struct _GstAFSrc {
{ GstElement element;
GstElement element; GstPad *srcpad;
GstPad *srcpad;
gchar *filename; gchar *filename;
/* FILE *file; */ /* FILE *file; */
/* AFfilesetup outfilesetup; */ /* AFfilesetup outfilesetup; */
AFfilehandle file; AFfilehandle file;
int format; int format;
int channels; int channels;
int width; int width;
unsigned int rate; unsigned int rate;
gboolean is_signed; gboolean is_signed;
int type; /* type of output, compare to audiofile.h int type; /* type of output, compare to audiofile.h
* RAW, AIFF, AIFFC, NEXTSND, WAVE * RAW, AIFF, AIFFC, NEXTSND, WAVE
*/ */
/* blocking */ /* blocking */
gulong curoffset; gulong curoffset;
gulong bytes_per_read; gulong bytes_per_read;
gulong seq; gulong seq;
guint64 framestamp; guint64 framestamp;
/* FIXME : endianness is a little cryptic at this point */ /* FIXME : endianness is a little cryptic at this point */
int endianness_data; /* 4321 or 1234 */ int endianness_data; /* 4321 or 1234 */
int endianness_wanted; /* same thing, but what the output format wants */ int endianness_wanted; /* same thing, but what the output format wants */
int endianness_output; /* what the output endianness will be */ int endianness_output; /* what the output endianness will be */
}; };
struct _GstAFSrcClass struct _GstAFSrcClass {
{ GstElementClass parent_class;
GstElementClass parent_class;
/* signals */ /* signals */
void (*handoff) (GstElement * element, GstPad * pad); void (*handoff) (GstElement *element,GstPad *pad);
}; };
GType gst_afsrc_get_type (void); GType gst_afsrc_get_type (void);
gboolean gst_afsrc_plugin_init (GstPlugin * plugin); gboolean gst_afsrc_plugin_init (GstPlugin *plugin);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_AFSRC_H__ */ #endif /* __GST_AFSRC_H__ */

View file

@ -24,9 +24,8 @@
#include <decore.h> #include <decore.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_DIVXDEC \ #define GST_TYPE_DIVXDEC \
@ -40,36 +39,34 @@ extern "C"
#define GST_IS_DIVXDEC_CLASS(obj) \ #define GST_IS_DIVXDEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_DIVXDEC)) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_DIVXDEC))
typedef struct _GstDivxDec GstDivxDec; typedef struct _GstDivxDec GstDivxDec;
typedef struct _GstDivxDecClass GstDivxDecClass; typedef struct _GstDivxDecClass GstDivxDecClass;
struct _GstDivxDec struct _GstDivxDec {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
/* divx handle */ /* divx handle */
void *handle; void *handle;
/* video (output) settings */ /* video (output) settings */
guint32 csp; guint32 csp;
int bitcnt, bpp; int bitcnt, bpp;
int version; int version;
int width, height; int width, height;
gdouble fps; gdouble fps;
}; };
struct _GstDivxDecClass struct _GstDivxDecClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_divxdec_get_type (void); GType gst_divxdec_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_DIVXDEC_H__ */ #endif /* __GST_DIVXDEC_H__ */

View file

@ -23,9 +23,8 @@
#include <gst/gst.h> #include <gst/gst.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_DIVXENC \ #define GST_TYPE_DIVXENC \
@ -39,48 +38,46 @@ extern "C"
#define GST_IS_DIVXENC_CLASS(obj) \ #define GST_IS_DIVXENC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_DIVXENC)) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_DIVXENC))
typedef struct _GstDivxEnc GstDivxEnc; typedef struct _GstDivxEnc GstDivxEnc;
typedef struct _GstDivxEncClass GstDivxEncClass; typedef struct _GstDivxEncClass GstDivxEncClass;
struct _GstDivxEnc struct _GstDivxEnc {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
/* quality of encoded image */ /* quality of encoded image */
gulong bitrate; gulong bitrate;
/* size of the buffers */ /* size of the buffers */
gulong buffer_size; gulong buffer_size;
/* max key interval */ /* max key interval */
gint max_key_interval; gint max_key_interval;
/* amount of motion estimation to do */ /* amount of motion estimation to do */
gint quality; gint quality;
/* divx handle */ /* divx handle */
void *handle; void *handle;
guint32 csp; guint32 csp;
gint bitcnt; gint bitcnt;
gint width, height; gint width, height;
gfloat fps; gfloat fps;
}; };
struct _GstDivxEncClass struct _GstDivxEncClass {
{ GstElementClass parent_class;
GstElementClass parent_class;
/* signals */ /* signals */
void (*frame_encoded) (GstElement * element); void (*frame_encoded) (GstElement *element);
}; };
GType gst_divxenc_get_type (void); GType gst_divxenc_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_DIVXENC_H__ */ #endif /* __GST_DIVXENC_H__ */

View file

@ -24,6 +24,7 @@
#include <faac.h> #include <faac.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_FAAC \ #define GST_TYPE_FAAC \
(gst_faac_get_type ()) (gst_faac_get_type ())
#define GST_FAAC(obj) \ #define GST_FAAC(obj) \
@ -34,17 +35,25 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_FAAC)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_FAAC))
#define GST_IS_FAAC_CLASS(obj) \ #define GST_IS_FAAC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_FAAC)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_FAAC))
typedef struct _GstFaac
{ typedef struct _GstFaac {
GstElement element; GstElement element;
/* pads */ /* pads */
GstPad *srcpad, *sinkpad; GstPad *srcpad, *sinkpad;
/* stream properties */ /* stream properties */
gint samplerate, channels, format, bps, bitrate, profile, shortctl; gint samplerate,
gboolean tns, midside; channels,
gulong bytes, samples; format,
bps,
bitrate,
profile,
shortctl;
gboolean tns,
midside;
gulong bytes,
samples;
/* FAAC object */ /* FAAC object */
faacEncHandle handle; faacEncHandle handle;
@ -54,12 +63,12 @@ G_BEGIN_DECLS
guint64 cache_time, cache_duration; guint64 cache_time, cache_duration;
} GstFaac; } GstFaac;
typedef struct _GstFaacClass typedef struct _GstFaacClass {
{
GstElementClass parent_class; GstElementClass parent_class;
} GstFaacClass; } GstFaacClass;
GType gst_faac_get_type (void); GType gst_faac_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_FAAC_H__ */ #endif /* __GST_FAAC_H__ */

View file

@ -24,6 +24,7 @@
#include <faad.h> #include <faad.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_FAAD \ #define GST_TYPE_FAAD \
(gst_faad_get_type ()) (gst_faad_get_type ())
#define GST_FAAD(obj) \ #define GST_FAAD(obj) \
@ -34,26 +35,28 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_FAAD)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_FAAD))
#define GST_IS_FAAD_CLASS(obj) \ #define GST_IS_FAAD_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_FAAD)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_FAAD))
typedef struct _GstFaad
{ typedef struct _GstFaad {
GstElement element; GstElement element;
/* pads */ /* pads */
GstPad *srcpad, *sinkpad; GstPad *srcpad, *sinkpad;
/* cache for latest MPEG-frame */ /* cache for latest MPEG-frame */
gint samplerate, channels, bps; gint samplerate,
channels,
bps;
/* FAAD object */ /* FAAD object */
faacDecHandle handle; faacDecHandle handle;
} GstFaad; } GstFaad;
typedef struct _GstFaadClass typedef struct _GstFaadClass {
{
GstElementClass parent_class; GstElementClass parent_class;
} GstFaadClass; } GstFaadClass;
GType gst_faad_get_type (void); GType gst_faad_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_FAAD_H__ */ #endif /* __GST_FAAD_H__ */

View file

@ -31,9 +31,8 @@
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_GSMDEC \ #define GST_TYPE_GSMDEC \
@ -47,32 +46,30 @@ extern "C"
#define GST_IS_GSMDEC_CLASS(obj) \ #define GST_IS_GSMDEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GSMDEC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GSMDEC))
typedef struct _GstGSMDec GstGSMDec; typedef struct _GstGSMDec GstGSMDec;
typedef struct _GstGSMDecClass GstGSMDecClass; typedef struct _GstGSMDecClass GstGSMDecClass;
struct _GstGSMDec struct _GstGSMDec {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
gsm state; gsm state;
gsm_byte buffer[33]; gsm_byte buffer[33];
gint bufsize; gint bufsize;
}; };
struct _GstGSMDecClass struct _GstGSMDecClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_gsmdec_get_type (void); GType gst_gsmdec_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_GSMDEC_H__ */ #endif /* __GST_GSMDEC_H__ */

View file

@ -31,9 +31,8 @@
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_GSMENC \ #define GST_TYPE_GSMENC \
@ -47,38 +46,36 @@ extern "C"
#define GST_IS_GSMENC_CLASS(obj) \ #define GST_IS_GSMENC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GSMENC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GSMENC))
typedef struct _GstGSMEnc GstGSMEnc; typedef struct _GstGSMEnc GstGSMEnc;
typedef struct _GstGSMEncClass GstGSMEncClass; typedef struct _GstGSMEncClass GstGSMEncClass;
struct _GstGSMEnc struct _GstGSMEnc {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
gsm state; gsm state;
gsm_signal buffer[160]; gsm_signal buffer[160];
gint bufsize; gint bufsize;
guint64 next_ts; guint64 next_ts;
gint rate; gint rate;
}; };
struct _GstGSMEncClass struct _GstGSMEncClass {
{ GstElementClass parent_class;
GstElementClass parent_class;
/* signals */ /* signals */
void (*frame_encoded) (GstElement * element); void (*frame_encoded) (GstElement *element);
}; };
GType gst_gsmenc_get_type (void); GType gst_gsmenc_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_GSMENC_H__ */ #endif /* __GST_GSMENC_H__ */

View file

@ -27,9 +27,8 @@
#include <tremor/ivorbiscodec.h> #include <tremor/ivorbiscodec.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_VORBISENC \ #define GST_TYPE_VORBISENC \
(vorbisenc_get_type()) (vorbisenc_get_type())
@ -42,61 +41,60 @@ extern "C"
#define GST_IS_VORBISENC_CLASS(obj) \ #define GST_IS_VORBISENC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VORBISENC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VORBISENC))
typedef struct _VorbisEnc VorbisEnc; typedef struct _VorbisEnc VorbisEnc;
typedef struct _VorbisEncClass VorbisEncClass; typedef struct _VorbisEncClass VorbisEncClass;
struct _VorbisEnc struct _VorbisEnc {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,
*srcpad;
ogg_stream_state os; /* take physical pages, weld into a logical ogg_stream_state os; /* take physical pages, weld into a logical
stream of packets */ stream of packets */
ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */ ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */
ogg_packet op; /* one raw packet of data for decode */ ogg_packet op; /* one raw packet of data for decode */
vorbis_info vi; /* struct that stores all the static vorbis bitstream vorbis_info vi; /* struct that stores all the static vorbis bitstream
settings */ settings */
vorbis_comment vc; /* struct that stores all the user comments */ vorbis_comment vc; /* struct that stores all the user comments */
vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
vorbis_block vb; /* local working space for packet->PCM decode */ vorbis_block vb; /* local working space for packet->PCM decode */
gboolean eos; gboolean eos;
gboolean managed; gboolean managed;
gint bitrate; gint bitrate;
gint min_bitrate; gint min_bitrate;
gint max_bitrate; gint max_bitrate;
gfloat quality; gfloat quality;
gboolean quality_set; gboolean quality_set;
gint serial; gint serial;
gint channels; gint channels;
gint frequency; gint frequency;
guint64 samples_in; guint64 samples_in;
guint64 bytes_out; guint64 bytes_out;
GstCaps *metadata; GstCaps *metadata;
gboolean setup; gboolean setup;
gboolean flush_header; gboolean flush_header;
gchar *last_message; gchar *last_message;
}; };
struct _VorbisEncClass struct _VorbisEncClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType vorbisenc_get_type (void); GType vorbisenc_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __VORBISENC_H__ */ #endif /* __VORBISENC_H__ */

View file

@ -51,7 +51,7 @@
#define GST_IS_JACK_BIN_CLASS(klass) G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_JACK_BIN) #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_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; typedef struct _GstJack GstJack;
@ -64,65 +64,59 @@ typedef GstJack GstJackSrc;
typedef GstJackClass GstJackSrcClass; typedef GstJackClass GstJackSrcClass;
enum enum {
{ GST_JACK_OPEN = GST_BIN_FLAG_LAST,
GST_JACK_OPEN = GST_BIN_FLAG_LAST, GST_JACK_ACTIVE,
GST_JACK_ACTIVE, GST_JACK_FLAG_LAST = GST_BIN_FLAG_LAST + 3,
GST_JACK_FLAG_LAST = GST_BIN_FLAG_LAST + 3,
}; };
typedef jack_default_audio_sample_t sample_t; typedef jack_default_audio_sample_t sample_t;
typedef struct typedef struct {
{ GstPad *pad;
GstPad *pad; void *data;
void *data; const gchar *name;
const gchar *name; const gchar *peer_name;
const gchar *peer_name; jack_port_t *port;
jack_port_t *port;
} GstJackPad; } GstJackPad;
struct _GstJack struct _GstJack {
{ GstElement element;
GstElement element;
/* list of GstJackPads */ /* list of GstJackPads */
GList *pads; GList *pads;
/* for convenience */ /* for convenience */
GstPadDirection direction; GstPadDirection direction;
gchar *port_name_prefix; gchar *port_name_prefix;
GstJackBin *bin; GstJackBin *bin;
}; };
struct _GstJackClass struct _GstJackClass {
{ GstElementClass parent_class;
GstElementClass parent_class;
}; };
struct _GstJackBin struct _GstJackBin {
{ GstBin bin;
GstBin bin;
jack_client_t *client; jack_client_t *client;
gint default_new_port_number; gint default_new_port_number;
/* lists of GstJackPads */ /* lists of GstJackPads */
GList *sink_pads; GList *sink_pads;
GList *src_pads; GList *src_pads;
gchar *client_name; gchar *client_name;
guint rate; guint rate;
jack_nframes_t nframes; jack_nframes_t nframes;
}; };
struct _GstJackBinClass struct _GstJackBinClass {
{ GstBinClass parent_class;
GstBinClass parent_class;
}; };

View file

@ -31,60 +31,62 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
typedef struct _ladspa_control_info typedef struct _ladspa_control_info {
{ gchar *name;
gchar *name; gchar *param_name;
gchar *param_name; gfloat lowerbound, upperbound;
gfloat lowerbound, upperbound; gfloat def;
gfloat def; gboolean lower,upper,samplerate;
gboolean lower, upper, samplerate; gboolean toggled, logarithmic, integer, writable;
gboolean toggled, logarithmic, integer, writable; } ladspa_control_info;
} ladspa_control_info;
typedef struct _GstLADSPA GstLADSPA; typedef struct _GstLADSPA GstLADSPA;
typedef struct _GstLADSPAClass GstLADSPAClass; typedef struct _GstLADSPAClass GstLADSPAClass;
struct _GstLADSPA struct _GstLADSPA {
{ GstElement element;
GstElement element;
LADSPA_Descriptor *descriptor; LADSPA_Descriptor *descriptor;
LADSPA_Handle *handle; 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; struct _GstLADSPAClass {
gint64 timestamp; GstElementClass parent_class;
gboolean inplace_broken;
};
struct _GstLADSPAClass LADSPA_Descriptor *descriptor;
{
GstElementClass parent_class;
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 #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_LADSPA_H__ */ #endif /* __GST_LADSPA_H__ */

View file

@ -20,19 +20,20 @@
unloadLADSPAPluginLibrary(). Errors are handled by writing a unloadLADSPAPluginLibrary(). Errors are handled by writing a
message to stderr and calling exit(1). It is alright (although message to stderr and calling exit(1). It is alright (although
inefficient) to call this more than once for the same file. */ 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. */ /* 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 /* This function locates a LADSPA plugin within a plugin library
loaded with loadLADSPAPluginLibrary(). Errors are handled by loaded with loadLADSPAPluginLibrary(). Errors are handled by
writing a message to stderr and calling exit(1). Note that the writing a message to stderr and calling exit(1). Note that the
plugin library filename is only included to help provide plugin library filename is only included to help provide
informative error messages. */ informative error messages. */
const LADSPA_Descriptor *findLADSPAPluginDescriptor (void const LADSPA_Descriptor *
*pvLADSPAPluginLibrary, const char *pcPluginLibraryFilename, findLADSPAPluginDescriptor(void * pvLADSPAPluginLibrary,
const char *pcPluginLabel); const char * pcPluginLibraryFilename,
const char * pcPluginLabel);
/*****************************************************************************/ /*****************************************************************************/
@ -43,15 +44,16 @@ const LADSPA_Descriptor *findLADSPAPluginDescriptor (void
style) and a LADSPA_DescriptorFunction (from which style) and a LADSPA_DescriptorFunction (from which
LADSPA_Descriptors can be acquired). */ LADSPA_Descriptors can be acquired). */
typedef void LADSPAPluginSearchCallbackFunction typedef void LADSPAPluginSearchCallbackFunction
(const char *pcFullFilename, (const char * pcFullFilename,
void *pvPluginHandle, LADSPA_Descriptor_Function fDescriptorFunction); void * pvPluginHandle,
LADSPA_Descriptor_Function fDescriptorFunction);
/* Search through the $(LADSPA_PATH) (or a default path) for any /* Search through the $(LADSPA_PATH) (or a default path) for any
LADSPA plugin libraries. Each plugin library is tested using LADSPA plugin libraries. Each plugin library is tested using
dlopen() and dlsym(,"ladspa_descriptor"). After loading each dlopen() and dlsym(,"ladspa_descriptor"). After loading each
library, the callback function is called to process it. This library, the callback function is called to process it. This
function leaves items passed to the callback function open. */ function leaves items passed to the callback function open. */
void LADSPAPluginSearch (LADSPAPluginSearchCallbackFunction fCallbackFunction); void LADSPAPluginSearch(LADSPAPluginSearchCallbackFunction fCallbackFunction);
/*****************************************************************************/ /*****************************************************************************/

View file

@ -25,9 +25,8 @@
#include <fame.h> #include <fame.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_FAMEENC \ #define GST_TYPE_FAMEENC \
@ -41,50 +40,48 @@ extern "C"
#define GST_IS_FAMEENC_CLASS(obj) \ #define GST_IS_FAMEENC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAMEENC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAMEENC))
typedef struct _GstFameEnc GstFameEnc; typedef struct _GstFameEnc GstFameEnc;
typedef struct _GstFameEncClass GstFameEncClass; typedef struct _GstFameEncClass GstFameEncClass;
struct _GstFameEnc struct _GstFameEnc {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
/* the timestamp of the next frame */ /* the timestamp of the next frame */
guint64 next_time; guint64 next_time;
/* the interval between frames */ /* the interval between frames */
guint64 time_interval; guint64 time_interval;
/* video state */ /* video state */
gint format; gint format;
/* the size of the output buffer */ /* the size of the output buffer */
gint outsize; gint outsize;
/* encoding pattern string */ /* encoding pattern string */
gchar *pattern; gchar *pattern;
/* fameenc stuff */ /* fameenc stuff */
gboolean verbose; gboolean verbose;
fame_context_t *fc; fame_context_t *fc;
fame_parameters_t fp; fame_parameters_t fp;
fame_yuv_t fy; fame_yuv_t fy;
gulong buffer_size; gulong buffer_size;
unsigned char *buffer; unsigned char *buffer;
gboolean initialized; gboolean initialized;
}; };
struct _GstFameEncClass struct _GstFameEncClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_fameenc_get_type (void); GType gst_fameenc_get_type (void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_FAMEENC_H__ */ #endif /* __GST_FAMEENC_H__ */

View file

@ -26,9 +26,8 @@
#include <musicbrainz/mb_c.h> #include <musicbrainz/mb_c.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_MUSICBRAINZ \ #define GST_TYPE_MUSICBRAINZ \
@ -43,43 +42,41 @@ extern "C"
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MUSICBRAINZ)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MUSICBRAINZ))
typedef struct _GstMusicBrainz GstMusicBrainz; typedef struct _GstMusicBrainz GstMusicBrainz;
typedef struct _GstMusicBrainzClass GstMusicBrainzClass; typedef struct _GstMusicBrainzClass GstMusicBrainzClass;
struct _GstMusicBrainz struct _GstMusicBrainz {
{ GstElement element;
GstElement element;
GstPad *sinkpad; GstPad *sinkpad;
GstPad *srcpad; GstPad *srcpad;
const GstCaps *caps; const GstCaps *caps;
trm_t trm; trm_t trm;
gchar signature[17]; gchar signature[17];
gchar ascii_signature[37]; gchar ascii_signature[37];
guint depth; guint depth;
guint rate; guint rate;
guint channels; guint channels;
gboolean linked; gboolean linked;
gboolean data_available; gboolean data_available;
gboolean signature_available; gboolean signature_available;
guint64 total_time; guint64 total_time;
}; };
struct _GstMusicBrainzClass struct _GstMusicBrainzClass {
{ GstElementClass parent_class;
GstElementClass parent_class;
/* signals */ /* signals */
void (*signature_available) (GstElement * element); void (*signature_available) (GstElement *element);
}; };
GType gst_musicbrainz_get_type (void); GType gst_musicbrainz_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_MUSICBRAINZE_H__ */ #endif /* __GST_MUSICBRAINZE_H__ */

View file

@ -24,9 +24,8 @@
#include <gst/gst.h> #include <gst/gst.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_NASSINK \ #define GST_TYPE_NASSINK \
@ -40,54 +39,51 @@ extern "C"
#define GST_IS_NASSINK_CLASS(obj) \ #define GST_IS_NASSINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NASSINK)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NASSINK))
typedef enum typedef enum {
{ GST_NASSINK_OPEN = GST_ELEMENT_FLAG_LAST,
GST_NASSINK_OPEN = GST_ELEMENT_FLAG_LAST, GST_NASSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST+2
GST_NASSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2 } GstNasSinkFlags;
} GstNasSinkFlags;
typedef struct _GstNassink GstNassink; typedef struct _GstNassink GstNassink;
typedef struct _GstNassinkClass GstNassinkClass; typedef struct _GstNassinkClass GstNassinkClass;
struct _GstNassink struct _GstNassink {
{ GstElement element;
GstElement element;
GstPad *sinkpad; GstPad *sinkpad;
/* instance properties */ /* instance properties */
gboolean mute; gboolean mute;
gint depth; gint depth;
gint tracks; gint tracks;
gint rate; gint rate;
gchar *host; gchar* host;
/* Server info */ /* Server info */
AuServer *audio; AuServer *audio;
AuFlowID flow; AuFlowID flow;
AuDeviceID device; AuDeviceID device;
/* buffer */ /* buffer */
AuUint32 size; AuUint32 size;
AuUint32 pos; AuUint32 pos;
char *buf; char *buf;
}; };
struct _GstNassinkClass struct _GstNassinkClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_nassink_get_type (void); GType gst_nassink_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_NASSINK_H__ */ #endif /* __GST_NASSINK_H__ */

View file

@ -25,6 +25,7 @@
#include <SDL.h> #include <SDL.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_SDLVIDEOSINK \ #define GST_TYPE_SDLVIDEOSINK \
(gst_sdlvideosink_get_type()) (gst_sdlvideosink_get_type())
#define GST_SDLVIDEOSINK(obj) \ #define GST_SDLVIDEOSINK(obj) \
@ -35,9 +36,9 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SDLVIDEOSINK)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SDLVIDEOSINK))
#define GST_IS_SDLVIDEOSINK_CLASS(obj) \ #define GST_IS_SDLVIDEOSINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SDLVIDEOSINK)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SDLVIDEOSINK))
typedef enum
{ typedef enum {
GST_SDLVIDEOSINK_OPEN = GST_ELEMENT_FLAG_LAST, GST_SDLVIDEOSINK_OPEN = GST_ELEMENT_FLAG_LAST,
GST_SDLVIDEOSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, GST_SDLVIDEOSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
} GstSDLVideoSinkFlags; } GstSDLVideoSinkFlags;
@ -45,12 +46,11 @@ G_BEGIN_DECLS
typedef struct _GstSDLVideoSink GstSDLVideoSink; typedef struct _GstSDLVideoSink GstSDLVideoSink;
typedef struct _GstSDLVideoSinkClass GstSDLVideoSinkClass; typedef struct _GstSDLVideoSinkClass GstSDLVideoSinkClass;
struct _GstSDLVideoSink struct _GstSDLVideoSink {
{
GstVideoSink videosink; GstVideoSink videosink;
guint32 format; 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; unsigned long xwindow_id;
gboolean init; gboolean init;
@ -62,13 +62,13 @@ struct _GstSDLVideoSink
GMutex *lock; GMutex *lock;
}; };
struct _GstSDLVideoSinkClass struct _GstSDLVideoSinkClass {
{
GstVideoSinkClass parent_class; GstVideoSinkClass parent_class;
}; };
GType gst_sdlsink_get_type (void); GType gst_sdlsink_get_type(void);
G_END_DECLS G_END_DECLS
#endif /* __GST_SDLVIDEOSINK_H__ */ #endif /* __GST_SDLVIDEOSINK_H__ */

View file

@ -25,43 +25,40 @@
#include <shout/shout.h> #include <shout/shout.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
/* Definition of structure storing data for this element. */ /* Definition of structure storing data for this element. */
typedef struct _GstIcecastSend GstIcecastSend; typedef struct _GstIcecastSend GstIcecastSend;
struct _GstIcecastSend struct _GstIcecastSend {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
shout_conn_t conn; shout_conn_t conn;
gchar *ip; gchar *ip;
guint port; guint port;
gchar *password; gchar *password;
gboolean public; gboolean public;
gchar *name; gchar *name;
gchar *description; gchar *description;
gchar *genre; gchar *genre;
gchar *mount; gchar *mount;
gchar *dumpfile; gchar *dumpfile;
gboolean icy; gboolean icy;
gchar *aim; gchar *aim;
gchar *icq; gchar *icq;
gchar *irc; gchar *irc;
}; };
/* Standard definition defining a class for this element. */ /* Standard definition defining a class for this element. */
typedef struct _GstIcecastSendClass GstIcecastSendClass; typedef struct _GstIcecastSendClass GstIcecastSendClass;
struct _GstIcecastSendClass struct _GstIcecastSendClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
/* Standard macros for defining types for this element. */ /* Standard macros for defining types for this element. */
#define GST_TYPE_ICECASTSEND \ #define GST_TYPE_ICECASTSEND \
@ -76,12 +73,12 @@ extern "C"
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ICECASTSEND)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ICECASTSEND))
/* Standard function returning type information. */ /* Standard function returning type information. */
GType gst_icecastsend_get_type (void); GType gst_icecastsend_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_ICECASTSEND_H__ */ #endif /* __GST_ICECASTSEND_H__ */

View file

@ -26,9 +26,8 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_SMOOTHWAVE \ #define GST_TYPE_SMOOTHWAVE \
@ -42,33 +41,31 @@ extern "C"
#define GST_IS_SMOOTHWAVE_CLASS(obj) \ #define GST_IS_SMOOTHWAVE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMOOTHWAVE)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMOOTHWAVE))
typedef struct _GstSmoothWave GstSmoothWave; typedef struct _GstSmoothWave GstSmoothWave;
typedef struct _GstSmoothWaveClass GstSmoothWaveClass; typedef struct _GstSmoothWaveClass GstSmoothWaveClass;
struct _GstSmoothWave struct _GstSmoothWave {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
gint width, height; gint width,height;
GdkRgbCmap *cmap; GdkRgbCmap *cmap;
GtkWidget *image; GtkWidget *image;
guchar *imagebuffer; guchar *imagebuffer;
}; };
struct _GstSmoothWaveClass struct _GstSmoothWaveClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_smoothwave_get_type (void); GType gst_smoothwave_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_SMOOTHWAVE_H__ */ #endif /* __GST_SMOOTHWAVE_H__ */

View file

@ -26,9 +26,8 @@
#include <png.h> #include <png.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_SNAPSHOT \ #define GST_TYPE_SNAPSHOT \
@ -42,38 +41,36 @@ extern "C"
#define GST_IS_SNAPSHOT_CLASS(obj) \ #define GST_IS_SNAPSHOT_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SNAPSHOT)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SNAPSHOT))
typedef struct _GstSnapshot GstSnapshot; typedef struct _GstSnapshot GstSnapshot;
typedef struct _GstSnapshotClass GstSnapshotClass; typedef struct _GstSnapshotClass GstSnapshotClass;
struct _GstSnapshot struct _GstSnapshot {
{ GstElement element;
GstElement element;
guint32 format; guint32 format;
gint width; gint width;
gint height; gint height;
gint to_bpp; gint to_bpp;
glong frame; glong frame;
glong cur_frame; glong cur_frame;
const gchar *location; const gchar *location;
gboolean snapshot_asked; gboolean snapshot_asked;
png_structp png_struct_ptr; png_structp png_struct_ptr;
png_infop png_info_ptr; png_infop png_info_ptr;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
}; };
struct _GstSnapshotClass struct _GstSnapshotClass {
{ GstElementClass parent_class;
GstElementClass parent_class;
void (*snapshot) (GstElement * elem); void (*snapshot) (GstElement *elem);
}; };
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_SNAPSHOT_H__ */ #endif /* __GST_SNAPSHOT_H__ */

View file

@ -27,6 +27,8 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_SF \ #define GST_TYPE_SF \
(gst_sf_get_type()) (gst_sf_get_type())
#define GST_SF(obj) \ #define GST_SF(obj) \
@ -37,6 +39,7 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SF)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SF))
#define GST_IS_SF_CLASS(obj) \ #define GST_IS_SF_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SF)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SF))
#define GST_TYPE_SFSRC \ #define GST_TYPE_SFSRC \
(gst_sfsrc_get_type()) (gst_sfsrc_get_type())
#define GST_SFSRC(obj) \ #define GST_SFSRC(obj) \
@ -47,6 +50,7 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SFSRC)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SFSRC))
#define GST_IS_SFSRC_CLASS(obj) \ #define GST_IS_SFSRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SFSRC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SFSRC))
#define GST_TYPE_SFSINK \ #define GST_TYPE_SFSINK \
(gst_sfsink_get_type()) (gst_sfsink_get_type())
#define GST_SFSINK(obj) \ #define GST_SFSINK(obj) \
@ -57,17 +61,16 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SFSINK)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SFSINK))
#define GST_IS_SFSINK_CLASS(obj) \ #define GST_IS_SFSINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SFSINK)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SFSINK))
typedef struct _GstSF GstSF; typedef struct _GstSF GstSF;
typedef struct _GstSFClass GstSFClass; typedef struct _GstSFClass GstSFClass;
typedef enum typedef enum {
{ GST_SF_OPEN = GST_ELEMENT_FLAG_LAST,
GST_SF_OPEN = GST_ELEMENT_FLAG_LAST, GST_SF_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
GST_SF_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
} GstSFlags; } GstSFlags;
typedef struct typedef struct {
{
GstPad *pad; GstPad *pad;
gint num; gint num;
gboolean caps_set; gboolean caps_set;
@ -75,8 +78,7 @@ typedef struct
#define GST_SF_CHANNEL(l) ((GstSFChannel*)l->data) #define GST_SF_CHANNEL(l) ((GstSFChannel*)l->data)
struct _GstSF struct _GstSF {
{
GstElement element; GstElement element;
GList *channels; GList *channels;
@ -100,15 +102,16 @@ struct _GstSF
guint64 time; guint64 time;
}; };
struct _GstSFClass struct _GstSFClass {
{
GstElementClass parent_class; GstElementClass parent_class;
}; };
GType gst_sf_get_type (void); GType gst_sf_get_type (void);
GType gst_sfsrc_get_type (void); GType gst_sfsrc_get_type (void);
GType gst_sfsink_get_type (void); GType gst_sfsink_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_SFSINK_H__ */ #endif /* __GST_SFSINK_H__ */

View file

@ -26,9 +26,8 @@
#include <swfdec.h> #include <swfdec.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_SWFDEC \ #define GST_TYPE_SWFDEC \
@ -42,49 +41,47 @@ extern "C"
#define GST_IS_SWFDEC_CLASS(obj) \ #define GST_IS_SWFDEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SWFDEC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SWFDEC))
typedef struct _GstSwfdec GstSwfdec; typedef struct _GstSwfdec GstSwfdec;
typedef struct _GstSwfdecClass GstSwfdecClass; typedef struct _GstSwfdecClass GstSwfdecClass;
struct _GstSwfdec struct _GstSwfdec {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad; GstPad *sinkpad;
GstPad *videopad; GstPad *videopad;
GstPad *audiopad; GstPad *audiopad;
SwfdecDecoder *state; SwfdecDecoder *state;
gboolean closed; gboolean closed;
/* the timestamp of the next frame */ /* the timestamp of the next frame */
gboolean first; gboolean first;
gboolean have_format; gboolean have_format;
double rate; double rate;
gint64 timestamp; gint64 timestamp;
gint64 interval; gint64 interval;
double frame_rate; double frame_rate;
/* video state */ /* video state */
gint format; gint format;
gint width; gint width;
gint height; gint height;
gint64 total_frames; gint64 total_frames;
}; };
struct _GstSwfdecClass struct _GstSwfdecClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_swfdec_get_type (void); GType gst_swfdec_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_SWFDEC_H__ */ #endif /* __GST_SWFDEC_H__ */

View file

@ -15,7 +15,7 @@
#define ENTROPY_ENCODER_FLUSH(coder) bitcoder_flush(coder) #define ENTROPY_ENCODER_FLUSH(coder) bitcoder_flush(coder)
#define ENTROPY_DECODER_INIT(coder,bitstream,limit) \ #define ENTROPY_DECODER_INIT(coder,bitstream,limit) \
bitcoder_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_BITSTREAM(coder) (coder)->bitstream
#define ENTROPY_CODER_SYMBOL(coder) 1 #define ENTROPY_CODER_SYMBOL(coder) 1
@ -25,107 +25,106 @@
#endif #endif
typedef struct typedef struct {
{ int32_t bit_count; /* number of valid bits in byte */
int32_t bit_count; /* number of valid bits in byte */ uint8_t byte; /* buffer to save bits */
uint8_t byte; /* buffer to save bits */ uint32_t byte_count; /* number of bytes written */
uint32_t byte_count; /* number of bytes written */ uint8_t *bitstream;
uint8_t *bitstream; uint32_t limit; /* don't write more bytes to bitstream ... */
uint32_t limit; /* don't write more bytes to bitstream ... */ int eos; /* end of stream reached */
int eos; /* end of stream reached */
} BitCoderState; } BitCoderState;
static inline void static inline
bitcoder_encoder_init (BitCoderState * s, uint32_t limit) void bitcoder_encoder_init (BitCoderState *s, uint32_t limit)
{ {
s->bit_count = 0; s->bit_count = 0;
s->byte = 0; s->byte = 0;
s->byte_count = 0; s->byte_count = 0;
s->bitstream = (uint8_t *) MALLOC (limit); s->bitstream = (uint8_t*) MALLOC (limit);
s->limit = limit; s->limit = limit;
s->eos = 0; s->eos = 0;
} }
static inline void static inline
bitcoder_encoder_done (BitCoderState * s) void bitcoder_encoder_done (BitCoderState *s)
{ {
FREE (s->bitstream); FREE (s->bitstream);
} }
static inline void static inline
bitcoder_decoder_init (BitCoderState * s, uint8_t * bitstream, uint32_t limit) void bitcoder_decoder_init (BitCoderState *s, uint8_t *bitstream, uint32_t limit)
{ {
s->bit_count = -1; s->bit_count = -1;
s->byte = 0; s->byte = 0;
s->byte_count = 0; s->byte_count = 0;
s->bitstream = bitstream; s->bitstream = bitstream;
s->limit = limit; s->limit = limit;
s->eos = 0; s->eos = 0;
} }
static inline uint32_t static inline
bitcoder_flush (BitCoderState * s) uint32_t bitcoder_flush (BitCoderState *s)
{ {
if (s->bit_count > 0 && s->byte_count < s->limit) if (s->bit_count > 0 && s->byte_count < s->limit)
s->bitstream[s->byte_count++] = s->byte << (8 - s->bit_count); s->bitstream [s->byte_count++] = s->byte << (8 - s->bit_count);
/*printf ("%s: %i bytes written.\n", __FUNCTION__, s->byte_count); */ /*printf ("%s: %i bytes written.\n", __FUNCTION__, s->byte_count); */
/*printf ("%s: last bit %i\n", __FUNCTION__, s->bit_count); */ /*printf ("%s: last bit %i\n", __FUNCTION__, s->bit_count); */
return s->byte_count; return s->byte_count;
} }
static inline void static inline
bitcoder_write_bit (BitCoderState * s, int bit) void bitcoder_write_bit (BitCoderState *s, int bit)
{ {
s->byte <<= 1; s->byte <<= 1;
s->byte |= bit & 1; s->byte |= bit & 1;
s->bit_count++; s->bit_count++;
if (s->bit_count == 8) { if (s->bit_count == 8) {
if (s->byte_count < s->limit) { if (s->byte_count < s->limit) {
s->bitstream[s->byte_count++] = s->byte; s->bitstream [s->byte_count++] = s->byte;
s->bit_count = 0; s->bit_count = 0;
} else { } else {
s->eos = 1; s->eos = 1;
} }
} }
} }
static inline int static inline
bitcoder_read_bit (BitCoderState * s) int bitcoder_read_bit (BitCoderState *s)
{ {
int ret; int ret;
if (s->bit_count <= 0) { if (s->bit_count <= 0) {
if (!s->bitstream) { if (!s->bitstream) {
s->eos = 1; s->eos = 1;
return 0; return 0;
} }
if (s->byte_count < s->limit) { if (s->byte_count < s->limit) {
s->byte = s->bitstream[s->byte_count++]; s->byte = s->bitstream [s->byte_count++];
} else { } else {
s->eos = 1; s->eos = 1;
s->byte = 0; s->byte = 0;
} }
s->bit_count = 8; s->bit_count = 8;
} }
ret = s->byte >> 7; ret = s->byte >> 7;
s->byte <<= 1; s->byte <<= 1;
s->bit_count--; s->bit_count--;
return ret & 1; return ret & 1;
} }
@ -133,16 +132,17 @@ bitcoder_read_bit (BitCoderState * s)
static inline void static inline
bit_print (TYPE byte) void bit_print (TYPE byte)
{ {
int bit = 8 * sizeof (TYPE); int bit = 8*sizeof(TYPE);
do { do {
bit--; bit--;
printf ((byte & (1 << bit)) ? "1" : "0"); printf ((byte & (1 << bit)) ? "1" : "0");
} while (bit); } while (bit);
printf ("\n"); printf ("\n");
} }
#endif #endif

View file

@ -5,126 +5,128 @@
#include "bitcoder.h" #include "bitcoder.h"
static inline unsigned int static inline
required_bits (unsigned int x) unsigned int required_bits (unsigned int x)
{ {
int bits = 31; int bits = 31;
while ((x & (1 << bits)) == 0 && bits) while ((x & (1 << bits)) == 0 && bits)
bits--; bits--;
return bits; return bits;
} }
static inline void static inline
write_number_binary (BitCoderState * b, unsigned int x, int bits, int u) 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); */ /*printf ("wrote %i with %i bits (%i+%i)\n", x, u+bits, u, bits); */
while (bits) { while (bits) {
bits--; bits--;
bitcoder_write_bit (b, (x >> bits) & 1); bitcoder_write_bit (b, (x >> bits) & 1);
} }
} }
static inline unsigned int static inline
read_number_binary (BitCoderState * b, int bits) unsigned int read_number_binary (BitCoderState *b, int bits)
{ {
unsigned int x = 0; unsigned int x = 0;
while (bits) { while (bits) {
bits--; bits--;
x |= bitcoder_read_bit (b) << bits; x |= bitcoder_read_bit (b) << bits;
} }
return x; return x;
} }
static inline void static inline
golomb_write_number (BitCoderState * b, unsigned int x, int bits) void golomb_write_number (BitCoderState *b, unsigned int x, int bits)
{ {
unsigned int q, r; unsigned int q, r;
int i = 0; int i = 0;
assert (x > 0); assert (x > 0);
while ((q = (x - 1) >> bits) > 0) { while ((q = (x - 1) >> bits) > 0) {
bitcoder_write_bit (b, 1); /* fast temporary adaption, write */ bitcoder_write_bit (b, 1); /* fast temporary adaption, write */
bits++; /* unary representation of q */ bits++; /* unary representation of q */
i++; 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 static inline
golomb_read_number (BitCoderState * b, int bits) 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) { while (bitcoder_read_bit (b) != 0) {
bits++; bits++;
} }
r = read_number_binary (b, bits); r = read_number_binary (b, bits);
x = (q << bits) + r + 1; x = (q << bits) + r + 1;
return x; return x;
} }
typedef struct typedef struct {
{ uint8_t count;
uint8_t count; uint8_t bits; /* a 5.3 fixed point integer */
uint8_t bits; /* a 5.3 fixed point integer */
} GolombAdaptiveCoderState; } GolombAdaptiveCoderState;
#define GOLOMB_ADAPTIVE_CODER_STATE_INITIALIZER { 8<<3, 0 } #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 static inline
golombcoder_encode_number (GolombAdaptiveCoderState * g, void golombcoder_encode_number (GolombAdaptiveCoderState *g,
BitCoderState * b, unsigned int x) 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 + g->bits = ((256 - golomb_w_tab[g->count]) * (int) g->bits +
golomb_w_tab[g->count] * (required_bits (x) << 3)) / 256; golomb_w_tab[g->count] * (required_bits(x)<<3)) / 256;
g->count++; g->count++;
if (g->count > 2) if (g->count > 2)
g->count = 2; g->count = 2;
} }
static inline unsigned int static inline
golombcoder_decode_number (GolombAdaptiveCoderState * g, BitCoderState * b) 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 + g->bits = ((256 - golomb_w_tab[g->count]) * g->bits +
golomb_w_tab[g->count] * (required_bits (x) << 3)) / 256; golomb_w_tab[g->count] * (required_bits(x)<<3)) / 256;
g->count++; g->count++;
if (g->count > 2) if (g->count > 2)
g->count = 2; g->count = 2;
return x; return x;
} }
#endif #endif

View file

@ -27,9 +27,8 @@
#include "tarkin.h" #include "tarkin.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_TARKINDEC \ #define GST_TYPE_TARKINDEC \
(tarkindec_get_type()) (tarkindec_get_type())
@ -42,44 +41,42 @@ extern "C"
#define GST_IS_TARKINDEC_CLASS(obj) \ #define GST_IS_TARKINDEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TARKINDEC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TARKINDEC))
typedef struct _TarkinDec TarkinDec; typedef struct _TarkinDec TarkinDec;
typedef struct _TarkinDecClass TarkinDecClass; typedef struct _TarkinDecClass TarkinDecClass;
struct _TarkinDec struct _TarkinDec {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
ogg_sync_state oy; ogg_sync_state oy;
ogg_stream_state os; ogg_stream_state os;
ogg_page og; ogg_page og;
ogg_packet op; ogg_packet op;
TarkinStream *tarkin_stream; TarkinStream *tarkin_stream;
TarkinComment tc; TarkinComment tc;
TarkinInfo ti; TarkinInfo ti;
TarkinVideoLayerDesc layer[1]; TarkinVideoLayerDesc layer[1];
gint frame_num; gint frame_num;
gint nheader; gint nheader;
gboolean eos;
gint bitrate;
gboolean setup;
};
gboolean eos; struct _TarkinDecClass {
gint bitrate; GstElementClass parent_class;
gboolean setup; };
};
struct _TarkinDecClass GType tarkindec_get_type(void);
{
GstElementClass parent_class;
};
GType tarkindec_get_type (void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __TARKINDEC_H__ */ #endif /* __TARKINDEC_H__ */

View file

@ -27,9 +27,8 @@
#include "tarkin.h" #include "tarkin.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_TARKINENC \ #define GST_TYPE_TARKINENC \
(tarkinenc_get_type()) (tarkinenc_get_type())
@ -42,45 +41,43 @@ extern "C"
#define GST_IS_TARKINENC_CLASS(obj) \ #define GST_IS_TARKINENC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TARKINENC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TARKINENC))
typedef struct _TarkinEnc TarkinEnc; typedef struct _TarkinEnc TarkinEnc;
typedef struct _TarkinEncClass TarkinEncClass; typedef struct _TarkinEncClass TarkinEncClass;
struct _TarkinEnc struct _TarkinEnc {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
ogg_stream_state os; /* take physical pages, weld into a logical ogg_stream_state os; /* take physical pages, weld into a logical
stream of packets */ stream of packets */
ogg_page og; /* one Ogg bitstream page. Tarkin packets are inside */ ogg_page og; /* one Ogg bitstream page. Tarkin packets are inside */
ogg_packet op[3]; /* one raw packet of data for decode */ ogg_packet op[3]; /* one raw packet of data for decode */
TarkinStream *tarkin_stream; TarkinStream *tarkin_stream;
TarkinComment tc; TarkinComment tc;
TarkinInfo ti; TarkinInfo ti;
TarkinVideoLayerDesc layer[1]; TarkinVideoLayerDesc layer[1];
gint frame_num; gint frame_num;
gboolean eos;
gint bitrate;
gint s_moments;
gint a_moments;
gboolean setup;
};
gboolean eos; struct _TarkinEncClass {
gint bitrate; GstElementClass parent_class;
gint s_moments; };
gint a_moments;
gboolean setup;
};
struct _TarkinEncClass GType tarkinenc_get_type(void);
{
GstElementClass parent_class;
};
GType tarkinenc_get_type (void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __TARKINENC_H__ */ #endif /* __TARKINENC_H__ */

View file

@ -9,11 +9,9 @@
#if defined(DBG_MEMLEAKS) #if defined(DBG_MEMLEAKS)
extern void *dbg_malloc (char *file, int line, char *func, 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, extern void* dbg_calloc (char *file, int line, char *func, size_t count, size_t bytes);
size_t bytes); extern void* dbg_realloc (char *file, int line, char *func, char *what, void *mem, 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); extern void dbg_free (char *file, int line, char *func, char *what, void *mem);
#define MALLOC(bytes) dbg_malloc(__FILE__,__LINE__,__FUNCTION__,bytes) #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
#endif #endif

View file

@ -19,7 +19,7 @@
#define ENTROPY_ENCODER_FLUSH(coder) rlecoder_encoder_flush(coder) #define ENTROPY_ENCODER_FLUSH(coder) rlecoder_encoder_flush(coder)
#define ENTROPY_DECODER_INIT(coder,bitstream,limit) \ #define ENTROPY_DECODER_INIT(coder,bitstream,limit) \
rlecoder_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_BITSTREAM(coder) ((coder)->bitcoder.bitstream)
#define ENTROPY_CODER_EOS(coder) ((coder)->bitcoder.eos) #define ENTROPY_CODER_EOS(coder) ((coder)->bitcoder.eos)
@ -31,13 +31,12 @@
typedef struct typedef struct {
{ int symbol;
int symbol; uint32_t count; /* have seen count symbol's */
uint32_t count; /* have seen count symbol's */ BitCoderState bitcoder;
BitCoderState bitcoder; GolombAdaptiveCoderState golomb_state [2]; /* 2 states for 2 symbols... */
GolombAdaptiveCoderState golomb_state[2]; /* 2 states for 2 symbols... */ int have_seen_1;
int have_seen_1;
} RLECoderState; } RLECoderState;
@ -45,99 +44,100 @@ typedef struct
/* /*
* bit should be 0 or 1 !!! * bit should be 0 or 1 !!!
*/ */
static inline void static inline
rlecoder_write_bit (RLECoderState * s, int bit) void rlecoder_write_bit (RLECoderState *s, int bit)
{ {
assert (bit == 0 || bit == 1); assert (bit == 0 || bit == 1);
if (s->symbol == -1) { if (s->symbol == -1) {
s->symbol = bit & 1; s->symbol = bit & 1;
s->count = 1; s->count = 1;
s->have_seen_1 = bit; s->have_seen_1 = bit;
bitcoder_write_bit (&s->bitcoder, bit); bitcoder_write_bit (&s->bitcoder, bit);
} }
if (s->symbol != bit) { if (s->symbol != bit) {
golombcoder_encode_number (&s->golomb_state[s->symbol], golombcoder_encode_number (&s->golomb_state[s->symbol],
&s->bitcoder, s->count); &s->bitcoder, s->count);
s->symbol = ~s->symbol & 1; s->symbol = ~s->symbol & 1;
s->have_seen_1 = 1; s->have_seen_1 = 1;
s->count = 1; s->count = 1;
} else } else
s->count++; s->count++;
} }
static inline int static inline
rlecoder_read_bit (RLECoderState * s) int rlecoder_read_bit (RLECoderState *s)
{ {
if (s->count == 0) { if (s->count == 0) {
s->symbol = ~s->symbol & 1; s->symbol = ~s->symbol & 1;
s->count = golombcoder_decode_number (&s->golomb_state[s->symbol], s->count = golombcoder_decode_number (&s->golomb_state[s->symbol],
&s->bitcoder); &s->bitcoder);
if (s->bitcoder.eos) { if (s->bitcoder.eos) {
s->symbol = 0; s->symbol = 0;
s->count = ~0; s->count = ~0;
} }
} }
s->count--; s->count--;
return (s->symbol); return (s->symbol);
} }
int coder_id = 0; int coder_id = 0;
FILE *file = NULL; FILE *file = NULL;
static inline void static inline
rlecoder_encoder_init (RLECoderState * s, uint32_t limit) void rlecoder_encoder_init (RLECoderState *s, uint32_t limit)
{ {
bitcoder_encoder_init (&s->bitcoder, limit); bitcoder_encoder_init (&s->bitcoder, limit);
s->symbol = -1; s->symbol = -1;
s->have_seen_1 = 0; s->have_seen_1 = 0;
s->golomb_state[0].count = 0; s->golomb_state[0].count = 0;
s->golomb_state[1].count = 0; s->golomb_state[1].count = 0;
s->golomb_state[0].bits = 5 << 3; s->golomb_state[0].bits = 5 << 3;
s->golomb_state[1].bits = 5 << 3; s->golomb_state[1].bits = 5 << 3;
} }
/** /**
* once you called this, you better should not encode any more symbols ... * once you called this, you better should not encode any more symbols ...
*/ */
static inline uint32_t static inline
rlecoder_encoder_flush (RLECoderState * s) uint32_t rlecoder_encoder_flush (RLECoderState *s)
{ {
if (s->symbol == -1 || !s->have_seen_1) if (s->symbol == -1 || !s->have_seen_1)
return 0; return 0;
golombcoder_encode_number (&s->golomb_state[s->symbol], golombcoder_encode_number (&s->golomb_state[s->symbol],
&s->bitcoder, s->count); &s->bitcoder, s->count);
return bitcoder_flush (&s->bitcoder); return bitcoder_flush (&s->bitcoder);
} }
static inline void static inline
rlecoder_decoder_init (RLECoderState * s, uint8_t * bitstream, uint32_t limit) void rlecoder_decoder_init (RLECoderState *s, uint8_t *bitstream, uint32_t limit)
{ {
bitcoder_decoder_init (&s->bitcoder, bitstream, limit); bitcoder_decoder_init (&s->bitcoder, bitstream, limit);
s->golomb_state[0].count = 0; s->golomb_state[0].count = 0;
s->golomb_state[1].count = 0; s->golomb_state[1].count = 0;
s->golomb_state[0].bits = 5 << 3; s->golomb_state[0].bits = 5 << 3;
s->golomb_state[1].bits = 5 << 3; s->golomb_state[1].bits = 5 << 3;
s->symbol = bitcoder_read_bit (&s->bitcoder); s->symbol = bitcoder_read_bit (&s->bitcoder);
s->count = golombcoder_decode_number (&s->golomb_state[s->symbol], s->count = golombcoder_decode_number (&s->golomb_state[s->symbol],
&s->bitcoder) - 1; &s->bitcoder) - 1;
if (s->bitcoder.eos) { if (s->bitcoder.eos) {
s->symbol = 0; s->symbol = 0;
s->count = ~0; s->count = ~0;
} }
} }
static inline void static inline
rlecoder_encoder_done (RLECoderState * s) void rlecoder_encoder_done (RLECoderState *s)
{ {
bitcoder_encoder_done (&s->bitcoder); bitcoder_encoder_done (&s->bitcoder);
} }
#endif #endif

View file

@ -18,115 +18,105 @@
/* Theses determine what infos the packet comes with */ /* Theses determine what infos the packet comes with */
#define TARKIN_PACK_EXAMPLE 1 #define TARKIN_PACK_EXAMPLE 1
typedef struct typedef struct {
{ uint8_t *data;
uint8_t *data; uint32_t data_len;
uint32_t data_len; uint32_t storage;
uint32_t storage; } TarkinPacket;
} TarkinPacket;
typedef enum typedef enum {
{ TARKIN_GRAYSCALE,
TARKIN_GRAYSCALE, TARKIN_RGB24, /* tight packed RGB */
TARKIN_RGB24, /* tight packed RGB */ TARKIN_RGB32, /* 32bit, no alphachannel */
TARKIN_RGB32, /* 32bit, no alphachannel */ TARKIN_RGBA, /* dito w/ alphachannel */
TARKIN_RGBA, /* dito w/ alphachannel */ TARKIN_YUV2, /* 16 bits YUV */
TARKIN_YUV2, /* 16 bits YUV */ TARKIN_YUV12, /* 12 bits YUV */
TARKIN_YUV12, /* 12 bits YUV */ TARKIN_FYUV, /* Tarkin's Fast YUV-like? */
TARKIN_FYUV, /* Tarkin's Fast YUV-like? */
} TarkinColorFormat; } TarkinColorFormat;
#define TARKIN_INTERNAL_FORMAT TARKIN_FYUV #define TARKIN_INTERNAL_FORMAT TARKIN_FYUV
typedef enum typedef enum {
{ TARKIN_OK = 0,
TARKIN_OK = 0, TARKIN_IO_ERROR,
TARKIN_IO_ERROR, TARKIN_SIGNATURE_NOT_FOUND,
TARKIN_SIGNATURE_NOT_FOUND, TARKIN_INVALID_LAYER,
TARKIN_INVALID_LAYER, TARKIN_INVALID_COLOR_FORMAT,
TARKIN_INVALID_COLOR_FORMAT, TARKIN_VERSION,
TARKIN_VERSION, TARKIN_BAD_HEADER,
TARKIN_BAD_HEADER, TARKIN_NOT_TARKIN,
TARKIN_NOT_TARKIN, TARKIN_FAULT,
TARKIN_FAULT, TARKIN_UNUSED,
TARKIN_UNUSED, TARKIN_NEED_MORE,
TARKIN_NEED_MORE, TARKIN_NOT_IMPLEMENTED
TARKIN_NOT_IMPLEMENTED
} TarkinError; } TarkinError;
typedef struct typedef struct {
{ uint32_t width;
uint32_t width; uint32_t height;
uint32_t height; uint32_t a_moments;
uint32_t a_moments; uint32_t s_moments;
uint32_t s_moments; uint32_t frames_per_buf;
uint32_t frames_per_buf; uint32_t bitstream_len; /* for all color components, bytes */
uint32_t bitstream_len; /* for all color components, bytes */ TarkinColorFormat format;
TarkinColorFormat format;
} TarkinVideoLayerDesc; } TarkinVideoLayerDesc;
typedef struct typedef struct {
{ TarkinVideoLayerDesc desc;
TarkinVideoLayerDesc desc; uint32_t n_comp; /* number of color components */
uint32_t n_comp; /* number of color components */ Wavelet3DBuf **waveletbuf;
Wavelet3DBuf **waveletbuf; TarkinPacket *packet;
TarkinPacket *packet; uint32_t current_frame_in_buf;
uint32_t current_frame_in_buf; uint32_t frameno;
uint32_t frameno;
void (*color_fwd_xform) (uint8_t * rgba, Wavelet3DBuf * yuva[], void (*color_fwd_xform) (uint8_t *rgba, Wavelet3DBuf *yuva [], uint32_t count);
uint32_t count); void (*color_inv_xform) (Wavelet3DBuf *yuva [], uint8_t *rgba, uint32_t count);
void (*color_inv_xform) (Wavelet3DBuf * yuva[], uint8_t * rgba,
uint32_t count);
} TarkinVideoLayer; } TarkinVideoLayer;
typedef struct typedef struct {
{ uint32_t numerator;
uint32_t numerator; uint32_t denominator;
uint32_t denominator; } TarkinTime; /* Let's say the unit is 1 second */
} TarkinTime; /* Let's say the unit is 1 second */
typedef struct TarkinInfo typedef struct TarkinInfo {
{ int version;
int version; int n_layers;
int n_layers; TarkinVideoLayer *layer;
TarkinVideoLayer *layer; TarkinTime inter; /* numerator == O if per-frame time info. */
TarkinTime inter; /* numerator == O if per-frame time info. */ int frames_per_block;
int frames_per_block; int comp_per_block; /* AKA "packets per block" for now */
int comp_per_block; /* AKA "packets per block" for now */ uint32_t max_bitstream_len;
uint32_t max_bitstream_len;
/* The below bitrate declarations are *hints*. /* The below bitrate declarations are *hints*.
Combinations of the three values carry the following implications: Combinations of the three values carry the following implications:
all three set to the same value: all three set to the same value:
implies a fixed rate bitstream implies a fixed rate bitstream
only nominal set: only nominal set:
implies a VBR stream that averages the nominal bitrate. No hard implies a VBR stream that averages the nominal bitrate. No hard
upper/lower limit upper/lower limit
upper and or lower set: upper and or lower set:
implies a VBR bitstream that obeys the bitrate limits. nominal implies a VBR bitstream that obeys the bitrate limits. nominal
may also be set to give a nominal rate. may also be set to give a nominal rate.
none set: none set:
the coder does not care to speculate. the coder does not care to speculate.
*/ */
long bitrate_upper; long bitrate_upper;
long bitrate_nominal; long bitrate_nominal;
long bitrate_lower; long bitrate_lower;
long bitrate_window; long bitrate_window;
} TarkinInfo; } TarkinInfo;
/* This is used for encoding */ /* This is used for encoding */
typedef struct typedef struct {
{ unsigned char *header;
unsigned char *header; unsigned char *header1;
unsigned char *header1; unsigned char *header2;
unsigned char *header2;
} tarkin_header_store; } tarkin_header_store;
@ -134,33 +124,31 @@ typedef struct
/* Some of the fields in TarkinStream are redundent with TarkinInfo ones /* Some of the fields in TarkinStream are redundent with TarkinInfo ones
* and will probably get deleted, namely n_layers and frames_per_buf */ * and will probably get deleted, namely n_layers and frames_per_buf */
typedef struct TarkinStream typedef struct TarkinStream {
{ uint32_t n_layers;
uint32_t n_layers; TarkinVideoLayer *layer;
TarkinVideoLayer *layer; uint32_t current_frame;
uint32_t current_frame; uint32_t current_frame_in_buf;
uint32_t current_frame_in_buf; ogg_int64_t packetno;
ogg_int64_t packetno; uint32_t frames_per_buf;
uint32_t frames_per_buf; uint32_t max_bitstream_len;
uint32_t max_bitstream_len; TarkinInfo *ti;
TarkinInfo *ti; tarkin_header_store headers;
tarkin_header_store headers; /* These callbacks are only used for encoding */
/* These callbacks are only used for encoding */ TarkinError (*free_frame)(void *tarkinstream, void *ptr);
TarkinError (*free_frame) (void *tarkinstream, void *ptr); /* These thing allows not to buffer but it needs global var in caller. */
/* These thing allows not to buffer but it needs global var in caller. */ TarkinError (*packet_out)(void *tarkinstream, ogg_packet *ptr);
TarkinError (*packet_out) (void *tarkinstream, ogg_packet * ptr); void * user_ptr;
void *user_ptr;
} TarkinStream; } TarkinStream;
typedef struct TarkinComment typedef struct TarkinComment{
{
/* unlimited user comment fields. libtarkin writes 'libtarkin' /* unlimited user comment fields. libtarkin writes 'libtarkin'
whatever vendor is set to in encode */ whatever vendor is set to in encode */
char **user_comments; char **user_comments;
int *comment_lengths; int *comment_lengths;
int comments; int comments;
char *vendor; char *vendor;
} TarkinComment; } TarkinComment;
@ -173,17 +161,17 @@ typedef struct TarkinComment
/* Theses are the very same than Vorbis versions, they could be shared. */ /* Theses are the very same than Vorbis versions, they could be shared. */
extern TarkinStream *tarkin_stream_new (); extern TarkinStream* tarkin_stream_new ();
extern void tarkin_stream_destroy (TarkinStream * s); extern void tarkin_stream_destroy (TarkinStream *s);
extern void tarkin_info_init (TarkinInfo * vi); extern void tarkin_info_init(TarkinInfo *vi);
extern void tarkin_info_clear (TarkinInfo * vi); extern void tarkin_info_clear(TarkinInfo *vi);
extern void tarkin_comment_init (TarkinComment * vc); extern void tarkin_comment_init(TarkinComment *vc);
extern void tarkin_comment_add (TarkinComment * vc, char *comment); extern void tarkin_comment_add(TarkinComment *vc, char *comment);
extern void tarkin_comment_add_tag (TarkinComment * vc, extern void tarkin_comment_add_tag(TarkinComment *vc,
char *tag, char *contents); char *tag, char *contents);
extern char *tarkin_comment_query (TarkinComment * vc, char *tag, int count); extern char *tarkin_comment_query(TarkinComment *vc, char *tag, int count);
extern int tarkin_comment_query_count (TarkinComment * vc, char *tag); extern int tarkin_comment_query_count(TarkinComment *vc, char *tag);
extern void tarkin_comment_clear (TarkinComment * vc); extern void tarkin_comment_clear(TarkinComment *vc);
/* Tarkin PRIMITIVES: analysis layer ****************************/ /* Tarkin PRIMITIVES: analysis layer ****************************/
/* Tarkin encoding is done this way : you init it passing a fresh /* 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 * 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 * 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(). */ * time. The user_ptr is stored in s and can be used by packet_out(). */
extern int tarkin_analysis_init (TarkinStream * s, extern int tarkin_analysis_init(TarkinStream *s,
TarkinInfo * ti, TarkinInfo *ti,
TarkinError (*free_frame) (void *tarkinstream, void *ptr), TarkinError (*free_frame)(void *tarkinstream, void *ptr),
TarkinError (*packet_out) (void *tarkinstream, ogg_packet * ptr), TarkinError (*packet_out)(void *tarkinstream, ogg_packet *ptr),
void *user_ptr); void *user_ptr
);
/* Then you need to add at least a layer in your stream, passing a /* Then you need to add at least a layer in your stream, passing a
* TarkinVideoLayerDesc renseigned at least on the width, height and * TarkinVideoLayerDesc renseigned at least on the width, height and
* format parameters. */ * format parameters. */
extern int tarkin_analysis_add_layer (TarkinStream * s, extern int tarkin_analysis_add_layer(TarkinStream *s,
TarkinVideoLayerDesc * tvld); TarkinVideoLayerDesc *tvld);
/* At that point you are ready to get headers out the lib by calling /* At that point you are ready to get headers out the lib by calling
* tarkin_analysis_headerout() passing it a renseigned TarkinComment * tarkin_analysis_headerout() passing it a renseigned TarkinComment
* structure. It does fill your 3 ogg_packet headers, which are valid * structure. It does fill your 3 ogg_packet headers, which are valid
* till next call */ * till next call */
extern int TarkinCommentheader_out (TarkinComment * vc, ogg_packet * op); extern int TarkinCommentheader_out(TarkinComment *vc, ogg_packet *op);
extern TarkinError tarkin_analysis_headerout (TarkinStream * s, extern TarkinError tarkin_analysis_headerout(TarkinStream *s,
TarkinComment * vc, TarkinComment *vc,
ogg_packet * op, ogg_packet * op_comm, ogg_packet * op_code); 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 /* 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 * 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. * 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 * If you encode multiple layers you have to do it synchronously, putting
* one frame from each layer at a time. */ * one frame from each layer at a time. */
extern uint32_t tarkin_analysis_framein (TarkinStream * s, uint8_t * frame, /* NULL for EOS */ extern uint32_t tarkin_analysis_framein(TarkinStream *s,
uint32_t layer, TarkinTime * date); uint8_t *frame, /* NULL for EOS */
uint32_t layer,
TarkinTime *date);
/* Tarkin PRIMITIVES: synthesis layer *******************************/ /* Tarkin PRIMITIVES: synthesis layer *******************************/
/* For decoding, you needs first to give the three first packet of the /* For decoding, you needs first to give the three first packet of the
* stream to tarkin_synthesis_headerin() which will fill for you blank * stream to tarkin_synthesis_headerin() which will fill for you blank
* TarkinInfo and TarkinComment. */ * TarkinInfo and TarkinComment. */
extern TarkinError tarkin_synthesis_headerin (TarkinInfo * vi, extern TarkinError tarkin_synthesis_headerin(TarkinInfo *vi,TarkinComment *vc,
TarkinComment * vc, ogg_packet * op); ogg_packet *op);
/* Then you can init your stream with your TarkinInfo struct. */ /* 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*/ /* All subsequent packets are to this be passed to tarkin_synthesis_packetin*/
extern TarkinError tarkin_synthesis_packetin (TarkinStream * s, extern TarkinError tarkin_synthesis_packetin(TarkinStream *s, ogg_packet *op);
ogg_packet * op);
/* and then tarkin_synthesis_frameout gives you ptr on next frame, or NULL. It /* and then tarkin_synthesis_frameout gives you ptr on next frame, or NULL. It
* also fills for you date. */ * also fills for you date. */
extern TarkinError tarkin_synthesis_frameout (TarkinStream * s, extern TarkinError tarkin_synthesis_frameout(TarkinStream *s,
uint8_t ** frame, uint32_t layer_id, TarkinTime * date); uint8_t **frame, uint32_t layer_id, TarkinTime *date);
/* When you're done with a frame, tell it to the codec with this. */ /* 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 #endif

View file

@ -4,25 +4,24 @@
#include <stdint.h> #include <stdint.h>
typedef struct typedef struct {
{ TYPE *data;
TYPE *data; uint32_t width;
uint32_t width; uint32_t height;
uint32_t height; uint32_t frames;
uint32_t frames; uint32_t scales;
uint32_t scales; uint32_t *w;
uint32_t *w; uint32_t *h;
uint32_t *h; uint32_t *f;
uint32_t *f; uint32_t (*offset)[8];
uint32_t (*offset)[8]; TYPE *scratchbuf;
TYPE *scratchbuf;
} Wavelet3DBuf; } Wavelet3DBuf;
extern Wavelet3DBuf *wavelet_3d_buf_new (uint32_t width, uint32_t height, extern Wavelet3DBuf* wavelet_3d_buf_new (uint32_t width, uint32_t height,
uint32_t frames); uint32_t frames);
extern void wavelet_3d_buf_destroy (Wavelet3DBuf * buf); extern void wavelet_3d_buf_destroy (Wavelet3DBuf* buf);
/** /**
* transform buf->data * transform buf->data
@ -30,21 +29,25 @@ extern void wavelet_3d_buf_destroy (Wavelet3DBuf * buf);
* highpass filter, * highpass filter,
* s_moments the one of the synthesizing lowpass filter. * s_moments the one of the synthesizing lowpass filter.
*/ */
extern void wavelet_3d_buf_fwd_xform (Wavelet3DBuf * buf, extern void wavelet_3d_buf_fwd_xform (Wavelet3DBuf* buf,
int a_moments, int s_moments); int a_moments, int s_moments);
extern void wavelet_3d_buf_inv_xform (Wavelet3DBuf * buf, extern void wavelet_3d_buf_inv_xform (Wavelet3DBuf* buf,
int a_moments, int s_moments); int a_moments, int s_moments);
extern int wavelet_3d_buf_encode_coeff (const Wavelet3DBuf * buf, extern int wavelet_3d_buf_encode_coeff (const Wavelet3DBuf* buf,
uint8_t * bitstream, uint32_t limit); uint8_t *bitstream,
uint32_t limit);
extern void wavelet_3d_buf_decode_coeff (Wavelet3DBuf * buf, extern void wavelet_3d_buf_decode_coeff (Wavelet3DBuf* buf,
uint8_t * bitstream, uint32_t limit); uint8_t *bitstream,
uint32_t limit);
#if defined(DBG_XFORM) #if defined(DBG_XFORM)
extern void wavelet_3d_buf_dump (char *fmt, extern void wavelet_3d_buf_dump (char *fmt,
uint32_t first_frame_in_buf, uint32_t first_frame_in_buf,
uint32_t id, Wavelet3DBuf * buf, int16_t offset); uint32_t id,
Wavelet3DBuf* buf,
int16_t offset);
#else #else
#define wavelet_3d_buf_dump(x...) #define wavelet_3d_buf_dump(x...)
#endif #endif

View file

@ -5,16 +5,17 @@
#include <stdint.h> #include <stdint.h>
#include "wavelet.h" #include "wavelet.h"
extern void rgb24_to_yuv (uint8_t * rgb, Wavelet3DBuf * yuv[], 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 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 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 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 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 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 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 y_to_grayscale (Wavelet3DBuf *y [], uint8_t *rgba, uint32_t frame);
#endif #endif

View file

@ -25,6 +25,7 @@
#include <xine/buffer.h> #include <xine/buffer.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_XINE \ #define GST_TYPE_XINE \
(gst_xine_get_type()) (gst_xine_get_type())
#define GST_XINE(obj) \ #define GST_XINE(obj) \
@ -37,45 +38,47 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_XINE)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_XINE))
#define GST_IS_XINE_CLASS(obj) \ #define GST_IS_XINE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XINE)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XINE))
typedef struct _GstXine GstXine;
typedef struct _GstXine GstXine;
typedef struct _GstXineClass GstXineClass; typedef struct _GstXineClass GstXineClass;
struct _GstXine struct _GstXine
{ {
GstElement element; GstElement element;
xine_stream_t *stream; xine_stream_t * stream;
xine_ao_driver_t *audio_driver; xine_ao_driver_t * audio_driver;
xine_vo_driver_t *video_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_ao_driver_t * (* create_audio_driver) (GstXine * xine);
xine_vo_driver_t *(*create_video_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); xine_stream_t * gst_xine_get_stream (GstXine *xine);
void gst_xine_free_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 */ /* conversion functions from xinecaps.c */
const gchar *gst_xine_get_caps_for_format (guint32 format); const gchar * gst_xine_get_caps_for_format (guint32 format);
guint32 gst_xine_get_format_for_caps (const GstCaps * caps); guint32 gst_xine_get_format_for_caps (const GstCaps *caps);
/* init functions for the plugins */ /* init functions for the plugins */
gboolean gst_xine_audio_sink_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_audio_dec_init_plugin (GstPlugin *plugin);
gboolean gst_xine_input_init_plugin (GstPlugin * plugin); gboolean gst_xine_input_init_plugin (GstPlugin *plugin);
G_END_DECLS G_END_DECLS
#endif /* __GST_XINE_H__ */ #endif /* __GST_XINE_H__ */

View file

@ -23,11 +23,13 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define gst_xvid_init_struct(s) \ #define gst_xvid_init_struct(s) \
do { \ do { \
memset (&s, 0, sizeof(s)); \ memset (&s, 0, sizeof(s)); \
s.version = XVID_VERSION; \ s.version = XVID_VERSION; \
} while (0); } while (0);
#define RGB_24_32_STATIC_CAPS(bpp, r_mask,g_mask,b_mask) \ #define RGB_24_32_STATIC_CAPS(bpp, r_mask,g_mask,b_mask) \
"video/x-raw-rgb, " \ "video/x-raw-rgb, " \
"width = (int) [ 0, MAX ], " \ "width = (int) [ 0, MAX ], " \
@ -39,12 +41,14 @@ G_BEGIN_DECLS
"red_mask = (int) " G_STRINGIFY (r_mask) ", " \ "red_mask = (int) " G_STRINGIFY (r_mask) ", " \
"green_mask = (int) " G_STRINGIFY (g_mask) ", " \ "green_mask = (int) " G_STRINGIFY (g_mask) ", " \
"blue_mask = (int) " G_STRINGIFY (b_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, extern gchar * gst_xvid_error (int errorcode);
gint w, gint * stride, gint * bpp); extern gboolean gst_xvid_init (void);
extern GstCaps *gst_xvid_csp_to_caps (gint csp, gint w, gint h, gdouble fps);
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 G_END_DECLS
#endif /* __GST_XVID_H__ */ #endif /* __GST_XVID_H__ */

View file

@ -24,9 +24,8 @@
#include "gstxvid.h" #include "gstxvid.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_XVIDDEC \ #define GST_TYPE_XVIDDEC \
@ -40,34 +39,32 @@ extern "C"
#define GST_IS_XVIDDEC_CLASS(obj) \ #define GST_IS_XVIDDEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XVIDDEC)) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XVIDDEC))
typedef struct _GstXvidDec GstXvidDec; typedef struct _GstXvidDec GstXvidDec;
typedef struct _GstXvidDecClass GstXvidDecClass; typedef struct _GstXvidDecClass GstXvidDecClass;
struct _GstXvidDec struct _GstXvidDec {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
/* xvid handle */ /* xvid handle */
void *handle; void *handle;
/* video (output) settings */ /* video (output) settings */
gint csp, bpp, stride; gint csp, bpp, stride;
gint width, height; gint width, height;
double fps; double fps;
}; };
struct _GstXvidDecClass struct _GstXvidDecClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_xviddec_get_type (void); GType gst_xviddec_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_XVIDDEC_H__ */ #endif /* __GST_XVIDDEC_H__ */

View file

@ -24,9 +24,8 @@
#include "gstxvid.h" #include "gstxvid.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_XVIDENC \ #define GST_TYPE_XVIDENC \
@ -40,48 +39,46 @@ extern "C"
#define GST_IS_XVIDENC_CLASS(obj) \ #define GST_IS_XVIDENC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XVIDENC)) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XVIDENC))
typedef struct _GstXvidEnc GstXvidEnc; typedef struct _GstXvidEnc GstXvidEnc;
typedef struct _GstXvidEncClass GstXvidEncClass; typedef struct _GstXvidEncClass GstXvidEncClass;
struct _GstXvidEnc struct _GstXvidEnc {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
/* encoding profile */ /* encoding profile */
gint profile; gint profile;
/* quality of encoded image */ /* quality of encoded image */
gint bitrate; gint bitrate;
gint buffer_size; gint buffer_size;
/* max number of B frames between I/P */ /* max number of B frames between I/P */
gint max_b_frames; gint max_b_frames;
/* max key interval */ /* max key interval */
gint max_key_interval; gint max_key_interval;
/* xvid handle */ /* xvid handle */
void *handle; void *handle;
gint csp; gint csp;
gint width, height, stride; gint width, height, stride;
gdouble fps; gdouble fps;
}; };
struct _GstXvidEncClass struct _GstXvidEncClass {
{ GstElementClass parent_class;
GstElementClass parent_class;
/* signals */ /* signals */
void (*frame_encoded) (GstElement * element); void (*frame_encoded) (GstElement *element);
}; };
GType gst_xvidenc_get_type (void); GType gst_xvidenc_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_XVIDENC_H__ */ #endif /* __GST_XVIDENC_H__ */

View file

@ -26,6 +26,7 @@
#define __GST_AUDIO_AUDIO_H__ #define __GST_AUDIO_AUDIO_H__
G_BEGIN_DECLS G_BEGIN_DECLS
/* For people that are looking at this source: the purpose of these defines is /* 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 * 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 * 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 * Andy Wingo, 18 August 2001
* Thomas, 6 September 2002 */ * Thomas, 6 September 2002 */
#define GST_AUDIO_DEF_RATE 44100 #define GST_AUDIO_DEF_RATE 44100
#define GST_AUDIO_INT_PAD_TEMPLATE_CAPS \ #define GST_AUDIO_INT_PAD_TEMPLATE_CAPS \
"audio/x-raw-int, " \ "audio/x-raw-int, " \
"rate = (int) [ 1, MAX ], " \ "rate = (int) [ 1, MAX ], " \
@ -57,7 +60,9 @@ G_BEGIN_DECLS
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \ "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
"width = (int) { 8, 16, 32 }, " \ "width = (int) { 8, 16, 32 }, " \
"depth = (int) [ 1, 32 ], " \ "depth = (int) [ 1, 32 ], " \
"signed = (boolean) { true, false }" "signed = (boolean) { true, false }"
/* "standard" int audio is native order, 16 bit stereo. */ /* "standard" int audio is native order, 16 bit stereo. */
#define GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS \ #define GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS \
"audio/x-raw-int, " \ "audio/x-raw-int, " \
@ -66,7 +71,8 @@ G_BEGIN_DECLS
"endianness = (int) BYTE_ORDER, " \ "endianness = (int) BYTE_ORDER, " \
"width = (int) 16, " \ "width = (int) 16, " \
"depth = (int) 16, " \ "depth = (int) 16, " \
"signed = (boolean) true" "signed = (boolean) true"
#define GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS \ #define GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS \
"audio/x-raw-float, " \ "audio/x-raw-float, " \
"rate = (int) [ 1, MAX ], " \ "rate = (int) [ 1, MAX ], " \
@ -74,6 +80,7 @@ G_BEGIN_DECLS
"endianness = (int) { LITTLE_ENDIAN , BIG_ENDIAN }, " \ "endianness = (int) { LITTLE_ENDIAN , BIG_ENDIAN }, " \
"width = (int) { 32, 64 }, " \ "width = (int) { 32, 64 }, " \
"buffer-frames = (int) [ 1, MAX]" "buffer-frames = (int) [ 1, MAX]"
/* "standard" float audio is native order, 32 bit mono. */ /* "standard" float audio is native order, 32 bit mono. */
#define GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS \ #define GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS \
"audio/x-raw-float, " \ "audio/x-raw-float, " \
@ -81,42 +88,43 @@ G_BEGIN_DECLS
"channels = (int) 1, " \ "channels = (int) 1, " \
"endianness = (int) BYTE_ORDER, " \ "endianness = (int) BYTE_ORDER, " \
"buffer-frames = (int) [ 1, MAX]" "buffer-frames = (int) [ 1, MAX]"
/* /*
* this library defines and implements some helper functions for audio * this library defines and implements some helper functions for audio
* handling * handling
*/ */
/* get byte size of audio frame (based on caps of pad */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* functions useful for _getcaps functions */
typedef enum typedef enum {
{ GST_AUDIO_FIELD_RATE = (1 << 0),
GST_AUDIO_FIELD_RATE = (1 << 0), GST_AUDIO_FIELD_CHANNELS = (1 << 1),
GST_AUDIO_FIELD_CHANNELS = (1 << 1), GST_AUDIO_FIELD_ENDIANNESS = (1 << 2),
GST_AUDIO_FIELD_ENDIANNESS = (1 << 2), GST_AUDIO_FIELD_WIDTH = (1 << 3),
GST_AUDIO_FIELD_WIDTH = (1 << 3), GST_AUDIO_FIELD_DEPTH = (1 << 4),
GST_AUDIO_FIELD_DEPTH = (1 << 4), GST_AUDIO_FIELD_SIGNED = (1 << 5),
GST_AUDIO_FIELD_SIGNED = (1 << 5),
GST_AUDIO_FIELD_BUFFER_FRAMES = (1 << 6) GST_AUDIO_FIELD_BUFFER_FRAMES = (1 << 6)
} GstAudioFieldFlag; } GstAudioFieldFlag;
void gst_audio_structure_set_int (GstStructure * structure, void gst_audio_structure_set_int (GstStructure *structure, GstAudioFieldFlag flag);
GstAudioFieldFlag flag);
G_END_DECLS G_END_DECLS
#endif /* __GST_AUDIO_AUDIO_H__ */ #endif /* __GST_AUDIO_AUDIO_H__ */

View file

@ -27,6 +27,7 @@
#include <gst/gstsystemclock.h> #include <gst/gstsystemclock.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_AUDIO_CLOCK \ #define GST_TYPE_AUDIO_CLOCK \
(gst_audio_clock_get_type()) (gst_audio_clock_get_type())
#define GST_AUDIO_CLOCK(obj) \ #define GST_AUDIO_CLOCK(obj) \
@ -37,15 +38,14 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_CLOCK)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_CLOCK))
#define GST_IS_AUDIO_CLOCK_CLASS(obj) \ #define GST_IS_AUDIO_CLOCK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_CLOCK)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_CLOCK))
typedef struct _GstAudioClock GstAudioClock; typedef struct _GstAudioClock GstAudioClock;
typedef struct _GstAudioClockClass GstAudioClockClass; typedef struct _GstAudioClockClass GstAudioClockClass;
typedef GstClockTime (*GstAudioClockGetTimeFunc) (GstClock * clock, typedef GstClockTime (*GstAudioClockGetTimeFunc) (GstClock *clock, gpointer user_data);
gpointer user_data);
struct _GstAudioClock struct _GstAudioClock {
{
GstSystemClock clock; GstSystemClock clock;
GstClockTime prev1, prev2; GstClockTime prev1, prev2;
@ -63,19 +63,19 @@ struct _GstAudioClock
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
}; };
struct _GstAudioClockClass struct _GstAudioClockClass {
{
GstSystemClockClass parent_class; GstSystemClockClass parent_class;
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
}; };
GType gst_audio_clock_get_type (void); GType gst_audio_clock_get_type (void);
GstClock *gst_audio_clock_new (gchar * name, GstAudioClockGetTimeFunc func, GstClock* gst_audio_clock_new (gchar *name, GstAudioClockGetTimeFunc func,
gpointer user_data); gpointer user_data);
void gst_audio_clock_set_active (GstAudioClock * aclock, gboolean active); 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 G_END_DECLS
#endif /* __GST_AUDIO_CLOCK_H__ */ #endif /* __GST_AUDIO_CLOCK_H__ */

View file

@ -25,15 +25,17 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS typedef struct _GstAudiofilter GstAudiofilter; G_BEGIN_DECLS
typedef struct _GstAudiofilter GstAudiofilter;
typedef struct _GstAudiofilterClass GstAudiofilterClass; typedef struct _GstAudiofilterClass GstAudiofilterClass;
typedef void (*GstAudiofilterFilterFunc) (GstAudiofilter * filter, typedef void (*GstAudiofilterFilterFunc)(GstAudiofilter *filter,
GstBuffer * outbuf, GstBuffer * inbuf); GstBuffer *outbuf, GstBuffer *inbuf);
typedef void (*GstAudiofilterInplaceFilterFunc) (GstAudiofilter * filter, typedef void (*GstAudiofilterInplaceFilterFunc)(GstAudiofilter *filter,
GstBuffer * buffer); GstBuffer *buffer);
typedef void (*GstAudiofilterSetupFunc) (GstAudiofilter * filter); typedef void (*GstAudiofilterSetupFunc) (GstAudiofilter *filter);
#define GST_TYPE_AUDIOFILTER \ #define GST_TYPE_AUDIOFILTER \
@ -47,11 +49,10 @@ typedef void (*GstAudiofilterSetupFunc) (GstAudiofilter * filter);
#define GST_IS_AUDIOFILTER_CLASS(obj) \ #define GST_IS_AUDIOFILTER_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOFILTER)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOFILTER))
struct _GstAudiofilter struct _GstAudiofilter {
{
GstElement element; GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
/* audio state */ /* audio state */
gboolean inited; gboolean inited;
@ -67,8 +68,7 @@ struct _GstAudiofilter
int bytes_per_sample; int bytes_per_sample;
}; };
struct _GstAudiofilterClass struct _GstAudiofilterClass {
{
GstElementClass parent_class; GstElementClass parent_class;
GstCaps *caps; GstCaps *caps;
@ -77,10 +77,11 @@ struct _GstAudiofilterClass
GstAudiofilterFilterFunc filter; GstAudiofilterFilterFunc filter;
}; };
GType gst_audiofilter_get_type (void); GType gst_audiofilter_get_type(void);
void gst_audiofilter_class_add_pad_templates (GstAudiofilterClass * void gst_audiofilter_class_add_pad_templates (GstAudiofilterClass *audiofilterclass, const GstCaps *caps);
audiofilterclass, const GstCaps * caps);
G_END_DECLS G_END_DECLS
#endif /* __GST_AUDIOFILTER_H__ */ #endif /* __GST_AUDIOFILTER_H__ */

View file

@ -27,6 +27,7 @@
#include <gst/colorbalance/colorbalance-enumtypes.h> #include <gst/colorbalance/colorbalance-enumtypes.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_COLOR_BALANCE \ #define GST_TYPE_COLOR_BALANCE \
(gst_color_balance_get_type ()) (gst_color_balance_get_type ())
#define GST_COLOR_BALANCE(obj) \ #define GST_COLOR_BALANCE(obj) \
@ -41,48 +42,55 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE))
#define GST_COLOR_BALANCE_GET_CLASS(inst) \ #define GST_COLOR_BALANCE_GET_CLASS(inst) \
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_COLOR_BALANCE, GstColorBalanceClass)) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_COLOR_BALANCE, GstColorBalanceClass))
#define GST_COLOR_BALANCE_TYPE(klass) (klass->balance_type) #define GST_COLOR_BALANCE_TYPE(klass) (klass->balance_type)
typedef struct _GstColorBalance GstColorBalance;
typedef struct _GstColorBalance GstColorBalance;
typedef enum typedef enum
{ {
GST_COLOR_BALANCE_HARDWARE, GST_COLOR_BALANCE_HARDWARE,
GST_COLOR_BALANCE_SOFTWARE GST_COLOR_BALANCE_SOFTWARE
} GstColorBalanceType; } GstColorBalanceType;
typedef struct _GstColorBalanceClass typedef struct _GstColorBalanceClass {
{
GTypeInterface klass; GTypeInterface klass;
GstColorBalanceType balance_type; GstColorBalanceType balance_type;
/* virtual functions */ /* virtual functions */
const GList *(*list_channels) (GstColorBalance * balance); const GList * (* list_channels) (GstColorBalance *balance);
void (*set_value) (GstColorBalance * balance, void (* set_value) (GstColorBalance *balance,
GstColorBalanceChannel * channel, gint value); GstColorBalanceChannel *channel,
gint (*get_value) (GstColorBalance * balance, gint value);
GstColorBalanceChannel * channel); gint (* get_value) (GstColorBalance *balance,
GstColorBalanceChannel *channel);
/* signals */ /* signals */
void (*value_changed) (GstColorBalance * balance, void (* value_changed) (GstColorBalance *balance,
GstColorBalanceChannel * channel, gint value); GstColorBalanceChannel *channel,
gint value);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
} GstColorBalanceClass; } GstColorBalanceClass;
GType gst_color_balance_get_type (void); GType gst_color_balance_get_type (void);
/* virtual class function wrappers */ /* virtual class function wrappers */
const GList *gst_color_balance_list_channels (GstColorBalance * balance); const GList *
void gst_color_balance_set_value (GstColorBalance * balance, gst_color_balance_list_channels (GstColorBalance *balance);
GstColorBalanceChannel * channel, gint value); void gst_color_balance_set_value (GstColorBalance *balance,
gint gst_color_balance_get_value (GstColorBalance * balance, GstColorBalanceChannel *channel,
GstColorBalanceChannel * channel); gint value);
gint gst_color_balance_get_value (GstColorBalance *balance,
GstColorBalanceChannel *channel);
/* trigger signal */ /* trigger signal */
void gst_color_balance_value_changed (GstColorBalance * balance, void gst_color_balance_value_changed (GstColorBalance *balance,
GstColorBalanceChannel * channel, gint value); GstColorBalanceChannel *channel,
gint value);
G_END_DECLS G_END_DECLS
#endif /* __GST_COLOR_BALANCE_H__ */ #endif /* __GST_COLOR_BALANCE_H__ */

View file

@ -25,6 +25,7 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_COLOR_BALANCE_CHANNEL \ #define GST_TYPE_COLOR_BALANCE_CHANNEL \
(gst_color_balance_channel_get_type ()) (gst_color_balance_channel_get_type ())
#define GST_COLOR_BALANCE_CHANNEL(obj) \ #define GST_COLOR_BALANCE_CHANNEL(obj) \
@ -37,25 +38,27 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_COLOR_BALANCE_CHANNEL)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_COLOR_BALANCE_CHANNEL))
#define GST_IS_COLOR_BALANCE_CHANNEL_CLASS(klass) \ #define GST_IS_COLOR_BALANCE_CHANNEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE_CHANNEL)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE_CHANNEL))
typedef struct _GstColorBalanceChannel
{ typedef struct _GstColorBalanceChannel {
GObject parent; GObject parent;
gchar *label; gchar *label;
gint min_value, max_value; gint min_value,
max_value;
} GstColorBalanceChannel; } GstColorBalanceChannel;
typedef struct _GstColorBalanceChannelClass typedef struct _GstColorBalanceChannelClass {
{
GObjectClass parent; GObjectClass parent;
/* signals */ /* signals */
void (*value_changed) (GstColorBalanceChannel * channel, gint value); void (* value_changed) (GstColorBalanceChannel *channel,
gint value);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
} GstColorBalanceChannelClass; } GstColorBalanceChannelClass;
GType gst_color_balance_channel_get_type (void); GType gst_color_balance_channel_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_COLOR_BALANCE_CHANNEL_H__ */ #endif /* __GST_COLOR_BALANCE_CHANNEL_H__ */

View file

@ -29,46 +29,53 @@
#include <glib/gtypes.h> #include <glib/gtypes.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#if (HAVE_LRINT && HAVE_LRINTF) #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 /* These defines enable functionality introduced with the 1999 ISO C
** engage them. If optimisation is enabled, these functions will be ** standard. They must be defined before the inclusion of math.h to
** inlined. With optimisation switched off, you have to link in the ** engage them. If optimisation is enabled, these functions will be
** maths library using -lm. ** 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 _ISOC9X_SOURCE 1
#define __USE_ISOC99 1 #define _ISOC99_SOURCE 1
#include <math.h>
#define gst_cast_float(x) ((gint)lrintf(x)) #define __USE_ISOC9X 1
#define gst_cast_double(x) ((gint)lrint(x)) #define __USE_ISOC99 1
#include <math.h>
#define gst_cast_float(x) ((gint)lrintf(x))
#define gst_cast_double(x) ((gint)lrint(x))
#else #else
/* use a standard c cast, but do rounding correctly */ /* use a standard c cast, but do rounding correctly */
#define gst_cast_float(x) ((gint)floor((x)+0.5)) #define gst_cast_float(x) ((gint)floor((x)+0.5))
#define gst_cast_double(x) ((gint)floor((x)+0.5)) #define gst_cast_double(x) ((gint)floor((x)+0.5))
#endif #endif
inline static gfloat inline static gfloat
GFLOAT_SWAP_LE_BE (gfloat in) GFLOAT_SWAP_LE_BE(gfloat in)
{ {
gint32 swap; gint32 swap;
gfloat out; gfloat out;
memcpy(&swap, &in, 4);
memcpy (&swap, &in, 4);
swap = GUINT32_SWAP_LE_BE_CONSTANT (swap); swap = GUINT32_SWAP_LE_BE_CONSTANT (swap);
memcpy (&out, &swap, 4); memcpy(&out, &swap, 4);
return out; return out;
} }
inline static gdouble inline static gdouble
GDOUBLE_SWAP_LE_BE (gdouble in) GDOUBLE_SWAP_LE_BE(gdouble in)
{ {
gint64 swap; gint64 swap;
gdouble out; gdouble out;
memcpy(&swap, &in, 8);
memcpy (&swap, &in, 8);
swap = GUINT64_SWAP_LE_BE_CONSTANT (swap); swap = GUINT64_SWAP_LE_BE_CONSTANT (swap);
memcpy (&out, &swap, 8); memcpy(&out, &swap, 8);
return out; return out;
} }
@ -94,4 +101,6 @@ GDOUBLE_SWAP_LE_BE (gdouble in)
#define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val)) #define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val))
G_END_DECLS G_END_DECLS
#endif /* __FLOATCAST_H__ */ #endif /* __FLOATCAST_H__ */

View file

@ -27,16 +27,17 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gconf/gconf-client.h> #include <gconf/gconf-client.h>
gchar *gst_gconf_get_string (const gchar * key); gchar * gst_gconf_get_string (const gchar *key);
void gst_gconf_set_string (const gchar * key, const gchar * value); 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_key (const gchar *key);
GstElement *gst_gconf_render_bin_from_description (const gchar * description); GstElement * gst_gconf_render_bin_from_description (const gchar *description);
GstElement *gst_gconf_get_default_video_sink (void); GstElement * gst_gconf_get_default_video_sink (void);
GstElement *gst_gconf_get_default_audio_sink (void); GstElement * gst_gconf_get_default_audio_sink (void);
GstElement *gst_gconf_get_default_video_src (void); GstElement * gst_gconf_get_default_video_src (void);
GstElement *gst_gconf_get_default_audio_src (void); GstElement * gst_gconf_get_default_audio_src (void);
GstElement *gst_gconf_get_default_visualization_element (void); GstElement * gst_gconf_get_default_visualization_element (void);
#endif /* GST_GCONF_H */ #endif /* GST_GCONF_H */

View file

@ -22,8 +22,8 @@
#ifndef __GST_I18N_PLUGIN_H__ #ifndef __GST_I18N_PLUGIN_H__
#define __GST_I18N_PLUGIN_H__ #define __GST_I18N_PLUGIN_H__
#include <locale.h> /* some people need it and some people don't */ #include <locale.h> /* some people need it and some people don't */
#include "gettext.h" /* included with gettext distribution and copied */ #include "gettext.h" /* included with gettext distribution and copied */
#ifndef GETTEXT_PACKAGE #ifndef GETTEXT_PACKAGE
#error You must define GETTEXT_PACKAGE before including this header. #error You must define GETTEXT_PACKAGE before including this header.

View file

@ -16,7 +16,7 @@ typedef DCTELEM DCTBLOCK[DCTSIZE2];
typedef long INT32; /* must be at least 32 bits */ 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_init_fast_int_idct (void);
extern void gst_idct_fast_int_idct (short *block); 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); extern void gst_idct_sse_idct (short *block);
#endif /* HAVE_LIBMMX */ #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); extern void gst_idct_float_idct (short *block);

View file

@ -23,24 +23,22 @@
#include <glib.h> #include <glib.h>
typedef enum typedef enum {
{ GST_IDCT_DEFAULT,
GST_IDCT_DEFAULT, GST_IDCT_INT,
GST_IDCT_INT, GST_IDCT_FAST_INT,
GST_IDCT_FAST_INT, GST_IDCT_FLOAT,
GST_IDCT_FLOAT, GST_IDCT_MMX,
GST_IDCT_MMX,
GST_IDCT_MMX32, GST_IDCT_MMX32,
GST_IDCT_SSE, GST_IDCT_SSE,
} GstIDCTMethod; } GstIDCTMethod;
typedef struct _GstIDCT GstIDCT; typedef struct _GstIDCT GstIDCT;
typedef void (*GstIDCTFunction) (gshort * block); typedef void (*GstIDCTFunction) (gshort *block);
#define GST_IDCT_TRANSPOSE(idct) ((idct)->need_transpose) #define GST_IDCT_TRANSPOSE(idct) ((idct)->need_transpose)
struct _GstIDCT struct _GstIDCT {
{
/* private */ /* private */
GstIDCTFunction convert; GstIDCTFunction convert;
GstIDCTFunction convert_sparse; 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(idct, blocks) (idct)->convert((blocks))
#define gst_idct_convert_sparse(idct, blocks) (idct)->convert_sparse((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__ */ #endif /* __GST_IDCT_H__ */

View file

@ -72,65 +72,69 @@ struct GstMediaInfoPriv
gint metadata_iters; gint metadata_iters;
GstTagList *streaminfo; GstTagList *streaminfo;
GstElement *pipeline; /* will be != NULL during collection */ GstElement *pipeline; /* will be != NULL during collection */
gchar *pipeline_desc; /* will be != NULL during collection */ gchar *pipeline_desc; /* will be != NULL during collection */
GstElement *fakesink; /* so we can get caps from the GstElement *fakesink; /* so we can get caps from the
decoder sink pad */ decoder sink pad */
gchar *source_name; /* type of element used as source */ gchar *source_name; /* type of element used as source */
GstElement *source; GstElement *source;
GstPad *source_pad; /* pad for querying encoded caps */ GstPad *source_pad; /* pad for querying encoded caps */
GstElement *decoder; GstElement *decoder;
GstPad *decoder_pad; /* pad for querying decoded caps */ GstPad *decoder_pad; /* pad for querying decoded caps */
GstElement *decontainer; /* element to typefind in containers */ GstElement *decontainer; /* element to typefind in containers */
GstMediaInfoState state; /* current state of state machine */ GstMediaInfoState state; /* current state of state machine */
gchar *location; /* location set on the info object */ gchar *location; /* location set on the info object */
guint16 flags; /* flags supplied for detection */ guint16 flags; /* flags supplied for detection */
GstMediaInfoTrack *current_track; /* track pointer under inspection */ GstMediaInfoTrack *current_track; /* track pointer under inspection */
glong current_track_num; /* current track under inspection */ glong current_track_num; /* current track under inspection */
GstMediaInfoStream *stream; /* total stream properties */ GstMediaInfoStream *stream; /* total stream properties */
char *cache; /* location of cache */ char *cache; /* location of cache */
GError *error; /* error for creation problems */ GError *error; /* error for creation problems */
}; };
/* declarations */ /* declarations */
GstMediaInfoStream *gmi_stream_new (void); GstMediaInfoStream *
void gmi_stream_free (GstMediaInfoStream * stream); gmi_stream_new (void);
void gmi_stream_free (GstMediaInfoStream *stream);
GstMediaInfoTrack *gmi_track_new (void); GstMediaInfoTrack *
gmi_track_new (void);
void gmip_reset (GstMediaInfoPriv * priv); void gmip_reset (GstMediaInfoPriv *priv);
gboolean gmip_init (GstMediaInfoPriv * priv, GError ** error); gboolean gmip_init (GstMediaInfoPriv *priv, GError **error);
void gmi_clear_decoder (GstMediaInfo * info); void gmi_clear_decoder (GstMediaInfo *info);
gboolean gmi_seek_to_track (GstMediaInfo * info, long track); gboolean gmi_seek_to_track (GstMediaInfo *info,
long track);
gboolean gmi_set_mime (GstMediaInfo * info, const char *mime); gboolean gmi_set_mime (GstMediaInfo *info,
const char *mime);
void deep_notify_callback (GObject * object, void deep_notify_callback (GObject *object,
GstObject * origin, GParamSpec * pspec, GstMediaInfoPriv * priv); GstObject *origin,
void found_tag_callback (GObject * pipeline, GstElement * source, GParamSpec *pspec,
GstTagList * tags, GstMediaInfoPriv * priv); GstMediaInfoPriv *priv);
void error_callback (GObject * element, GstElement * source, GError * error, void found_tag_callback (GObject *pipeline, GstElement *source, GstTagList *tags, GstMediaInfoPriv *priv);
gchar * debug, 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_pre (GstMediaInfoPriv *priv, GError **error);
gboolean gmip_find_type_post (GstMediaInfoPriv * priv); gboolean gmip_find_type_post (GstMediaInfoPriv *priv);
gboolean gmip_find_type (GstMediaInfoPriv * priv, GError ** error); gboolean gmip_find_type (GstMediaInfoPriv *priv, GError **error);
gboolean gmip_find_stream_pre (GstMediaInfoPriv * priv); gboolean gmip_find_stream_pre (GstMediaInfoPriv *priv);
gboolean gmip_find_stream_post (GstMediaInfoPriv * priv); gboolean gmip_find_stream_post (GstMediaInfoPriv *priv);
gboolean gmip_find_stream (GstMediaInfoPriv * priv); gboolean gmip_find_stream (GstMediaInfoPriv *priv);
gboolean gmip_find_track_metadata_pre (GstMediaInfoPriv * priv); gboolean gmip_find_track_metadata_pre (GstMediaInfoPriv *priv);
gboolean gmip_find_track_metadata_post (GstMediaInfoPriv * priv); gboolean gmip_find_track_metadata_post (GstMediaInfoPriv *priv);
gboolean gmip_find_track_metadata (GstMediaInfoPriv * priv); gboolean gmip_find_track_metadata (GstMediaInfoPriv *priv);
gboolean gmip_find_track_streaminfo_pre (GstMediaInfoPriv * priv); gboolean gmip_find_track_streaminfo_pre (GstMediaInfoPriv *priv);
gboolean gmip_find_track_streaminfo_post (GstMediaInfoPriv * priv); gboolean gmip_find_track_streaminfo_post (GstMediaInfoPriv *priv);
gboolean gmip_find_track_streaminfo (GstMediaInfoPriv * priv); gboolean gmip_find_track_streaminfo (GstMediaInfoPriv *priv);
gboolean gmip_find_track_format_pre (GstMediaInfoPriv * priv); gboolean gmip_find_track_format_pre (GstMediaInfoPriv *priv);
gboolean gmip_find_track_format_post (GstMediaInfoPriv * priv); gboolean gmip_find_track_format_post (GstMediaInfoPriv *priv);
gboolean gmip_find_track_format (GstMediaInfoPriv * priv); gboolean gmip_find_track_format (GstMediaInfoPriv *priv);
#endif /* __GST_MEDIA_INFO_PRIV_H__ */ #endif /* __GST_MEDIA_INFO_PRIV_H__ */

View file

@ -23,9 +23,11 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS typedef struct GstMediaInfoPriv GstMediaInfoPriv; G_BEGIN_DECLS
typedef struct _GstMediaInfo GstMediaInfo;
typedef struct _GstMediaInfoClass GstMediaInfoClass; typedef struct GstMediaInfoPriv GstMediaInfoPriv;
typedef struct _GstMediaInfo GstMediaInfo;
typedef struct _GstMediaInfoClass GstMediaInfoClass;
struct _GstMediaInfo struct _GstMediaInfo
{ {
@ -41,9 +43,8 @@ struct _GstMediaInfoClass
GObjectClass parent_class; GObjectClass parent_class;
/* signals */ /* signals */
void (*media_info_signal) (GstMediaInfo * gst_media_info); void (*media_info_signal) (GstMediaInfo *gst_media_info);
void (*error_signal) (GstMediaInfo * gst_media_info, GError * error, void (*error_signal) (GstMediaInfo *gst_media_info, GError *error, const gchar *debug);
const gchar * debug);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
}; };
@ -99,25 +100,34 @@ typedef struct
#define GST_MEDIA_INFO_FORMAT 1 << 5 #define GST_MEDIA_INFO_FORMAT 1 << 5
#define GST_MEDIA_INFO_ALL ((1 << 6) - 1) #define GST_MEDIA_INFO_ALL ((1 << 6) - 1)
GQuark gst_media_info_error_quark (void); GQuark gst_media_info_error_quark (void);
void gst_media_info_init (void); void gst_media_info_init (void);
GType gst_media_info_get_type (void); GType gst_media_info_get_type (void);
GstMediaInfo *gst_media_info_new (GError ** error); 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);
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 ? * FIXME: reset ?
gboolean gst_media_info_write (GstMediaInfo *media_info, gboolean gst_media_info_write (GstMediaInfo *media_info,
@ -126,4 +136,5 @@ gboolean gst_media_info_write (GstMediaInfo *media_info,
*/ */
G_END_DECLS G_END_DECLS
#endif /* __GST_MEDIA_INFO_H__ */ #endif /* __GST_MEDIA_INFO_H__ */

View file

@ -27,6 +27,7 @@
#include <gst/mixer/mixer-enumtypes.h> #include <gst/mixer/mixer-enumtypes.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_MIXER \ #define GST_TYPE_MIXER \
(gst_mixer_get_type ()) (gst_mixer_get_type ())
#define GST_MIXER(obj) \ #define GST_MIXER(obj) \
@ -39,7 +40,9 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER))
#define GST_MIXER_GET_CLASS(inst) \ #define GST_MIXER_GET_CLASS(inst) \
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_MIXER, GstMixerClass)) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_MIXER, GstMixerClass))
#define GST_MIXER_TYPE(klass) (klass->mixer_type) #define GST_MIXER_TYPE(klass) (klass->mixer_type)
typedef struct _GstMixer GstMixer; typedef struct _GstMixer GstMixer;
typedef enum typedef enum
@ -48,52 +51,70 @@ typedef enum
GST_MIXER_SOFTWARE GST_MIXER_SOFTWARE
} GstMixerType; } GstMixerType;
typedef struct _GstMixerClass typedef struct _GstMixerClass {
{
GTypeInterface klass; GTypeInterface klass;
GstMixerType mixer_type; GstMixerType mixer_type;
/* virtual functions */ /* virtual functions */
const GList *(*list_tracks) (GstMixer * mixer); const GList * (* list_tracks) (GstMixer *mixer);
void (*set_volume) (GstMixer * mixer, GstMixerTrack * track, gint * volumes); void (* set_volume) (GstMixer *mixer,
void (*get_volume) (GstMixer * mixer, GstMixerTrack * track, gint * volumes); GstMixerTrack *track,
gint *volumes);
void (* get_volume) (GstMixer *mixer,
GstMixerTrack *track,
gint *volumes);
void (*set_mute) (GstMixer * mixer, GstMixerTrack * track, gboolean mute); void (* set_mute) (GstMixer *mixer,
void (*set_record) (GstMixer * mixer, GstMixerTrack * track, gboolean record); GstMixerTrack *track,
gboolean mute);
void (* set_record) (GstMixer *mixer,
GstMixerTrack *track,
gboolean record);
/* signals */ /* signals */
void (*mute_toggled) (GstMixer * mixer, void (* mute_toggled) (GstMixer *mixer,
GstMixerTrack * channel, gboolean mute); GstMixerTrack *channel,
void (*record_toggled) (GstMixer * mixer, gboolean mute);
GstMixerTrack * channel, gboolean record); void (* record_toggled) (GstMixer *mixer,
void (*volume_changed) (GstMixer * mixer, GstMixerTrack *channel,
GstMixerTrack * channel, gint * volumes); gboolean record);
void (* volume_changed) (GstMixer *mixer,
GstMixerTrack *channel,
gint *volumes);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
} GstMixerClass; } GstMixerClass;
GType gst_mixer_get_type (void); GType gst_mixer_get_type (void);
/* virtual class function wrappers */ /* virtual class function wrappers */
const GList *gst_mixer_list_tracks (GstMixer * mixer); const GList * gst_mixer_list_tracks (GstMixer *mixer);
void gst_mixer_set_volume (GstMixer * mixer, void gst_mixer_set_volume (GstMixer *mixer,
GstMixerTrack * track, gint * volumes); GstMixerTrack *track,
void gst_mixer_get_volume (GstMixer * mixer, gint *volumes);
GstMixerTrack * track, gint * volumes); void gst_mixer_get_volume (GstMixer *mixer,
void gst_mixer_set_mute (GstMixer * mixer, GstMixerTrack *track,
GstMixerTrack * track, gboolean mute); gint *volumes);
void gst_mixer_set_record (GstMixer * mixer, void gst_mixer_set_mute (GstMixer *mixer,
GstMixerTrack * track, gboolean record); GstMixerTrack *track,
gboolean mute);
void gst_mixer_set_record (GstMixer *mixer,
GstMixerTrack *track,
gboolean record);
/* trigger signals */ /* trigger signals */
void gst_mixer_mute_toggled (GstMixer * mixer, void gst_mixer_mute_toggled (GstMixer *mixer,
GstMixerTrack * track, gboolean mute); GstMixerTrack *track,
void gst_mixer_record_toggled (GstMixer * mixer, gboolean mute);
GstMixerTrack * track, gboolean record); void gst_mixer_record_toggled (GstMixer *mixer,
void gst_mixer_volume_changed (GstMixer * mixer, GstMixerTrack *track,
GstMixerTrack * track, gint * volumes); gboolean record);
void gst_mixer_volume_changed (GstMixer *mixer,
GstMixerTrack *track,
gint *volumes);
G_END_DECLS G_END_DECLS
#endif /* __GST_MIXER_H__ */ #endif /* __GST_MIXER_H__ */

View file

@ -25,6 +25,7 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_MIXER_TRACK \ #define GST_TYPE_MIXER_TRACK \
(gst_mixer_track_get_type ()) (gst_mixer_track_get_type ())
#define GST_MIXER_TRACK(obj) \ #define GST_MIXER_TRACK(obj) \
@ -37,6 +38,7 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MIXER_TRACK)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MIXER_TRACK))
#define GST_IS_MIXER_TRACK_CLASS(klass) \ #define GST_IS_MIXER_TRACK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER_TRACK)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER_TRACK))
/* /*
* Naming: * Naming:
* *
@ -52,41 +54,45 @@ G_BEGIN_DECLS
* mixer, which means that setting this track will change * mixer, which means that setting this track will change
* the hearable volume on any output. * the hearable volume on any output.
*/ */
typedef enum
{ typedef enum {
GST_MIXER_TRACK_INPUT = (1 << 0), GST_MIXER_TRACK_INPUT = (1<<0),
GST_MIXER_TRACK_OUTPUT = (1 << 1), GST_MIXER_TRACK_OUTPUT = (1<<1),
GST_MIXER_TRACK_MUTE = (1 << 2), GST_MIXER_TRACK_MUTE = (1<<2),
GST_MIXER_TRACK_RECORD = (1 << 3), GST_MIXER_TRACK_RECORD = (1<<3),
GST_MIXER_TRACK_MASTER = (1 << 4), GST_MIXER_TRACK_MASTER = (1<<4),
GST_MIXER_TRACK_SOFTWARE = (1 << 5) GST_MIXER_TRACK_SOFTWARE = (1<<5)
} GstMixerTrackFlags; } GstMixerTrackFlags;
#define GST_MIXER_TRACK_HAS_FLAG(channel, flag) \ #define GST_MIXER_TRACK_HAS_FLAG(channel, flag) \
((channel)->flags & flag) ((channel)->flags & flag)
typedef struct _GstMixerTrack typedef struct _GstMixerTrack {
{ GObject parent;
GObject parent;
gchar *label; gchar *label;
GstMixerTrackFlags flags; GstMixerTrackFlags flags;
gint num_channels, min_volume, max_volume; gint num_channels,
min_volume,
max_volume;
} GstMixerTrack; } GstMixerTrack;
typedef struct _GstMixerTrackClass typedef struct _GstMixerTrackClass {
{
GObjectClass parent; GObjectClass parent;
/* signals */ /* signals */
void (*mute_toggled) (GstMixerTrack * channel, gboolean mute); void (* mute_toggled) (GstMixerTrack *channel,
void (*record_toggled) (GstMixerTrack * channel, gboolean record); gboolean mute);
void (*volume_changed) (GstMixerTrack * channel, gint * volumes); void (* record_toggled) (GstMixerTrack *channel,
gboolean record);
void (* volume_changed) (GstMixerTrack *channel,
gint *volumes);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
} GstMixerTrackClass; } GstMixerTrackClass;
GType gst_mixer_track_get_type (void); GType gst_mixer_track_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_MIXER_TRACK_H__ */ #endif /* __GST_MIXER_TRACK_H__ */

View file

@ -26,6 +26,7 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_NAVIGATION \ #define GST_TYPE_NAVIGATION \
(gst_navigation_get_type ()) (gst_navigation_get_type ())
#define GST_NAVIGATION(obj) \ #define GST_NAVIGATION(obj) \
@ -34,28 +35,28 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NAVIGATION)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NAVIGATION))
#define GST_NAVIGATION_GET_IFACE(obj) \ #define GST_NAVIGATION_GET_IFACE(obj) \
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_NAVIGATION, GstNavigationInterface)) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_NAVIGATION, GstNavigationInterface))
typedef struct _GstNavigation GstNavigation; typedef struct _GstNavigation GstNavigation;
typedef struct _GstNavigationInterface typedef struct _GstNavigationInterface {
{
GTypeInterface g_iface; GTypeInterface g_iface;
/* virtual functions */ /* virtual functions */
void (*send_event) (GstNavigation * navigation, GstStructure * structure); void (*send_event) (GstNavigation *navigation, GstStructure *structure);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
} GstNavigationInterface; } GstNavigationInterface;
GType gst_navigation_get_type (void); GType gst_navigation_get_type (void);
/* virtual class function wrappers */ /* virtual class function wrappers */
void gst_navigation_send_event (GstNavigation * navigation, void gst_navigation_send_event (GstNavigation *navigation, GstStructure *structure);
GstStructure * structure);
void gst_navigation_send_key_event (GstNavigation * navigation, void gst_navigation_send_key_event (GstNavigation *navigation,
const char *event, const char *key); const char *event, const char *key);
void gst_navigation_send_mouse_event (GstNavigation * navigation, void gst_navigation_send_mouse_event (GstNavigation *navigation,
const char *event, int button, double x, double y); const char *event, int button, double x, double y);
G_END_DECLS G_END_DECLS
#endif /* __GST_NAVIGATION_H__ */ #endif /* __GST_NAVIGATION_H__ */

View file

@ -16,7 +16,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef __GST_PLAY_H__ #ifndef __GST_PLAY_H__
#define __GST_PLAY_H__ #define __GST_PLAY_H__
@ -46,43 +46,51 @@ typedef enum
typedef struct _GstPlay GstPlay; typedef struct _GstPlay GstPlay;
typedef struct _GstPlayClass GstPlayClass; typedef struct _GstPlayClass GstPlayClass;
typedef struct _GstPlayPrivate GstPlayPrivate; typedef struct _GstPlayPrivate GstPlayPrivate;
struct _GstPlay struct _GstPlay
{ {
GstPipeline pipeline; GstPipeline pipeline;
GstPlayPrivate *priv; GstPlayPrivate *priv;
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
}; };
struct _GstPlayClass struct _GstPlayClass
{ {
GstPipelineClass parent_class; GstPipelineClass parent_class;
void (*time_tick) (GstPlay * play, gint64 time_nanos); void (*time_tick) (GstPlay *play, gint64 time_nanos);
void (*stream_length) (GstPlay * play, gint64 length_nanos); void (*stream_length) (GstPlay *play, gint64 length_nanos);
void (*have_video_size) (GstPlay * play, gint width, gint height); void (*have_video_size) (GstPlay *play, gint width, gint height);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
}; };
GType gst_play_get_type (void); GType gst_play_get_type (void);
GstPlay *gst_play_new (GError ** error); GstPlay * gst_play_new (GError **error);
gboolean gst_play_set_data_src (GstPlay * play, GstElement * data_src); gboolean gst_play_set_data_src (GstPlay *play,
gboolean gst_play_set_video_sink (GstPlay * play, GstElement * video_sink); GstElement *data_src);
gboolean gst_play_set_audio_sink (GstPlay * play, GstElement * audio_sink); 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_set_visualization (GstPlay *play,
gboolean gst_play_connect_visualization (GstPlay * play, gboolean connect); GstElement *element);
gboolean gst_play_connect_visualization (GstPlay *play,
gboolean connect);
gboolean gst_play_set_location (GstPlay * play, const char *location); gboolean gst_play_set_location (GstPlay *play,
char *gst_play_get_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 * gst_play_get_sink_element (GstPlay *play,
GstElement * element, GstPlaySinkType sink_type); GstElement *element,
GstPlaySinkType sink_type);
#endif /* __GST_PLAY_H__ */ #endif /* __GST_PLAY_H__ */

View file

@ -25,6 +25,7 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_PROPERTY_PROBE \ #define GST_TYPE_PROPERTY_PROBE \
(gst_property_probe_get_type ()) (gst_property_probe_get_type ())
#define GST_PROPERTY_PROBE(obj) \ #define GST_PROPERTY_PROBE(obj) \
@ -33,59 +34,64 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PROPERTY_PROBE)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PROPERTY_PROBE))
#define GST_PROPERTY_PROBE_GET_IFACE(obj) \ #define GST_PROPERTY_PROBE_GET_IFACE(obj) \
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_PROPERTY_PROBE, GstPropertyProbeInterface)) (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; GTypeInterface klass;
/* signals */ /* signals */
void (*probe_needed) (GstPropertyProbe * probe, const GParamSpec * pspec); void (*probe_needed) (GstPropertyProbe *probe,
const GParamSpec *pspec);
/* virtual functions */ /* virtual functions */
const GList *(*get_properties) (GstPropertyProbe * probe); const GList * (*get_properties) (GstPropertyProbe *probe);
gboolean (*needs_probe) (GstPropertyProbe * probe, gboolean (*needs_probe) (GstPropertyProbe *probe,
guint prop_id, const GParamSpec * pspec); guint prop_id,
void (*probe_property) (GstPropertyProbe * probe, const GParamSpec *pspec);
guint prop_id, const GParamSpec * pspec); void (*probe_property) (GstPropertyProbe *probe,
GValueArray *(*get_values) (GstPropertyProbe * probe, guint prop_id,
guint prop_id, const GParamSpec * pspec); const GParamSpec *pspec);
GValueArray * (*get_values) (GstPropertyProbe *probe,
guint prop_id,
const GParamSpec *pspec);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
} GstPropertyProbeInterface; } GstPropertyProbeInterface;
GType gst_property_probe_get_type (void); GType gst_property_probe_get_type (void);
/* virtual class function wrappers */ /* virtual class function wrappers */
/* returns list of GParamSpecs */ /* returns list of GParamSpecs */
const GList *gst_property_probe_get_properties (GstPropertyProbe * probe); const GList * gst_property_probe_get_properties (GstPropertyProbe *probe);
const GParamSpec *gst_property_probe_get_property (GstPropertyProbe * probe, const GParamSpec *gst_property_probe_get_property (GstPropertyProbe *probe,
const gchar * name); const gchar *name);
/* probe one property */ /* probe one property */
void gst_property_probe_probe_property (GstPropertyProbe * probe, void gst_property_probe_probe_property (GstPropertyProbe *probe,
const GParamSpec * pspec); const GParamSpec *pspec);
void gst_property_probe_probe_property_name (GstPropertyProbe * probe, void gst_property_probe_probe_property_name (GstPropertyProbe *probe,
const gchar * name); const gchar *name);
/* do we need a probe? */ /* do we need a probe? */
gboolean gst_property_probe_needs_probe (GstPropertyProbe * probe, gboolean gst_property_probe_needs_probe (GstPropertyProbe *probe,
const GParamSpec * pspec); const GParamSpec *pspec);
gboolean gst_property_probe_needs_probe_name (GstPropertyProbe * probe, gboolean gst_property_probe_needs_probe_name (GstPropertyProbe *probe,
const gchar * name); const gchar *name);
/* returns list of GValues */ /* returns list of GValues */
GValueArray *gst_property_probe_get_values (GstPropertyProbe * probe, GValueArray * gst_property_probe_get_values (GstPropertyProbe *probe,
const GParamSpec * pspec); const GParamSpec *pspec);
GValueArray *gst_property_probe_get_values_name (GstPropertyProbe * probe, GValueArray * gst_property_probe_get_values_name (GstPropertyProbe *probe,
const gchar * name); const gchar *name);
/* sugar */ /* sugar */
GValueArray *gst_property_probe_probe_and_get_values (GstPropertyProbe * probe, GValueArray * gst_property_probe_probe_and_get_values (GstPropertyProbe *probe,
const GParamSpec * pspec); const GParamSpec *pspec);
GValueArray *gst_property_probe_probe_and_get_values_name (GstPropertyProbe * GValueArray * gst_property_probe_probe_and_get_values_name (GstPropertyProbe *probe,
probe, const gchar * name); const gchar *name);
G_END_DECLS G_END_DECLS
#endif /* __GST_PROPERTY_PROBE_H__ */ #endif /* __GST_PROPERTY_PROBE_H__ */

View file

@ -23,71 +23,68 @@
#include "resample.h" #include "resample.h"
void gst_resample_nearest_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_bilinear_s16(gst_resample_t *r);
void gst_resample_sinc_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_slow_s16(gst_resample_t *r);
void gst_resample_sinc_ft_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_nearest_float(gst_resample_t *r);
void gst_resample_bilinear_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_float(gst_resample_t *r);
void gst_resample_sinc_slow_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_sinc_ft_float(gst_resample_t * r);
typedef struct functable_s functable_t; typedef struct functable_s functable_t;
struct functable_s struct functable_s {
{ double start;
double start; double offset;
double offset; int len;
int len;
double invoffset; double invoffset;
double scale; double scale;
double scale2; double scale2;
double (*func_x) (void *, double x); double (*func_x)(void *,double x);
double (*func_dx) (void *, double x); double (*func_dx)(void *,double x);
double (*func2_x) (void *, double x); double (*func2_x)(void *,double x);
double (*func2_dx) (void *, double x); double (*func2_dx)(void *,double x);
double *fx; double *fx;
double *fdx; double *fdx;
void *priv; void *priv;
}; };
void functable_init (functable_t * t); void functable_init(functable_t *t);
double functable_eval (functable_t * t, double x); double functable_eval(functable_t *t,double x);
double functable_fir (functable_t * t, 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, void functable_fir2(functable_t *t,double *r0, double *r1, double x0,
int n, double *data, int len); int n,double *data,int len);
double functable_sinc (void *p, double x); double functable_sinc(void *p, double x);
double functable_dsinc (void *p, double x); double functable_dsinc(void *p, double x);
double functable_window_std (void *p, double x); double functable_window_std(void *p, double x);
double functable_window_dstd (void *p, double x); double functable_window_dstd(void *p, double x);
double functable_window_boxcar (void *p, double x); double functable_window_boxcar(void *p, double x);
double functable_window_dboxcar (void *p, double x); double functable_window_dboxcar(void *p, double x);
/* math lib stuff */ /* math lib stuff */
void conv_double_short_table (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_unroll(double *dest, short *src, int n);
void conv_double_short_ref (double *dest, short *src, int n); void conv_double_short_ref(double *dest, short *src, int n);
#ifdef HAVE_CPU_PPC #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 #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 #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 #endif
#ifdef HAVE_CPU_PPC #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_double_float conv_double_float_ref
#define conv_float_double conv_float_double_ref #define conv_float_double conv_float_double_ref
void conv_double_short_dstr (double *dest, short *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_short_double_sstr(short *dest, double *src, int n, int dstr);
void conv_double_float_ref (double *dest, float *src, int n); void conv_double_float_ref(double *dest, float *src, int n);
void conv_float_double_ref (float *dest, double *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_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_float_double_sstr(float *dest, double *src, int n, int sstr);
#endif /* __PRIVATE_H__ */ #endif /* __PRIVATE_H__ */

View file

@ -21,78 +21,76 @@
#ifndef __GST_RESAMPLE_H__ #ifndef __GST_RESAMPLE_H__
#define __GST_RESAMPLE_H__ #define __GST_RESAMPLE_H__
typedef enum typedef enum {
{ GST_RESAMPLE_NEAREST = 0,
GST_RESAMPLE_NEAREST = 0, GST_RESAMPLE_BILINEAR,
GST_RESAMPLE_BILINEAR, GST_RESAMPLE_SINC_SLOW,
GST_RESAMPLE_SINC_SLOW, GST_RESAMPLE_SINC,
GST_RESAMPLE_SINC,
} gst_resample_method; } gst_resample_method;
typedef enum typedef enum {
{ GST_RESAMPLE_S16 = 0,
GST_RESAMPLE_S16 = 0, GST_RESAMPLE_FLOAT
GST_RESAMPLE_FLOAT
} gst_resample_format; } gst_resample_format;
typedef struct gst_resample_s gst_resample_t; typedef struct gst_resample_s gst_resample_t;
struct gst_resample_s struct gst_resample_s {
{ /* parameters */
/* parameters */
gst_resample_method method; gst_resample_method method;
int channels; int channels;
int verbose; int verbose;
gst_resample_format format; gst_resample_format format;
int filter_length; int filter_length;
double i_rate; double i_rate;
double o_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; void *buffer;
int buffer_len; int buffer_len;
double i_start; double i_start;
double o_start; double o_start;
double i_start_buf; double i_start_buf;
double i_end_buf; double i_end_buf;
double i_inc; double i_inc;
double o_inc; double o_inc;
double i_end; double i_end;
double o_end; double o_end;
int i_samples; int i_samples;
int o_samples; int o_samples;
void *i_buf, *o_buf; void *i_buf, *o_buf;
double acc[10]; double acc[10];
/* methods */ /* methods */
void (*scale) (gst_resample_t * r); 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__ */ #endif /* __GST_RESAMPLE_H__ */

View file

@ -66,29 +66,29 @@
#define GST_RIFF_FCCH_MSVC GST_MAKE_FOURCC ('M','S','V','C') #define GST_RIFF_FCCH_MSVC GST_MAKE_FOURCC ('M','S','V','C')
/* INFO types - see http://www.saettler.com/RIFFMCI/riffmci.html */ /* 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_ITCH GST_MAKE_FOURCC ('I','T','C','H') /* technician(s) */
/*********Chunk Names***************/ /*********Chunk Names***************/
#define GST_RIFF_FF00 GST_MAKE_FOURCC (0xFF,0xFF,0x00,0x00) #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_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_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_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')
#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') #define GST_RIFF_rpza GST_MAKE_FOURCC ('r', 'p', 'z', 'a')
/* And this here's the mistakes that need to be supported */ /* 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 **********/ /*********** FND in MJPG **********/
#define GST_RIFF_ISFT GST_MAKE_FOURCC ('I', 'S', 'F', 'T') #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', ' ') #define GST_RIFF_rec GST_MAKE_FOURCC ('r', 'e', 'c', ' ')
/* common data structures */ /* common data structures */
typedef struct _gst_riff_strh typedef struct _gst_riff_strh {
{ guint32 type; /* stream type */
guint32 type; /* stream type */ guint32 fcc_handler; /* fcc_handler */
guint32 fcc_handler; /* fcc_handler */
guint32 flags; guint32 flags;
/* flags values */ /* flags values */
#define GST_RIFF_STRH_DISABLED 0x000000001 #define GST_RIFF_STRH_DISABLED 0x000000001
#define GST_RIFF_STRH_VIDEOPALCHANGES 0x000010000 #define GST_RIFF_STRH_VIDEOPALCHANGES 0x000010000
guint32 priority; guint32 priority;
guint32 init_frames; /* initial frames (???) */ guint32 init_frames; /* initial frames (???) */
guint32 scale; guint32 scale;
guint32 rate; guint32 rate;
guint32 start; guint32 start;
guint32 length; guint32 length;
guint32 bufsize; /* suggested buffer size */ guint32 bufsize; /* suggested buffer size */
guint32 quality; guint32 quality;
guint32 samplesize; guint32 samplesize;
/* XXX 16 bytes ? */ /* XXX 16 bytes ? */
} gst_riff_strh; } gst_riff_strh;
typedef struct _gst_riff_strf_vids typedef struct _gst_riff_strf_vids { /* == BitMapInfoHeader */
{ /* == BitMapInfoHeader */
guint32 size; guint32 size;
guint32 width; guint32 width;
guint32 height; guint32 height;
@ -247,14 +245,13 @@ typedef struct _gst_riff_strf_vids
guint32 image_size; guint32 image_size;
guint32 xpels_meter; guint32 xpels_meter;
guint32 ypels_meter; guint32 ypels_meter;
guint32 num_colors; /* used colors */ guint32 num_colors; /* used colors */
guint32 imp_colors; /* important colors */ guint32 imp_colors; /* important colors */
/* may be more for some codecs */ /* may be more for some codecs */
} gst_riff_strf_vids; } gst_riff_strf_vids;
typedef struct _gst_riff_strf_auds typedef struct _gst_riff_strf_auds { /* == WaveHeader (?) */
{ /* == WaveHeader (?) */
guint16 format; guint16 format;
/**** from public Microsoft RIFF docs ******/ /**** from public Microsoft RIFF docs ******/
#define GST_RIFF_WAVE_FORMAT_UNKNOWN (0x0000) #define GST_RIFF_WAVE_FORMAT_UNKNOWN (0x0000)
@ -293,8 +290,7 @@ typedef struct _gst_riff_strf_auds
guint16 size; guint16 size;
} gst_riff_strf_auds; } gst_riff_strf_auds;
typedef struct _gst_riff_strf_iavs typedef struct _gst_riff_strf_iavs {
{
guint32 DVAAuxSrc; guint32 DVAAuxSrc;
guint32 DVAAuxCtl; guint32 DVAAuxCtl;
guint32 DVAAuxSrc1; guint32 DVAAuxSrc1;
@ -305,8 +301,7 @@ typedef struct _gst_riff_strf_iavs
guint32 DVReserved2; guint32 DVReserved2;
} gst_riff_strf_iavs; } gst_riff_strf_iavs;
typedef struct _gst_riff_index_entry typedef struct _gst_riff_index_entry {
{
guint32 id; guint32 id;
guint32 flags; guint32 flags;
#define GST_RIFF_IF_LIST (0x00000001L) #define GST_RIFF_IF_LIST (0x00000001L)
@ -317,8 +312,7 @@ typedef struct _gst_riff_index_entry
guint32 size; guint32 size;
} gst_riff_index_entry; } gst_riff_index_entry;
typedef struct _gst_riff_dmlh typedef struct _gst_riff_dmlh {
{
guint32 totalframes; guint32 totalframes;
} gst_riff_dmlh; } gst_riff_dmlh;

View file

@ -27,15 +27,23 @@
#include "riff-ids.h" #include "riff-ids.h"
G_BEGIN_DECLS G_BEGIN_DECLS
/* /*
* Create one caps. strh/strf can be NULL (for non-fixed caps). * 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_video_caps (guint32 codec_fcc,
GstCaps *gst_riff_create_audio_caps (guint16 codec_id, gst_riff_strh *strh,
gst_riff_strh * strh, gst_riff_strf_auds * strf, char **codec_name); gst_riff_strf_vids *strf,
GstCaps *gst_riff_create_iavs_caps (guint32 codec_fcc, char **codec_name);
gst_riff_strh * strh, gst_riff_strf_iavs * 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). * 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_video_template_caps (void);
GstCaps *gst_riff_create_audio_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 G_END_DECLS
#endif /* __GST_RIFF_READ_H__ */ #endif /* __GST_RIFF_READ_H__ */

View file

@ -27,6 +27,7 @@
#include <gst/bytestream/bytestream.h> #include <gst/bytestream/bytestream.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_RIFF_READ \ #define GST_TYPE_RIFF_READ \
(gst_riff_read_get_type ()) (gst_riff_read_get_type ())
#define GST_RIFF_READ(obj) \ #define GST_RIFF_READ(obj) \
@ -39,13 +40,13 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RIFF_READ)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RIFF_READ))
#define GST_RIFF_READ_GET_CLASS(obj) \ #define GST_RIFF_READ_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RIFF_READ, GstRiffReadClass)) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RIFF_READ, GstRiffReadClass))
typedef struct _GstRiffLevel
{ typedef struct _GstRiffLevel {
guint64 start, length; guint64 start,
length;
} GstRiffLevel; } GstRiffLevel;
typedef struct _GstRiffRead typedef struct _GstRiffRead {
{
GstElement parent; GstElement parent;
GstPad *sinkpad; GstPad *sinkpad;
@ -54,35 +55,43 @@ typedef struct _GstRiffRead
GList *level; GList *level;
} GstRiffRead; } GstRiffRead;
typedef struct _GstRiffReadClass typedef struct _GstRiffReadClass {
{
GstElementClass parent; GstElementClass parent;
} GstRiffReadClass; } 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_tag (GstRiffRead *riff,
guint32 gst_riff_peek_list (GstRiffRead * riff); guint *level_up);
guint32 gst_riff_peek_list (GstRiffRead *riff);
GstEvent *gst_riff_read_seek (GstRiffRead * riff, guint64 offset); GstEvent *gst_riff_read_seek (GstRiffRead *riff,
gboolean gst_riff_read_skip (GstRiffRead * riff); guint64 offset);
gboolean gst_riff_read_data (GstRiffRead * riff, gboolean gst_riff_read_skip (GstRiffRead *riff);
guint32 * tag, GstBuffer ** buf); gboolean gst_riff_read_data (GstRiffRead *riff,
gboolean gst_riff_read_ascii (GstRiffRead * riff, guint32 * tag, gchar ** str); guint32 *tag,
gboolean gst_riff_read_list (GstRiffRead * riff, guint32 * tag); GstBuffer **buf);
gboolean gst_riff_read_header (GstRiffRead * read, guint32 * doctype); 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). * Utility functions (including byteswapping).
*/ */
gboolean gst_riff_read_strh (GstRiffRead * riff, gst_riff_strh ** header); gboolean gst_riff_read_strh (GstRiffRead *riff,
gboolean gst_riff_read_strf_vids (GstRiffRead * riff, gst_riff_strh **header);
gst_riff_strf_vids ** header); gboolean gst_riff_read_strf_vids (GstRiffRead *riff,
gboolean gst_riff_read_strf_auds (GstRiffRead * riff, gst_riff_strf_vids **header);
gst_riff_strf_auds ** header); gboolean gst_riff_read_strf_auds (GstRiffRead *riff,
gboolean gst_riff_read_strf_iavs (GstRiffRead * riff, gst_riff_strf_auds **header);
gst_riff_strf_iavs ** header); gboolean gst_riff_read_strf_iavs (GstRiffRead *riff,
gboolean gst_riff_read_info (GstRiffRead * riff); gst_riff_strf_iavs **header);
gboolean gst_riff_read_info (GstRiffRead *riff);
G_END_DECLS G_END_DECLS
#endif /* __GST_RIFF_READ_H__ */ #endif /* __GST_RIFF_READ_H__ */

View file

@ -24,30 +24,39 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS 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);
/* 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);
/* functions to convert GstBuffers with vorbiscomment contents to GstTagLists and back */ /* functions to convert GstBuffers with vorbiscomment contents to GstTagLists and back */
GstTagList *gst_tag_list_from_vorbiscomment_buffer (const GstBuffer * buffer, GstTagList * gst_tag_list_from_vorbiscomment_buffer (const GstBuffer * buffer,
const guint8 * id_data, const guint id_data_length, gchar ** vendor_string); const guint8 * id_data,
GstBuffer *gst_tag_list_to_vorbiscomment_buffer (const GstTagList * list, const guint id_data_length,
const guint8 * id_data, gchar ** vendor_string);
const guint id_data_length, const 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 */ /* functions for ID3 tag manipulation */
guint gst_tag_id3_genre_count (void); guint gst_tag_id3_genre_count (void);
G_CONST_RETURN gchar *gst_tag_id3_genre_get (const guint id); G_CONST_RETURN gchar * gst_tag_id3_genre_get (const guint id);
GstTagList *gst_tag_list_new_from_id3v1 (const guint8 * data); 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_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_to_id3_tag (const gchar * gst_tag);
G_END_DECLS G_END_DECLS
#endif /* __GST_TAG_TAG_H__ */ #endif /* __GST_TAG_TAG_H__ */

View file

@ -28,6 +28,7 @@
#include <gst/tuner/tuner-enumtypes.h> #include <gst/tuner/tuner-enumtypes.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_TUNER \ #define GST_TYPE_TUNER \
(gst_tuner_get_type ()) (gst_tuner_get_type ())
#define GST_TUNER(obj) \ #define GST_TUNER(obj) \
@ -40,65 +41,87 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER))
#define GST_TUNER_GET_CLASS(inst) \ #define GST_TUNER_GET_CLASS(inst) \
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_TUNER, GstTunerClass)) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_TUNER, GstTunerClass))
typedef struct _GstTuner GstTuner; typedef struct _GstTuner GstTuner;
typedef struct _GstTunerClass typedef struct _GstTunerClass {
{
GTypeInterface klass; GTypeInterface klass;
/* virtual functions */ /* virtual functions */
const GList *(*list_channels) (GstTuner * tuner); const GList * (* list_channels) (GstTuner *tuner);
void (*set_channel) (GstTuner * tuner, GstTunerChannel * channel); void (* set_channel) (GstTuner *tuner,
GstTunerChannel *(*get_channel) (GstTuner * tuner); GstTunerChannel *channel);
GstTunerChannel *
(* get_channel) (GstTuner *tuner);
const GList *(*list_norms) (GstTuner * tuner); const GList * (* list_norms) (GstTuner *tuner);
void (*set_norm) (GstTuner * tuner, GstTunerNorm * norm); void (* set_norm) (GstTuner *tuner,
GstTunerNorm *(*get_norm) (GstTuner * tuner); GstTunerNorm *norm);
GstTunerNorm *(* get_norm) (GstTuner *tuner);
void (*set_frequency) (GstTuner * tuner, void (* set_frequency) (GstTuner *tuner,
GstTunerChannel * channel, gulong frequency); GstTunerChannel *channel,
gulong (*get_frequency) (GstTuner * tuner, GstTunerChannel * channel); gulong frequency);
gint (*signal_strength) (GstTuner * tuner, GstTunerChannel * channel); gulong (* get_frequency) (GstTuner *tuner,
GstTunerChannel *channel);
gint (* signal_strength) (GstTuner *tuner,
GstTunerChannel *channel);
/* signals */ /* signals */
void (*channel_changed) (GstTuner * tuner, GstTunerChannel * channel); void (*channel_changed) (GstTuner *tuner,
void (*norm_changed) (GstTuner * tuner, GstTunerNorm * norm); GstTunerChannel *channel);
void (*frequency_changed) (GstTuner * tuner, void (*norm_changed) (GstTuner *tuner,
GstTunerChannel * channel, gulong frequency); GstTunerNorm *norm);
void (*signal_changed) (GstTuner * tuner, void (*frequency_changed) (GstTuner *tuner,
GstTunerChannel * channel, gint signal); GstTunerChannel *channel,
gulong frequency);
void (*signal_changed) (GstTuner *tuner,
GstTunerChannel *channel,
gint signal);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
} GstTunerClass; } GstTunerClass;
GType gst_tuner_get_type (void); GType gst_tuner_get_type (void);
/* virtual class function wrappers */ /* virtual class function wrappers */
const GList *gst_tuner_list_channels (GstTuner * tuner); const GList * gst_tuner_list_channels (GstTuner *tuner);
void gst_tuner_set_channel (GstTuner * tuner, GstTunerChannel * channel); void gst_tuner_set_channel (GstTuner *tuner,
GstTunerChannel *gst_tuner_get_channel (GstTuner * tuner); GstTunerChannel *channel);
GstTunerChannel *
gst_tuner_get_channel (GstTuner *tuner);
const GList *gst_tuner_list_norms (GstTuner * tuner); const GList * gst_tuner_list_norms (GstTuner *tuner);
void gst_tuner_set_norm (GstTuner * tuner, GstTunerNorm * channel); void gst_tuner_set_norm (GstTuner *tuner,
GstTunerNorm *gst_tuner_get_norm (GstTuner * tuner); GstTunerNorm *channel);
GstTunerNorm * gst_tuner_get_norm (GstTuner *tuner);
void gst_tuner_set_frequency (GstTuner * tuner, void gst_tuner_set_frequency (GstTuner *tuner,
GstTunerChannel * channel, gulong frequency); GstTunerChannel *channel,
gulong gst_tuner_get_frequency (GstTuner * tuner, GstTunerChannel * channel); gulong frequency);
gint gst_tuner_signal_strength (GstTuner * tuner, GstTunerChannel * channel); gulong gst_tuner_get_frequency (GstTuner *tuner,
GstTunerChannel *channel);
gint gst_tuner_signal_strength (GstTuner *tuner,
GstTunerChannel *channel);
/* helper functions */ /* helper functions */
GstTunerNorm *gst_tuner_find_norm_by_name (GstTuner * tuner, gchar * norm); GstTunerNorm * gst_tuner_find_norm_by_name (GstTuner *tuner,
GstTunerChannel *gst_tuner_find_channel_by_name (GstTuner * tuner, gchar *norm);
gchar * channel); GstTunerChannel *gst_tuner_find_channel_by_name (GstTuner *tuner,
gchar *channel);
/* trigger signals */ /* trigger signals */
void gst_tuner_channel_changed (GstTuner * tuner, GstTunerChannel * channel); void gst_tuner_channel_changed (GstTuner *tuner,
void gst_tuner_norm_changed (GstTuner * tuner, GstTunerNorm * norm); GstTunerChannel *channel);
void gst_tuner_frequency_changed (GstTuner * tuner, void gst_tuner_norm_changed (GstTuner *tuner,
GstTunerChannel * channel, gulong frequency); GstTunerNorm *norm);
void gst_tuner_signal_changed (GstTuner * tuner, void gst_tuner_frequency_changed (GstTuner *tuner,
GstTunerChannel * channel, gint signal); GstTunerChannel *channel,
gulong frequency);
void gst_tuner_signal_changed (GstTuner *tuner,
GstTunerChannel *channel,
gint signal);
G_END_DECLS G_END_DECLS
#endif /* __GST_TUNER_H__ */ #endif /* __GST_TUNER_H__ */

View file

@ -25,6 +25,7 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_TUNER_CHANNEL \ #define GST_TYPE_TUNER_CHANNEL \
(gst_tuner_channel_get_type ()) (gst_tuner_channel_get_type ())
#define GST_TUNER_CHANNEL(obj) \ #define GST_TUNER_CHANNEL(obj) \
@ -37,39 +38,42 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER_CHANNEL)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER_CHANNEL))
#define GST_IS_TUNER_CHANNEL_CLASS(klass) \ #define GST_IS_TUNER_CHANNEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER_CHANNEL)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER_CHANNEL))
typedef enum
{ typedef enum {
GST_TUNER_CHANNEL_INPUT = (1 << 0), GST_TUNER_CHANNEL_INPUT = (1<<0),
GST_TUNER_CHANNEL_OUTPUT = (1 << 1), GST_TUNER_CHANNEL_OUTPUT = (1<<1),
GST_TUNER_CHANNEL_FREQUENCY = (1 << 2), GST_TUNER_CHANNEL_FREQUENCY = (1<<2),
GST_TUNER_CHANNEL_AUDIO = (1 << 3), GST_TUNER_CHANNEL_AUDIO = (1<<3),
} GstTunerChannelFlags; } GstTunerChannelFlags;
#define GST_TUNER_CHANNEL_HAS_FLAG(channel, flag) \ #define GST_TUNER_CHANNEL_HAS_FLAG(channel, flag) \
((channel)->flags & flag) ((channel)->flags & flag)
typedef struct _GstTunerChannel typedef struct _GstTunerChannel {
{ GObject parent;
GObject parent;
gchar *label; gchar *label;
GstTunerChannelFlags flags; GstTunerChannelFlags flags;
gulong min_frequency, max_frequency; gulong min_frequency,
gint min_signal, max_signal; max_frequency;
gint min_signal,
max_signal;
} GstTunerChannel; } GstTunerChannel;
typedef struct _GstTunerChannelClass typedef struct _GstTunerChannelClass {
{
GObjectClass parent; GObjectClass parent;
/* signals */ /* signals */
void (*frequency_changed) (GstTunerChannel * channel, gulong frequency); void (*frequency_changed) (GstTunerChannel *channel,
void (*signal_changed) (GstTunerChannel * channel, gint signal); gulong frequency);
void (*signal_changed) (GstTunerChannel *channel,
gint signal);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
} GstTunerChannelClass; } GstTunerChannelClass;
GType gst_tuner_channel_get_type (void); GType gst_tuner_channel_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_TUNER_CHANNEL_H__ */ #endif /* __GST_TUNER_CHANNEL_H__ */

View file

@ -25,6 +25,7 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_TUNER_NORM \ #define GST_TYPE_TUNER_NORM \
(gst_tuner_norm_get_type ()) (gst_tuner_norm_get_type ())
#define GST_TUNER_NORM(obj) \ #define GST_TUNER_NORM(obj) \
@ -35,22 +36,22 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER_NORM)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER_NORM))
#define GST_IS_TUNER_NORM_CLASS(klass) \ #define GST_IS_TUNER_NORM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER_NORM)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER_NORM))
typedef struct _GstTunerNorm
{ typedef struct _GstTunerNorm {
GObject parent; GObject parent;
gchar *label; gchar *label;
gfloat fps; gfloat fps;
} GstTunerNorm; } GstTunerNorm;
typedef struct _GstTunerNormClass typedef struct _GstTunerNormClass {
{
GObjectClass parent; GObjectClass parent;
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
} GstTunerNormClass; } GstTunerNormClass;
GType gst_tuner_norm_get_type (void); GType gst_tuner_norm_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_TUNER_NORM_H__ */ #endif /* __GST_TUNER_NORM_H__ */

View file

@ -98,31 +98,31 @@
#define GST_VIDEO_CAPS_RGBx \ #define GST_VIDEO_CAPS_RGBx \
__GST_VIDEO_CAPS_MAKE_32 (1, 2, 3) __GST_VIDEO_CAPS_MAKE_32 (1, 2, 3)
#define GST_VIDEO_CAPS_xRGB \ #define GST_VIDEO_CAPS_xRGB \
__GST_VIDEO_CAPS_MAKE_32 (2, 3, 4) __GST_VIDEO_CAPS_MAKE_32 (2, 3, 4)
#define GST_VIDEO_CAPS_BGRx \ #define GST_VIDEO_CAPS_BGRx \
__GST_VIDEO_CAPS_MAKE_32 (3, 2, 1) __GST_VIDEO_CAPS_MAKE_32 (3, 2, 1)
#define GST_VIDEO_CAPS_xBGR \ #define GST_VIDEO_CAPS_xBGR \
__GST_VIDEO_CAPS_MAKE_32 (4, 3, 2) __GST_VIDEO_CAPS_MAKE_32 (4, 3, 2)
/* note: the macro name uses the order on BE systems */ /* note: the macro name uses the order on BE systems */
#if G_BYTE_ORDER == G_BIG_ENDIAN #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 GST_VIDEO_CAPS_xRGB
#define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \ #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
GST_VIDEO_CAPS_BGRx GST_VIDEO_CAPS_BGRx
#else #else
#define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \ #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
GST_VIDEO_CAPS_BGRx GST_VIDEO_CAPS_BGRx
#define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \ #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
GST_VIDEO_CAPS_xRGB GST_VIDEO_CAPS_xRGB
#endif #endif
/* 15/16 bit */ /* 15/16 bit */
#define GST_VIDEO_CAPS_RGB_16 \ #define GST_VIDEO_CAPS_RGB_16 \
"video/x-raw-rgb, " \ "video/x-raw-rgb, " \
"bpp = (int) 16, " \ "bpp = (int) 16, " \
@ -155,7 +155,9 @@
"framerate = " GST_VIDEO_FPS_RANGE "framerate = " GST_VIDEO_FPS_RANGE
/* functions */ /* functions */
gdouble gst_video_frame_rate (GstPad * pad); gdouble gst_video_frame_rate (GstPad *pad);
gboolean gst_video_get_size (GstPad * pad, gint * width, gint * height); gboolean gst_video_get_size (GstPad *pad,
gint *width,
gint *height);
#endif /* __GST_VIDEO_H__ */ #endif /* __GST_VIDEO_H__ */

View file

@ -17,17 +17,16 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef __GST_VIDEOSINK_H__ #ifndef __GST_VIDEOSINK_H__
#define __GST_VIDEOSINK_H__ #define __GST_VIDEOSINK_H__
#include <gst/gst.h> #include <gst/gst.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_VIDEOSINK (gst_videosink_get_type()) #define GST_TYPE_VIDEOSINK (gst_videosink_get_type())
#define GST_VIDEOSINK(obj) \ #define GST_VIDEOSINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEOSINK, GstVideoSink)) (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)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VIDEOSINK))
#define GST_VIDEOSINK_GET_CLASS(obj) \ #define GST_VIDEOSINK_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VIDEOSINK, GstVideoSinkClass)) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VIDEOSINK, GstVideoSinkClass))
#define GST_VIDEOSINK_PAD(obj) (GST_VIDEOSINK (obj)->sinkpad) #define GST_VIDEOSINK_PAD(obj) (GST_VIDEOSINK (obj)->sinkpad)
#define GST_VIDEOSINK_WIDTH(obj) (GST_VIDEOSINK (obj)->width) #define GST_VIDEOSINK_WIDTH(obj) (GST_VIDEOSINK (obj)->width)
#define GST_VIDEOSINK_HEIGHT(obj) (GST_VIDEOSINK (obj)->height) #define GST_VIDEOSINK_HEIGHT(obj) (GST_VIDEOSINK (obj)->height)
#define GST_VIDEOSINK_CLOCK(obj) (GST_VIDEOSINK (obj)->clock) #define GST_VIDEOSINK_CLOCK(obj) (GST_VIDEOSINK (obj)->clock)
typedef struct _GstVideoSink GstVideoSink;
typedef struct _GstVideoSinkClass GstVideoSinkClass;
typedef struct _GstVideoSink GstVideoSink; struct _GstVideoSink {
typedef struct _GstVideoSinkClass GstVideoSinkClass; GstElement element;
GstPad *sinkpad;
gint width, height;
GstClock *clock;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstVideoSink struct _GstVideoSinkClass {
{ GstElementClass parent_class;
GstElement element;
gpointer _gst_reserved[GST_PADDING];
};
GstPad *sinkpad; GType gst_videosink_get_type (void);
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 #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_VIDEOSINK_H__ */ #endif /* __GST_VIDEOSINK_H__ */

View file

@ -26,6 +26,7 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_X_OVERLAY \ #define GST_TYPE_X_OVERLAY \
(gst_x_overlay_get_type ()) (gst_x_overlay_get_type ())
#define GST_X_OVERLAY(obj) \ #define GST_X_OVERLAY(obj) \
@ -39,38 +40,42 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_X_OVERLAY)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_X_OVERLAY))
#define GST_X_OVERLAY_GET_CLASS(inst) \ #define GST_X_OVERLAY_GET_CLASS(inst) \
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_X_OVERLAY, GstXOverlayClass)) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_X_OVERLAY, GstXOverlayClass))
typedef struct _GstXOverlay GstXOverlay; typedef struct _GstXOverlay GstXOverlay;
typedef struct _GstXOverlayClass typedef struct _GstXOverlayClass {
{
GTypeInterface klass; GTypeInterface klass;
/* virtual functions */ /* virtual functions */
void (*set_xwindow_id) (GstXOverlay * overlay, gulong xwindow_id); void (* set_xwindow_id) (GstXOverlay *overlay,
gulong xwindow_id);
/* optional virtual functions */ /* optional virtual functions */
void (*get_desired_size) (GstXOverlay * overlay, void (* get_desired_size) (GstXOverlay *overlay,
guint * width, guint * height); guint *width,
void (*expose) (GstXOverlay * overlay); guint *height);
void (* expose) (GstXOverlay *overlay);
/* signals */ /* signals */
void (*have_xwindow_id) (GstXOverlay * overlay, gulong xwindow_id); void (*have_xwindow_id) (GstXOverlay *overlay,
void (*desired_size) (GstXOverlay * overlay, guint width, guint height); gulong xwindow_id);
void (* desired_size) (GstXOverlay *overlay,
guint width,
guint height);
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
} GstXOverlayClass; } GstXOverlayClass;
GType gst_x_overlay_get_type (void); GType gst_x_overlay_get_type (void);
/* virtual class function wrappers */ /* virtual class function wrappers */
void gst_x_overlay_set_xwindow_id (GstXOverlay * overlay, gulong xwindow_id); void gst_x_overlay_set_xwindow_id (GstXOverlay *overlay, gulong xwindow_id);
void gst_x_overlay_get_desired_size (GstXOverlay * overlay, guint * width, void gst_x_overlay_get_desired_size (GstXOverlay *overlay, guint *width, guint *height);
guint * height); void gst_x_overlay_expose (GstXOverlay *overlay);
void gst_x_overlay_expose (GstXOverlay * overlay);
/* public methods to fire signals */ /* public methods to fire signals */
void gst_x_overlay_got_xwindow_id (GstXOverlay * overlay, gulong xwindow_id); void gst_x_overlay_got_xwindow_id (GstXOverlay *overlay, gulong xwindow_id);
void gst_x_overlay_got_desired_size (GstXOverlay * overlay, guint width, void gst_x_overlay_got_desired_size (GstXOverlay *overlay, guint width, guint height);
guint height);
G_END_DECLS G_END_DECLS
#endif /* __GST_X_OVERLAY_H__ */ #endif /* __GST_X_OVERLAY_H__ */

View file

@ -26,6 +26,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_X_WINDOW_LISTENER \ #define GST_TYPE_X_WINDOW_LISTENER \
(gst_x_window_listener_get_type()) (gst_x_window_listener_get_type())
#define GST_X_WINDOW_LISTENER(obj) \ #define GST_X_WINDOW_LISTENER(obj) \
@ -38,22 +39,28 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_X_WINDOW_LISTENER)) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_X_WINDOW_LISTENER))
#define GST_IS_X_WINDOW_LISTENER_CLASS(obj) \ #define GST_IS_X_WINDOW_LISTENER_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_X_WINDOW_LISTENER)) (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 typedef struct _GstXWindowListener GstXWindowListener;
{ typedef struct _GstXWindowListenerClass GstXWindowListenerClass;
gint32 x_offset, y_offset, width, height; 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; gpointer data;
}; };
struct _GstXWindowListener struct _GstXWindowListener {
{ GObject parent;
GObject parent;
/* "per-instance virtual functions" */ /* "per-instance virtual functions" */
MapWindowFunc map_window_func; MapWindowFunc map_window_func;
@ -63,12 +70,12 @@ struct _GstXWindowListener
gpointer private_data; gpointer private_data;
/* general information of what we're doing */ /* general information of what we're doing */
gchar *display_name; gchar *display_name;
XID xwindow_id; XID xwindow_id;
/* one extra... */ /* one extra... */
Display *main_display; Display *main_display;
GMutex *main_lock; GMutex *main_lock;
/* oh my g*d, this is going to be so horribly ugly */ /* oh my g*d, this is going to be so horribly ugly */
GThread *thread; GThread *thread;
@ -77,24 +84,33 @@ struct _GstXWindowListener
/* the overlay window + own thread */ /* the overlay window + own thread */
Display *display; Display *display;
Drawable child; Drawable child;
gboolean ov_conf, ov_map, ov_visible, ov_refresh, ov_move, ov_wmmap; gboolean ov_conf,
gint ov_visibility; ov_map,
guint ov_conf_id, ov_refresh_id; ov_visible,
gint x, y, w, h; ov_refresh,
ov_move,
ov_wmmap;
gint ov_visibility;
guint ov_conf_id,
ov_refresh_id;
gint x, y, w, h;
GstXWindowClip *clips; GstXWindowClip *clips;
gint num_clips; gint num_clips;
}; };
struct _GstXWindowListenerClass struct _GstXWindowListenerClass {
{
GObjectClass parent; GObjectClass parent;
}; };
GType gst_x_window_listener_get_type (void); GType gst_x_window_listener_get_type (void);
GstXWindowListener *gst_x_window_listener_new (gchar * display, GstXWindowListener *
MapWindowFunc map_window_func, gst_x_window_listener_new (gchar *display,
SetWindowFunc set_window_func, gpointer private_data); MapWindowFunc map_window_func,
void gst_x_window_listener_set_xid (GstXWindowListener * xwin, XID id); SetWindowFunc set_window_func,
gpointer private_data);
void gst_x_window_listener_set_xid (GstXWindowListener *xwin,
XID id);
G_END_DECLS G_END_DECLS
#endif /* __X_WINDOW_LISTENER_H__ */ #endif /* __X_WINDOW_LISTENER_H__ */

View file

@ -26,9 +26,8 @@
#include <gst/bytestream/bytestream.h> #include <gst/bytestream/bytestream.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_CDXA_PARSE \ #define GST_TYPE_CDXA_PARSE \
(gst_cdxa_parse_get_type()) (gst_cdxa_parse_get_type())
@ -44,40 +43,38 @@ extern "C"
#define CDXA_SECTOR_SIZE 2352 #define CDXA_SECTOR_SIZE 2352
#define CDXA_DATA_SIZE 2324 #define CDXA_DATA_SIZE 2324
typedef enum typedef enum
{ {
CDXA_PARSE_HEADER, CDXA_PARSE_HEADER,
CDXA_PARSE_DATA, CDXA_PARSE_DATA,
} GstCDXAParseState; } GstCDXAParseState;
typedef struct _GstCDXAParse GstCDXAParse; typedef struct _GstCDXAParse GstCDXAParse;
typedef struct _GstCDXAParseClass GstCDXAParseClass; typedef struct _GstCDXAParseClass GstCDXAParseClass;
struct _GstCDXAParse struct _GstCDXAParse {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
GstByteStream *bs; GstByteStream *bs;
GstCDXAParseState state; GstCDXAParseState state;
guint32 riff_size; guint32 riff_size;
guint32 data_size; guint32 data_size;
guint32 sectors; guint32 sectors;
}; };
struct _GstCDXAParseClass struct _GstCDXAParseClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_cdxa_parse_get_type (void); GType gst_cdxa_parse_get_type (void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_CDXA_PARSE_H__ */ #endif /* __GST_CDXA_PARSE_H__ */

View file

@ -23,6 +23,7 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_COLORSPACE \ #define GST_TYPE_COLORSPACE \
(gst_colorspace_get_type()) (gst_colorspace_get_type())
#define GST_COLORSPACE(obj) \ #define GST_COLORSPACE(obj) \
@ -33,11 +34,11 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_COLORSPACE)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_COLORSPACE))
#define GST_IS_COLORSPACE_CLASS(obj) \ #define GST_IS_COLORSPACE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_COLORSPACE)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_COLORSPACE))
typedef struct _GstColorspace GstColorspace; typedef struct _GstColorspace GstColorspace;
typedef struct _GstColorspaceClass GstColorspaceClass; typedef struct _GstColorspaceClass GstColorspaceClass;
typedef enum typedef enum {
{
GST_COLORSPACE_NONE, GST_COLORSPACE_NONE,
GST_COLORSPACE_HERMES, GST_COLORSPACE_HERMES,
GST_COLORSPACE_YUV_RGB, GST_COLORSPACE_YUV_RGB,
@ -47,11 +48,10 @@ typedef enum
GST_COLORSPACE_420_SWAP, GST_COLORSPACE_420_SWAP,
} GstColorSpaceConverterType; } GstColorSpaceConverterType;
struct _GstColorspace struct _GstColorspace {
{
GstElement element; GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
int converter_index; int converter_index;
@ -60,7 +60,7 @@ struct _GstColorspace
int src_size; int src_size;
int sink_size; int sink_size;
int src_stride; int src_stride;
int sink_stride; int sink_stride;
@ -68,21 +68,18 @@ struct _GstColorspace
gdouble fps; gdouble fps;
}; };
struct _GstColorspaceClass struct _GstColorspaceClass {
{
GstElementClass parent_class; GstElementClass parent_class;
}; };
GType gst_colorspace_get_type (void); GType gst_colorspace_get_type(void);
typedef struct _GstColorspaceFormat typedef struct _GstColorspaceFormat {
{
GstStaticCaps caps; GstStaticCaps caps;
} GstColorspaceFormat; } GstColorspaceFormat;
typedef enum typedef enum {
{
GST_COLORSPACE_I420, GST_COLORSPACE_I420,
GST_COLORSPACE_YV12, GST_COLORSPACE_YV12,
GST_COLORSPACE_RGB32, GST_COLORSPACE_RGB32,
@ -90,13 +87,13 @@ typedef enum
GST_COLORSPACE_RGB16, GST_COLORSPACE_RGB16,
} GstColorSpaceFormatType; } GstColorSpaceFormatType;
typedef struct _GstColorspaceConverter typedef struct _GstColorspaceConverter {
{
GstColorSpaceFormatType from; GstColorSpaceFormatType from;
GstColorSpaceFormatType to; GstColorSpaceFormatType to;
void (*convert) (GstColorspace * colorspace, unsigned char *dest, void (*convert) (GstColorspace *colorspace, unsigned char *dest, unsigned char *src);
unsigned char *src);
} GstColorspaceConverter; } GstColorspaceConverter;
G_END_DECLS G_END_DECLS
#endif #endif

View file

@ -26,11 +26,11 @@
#include <gstcolorspace.h> #include <gstcolorspace.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#if 0 #if 0
typedef struct _GstColorspaceYUVTables GstColorspaceYUVTables; typedef struct _GstColorspaceYUVTables GstColorspaceYUVTables;
struct _GstColorspaceYUVTables struct _GstColorspaceYUVTables {
{
int gammaCorrectFlag; int gammaCorrectFlag;
double gammaCorrect; double gammaCorrect;
int chromaCorrectFlag; int chromaCorrectFlag;
@ -50,11 +50,9 @@ struct _GstColorspaceYUVTables
typedef struct _GstColorspaceConverter GstColorspaceConverter; typedef struct _GstColorspaceConverter GstColorspaceConverter;
typedef void (*GstColorspaceConvertFunction) (GstColorspaceConverter * space, typedef void (*GstColorspaceConvertFunction) (GstColorspaceConverter *space, guchar *src, guchar *dest);
guchar * src, guchar * dest);
struct _GstColorspaceConverter struct _GstColorspaceConverter {
{
guint width; guint width;
guint height; guint height;
guint insize; guint insize;
@ -65,34 +63,35 @@ struct _GstColorspaceConverter
}; };
#endif #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); 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); 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); 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); 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); 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); unsigned char *src, unsigned char *dest);
#if 0 #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); long red_mask, long green_mask, long blue_mask);
#endif #endif
#if 0 #if 0
GstColorspaceConverter *gst_colorspace_yuv2rgb_get_converter (const GstCaps * GstColorspaceConverter* gst_colorspace_yuv2rgb_get_converter (const GstCaps *from, const GstCaps *to);
from, const GstCaps * to);
#define gst_colorspace_convert(converter, src, dest) \ #define gst_colorspace_convert(converter, src, dest) \
(converter)->convert((converter), (src), (dest)) (converter)->convert((converter), (src), (dest))
void gst_colorspace_converter_destroy (GstColorspaceConverter * space); void gst_colorspace_converter_destroy (GstColorspaceConverter *space);
#endif #endif
G_END_DECLS G_END_DECLS
#endif #endif

View file

@ -26,6 +26,7 @@
/* #include <gst/meta/audioraw.h> */ /* #include <gst/meta/audioraw.h> */
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_DEINTERLACE \ #define GST_TYPE_DEINTERLACE \
(gst_deinterlace_get_type()) (gst_deinterlace_get_type())
#define GST_DEINTERLACE(obj) \ #define GST_DEINTERLACE(obj) \
@ -36,11 +37,11 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DEINTERLACE)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DEINTERLACE))
#define GST_IS_DEINTERLACE_CLASS(obj) \ #define GST_IS_DEINTERLACE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DEINTERLACE)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DEINTERLACE))
typedef struct _GstDeInterlace GstDeInterlace; typedef struct _GstDeInterlace GstDeInterlace;
typedef struct _GstDeInterlaceClass GstDeInterlaceClass; typedef struct _GstDeInterlaceClass GstDeInterlaceClass;
struct _GstDeInterlace struct _GstDeInterlace {
{
GstElement element; GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
@ -49,8 +50,8 @@ struct _GstDeInterlace
gboolean show_deinterlaced_area_only; gboolean show_deinterlaced_area_only;
gboolean blend; gboolean blend;
gint threshold_blend; /* here we start blending */ gint threshold_blend; /* here we start blending */
gint threshold; /* here we start interpolating TODO FIXME */ gint threshold; /* here we start interpolating TODO FIXME */
gint edge_detect; gint edge_detect;
gint picsize; gint picsize;
@ -58,10 +59,10 @@ struct _GstDeInterlace
}; };
struct _GstDeInterlaceClass struct _GstDeInterlaceClass {
{
GstElementClass parent_class; GstElementClass parent_class;
}; };
G_END_DECLS G_END_DECLS
#endif /* __GST_DEINTERLACE_H__ */ #endif /* __GST_DEINTERLACE_H__ */

View file

@ -64,24 +64,23 @@
#include <gst/gst.h> #include <gst/gst.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define FESTIVAL_DEFAULT_SERVER_HOST "localhost" #define FESTIVAL_DEFAULT_SERVER_HOST "localhost"
#define FESTIVAL_DEFAULT_SERVER_PORT 1314 #define FESTIVAL_DEFAULT_SERVER_PORT 1314
#define FESTIVAL_DEFAULT_TEXT_MODE "fundamental" #define FESTIVAL_DEFAULT_TEXT_MODE "fundamental"
typedef struct FT_Info typedef struct FT_Info
{ {
int encoding; int encoding;
char *server_host; char *server_host;
int server_port; int server_port;
char *text_mode; char *text_mode;
int server_fd; int server_fd;
} FT_Info; } FT_Info;
#define GST_TYPE_FESTIVAL \ #define GST_TYPE_FESTIVAL \
(gst_festival_get_type()) (gst_festival_get_type())
@ -94,35 +93,32 @@ extern "C"
#define GST_IS_FESTIVAL_CLASS(obj) \ #define GST_IS_FESTIVAL_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FESTIVAL)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FESTIVAL))
typedef enum typedef enum {
{ GST_FESTIVAL_OPEN = GST_ELEMENT_FLAG_LAST,
GST_FESTIVAL_OPEN = GST_ELEMENT_FLAG_LAST,
GST_FESTIVAL_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, GST_FESTIVAL_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
} GstFestivalFlags; } GstFestivalFlags;
typedef struct _GstFestival GstFestival; typedef struct _GstFestival GstFestival;
typedef struct _GstFestivalClass GstFestivalClass; typedef struct _GstFestivalClass GstFestivalClass;
struct _GstFestival struct _GstFestival {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
FT_Info *info; FT_Info *info;
}; };
struct _GstFestivalClass struct _GstFestivalClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_festival_get_type (void); GType gst_festival_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_FESTIVAL_H__ */ #endif /* __GST_FESTIVAL_H__ */

View file

@ -19,8 +19,7 @@
#ifndef _V_IIR_H_ #ifndef _V_IIR_H_
#define _V_IIR_H_ #define _V_IIR_H_
typedef struct typedef struct {
{
int stages; int stages;
double *coeff_A; double *coeff_A;
double *coeff_B; double *coeff_B;
@ -30,9 +29,9 @@ typedef struct
double gain; double gain;
} IIR_state; } IIR_state;
void IIR_init (IIR_state * s, int stages, double gain, double *A, double *B); void IIR_init(IIR_state *s,int stages,double gain, double *A, double *B);
void IIR_clear (IIR_state * s); void IIR_clear(IIR_state *s);
double IIR_filter (IIR_state * s, double in); double IIR_filter(IIR_state *s,double in);
double IIR_filter_ChebBand (IIR_state * s, double in); double IIR_filter_ChebBand(IIR_state *s,double in);
#endif #endif

View file

@ -17,8 +17,7 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
typedef enum typedef enum {
{
FLX_COLORSPACE_RGB8, FLX_COLORSPACE_RGB8,
FLX_COLORSPACE_RGB32, FLX_COLORSPACE_RGB32,
} FlxColorSpaceType; } FlxColorSpaceType;
@ -26,20 +25,19 @@ typedef enum
typedef struct _FlxColorSpaceConverter FlxColorSpaceConverter; typedef struct _FlxColorSpaceConverter FlxColorSpaceConverter;
struct _FlxColorSpaceConverter struct _FlxColorSpaceConverter {
{ guint width;
guint width; guint height;
guint height; guchar palvec[768];
guchar palvec[768];
}; };
void flx_colorspace_converter_destroy (FlxColorSpaceConverter * flxpal); void flx_colorspace_converter_destroy(FlxColorSpaceConverter *flxpal);
void flx_colorspace_convert (FlxColorSpaceConverter * flxpal, guchar * src, void flx_colorspace_convert(FlxColorSpaceConverter *flxpal, guchar *src, guchar *dest);
guchar * dest); FlxColorSpaceConverter * flx_colorspace_converter_new(gint width, gint height);
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);

View file

@ -24,114 +24,113 @@
#include <gst/gst.h> #include <gst/gst.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
#endif /* __cplusplus */
enum Flx_TypeChunk
{ {
#endif /* __cplusplus */ /* frame chunks */
FLX_PREFIX_TYPE = 0xf100,
FLX_SCRIPT_CHUNK = 0xf1e0,
FLX_FRAME_TYPE = 0xf1fa,
FLX_SEGMENT_TABLE = 0xf1fb,
FLX_HUFFMAN_TABLE = 0xf1fc,
enum Flx_TypeChunk /* sub chunks */
{ FLX_CEL_DATA = 3,
/* frame chunks */ FLX_COLOR256 = 4,
FLX_PREFIX_TYPE = 0xf100, FLX_SS2 = 7,
FLX_SCRIPT_CHUNK = 0xf1e0, FLX_COLOR64 = 11,
FLX_FRAME_TYPE = 0xf1fa, FLX_LC = 12,
FLX_SEGMENT_TABLE = 0xf1fb, FLX_BLACK = 13,
FLX_HUFFMAN_TABLE = 0xf1fc, 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,
/* 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
{
enum Flx_MagicHdr FLX_MAGICHDR_FLI = 0xaf11,
{ FLX_MAGICHDR_FLC = 0xaf12,
FLX_MAGICHDR_FLI = 0xaf11, FLX_MAGICHDR_FLX = 0xaf44,
FLX_MAGICHDR_FLC = 0xaf12, FLX_MAGICHDR_HUFFBWT = 0xaf30,
FLX_MAGICHDR_FLX = 0xaf44, };
FLX_MAGICHDR_HUFFBWT = 0xaf30,
};
typedef struct _FlxHeader typedef struct _FlxHeader
{ {
guint32 size; guint32 size;
guint16 type; guint16 type;
guint16 frames; guint16 frames;
guint16 width, height, depth, flags; guint16 width,height,depth,flags;
guint32 speed; guint32 speed;
guint16 reserved1; guint16 reserved1;
/* FLC */ /* FLC */
guint32 created, creator, updated, updater; guint32 created,creator,updated,updater;
guint16 aspect_dx, aspect_dy; guint16 aspect_dx, aspect_dy;
/* EGI */ /* EGI */
guint16 ext_flags, keyframes, totalframes; guint16 ext_flags,keyframes,totalframes;
guint32 req_memory; guint32 req_memory;
guint16 max_regions, transp_num; guint16 max_regions,transp_num;
guchar reserved2[24]; guchar reserved2[24];
/* FLC */ /* FLC */
guint32 oframe1, oframe2; guint32 oframe1,oframe2;
guchar reserved3[40]; guchar reserved3[40];
} FlxHeader; } FlxHeader;
#define FlxHeaderSize 128 #define FlxHeaderSize 128
typedef struct _FlxFrameChunk typedef struct _FlxFrameChunk
{ {
guint32 size; guint32 size;
guint16 id; guint16 id;
} FlxFrameChunk; } FlxFrameChunk;
#define FlxFrameChunkSize 6 #define FlxFrameChunkSize 6
typedef struct _FlxPrefixChunk typedef struct _FlxPrefixChunk
{ {
guint16 chunks; guint16 chunks;
guchar reserved[8]; guchar reserved[8];
} FlxPrefixChunk; } FlxPrefixChunk;
typedef struct _FlxSegmentTable typedef struct _FlxSegmentTable
{ {
guint16 segments; guint16 segments;
} FlxSegmentTable; } FlxSegmentTable;
typedef struct _FlxHuffmanTable typedef struct _FlxHuffmanTable
{ {
guint16 codelength; guint16 codelength;
guint16 numcodes; guint16 numcodes;
guchar reserved[6]; guchar reserved[6];
} FlxHuffmanTable; } FlxHuffmanTable;
typedef struct _FlxFrameType typedef struct _FlxFrameType
{ {
guint16 chunks; guint16 chunks;
guint16 delay; guint16 delay;
guchar reserved[6]; guchar reserved[6];
} FlxFrameType; } FlxFrameType;
#define FlxFrameTypeSize 10 #define FlxFrameTypeSize 10
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_FLX_FMT_H__ */ #endif /* __GST_FLX_FMT_H__ */

View file

@ -27,46 +27,42 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
typedef enum
{
GST_FLXDEC_READ_HEADER,
GST_FLXDEC_PLAYING,
} GstFlxDecState;
typedef enum {
GST_FLXDEC_READ_HEADER,
GST_FLXDEC_PLAYING,
} GstFlxDecState;
/* Definition of structure storing data for this element. */ /* Definition of structure storing data for this element. */
typedef struct _GstFlxDec GstFlxDec; typedef struct _GstFlxDec GstFlxDec;
struct _GstFlxDec struct _GstFlxDec {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
gboolean active, new_meta; gboolean active, new_meta;
GstBuffer *delta, *frame; GstBuffer *delta, *frame;
GstByteStream *bs; GstByteStream *bs;
gulong size; gulong size;
GstFlxDecState state; GstFlxDecState state;
glong frame_time; glong frame_time;
gint64 next_time; gint64 next_time;
FlxColorSpaceConverter *converter; FlxColorSpaceConverter *converter;
FlxHeader hdr; FlxHeader hdr;
}; };
/* Standard definition defining a class for this element. */ /* Standard definition defining a class for this element. */
typedef struct _GstFlxDecClass GstFlxDecClass; typedef struct _GstFlxDecClass GstFlxDecClass;
struct _GstFlxDecClass struct _GstFlxDecClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
/* Standard macros for defining types for this element. */ /* Standard macros for defining types for this element. */
#define GST_TYPE_FLXDEC \ #define GST_TYPE_FLXDEC \
@ -81,12 +77,12 @@ extern "C"
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FLXDEC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FLXDEC))
/* Standard function returning type information. */ /* Standard function returning type information. */
GType gst_flxdec_get_type (void); GType gst_flxdec_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_FLX_DECODER_H__ */ #endif /* __GST_FLX_DECODER_H__ */

View file

@ -22,16 +22,15 @@
#define __GST_MODPLUG_H__ #define __GST_MODPLUG_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/bytestream/bytestream.h> #include <gst/bytestream/bytestream.h>
#define GST_TYPE_MODPLUG \ #define GST_TYPE_MODPLUG \
(gst_modplug_get_type()) (gst_modplug_get_type())
#define GST_MODPLUG(obj) \ #define GST_MODPLUG(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MODPLUG,GstModPlug)) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MODPLUG,GstModPlug))
#define GST_MODPLUG_CLASS(klass) \ #define GST_MODPLUG_CLASS(klass) \
@ -40,59 +39,57 @@ extern "C"
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MODPLUG)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MODPLUG))
#define GST_IS_MODPLUG_CLASS(obj) \ #define GST_IS_MODPLUG_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MODPLUG)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MODPLUG))
struct _GstModPlug {
GstElement element;
GstPad *sinkpad, *srcpad;
guint8 *buffer_in;
GstByteStream *bs;
struct _GstModPlug const gchar *songname;
{ gboolean reverb;
GstElement element; gint reverb_depth;
GstPad *sinkpad, *srcpad; gint reverb_delay;
guint8 *buffer_in; gboolean megabass;
GstByteStream *bs; 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;
const gchar *songname; guchar *audiobuffer;
gboolean reverb; gint32 length;
gint reverb_depth; guint state;
gint reverb_delay; guint bitsPerSample;
gboolean megabass; gboolean need_discont;
gint megabass_amount; gboolean eos;
gint megabass_range; gint64 seek_at;
gboolean surround; guint64 song_size;
gint surround_depth; guint64 timestamp;
gint surround_delay;
gboolean noise_reduction;
gboolean _16bit;
gboolean oversamp;
gint channel;
gint frequency;
guchar *audiobuffer; CSoundFile *mSoundFile;
gint32 length; gboolean opened; /* set to TRUE when mSoundFile is created */
guint state; };
guint bitsPerSample;
gboolean need_discont;
gboolean eos;
gint64 seek_at;
guint64 song_size;
guint64 timestamp;
CSoundFile *mSoundFile; struct _GstModPlugClass {
gboolean opened; /* set to TRUE when mSoundFile is created */ GstElementClass parent_class;
}; };
struct _GstModPlugClass typedef struct _GstModPlug GstModPlug;
{ typedef struct _GstModPlugClass GstModPlugClass;
GstElementClass parent_class;
};
typedef struct _GstModPlug GstModPlug; GstPad *srcpad;
typedef struct _GstModPlugClass GstModPlugClass; int need_sync;
GstPad *srcpad; GType gst_modplug_get_type(void);
int need_sync;
GType gst_modplug_get_type (void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_MODPLUG_H__ */ #endif /* __GST_MODPLUG_H__ */

View file

@ -5,125 +5,125 @@
typedef struct tagITFILEHEADER typedef struct tagITFILEHEADER
{ {
DWORD id; /* 0x4D504D49 */ DWORD id; /* 0x4D504D49 */
CHAR songname[26]; CHAR songname[26];
WORD reserved1; /* 0x1004 */ WORD reserved1; /* 0x1004 */
WORD ordnum; WORD ordnum;
WORD insnum; WORD insnum;
WORD smpnum; WORD smpnum;
WORD patnum; WORD patnum;
WORD cwtv; WORD cwtv;
WORD cmwt; WORD cmwt;
WORD flags; WORD flags;
WORD special; WORD special;
BYTE globalvol; BYTE globalvol;
BYTE mv; BYTE mv;
BYTE speed; BYTE speed;
BYTE tempo; BYTE tempo;
BYTE sep; BYTE sep;
BYTE zero; BYTE zero;
WORD msglength; WORD msglength;
DWORD msgoffset; DWORD msgoffset;
DWORD reserved2; DWORD reserved2;
BYTE chnpan[64]; BYTE chnpan[64];
BYTE chnvol[64]; BYTE chnvol[64];
} ITFILEHEADER; } ITFILEHEADER;
typedef struct tagITENVELOPE typedef struct tagITENVELOPE
{ {
BYTE flags; BYTE flags;
BYTE num; BYTE num;
BYTE lpb; BYTE lpb;
BYTE lpe; BYTE lpe;
BYTE slb; BYTE slb;
BYTE sle; BYTE sle;
BYTE data[25 * 3]; BYTE data[25*3];
BYTE reserved; BYTE reserved;
} ITENVELOPE; } ITENVELOPE;
/* Old Impulse Instrument Format (cmwt < 0x200) */ /* Old Impulse Instrument Format (cmwt < 0x200) */
typedef struct tagITOLDINSTRUMENT typedef struct tagITOLDINSTRUMENT
{ {
DWORD id; /* IMPI = 0x49504D49 */ DWORD id; /* IMPI = 0x49504D49 */
CHAR filename[12]; /* DOS file name */ CHAR filename[12]; /* DOS file name */
BYTE zero; BYTE zero;
BYTE flags; BYTE flags;
BYTE vls; BYTE vls;
BYTE vle; BYTE vle;
BYTE sls; BYTE sls;
BYTE sle; BYTE sle;
WORD reserved1; WORD reserved1;
WORD fadeout; WORD fadeout;
BYTE nna; BYTE nna;
BYTE dnc; BYTE dnc;
WORD trkvers; WORD trkvers;
BYTE nos; BYTE nos;
BYTE reserved2; BYTE reserved2;
CHAR name[26]; CHAR name[26];
WORD reserved3[3]; WORD reserved3[3];
BYTE keyboard[240]; BYTE keyboard[240];
BYTE volenv[200]; BYTE volenv[200];
BYTE nodes[50]; BYTE nodes[50];
} ITOLDINSTRUMENT; } ITOLDINSTRUMENT;
/* Impulse Instrument Format */ /* Impulse Instrument Format */
typedef struct tagITINSTRUMENT typedef struct tagITINSTRUMENT
{ {
DWORD id; DWORD id;
CHAR filename[12]; CHAR filename[12];
BYTE zero; BYTE zero;
BYTE nna; BYTE nna;
BYTE dct; BYTE dct;
BYTE dca; BYTE dca;
WORD fadeout; WORD fadeout;
signed char pps; signed char pps;
BYTE ppc; BYTE ppc;
BYTE gbv; BYTE gbv;
BYTE dfp; BYTE dfp;
BYTE rv; BYTE rv;
BYTE rp; BYTE rp;
WORD trkvers; WORD trkvers;
BYTE nos; BYTE nos;
BYTE reserved1; BYTE reserved1;
CHAR name[26]; CHAR name[26];
BYTE ifc; BYTE ifc;
BYTE ifr; BYTE ifr;
BYTE mch; BYTE mch;
BYTE mpr; BYTE mpr;
WORD mbank; WORD mbank;
BYTE keyboard[240]; BYTE keyboard[240];
ITENVELOPE volenv; ITENVELOPE volenv;
ITENVELOPE panenv; ITENVELOPE panenv;
ITENVELOPE pitchenv; ITENVELOPE pitchenv;
BYTE dummy[4]; /* was 7, but IT v2.17 saves 554 bytes */ BYTE dummy[4]; /* was 7, but IT v2.17 saves 554 bytes */
} ITINSTRUMENT; } ITINSTRUMENT;
/* IT Sample Format */ /* IT Sample Format */
typedef struct ITSAMPLESTRUCT typedef struct ITSAMPLESTRUCT
{ {
DWORD id; /* 0x53504D49 */ DWORD id; /* 0x53504D49 */
CHAR filename[12]; CHAR filename[12];
BYTE zero; BYTE zero;
BYTE gvl; BYTE gvl;
BYTE flags; BYTE flags;
BYTE vol; BYTE vol;
CHAR name[26]; CHAR name[26];
BYTE cvt; BYTE cvt;
BYTE dfp; BYTE dfp;
DWORD length; DWORD length;
DWORD loopbegin; DWORD loopbegin;
DWORD loopend; DWORD loopend;
DWORD C5Speed; DWORD C5Speed;
DWORD susloopbegin; DWORD susloopbegin;
DWORD susloopend; DWORD susloopend;
DWORD samplepointer; DWORD samplepointer;
BYTE vis; BYTE vis;
BYTE vid; BYTE vid;
BYTE vir; BYTE vir;
BYTE vit; BYTE vit;
} ITSAMPLESTRUCT; } ITSAMPLESTRUCT;
#pragma pack() #pragma pack()

View file

@ -8,31 +8,30 @@
#define MODPLUG_H__INCLUDED #define MODPLUG_H__INCLUDED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{
#endif #endif
struct _ModPlugFile; struct _ModPlugFile;
typedef struct _ModPlugFile ModPlugFile; typedef struct _ModPlugFile ModPlugFile;
/* Load a mod file. [data] should point to a block of memory containing the complete /* 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. * file, and [size] should be the size of that block.
* Return the loaded mod file on success, or NULL on failure. */ * 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. */ /* 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 /* Read sample data into the buffer. Returns the number of bytes read. If the end
* of the mod has been reached, zero is returned. */ * 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 /* Get the name of the mod. The returned buffer is stored within the ModPlugFile
* structure and will remain valid until you unload the file. */ * 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 /* Get the length of the mod, in milliseconds. Note that this result is not always
* accurate, especially in the case of mods with loops. */ * 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 /* 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 * 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, * 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 * note that seeking is not very exact in some mods -- especially those for which
* ModPlug_GetLength() does not report the full length. */ * ModPlug_GetLength() does not report the full length. */
void ModPlug_Seek (ModPlugFile * file, int millisecond); void ModPlug_Seek(ModPlugFile* file, int millisecond);
enum _ModPlug_Flags enum _ModPlug_Flags
{ {
MODPLUG_ENABLE_OVERSAMPLING = 1 << 0, /* Enable oversampling (*highly* recommended) */ MODPLUG_ENABLE_OVERSAMPLING = 1 << 0, /* Enable oversampling (*highly* recommended) */
MODPLUG_ENABLE_NOISE_REDUCTION = 1 << 1, /* Enable noise reduction */ MODPLUG_ENABLE_NOISE_REDUCTION = 1 << 1, /* Enable noise reduction */
MODPLUG_ENABLE_REVERB = 1 << 2, /* Enable reverb */ MODPLUG_ENABLE_REVERB = 1 << 2, /* Enable reverb */
MODPLUG_ENABLE_MEGABASS = 1 << 3, /* Enable megabass */ MODPLUG_ENABLE_MEGABASS = 1 << 3, /* Enable megabass */
MODPLUG_ENABLE_SURROUND = 1 << 4 /* Enable surround sound. */ MODPLUG_ENABLE_SURROUND = 1 << 4 /* Enable surround sound. */
}; };
enum _ModPlug_ResamplingMode enum _ModPlug_ResamplingMode
{ {
MODPLUG_RESAMPLE_NEAREST = 0, /* No interpolation (very fast, extremely bad sound quality) */ MODPLUG_RESAMPLE_NEAREST = 0, /* No interpolation (very fast, extremely bad sound quality) */
MODPLUG_RESAMPLE_LINEAR = 1, /* Linear interpolation (fast, good quality) */ MODPLUG_RESAMPLE_LINEAR = 1, /* Linear interpolation (fast, good quality) */
MODPLUG_RESAMPLE_SPLINE = 2, /* Cubic spline interpolation (high quality) */ MODPLUG_RESAMPLE_SPLINE = 2, /* Cubic spline interpolation (high quality) */
MODPLUG_RESAMPLE_FIR = 3 /* 8-tap fir filter (extremely high quality) */ MODPLUG_RESAMPLE_FIR = 3 /* 8-tap fir filter (extremely high quality) */
}; };
typedef struct _ModPlug_Settings typedef struct _ModPlug_Settings
{ {
int mFlags; /* One or more of the MODPLUG_ENABLE_* flags above, bitwise-OR'ed */ 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 /* Note that ModPlug always decodes sound at 44100kHz, 32 bit, stereo and then
* down-mixes to the settings you choose. */ * down-mixes to the settings you choose. */
int mChannels; /* Number of channels - 1 for mono or 2 for stereo */ int mChannels; /* Number of channels - 1 for mono or 2 for stereo */
int mBits; /* Bits per sample - 8, 16, or 32 */ int mBits; /* Bits per sample - 8, 16, or 32 */
int mFrequency; /* Sampling rate - 11025, 22050, or 44100 */ int mFrequency; /* Sampling rate - 11025, 22050, or 44100 */
int mResamplingMode; /* One of MODPLUG_RESAMPLE_*, above */ int mResamplingMode; /* One of MODPLUG_RESAMPLE_*, above */
int mReverbDepth; /* Reverb level 0(quiet)-100(loud) */ int mReverbDepth; /* Reverb level 0(quiet)-100(loud) */
int mReverbDelay; /* Reverb delay in ms, usually 40-200ms */ int mReverbDelay; /* Reverb delay in ms, usually 40-200ms */
int mBassAmount; /* XBass level 0(quiet)-100(loud) */ int mBassAmount; /* XBass level 0(quiet)-100(loud) */
int mBassRange; /* XBass cutoff in Hz 10-100 */ int mBassRange; /* XBass cutoff in Hz 10-100 */
int mSurroundDepth; /* Surround level 0(quiet)-100(heavy) */ int mSurroundDepth; /* Surround level 0(quiet)-100(heavy) */
int mSurroundDelay; /* Surround delay in ms, usually 5-40ms */ int mSurroundDelay; /* Surround delay in ms, usually 5-40ms */
int mLoopCount; /* Number of times to loop. Zero prevents looping. int mLoopCount; /* Number of times to loop. Zero prevents looping.
-1 loops forever. */ -1 loops forever. */
} ModPlug_Settings; } ModPlug_Settings;
/* Get and set the mod decoder settings. All options, except for channels, bits-per-sample, /* 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 * 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. */ * take effect immediately will take effect the next time you load a mod. */
void ModPlug_GetSettings (ModPlug_Settings * settings); void ModPlug_GetSettings(ModPlug_Settings* settings);
void ModPlug_SetSettings (const ModPlug_Settings * settings); void ModPlug_SetSettings(const ModPlug_Settings* settings);
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif #endif
#endif #endif

File diff suppressed because it is too large Load diff

View file

@ -19,10 +19,7 @@
#include <mmsystem.h> #include <mmsystem.h>
#include <stdio.h> #include <stdio.h>
inline void inline void ProcessPlugins(int n) {}
ProcessPlugins (int n)
{
}
#else #else
@ -32,7 +29,7 @@ ProcessPlugins (int n)
typedef signed char CHAR; typedef signed char CHAR;
typedef unsigned char UCHAR; typedef unsigned char UCHAR;
typedef unsigned char *PUCHAR; typedef unsigned char* PUCHAR;
typedef unsigned short USHORT; typedef unsigned short USHORT;
typedef unsigned long ULONG; typedef unsigned long ULONG;
typedef unsigned long UINT; typedef unsigned long UINT;
@ -40,24 +37,23 @@ typedef unsigned long DWORD;
typedef long LONG; typedef long LONG;
typedef unsigned short WORD; typedef unsigned short WORD;
typedef unsigned char BYTE; typedef unsigned char BYTE;
typedef unsigned char *LPBYTE; typedef unsigned char * LPBYTE;
typedef bool BOOL; typedef bool BOOL;
typedef char *LPSTR; typedef char * LPSTR;
typedef void *LPVOID; typedef void * LPVOID;
typedef long *LPLONG; typedef long * LPLONG;
typedef unsigned long *LPDWORD; typedef unsigned long * LPDWORD;
typedef unsigned short *LPWORD; typedef unsigned short * LPWORD;
typedef const char *LPCSTR; typedef const char * LPCSTR;
typedef long long LONGLONG; typedef long long LONGLONG;
typedef void *PVOID; typedef void * PVOID;
typedef void VOID; typedef void VOID;
inline LONG inline LONG MulDiv (long a, long b, long c)
MulDiv (long a, long b, long c)
{ {
/* if (!c) return 0; */ /* 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 #define MODPLUG_NO_FILESAVE
@ -71,20 +67,15 @@ MulDiv (long a, long b, long c)
#define GHND 0 #define GHND 0
inline signed char * inline signed char * GlobalAllocPtr(unsigned int, size_t size)
GlobalAllocPtr (unsigned int, size_t size)
{ {
signed char *p = (signed char *) malloc (size); signed char * p = (signed char *) malloc(size);
if (p != NULL) if (p != NULL) memset(p, 0, size);
memset (p, 0, size);
return p; return p;
} }
inline void inline void ProcessPlugins(int n) {}
ProcessPlugins (int n)
{
}
#define GlobalFreePtr(p) free((void *)(p)) #define GlobalFreePtr(p) free((void *)(p))
@ -102,3 +93,6 @@ ProcessPlugins (int n)
#endif /* MSC_VER */ #endif /* MSC_VER */
#endif #endif

View file

@ -24,9 +24,8 @@
#include <gst/gst.h> #include <gst/gst.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define MPEG1MUX_BUFFER_QUEUED(mb) (g_list_length((mb)->timecode_list)) #define MPEG1MUX_BUFFER_QUEUED(mb) (g_list_length((mb)->timecode_list))
#define MPEG1MUX_BUFFER_SPACE(mb) ((mb)->length) #define MPEG1MUX_BUFFER_SPACE(mb) ((mb)->length)
@ -42,104 +41,101 @@ extern "C"
#define FRAME_TYPE_PFRAME 3 #define FRAME_TYPE_PFRAME 3
#define FRAME_TYPE_AUDIO 4 #define FRAME_TYPE_AUDIO 4
typedef struct _Mpeg1MuxBuffer Mpeg1MuxBuffer; typedef struct _Mpeg1MuxBuffer Mpeg1MuxBuffer;
typedef struct _Mpeg1MuxTimecode Mpeg1MuxTimecode; typedef struct _Mpeg1MuxTimecode Mpeg1MuxTimecode;
typedef struct video_struc /* Informationen ueber Video Stream */ typedef struct video_struc /* Informationen ueber Video Stream */
{ {
unsigned int stream_length; unsigned int stream_length ;
unsigned int num_sequence; unsigned int num_sequence ;
unsigned int num_seq_end; unsigned int num_seq_end ;
unsigned int num_pictures; unsigned int num_pictures ;
unsigned int num_groups; unsigned int num_groups ;
unsigned int num_frames[4]; unsigned int num_frames[4] ;
unsigned int avg_frames[4]; unsigned int avg_frames[4] ;
unsigned int horizontal_size; unsigned int horizontal_size;
unsigned int vertical_size; unsigned int vertical_size ;
unsigned int aspect_ratio; unsigned int aspect_ratio ;
unsigned int picture_rate; unsigned int picture_rate ;
unsigned int bit_rate; unsigned int bit_rate ;
unsigned int comp_bit_rate; unsigned int comp_bit_rate ;
unsigned int vbv_buffer_size; unsigned int vbv_buffer_size;
unsigned int CSPF; unsigned int CSPF ;
guint64 PTS; guint64 PTS;
guint64 DTS; guint64 DTS;
guint64 current_PTS; guint64 current_PTS;
guint64 current_DTS; guint64 current_DTS;
guchar current_type; guchar current_type;
double secs_per_frame; double secs_per_frame;
gulong group_order, decoding_order; gulong group_order, decoding_order;
} Video_struc; } Video_struc;
typedef struct audio_struc /* Informationen ueber Audio Stream */ typedef struct audio_struc /* Informationen ueber Audio Stream */
{ {
unsigned int stream_length; unsigned int stream_length ;
unsigned int num_syncword; unsigned int num_syncword ;
unsigned int num_frames[2]; unsigned int num_frames [2] ;
unsigned int framesize; unsigned int framesize ;
unsigned int layer; unsigned int layer ;
unsigned int protection; unsigned int protection ;
unsigned int bit_rate; unsigned int bit_rate ;
unsigned int frequency; unsigned int frequency ;
unsigned int mode; unsigned int mode ;
unsigned int mode_extension; unsigned int mode_extension ;
unsigned int copyright; unsigned int copyright ;
unsigned int original_copy; unsigned int original_copy ;
unsigned int emphasis; unsigned int emphasis ;
guint64 PTS; guint64 PTS;
guint64 current_PTS; guint64 current_PTS;
double samples_per_second; double samples_per_second;
gulong decoding_order; gulong decoding_order;
} Audio_struc; } Audio_struc;
struct _Mpeg1MuxTimecode struct _Mpeg1MuxTimecode {
{ gulong length;
gulong length; gulong original_length;
gulong original_length; guchar frame_type;
guchar frame_type; guint64 PTS;
guint64 PTS; guint64 DTS;
guint64 DTS; };
};
struct _Mpeg1MuxBuffer struct _Mpeg1MuxBuffer {
{ unsigned char *buffer;
unsigned char *buffer; gulong length;
gulong length; gulong base;
gulong base; gulong scan_pos;
gulong scan_pos; gulong last_pos;
gulong last_pos; gulong current_start;
gulong current_start; guchar buffer_type;
guchar buffer_type; guchar stream_id;
guchar stream_id; gboolean new_frame;
gboolean new_frame; guint64 next_frame_time;
guint64 next_frame_time;
union union {
{ Video_struc video;
Video_struc video; Audio_struc audio;
Audio_struc audio; } info;
} info;
GList *timecode_list; GList *timecode_list;
GList *queued_list; GList *queued_list;
}; };
Mpeg1MuxBuffer *mpeg1mux_buffer_new (guchar type, guchar id); Mpeg1MuxBuffer *mpeg1mux_buffer_new(guchar type, guchar id);
void mpeg1mux_buffer_queue (Mpeg1MuxBuffer * mb, GstBuffer * buf); void mpeg1mux_buffer_queue(Mpeg1MuxBuffer *mb, GstBuffer *buf);
void mpeg1mux_buffer_shrink (Mpeg1MuxBuffer * mb, gulong size); void mpeg1mux_buffer_shrink(Mpeg1MuxBuffer *mb, gulong size);
gulong mpeg1mux_buffer_update_queued (Mpeg1MuxBuffer * mb, guint64 scr); gulong mpeg1mux_buffer_update_queued(Mpeg1MuxBuffer *mb, guint64 scr);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __BUFFER_H__ */ #endif /* __BUFFER_H__ */

View file

@ -29,9 +29,8 @@
#include "main.h" #include "main.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_SYSTEM_ENCODE \ #define GST_TYPE_SYSTEM_ENCODE \
@ -45,68 +44,66 @@ extern "C"
#define GST_IS_SYSTEM_ENCODE_CLASS(obj) \ #define GST_IS_SYSTEM_ENCODE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SYSTEM_ENCODE)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SYSTEM_ENCODE))
typedef struct _GstMPEG1SystemEncode GstMPEG1SystemEncode; typedef struct _GstMPEG1SystemEncode GstMPEG1SystemEncode;
typedef struct _GstMPEG1SystemEncodeClass GstMPEG1SystemEncodeClass; typedef struct _GstMPEG1SystemEncodeClass GstMPEG1SystemEncodeClass;
struct _GstMPEG1SystemEncode struct _GstMPEG1SystemEncode {
{ GstElement element;
GstElement element;
GstPad *srcpad; GstPad *srcpad;
gboolean have_setup; gboolean have_setup;
GMutex *lock; GMutex *lock;
guint num_audio_pads; guint num_audio_pads;
guint num_video_pads; guint num_video_pads;
Mpeg1MuxBuffer *audio_buffer; Mpeg1MuxBuffer *audio_buffer;
Mpeg1MuxBuffer *video_buffer; Mpeg1MuxBuffer *video_buffer;
Pack_struc *pack; Pack_struc *pack;
Sys_header_struc *sys_header; Sys_header_struc *sys_header;
Sector_struc *sector; Sector_struc *sector;
guint data_rate, video_rate, audio_rate; guint data_rate, video_rate, audio_rate;
gdouble delay, audio_delay, video_delay; gdouble delay, audio_delay, video_delay;
gdouble clock_cycles; gdouble clock_cycles;
gulong sectors_delay, video_delay_ms, audio_delay_ms; gulong sectors_delay, video_delay_ms, audio_delay_ms;
gulong startup_delay; gulong startup_delay;
gulong audio_buffer_size; gulong audio_buffer_size;
gulong video_buffer_size; gulong video_buffer_size;
gulong mux_rate, dmux_rate; gulong mux_rate, dmux_rate;
guint64 SCR; guint64 SCR;
gint which_streams; gint which_streams;
gint current_pack; gint current_pack;
gulong min_packet_data; gulong min_packet_data;
gulong max_packet_data; gulong max_packet_data;
gint packets_per_pack; gint packets_per_pack;
gulong packet_size; gulong packet_size;
gulong bytes_output; gulong bytes_output;
GList *mta; GList *mta;
/* stream input pads */ /* stream input pads */
GstPad *private_1_pad[8]; /* up to 8 ac3 audio tracks <grumble> */ GstPad *private_1_pad[8]; /* up to 8 ac3 audio tracks <grumble> */
GstPad *private_2_pad; GstPad *private_2_pad;
GstPad *video_pad[16]; GstPad *video_pad[16];
GstPad *audio_pad[32]; GstPad *audio_pad[32];
}; };
struct _GstMPEG1SystemEncodeClass struct _GstMPEG1SystemEncodeClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_mpeg1_system_encode_get_type (void); GType gst_mpeg1_system_encode_get_type(void);
/* multplex.c */ /* multplex.c */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __SYSTEM_ENCODE_H__ */ #endif /* __SYSTEM_ENCODE_H__ */

View file

@ -45,82 +45,79 @@
#define ISO11172_END 0x000001b9 #define ISO11172_END 0x000001b9
#define PACKET_START 0x000001 #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 */ #define AFTER_PACKET_LENGTH 15 /* No of non-data-bytes */
/* following the packet */ /* following the packet */
/* length field */ /* length field */
#define LAST_SCR_BYTE_IN_PACK 9 /* No of bytes in pack */ #define LAST_SCR_BYTE_IN_PACK 9 /* No of bytes in pack */
/* preceding, and */ /* preceding, and */
/* including, the SCR */ /* including, the SCR */
/* The following values for sys_header_length & size are only valid for */ /* The following values for sys_header_length & size are only valid for */
/* System streams consisting of two basic streams. When wrapping around */ /* System streams consisting of two basic streams. When wrapping around */
/* the system layer on a single video or a single audio stream, those */ /* the system layer on a single video or a single audio stream, those */
/* values get decreased by 3. */ /* values get decreased by 3. */
#define SYS_HEADER_LENGTH 12 /* length of Sys Header */ #define SYS_HEADER_LENGTH 12 /* length of Sys Header */
/* after start code and */ /* after start code and */
/* length field */ /* length field */
#define SYS_HEADER_SIZE 18 /* incl. start code and */ #define SYS_HEADER_SIZE 18 /* incl. start code and */
/* length field */ /* length field */
#define PACK_HEADER_SIZE 12 #define PACK_HEADER_SIZE 12
#define PACKET_HEADER_SIZE 6 #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_VIDEO 1
#define STREAMS_AUDIO 2 #define STREAMS_AUDIO 2
#define STREAMS_BOTH 3 #define STREAMS_BOTH 3
#define AUDIO_STREAMS 0xb8 /* Marker Audio Streams */ #define AUDIO_STREAMS 0xb8 /* Marker Audio Streams */
#define VIDEO_STREAMS 0xb9 /* Marker Video Streams */ #define VIDEO_STREAMS 0xb9 /* Marker Video Streams */
#define AUDIO_STR_0 0xc0 /* Marker Audio Stream0 */ #define AUDIO_STR_0 0xc0 /* Marker Audio Stream0 */
#define VIDEO_STR_0 0xe0 /* Marker Video Stream0 */ #define VIDEO_STR_0 0xe0 /* Marker Video Stream0 */
#define PADDING_STR 0xbe /* Marker Padding Stream */ #define PADDING_STR 0xbe /* Marker Padding Stream*/
#define ZERO_STUFFING_BYTE 0 #define ZERO_STUFFING_BYTE 0
#define STUFFING_BYTE 0xff #define STUFFING_BYTE 0xff
#define RESERVED_BYTE 0xff #define RESERVED_BYTE 0xff
#define TIMESTAMPS_NO 0 /* Flag NO timestamps */ #define TIMESTAMPS_NO 0 /* Flag NO timestamps */
#define TIMESTAMPS_PTS 1 /* Flag PTS timestamp */ #define TIMESTAMPS_PTS 1 /* Flag PTS timestamp */
#define TIMESTAMPS_PTS_DTS 2 /* Flag BOTH timestamps */ #define TIMESTAMPS_PTS_DTS 2 /* Flag BOTH timestamps */
#define MARKER_SCR 2 /* Marker SCR */ #define MARKER_SCR 2 /* Marker SCR */
#define MARKER_JUST_PTS 2 /* Marker only PTS */ #define MARKER_JUST_PTS 2 /* Marker only PTS */
#define MARKER_PTS 3 /* Marker PTS */ #define MARKER_PTS 3 /* Marker PTS */
#define MARKER_DTS 1 /* Marker DTS */ #define MARKER_DTS 1 /* Marker DTS */
#define MARKER_NO_TIMESTAMPS 0x0f /* Marker NO timestamps */ #define MARKER_NO_TIMESTAMPS 0x0f /* Marker NO timestamps */
#define STATUS_AUDIO_END 0 /* Statusmessage A end */ #define STATUS_AUDIO_END 0 /* Statusmessage A end */
#define STATUS_VIDEO_END 1 /* Statusmessage V end */ #define STATUS_VIDEO_END 1 /* Statusmessage V end */
#define STATUS_AUDIO_TIME_OUT 2 /* Statusmessage A out */ #define STATUS_AUDIO_TIME_OUT 2 /* Statusmessage A out */
#define STATUS_VIDEO_TIME_OUT 3 /* Statusmessage V out */ #define STATUS_VIDEO_TIME_OUT 3 /* Statusmessage V out */
/************************************************************************* /*************************************************************************
Typ- und Strukturdefinitionen Typ- und Strukturdefinitionen
*************************************************************************/ *************************************************************************/
typedef struct sector_struc /* A sector, can contain pack, sys header */ typedef struct sector_struc /* A sector, can contain pack, sys header */
/* and packet. */ /* and packet. */
{ { unsigned char buf [MAX_SECTOR_SIZE] ;
unsigned char buf[MAX_SECTOR_SIZE]; unsigned int length_of_sector ;
unsigned int length_of_sector; unsigned int length_of_packet_data ;
unsigned int length_of_packet_data; guint64 TS ;
guint64 TS;
} Sector_struc; } Sector_struc;
typedef struct pack_struc /* Pack Info */ typedef struct pack_struc /* Pack Info */
{ { unsigned char buf [PACK_HEADER_SIZE];
unsigned char buf[PACK_HEADER_SIZE]; guint64 SCR;
guint64 SCR;
} Pack_struc; } Pack_struc;
typedef struct sys_header_struc /* System Header Info */ typedef struct sys_header_struc /* System Header Info */
{ { unsigned char buf [SYS_HEADER_SIZE];
unsigned char buf[SYS_HEADER_SIZE];
} Sys_header_struc; } Sys_header_struc;
/************************************************************************* /*************************************************************************
@ -128,20 +125,16 @@ typedef struct sys_header_struc /* System Header Info */
*************************************************************************/ *************************************************************************/
/* systems.c */ /* systems.c */
void create_sector (Sector_struc * sector, Pack_struc * pack, void create_sector (Sector_struc *sector, Pack_struc *pack, Sys_header_struc *sys_header,
Sys_header_struc * sys_header, unsigned int packet_size, unsigned int packet_size, unsigned char *inputbuffer, unsigned char type, unsigned char buffer_scale,
unsigned char *inputbuffer, unsigned char type, unsigned char buffer_scale, unsigned int buffer_size, unsigned char buffers, guint64 PTS, guint64 DTS,
unsigned int buffer_size, unsigned char buffers, guint64 PTS, guint64 DTS, unsigned char timestamps, unsigned int which_streams);
unsigned char timestamps, unsigned int which_streams);
void create_pack (Pack_struc * pack, guint64 SCR, unsigned int mux_rate); 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, void create_sys_header (Sys_header_struc *sys_header, unsigned int rate_bound, unsigned char audio_bound,
unsigned char audio_bound, unsigned char fixed, unsigned char CSPS, unsigned char fixed, unsigned char CSPS, unsigned char audio_lock, unsigned char video_lock,
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 video_bound, unsigned char stream1, unsigned char stream2, unsigned char buffer2_scale, unsigned int buffer2_size, unsigned int which_streams);
unsigned char buffer1_scale, unsigned int buffer1_size,
unsigned char stream2, unsigned char buffer2_scale,
unsigned int buffer2_size, unsigned int which_streams);
#endif #endif

View file

@ -26,9 +26,8 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_MP1VIDEOPARSE \ #define GST_TYPE_MP1VIDEOPARSE \
@ -42,37 +41,35 @@ extern "C"
#define GST_IS_MP1VIDEOPARSE_CLASS(obj) \ #define GST_IS_MP1VIDEOPARSE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MP1VIDEOPARSE)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MP1VIDEOPARSE))
typedef struct _Mp1VideoParse Mp1VideoParse; typedef struct _Mp1VideoParse Mp1VideoParse;
typedef struct _Mp1VideoParseClass Mp1VideoParseClass; typedef struct _Mp1VideoParseClass Mp1VideoParseClass;
struct _Mp1VideoParse struct _Mp1VideoParse {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
GstBuffer *partialbuf; /* previous buffer (if carryover) */ GstBuffer *partialbuf; /* previous buffer (if carryover) */
gulong next_buffer_offset; gulong next_buffer_offset;
gboolean need_resync; gboolean need_resync;
gboolean in_flush; gboolean in_flush;
guint64 last_pts; guint64 last_pts;
gint picture_in_buffer; gint picture_in_buffer;
gint width, height; gint width, height;
gfloat fps, asr; gfloat fps, asr;
}; };
struct _Mp1VideoParseClass struct _Mp1VideoParseClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_mp1videoparse_get_type (void); GType gst_mp1videoparse_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __MP1VIDEOPARSE_H__ */ #endif /* __MP1VIDEOPARSE_H__ */

View file

@ -26,9 +26,8 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_MPEG2SUBT \ #define GST_TYPE_MPEG2SUBT \
@ -42,43 +41,41 @@ extern "C"
#define GST_IS_MPEG2SUBT_CLASS(obj) \ #define GST_IS_MPEG2SUBT_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MPEG2SUBT)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MPEG2SUBT))
typedef struct _GstMpeg2Subt GstMpeg2Subt; typedef struct _GstMpeg2Subt GstMpeg2Subt;
typedef struct _GstMpeg2SubtClass GstMpeg2SubtClass; typedef struct _GstMpeg2SubtClass GstMpeg2SubtClass;
struct _GstMpeg2Subt struct _GstMpeg2Subt {
{ GstElement element;
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 packet_size;
guint16 data_size; guint16 data_size;
gint offset[2]; gint offset[2];
guchar color[5]; guchar color[5];
guchar trans[4]; guchar trans[4];
guint duration; guint duration;
gint width, height; gint width, height;
}; };
struct _GstMpeg2SubtClass struct _GstMpeg2SubtClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_mpeg2subt_get_type (void); GType gst_mpeg2subt_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_MPEG2SUBT_H__ */ #endif /* __GST_MPEG2SUBT_H__ */

View file

@ -26,9 +26,8 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_MP3PARSE \ #define GST_TYPE_MP3PARSE \
@ -42,33 +41,31 @@ extern "C"
#define GST_IS_MP3PARSE_CLASS(obj) \ #define GST_IS_MP3PARSE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MP3PARSE)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MP3PARSE))
typedef struct _GstMPEGAudioParse GstMPEGAudioParse; typedef struct _GstMPEGAudioParse GstMPEGAudioParse;
typedef struct _GstMPEGAudioParseClass GstMPEGAudioParseClass; typedef struct _GstMPEGAudioParseClass GstMPEGAudioParseClass;
struct _GstMPEGAudioParse struct _GstMPEGAudioParse {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
GstBuffer *partialbuf; /* previous buffer (if carryover) */ GstBuffer *partialbuf; /* previous buffer (if carryover) */
guint skip; /* number of frames to skip */ guint skip; /* number of frames to skip */
guint bit_rate; guint bit_rate;
gint channels, rate, layer; gint channels, rate, layer;
gboolean in_flush; gboolean in_flush;
}; };
struct _GstMPEGAudioParseClass struct _GstMPEGAudioParseClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_mp3parse_get_type (void); GType gst_mp3parse_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __MP3PARSE_H__ */ #endif /* __MP3PARSE_H__ */

View file

@ -37,32 +37,30 @@
typedef struct _GstOverlay GstOverlay; typedef struct _GstOverlay GstOverlay;
typedef struct _GstOverlayClass GstOverlayClass; typedef struct _GstOverlayClass GstOverlayClass;
struct _GstOverlay struct _GstOverlay {
{ GstElement element;
GstElement element;
GstPad *srcpad; GstPad *srcpad;
GstPad *sinkpad1; GstPad *sinkpad1;
GstPad *sinkpad2; GstPad *sinkpad2;
GstPad *sinkpad3; GstPad *sinkpad3;
gint format; gint format;
gint width; gint width;
gint height; gint height;
gint duration; gint duration;
gint position; gint position;
gint type; gint type;
gint fps; gint fps;
gint border; gint border;
gint depth; gint depth;
gdouble framerate; gdouble framerate;
}; };
struct _GstOverlayClass struct _GstOverlayClass {
{
GstElementClass parent_class; GstElementClass parent_class;
}; };

View file

@ -25,6 +25,7 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_PASSTHROUGH \ #define GST_TYPE_PASSTHROUGH \
(gst_passthrough_get_type()) (gst_passthrough_get_type())
#define GST_PASSTHROUGH(obj) \ #define GST_PASSTHROUGH(obj) \
@ -35,18 +36,17 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PASSTHROUGH)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PASSTHROUGH))
#define GST_IS_PASSTHROUGH_CLASS(obj) \ #define GST_IS_PASSTHROUGH_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PASSTHROUGH)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PASSTHROUGH))
typedef struct _GstPassthrough GstPassthrough; typedef struct _GstPassthrough GstPassthrough;
typedef struct _GstPassthroughClass GstPassthroughClass; typedef struct _GstPassthroughClass GstPassthroughClass;
typedef enum _GstPassthroughFormat GstPassthroughFormat; typedef enum _GstPassthroughFormat GstPassthroughFormat;
enum _GstPassthroughFormat enum _GstPassthroughFormat {
{
GST_PASSTHROUGH_FORMAT_INT, GST_PASSTHROUGH_FORMAT_INT,
GST_PASSTHROUGH_FORMAT_FLOAT GST_PASSTHROUGH_FORMAT_FLOAT
}; };
struct _GstPassthrough struct _GstPassthrough {
{
GstElement element; GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
@ -66,12 +66,12 @@ struct _GstPassthrough
gboolean is_signed; gboolean is_signed;
}; };
struct _GstPassthroughClass struct _GstPassthroughClass {
{
GstElementClass parent_class; GstElementClass parent_class;
}; };
GType gst_passthrough_get_type (void); GType gst_passthrough_get_type(void);
G_END_DECLS G_END_DECLS
#endif /* __GST_PASSTHROUGH_H__ */ #endif /* __GST_PASSTHROUGH_H__ */

View file

@ -29,6 +29,7 @@
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_PLAYONDEMAND \ #define GST_TYPE_PLAYONDEMAND \
(gst_play_on_demand_get_type()) (gst_play_on_demand_get_type())
#define GST_PLAYONDEMAND(obj) \ #define GST_PLAYONDEMAND(obj) \
@ -39,59 +40,58 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYONDEMAND)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYONDEMAND))
#define GST_IS_PLAYONDEMAND_CLASS(obj) \ #define GST_IS_PLAYONDEMAND_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYONDEMAND)) (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_INT,
GST_PLAYONDEMAND_FORMAT_FLOAT GST_PLAYONDEMAND_FORMAT_FLOAT
}; };
struct _GstPlayOnDemand struct _GstPlayOnDemand {
{
GstElement element; GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
GstClock *clock; GstClock *clock;
/* filter properties */ /* filter properties */
gboolean mute; gboolean mute;
gfloat buffer_time; gfloat buffer_time;
guint max_plays; guint max_plays;
gfloat tick_rate; gfloat tick_rate;
guint total_ticks; guint total_ticks;
guint32 *ticks; guint32 *ticks;
/* internal buffer info */ /* internal buffer info */
gchar *buffer; gchar *buffer;
guint buffer_bytes; guint buffer_bytes;
gboolean eos; gboolean eos;
/* play pointers == internal buffer offsets for producing output sound */ /* play pointers == internal buffer offsets for producing output sound */
guint *plays; guint *plays;
guint write; guint write;
/* audio format info (used to calculate buffer_samples) */ /* audio format info (used to calculate buffer_samples) */
GstPlayOnDemandFormat format; GstPlayOnDemandFormat format;
guint rate; guint rate;
guint channels; guint channels;
guint width; guint width;
}; };
struct _GstPlayOnDemandClass struct _GstPlayOnDemandClass {
{
GstElementClass parent_class; GstElementClass parent_class;
void (*play) (GstElement * elem); void (*play) (GstElement *elem);
void (*clear) (GstElement * elem); void (*clear) (GstElement *elem);
void (*reset) (GstElement * elem); void (*reset) (GstElement *elem);
void (*played) (GstElement * elem); void (*played) (GstElement *elem);
void (*stopped) (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 G_END_DECLS
#endif /* __GST_PLAYONDEMAND_H__ */ #endif /* __GST_PLAYONDEMAND_H__ */

View file

@ -26,9 +26,8 @@
#include <gst/getbits/getbits.h> #include <gst/getbits/getbits.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_QTDEMUX \ #define GST_TYPE_QTDEMUX \
@ -44,45 +43,43 @@ extern "C"
#define GST_QTDEMUX_MAX_STREAMS 8 #define GST_QTDEMUX_MAX_STREAMS 8
typedef struct _GstQTDemux GstQTDemux; typedef struct _GstQTDemux GstQTDemux;
typedef struct _GstQTDemuxClass GstQTDemuxClass; typedef struct _GstQTDemuxClass GstQTDemuxClass;
typedef struct _QtDemuxStream QtDemuxStream; typedef struct _QtDemuxStream QtDemuxStream;
struct _GstQTDemux struct _GstQTDemux {
{ GstElement element;
GstElement element;
/* pads */ /* pads */
GstPad *sinkpad; GstPad *sinkpad;
QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS]; QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS];
int n_streams; int n_streams;
int n_video_streams; int n_video_streams;
int n_audio_streams; int n_audio_streams;
GstByteStream *bs; GstByteStream *bs;
GNode *moov_node; GNode *moov_node;
GNode *moov_node_compressed; GNode *moov_node_compressed;
guint32 timescale; guint32 timescale;
guint32 duration; guint32 duration;
int state; int state;
int offset; int offset;
/* track stuff */ /* track stuff */
}; };
struct _GstQTDemuxClass struct _GstQTDemuxClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_QTDEMUX_H__ */ #endif /* __GST_QTDEMUX_H__ */

View file

@ -23,32 +23,30 @@
#include <inttypes.h> #include <inttypes.h>
typedef uint8_t __u8; typedef uint8_t __u8;
typedef uint32_t __u32; typedef uint32_t __u32;
typedef int8_t __s8; typedef int8_t __s8;
typedef uint16_t __u16; typedef uint16_t __u16;
extern void RTjpeg_init_Q (__u8 Q); extern void RTjpeg_init_Q(__u8 Q);
extern void RTjpeg_init_compress (long unsigned int *buf, int width, int height, extern void RTjpeg_init_compress(long unsigned int *buf, int width, int height, __u8 Q);
__u8 Q); extern void RTjpeg_init_decompress(long unsigned int *buf, int width, int height);
extern void RTjpeg_init_decompress (long unsigned int *buf, int width, extern int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp);
int height); extern int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp);
extern int RTjpeg_compressYUV420 (__s8 * sp, unsigned char *bp); extern void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp);
extern int RTjpeg_compressYUV422 (__s8 * sp, unsigned char *bp); extern void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp);
extern void RTjpeg_decompressYUV420 (__s8 * sp, __u8 * bp); extern int RTjpeg_compress8(__s8 *sp, unsigned char *bp);
extern void RTjpeg_decompressYUV422 (__s8 * sp, __u8 * bp); extern void RTjpeg_decompress8(__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 void RTjpeg_init_mcompress(void);
extern int RTjpeg_mcompress (__s8 * sp, unsigned char *bp, __u16 lmask, extern int RTjpeg_mcompress(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask);
__u16 cmask); extern int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask);
extern int RTjpeg_mcompress8 (__s8 * sp, unsigned char *bp, __u16 lmask); extern void RTjpeg_set_test(int i);
extern void RTjpeg_set_test (int i);
extern void RTjpeg_yuv420rgb (__u8 * buf, __u8 * rgb); extern void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb);
extern void RTjpeg_yuv422rgb (__u8 * buf, __u8 * rgb); extern void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb);
extern void RTjpeg_yuvrgb8 (__u8 * buf, __u8 * rgb); extern void RTjpeg_yuvrgb8(__u8 *buf, __u8 *rgb);
extern void RTjpeg_yuvrgb16 (__u8 * buf, __u8 * rgb); extern void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb);
extern void RTjpeg_yuvrgb24 (__u8 * buf, __u8 * rgb); extern void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb);
extern void RTjpeg_yuvrgb32 (__u8 * buf, __u8 * rgb); extern void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb);

View file

@ -26,9 +26,8 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_RTJPEGDEC \ #define GST_TYPE_RTJPEGDEC \
@ -42,32 +41,30 @@ extern "C"
#define GST_IS_RTJPEGDEC_CLASS(obj) \ #define GST_IS_RTJPEGDEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTJPEGDEC))) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTJPEGDEC)))
typedef struct _GstRTJpegDec GstRTJpegDec; typedef struct _GstRTJpegDec GstRTJpegDec;
typedef struct _GstRTJpegDecClass GstRTJpegDecClass; typedef struct _GstRTJpegDecClass GstRTJpegDecClass;
struct _GstRTJpegDec struct _GstRTJpegDec {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
gint width, height; gint width,height;
gint quality; gint quality;
gint quant[128]; gint quant[128];
}; };
struct _GstRTJpegDecClass struct _GstRTJpegDecClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_rtjpegdec_get_type (void); GType gst_rtjpegdec_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __RTJPEGDEC_H__ */ #endif /* __RTJPEGDEC_H__ */

View file

@ -28,9 +28,8 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_RTJPEGENC \ #define GST_TYPE_RTJPEGENC \
@ -44,31 +43,29 @@ extern "C"
#define GST_IS_RTJPEGENC_CLASS(obj) \ #define GST_IS_RTJPEGENC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTJPEGENC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTJPEGENC))
typedef struct _GstRTJpegEnc GstRTJpegEnc; typedef struct _GstRTJpegEnc GstRTJpegEnc;
typedef struct _GstRTJpegEncClass GstRTJpegEncClass; typedef struct _GstRTJpegEncClass GstRTJpegEncClass;
struct _GstRTJpegEnc struct _GstRTJpegEnc {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
gint width, height; gint width,height;
gint quality; gint quality;
gint quant[128]; gint quant[128];
}; };
struct _GstRTJpegEncClass struct _GstRTJpegEncClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_rtjpegenc_get_type (void); GType gst_rtjpegenc_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __RTJPEGENC_H__ */ #endif /* __RTJPEGENC_H__ */

View file

@ -25,9 +25,8 @@
#include <gst/gst.h> #include <gst/gst.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_SMOOTH \ #define GST_TYPE_SMOOTH \
@ -41,36 +40,34 @@ extern "C"
#define GST_IS_SMOOTH_CLASS(obj) \ #define GST_IS_SMOOTH_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMOOTH)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMOOTH))
typedef struct _GstSmooth GstSmooth; typedef struct _GstSmooth GstSmooth;
typedef struct _GstSmoothClass GstSmoothClass; typedef struct _GstSmoothClass GstSmoothClass;
struct _GstSmooth struct _GstSmooth {
{ GstElement element;
GstElement element;
int format; int format;
int width; int width;
int height; int height;
gboolean active; gboolean active;
int tolerance; int tolerance;
int filtersize; int filtersize;
gboolean lum_only; gboolean lum_only;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
}; };
struct _GstSmoothClass struct _GstSmoothClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_smooth_get_type (void); GType gst_smooth_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_SMOOTH_H__ */ #endif /* __GST_SMOOTH_H__ */

View file

@ -26,9 +26,8 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{ #endif /* __cplusplus */
#endif /* __cplusplus */
#define GST_TYPE_SMOOTHWAVE \ #define GST_TYPE_SMOOTHWAVE \
@ -42,33 +41,31 @@ extern "C"
#define GST_IS_SMOOTHWAVE_CLASS(obj) \ #define GST_IS_SMOOTHWAVE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMOOTHWAVE)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMOOTHWAVE))
typedef struct _GstSmoothWave GstSmoothWave; typedef struct _GstSmoothWave GstSmoothWave;
typedef struct _GstSmoothWaveClass GstSmoothWaveClass; typedef struct _GstSmoothWaveClass GstSmoothWaveClass;
struct _GstSmoothWave struct _GstSmoothWave {
{ GstElement element;
GstElement element;
GstPad *sinkpad, *srcpad; GstPad *sinkpad,*srcpad;
gint width, height; gint width,height;
GdkRgbCmap *cmap; GdkRgbCmap *cmap;
GtkWidget *image; GtkWidget *image;
guchar *imagebuffer; guchar *imagebuffer;
}; };
struct _GstSmoothWaveClass struct _GstSmoothWaveClass {
{ GstElementClass parent_class;
GstElementClass parent_class; };
};
GType gst_smoothwave_get_type (void); GType gst_smoothwave_get_type(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GST_SMOOTHWAVE_H__ */ #endif /* __GST_SMOOTHWAVE_H__ */

View file

@ -27,39 +27,37 @@
typedef struct _GstMask GstMask; typedef struct _GstMask GstMask;
typedef struct _GstMaskDefinition GstMaskDefinition; typedef struct _GstMaskDefinition GstMaskDefinition;
typedef void (*GstMaskDrawFunc) (GstMask * mask); typedef void (*GstMaskDrawFunc) (GstMask *mask);
typedef void (*GstMaskDestroyFunc) (GstMask * mask); typedef void (*GstMaskDestroyFunc) (GstMask *mask);
struct _GstMaskDefinition struct _GstMaskDefinition {
{ gint type;
gint type; gchar *short_name;
gchar *short_name; gchar *long_name;
gchar *long_name; GstMaskDrawFunc draw_func;
GstMaskDrawFunc draw_func; GstMaskDestroyFunc destroy_func;
GstMaskDestroyFunc destroy_func; gpointer user_data;
gpointer user_data;
}; };
struct _GstMask struct _GstMask {
{ gint type;
gint type; guint32 *data;
guint32 *data; gpointer user_data;
gpointer user_data;
gint width; gint width;
gint height; gint height;
gint bpp; gint bpp;
GstMaskDestroyFunc destroy_func; GstMaskDestroyFunc destroy_func;
}; };
void _gst_mask_init (void); void _gst_mask_init (void);
void _gst_mask_register (GstMaskDefinition * definition); 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); const GList* gst_mask_get_definitions (void);
GstMask *gst_mask_factory_new (gint type, gint bpp, gint width, gint height); GstMask* gst_mask_factory_new (gint type, gint bpp, gint width, gint height);
void gst_mask_destroy (GstMask * mask); void gst_mask_destroy (GstMask *mask);
#endif /* __GST_MASK_H__ */ #endif /* __GST_MASK_H__ */

View file

@ -38,28 +38,28 @@
typedef struct _GstSMPTE GstSMPTE; typedef struct _GstSMPTE GstSMPTE;
typedef struct _GstSMPTEClass GstSMPTEClass; typedef struct _GstSMPTEClass GstSMPTEClass;
struct _GstSMPTE struct _GstSMPTE {
{ GstElement element;
GstElement element;
gint format; gint format;
gint width; gint width;
gint height; gint height;
gdouble fps; gdouble fps;
gint duration; gint duration;
gint position; gint position;
GstPad *srcpad, *sinkpad1, *sinkpad2; GstPad *srcpad,
*sinkpad1,
*sinkpad2;
gint type; gint type;
gint border; gint border;
gint depth; gint depth;
GstMask *mask; GstMask *mask;
}; };
struct _GstSMPTEClass struct _GstSMPTEClass {
{
GstElementClass parent_class; GstElementClass parent_class;
}; };

Some files were not shown because too many files have changed in this diff Show more