Commit ad6ed7da authored by Andy Wingo Wingo's avatar Andy Wingo Wingo

Initial revision

Original commit message from CVS:
Initial revision
parent e5d9d6e2
Makefile
Makefile.in
*.o
*.lo
*.la
.deps
.libs
filterdir = $(libdir)/gst
filter_LTLIBRARIES = libchart.la
libchart_la_SOURCES = gstchart.c
libchart_la_CFLAGS = $(GST_CFLAGS)
This diff is collapsed.
Makefile
Makefile.in
*.o
*.lo
*.la
.deps
.libs
filterdir = $(libdir)/gst
filter_LTLIBRARIES = libgstdeinterlace.la
libgstdeinterlace_la_SOURCES = gstdeinterlace.c
libgstdeinterlace_la_CFLAGS = $(GST_CFLAGS)
noinst_HEADERS = gstdeinterlace.h
This diff is collapsed.
/* Gnome-Streamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_DEINTERLACE_H__
#define __GST_DEINTERLACE_H__
#include <config.h>
#include <gst/gst.h>
// #include <gst/meta/audioraw.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GST_TYPE_DEINTERLACE \
(gst_deinterlace_get_type())
#define GST_DEINTERLACE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DEINTERLACE,GstDeInterlace))
#define GST_DEINTERLACE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ULAW,GstDeInterlace))
#define GST_IS_DEINTERLACE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DEINTERLACE))
#define GST_IS_DEINTERLACE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DEINTERLACE))
typedef struct _GstDeInterlace GstDeInterlace;
typedef struct _GstDeInterlaceClass GstDeInterlaceClass;
struct _GstDeInterlace {
GstElement element;
GstPad *sinkpad, *srcpad;
gint width, height;
gboolean show_deinterlaced_area_only;
gboolean blend;
gint threshold_blend; // here we start blending
gint threshold; // here we start interpolating TODO FIXME
gint edge_detect;
gint picsize;
guchar *src;
};
struct _GstDeInterlaceClass {
GstElementClass parent_class;
};
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GST_STEREO_H__ */
filterdir = $(libdir)/gst
filter_LTLIBRARIES = libgstflxdec.la
libgstflxdec_la_SOURCES = gstflxdec.c flx_color.c
libgstflxdec_la_CFLAGS = $(GST_CFLAGS)
noinst_HEADERS = flx_fmt.h flx_color.h gstflxdec.h
/* Gnome-Streamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <string.h>
#include <gst/gst.h>
#include "flx_color.h"
FlxColorSpaceConverter *
flx_colorspace_converter_new(gint width, gint height)
{
FlxColorSpaceConverter *new = g_malloc(sizeof(FlxColorSpaceConverter));
new->width = width;
new->height = height;
memset(new->palvec, 0, sizeof(new->palvec));
return new;
}
void
flx_colorspace_converter_destroy(FlxColorSpaceConverter *flxpal)
{
g_return_if_fail(flxpal != NULL);
g_free(flxpal);
}
void
flx_colorspace_convert(FlxColorSpaceConverter *flxpal, guchar *src, guchar *dest)
{
guint size, col;
g_return_if_fail(flxpal != NULL);
g_return_if_fail(src != dest);
size = flxpal->width * flxpal->height;
while(size--) {
col = (*src++ * 3);
*dest++ = flxpal->palvec[col+2];
*dest++ = flxpal->palvec[col+1];
*dest++ = flxpal->palvec[col];
*dest++ = 0;
}
}
void
flx_set_palette_vector(FlxColorSpaceConverter *flxpal, guint start, guint num, guchar *newpal)
{
guint grab;
g_return_if_fail(flxpal != NULL);
g_return_if_fail(start < 0x100);
grab = ((start + num) > 0x100 ? 0x100 - start : num);
memcpy(&flxpal->palvec[start * 3], newpal, grab*3);
}
void
flx_set_color(FlxColorSpaceConverter *flxpal, guint colr, guint red, guint green, guint blue)
{
g_return_if_fail(flxpal != NULL);
g_return_if_fail(colr < 0x100);
flxpal->palvec[(colr * 3)] = red;
flxpal->palvec[(colr * 3) + 1] = green;
flxpal->palvec[(colr * 3) + 2] = blue;
}
/* Gnome-Streamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
typedef enum {
FLX_COLORSPACE_RGB8,
FLX_COLORSPACE_RGB32,
} FlxColorSpaceType;
typedef struct _FlxColorSpaceConverter FlxColorSpaceConverter;
struct _FlxColorSpaceConverter {
guint width;
guint height;
guchar palvec[768];
};
void flx_colorspace_converter_destroy(FlxColorSpaceConverter *flxpal);
void flx_colorspace_convert(FlxColorSpaceConverter *flxpal, guchar *src, guchar *dest);
FlxColorSpaceConverter * flx_colorspace_converter_new(gint width, gint height);
void flx_set_palette_vector(FlxColorSpaceConverter *flxpal, guint start, guint num,
guchar *newpal);
void flx_set_color(FlxColorSpaceConverter *flxpal, guint colr, guint red, guint green,
guint blue);
/* Gnome-Streamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_FLX_FMT__H__
#define __GST_FLX_FMT_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
enum Flx_TypeChunk
{
/* frame chunks */
FLX_PREFIX_TYPE = 0xf100,
FLX_SCRIPT_CHUNK = 0xf1e0,
FLX_FRAME_TYPE = 0xf1fa,
FLX_SEGMENT_TABLE = 0xf1fb,
FLX_HUFFMAN_TABLE = 0xf1fc,
/* sub chunks */
FLX_CEL_DATA = 3,
FLX_COLOR256 = 4,
FLX_SS2 = 7,
FLX_COLOR64 = 11,
FLX_LC = 12,
FLX_BLACK = 13,
FLX_BRUN = 15,
FLX_COPY = 16,
FLX_MINI = 18,
FLX_DTA_RUN = 25,
FLX_DTA_COPY = 26,
FLX_DTA_LC = 27,
FLX_LABEL = 31,
FLX_BMP_MASK = 32,
FLX_MLEV_MASK = 33,
FLX_SEGMENT = 34,
FLX_KEY_IMAGE = 35,
FLX_KEY_PAL = 36,
FLX_REGION = 37,
FLX_WAVE = 38,
FLX_USERSTRING = 39,
FLX_RGN_MASK = 40,
};
enum Flx_MagicHdr
{
FLX_MAGICHDR_FLI = 0xaf11,
FLX_MAGICHDR_FLC = 0xaf12,
FLX_MAGICHDR_FLX = 0xaf44,
FLX_MAGICHDR_HUFFBWT = 0xaf30,
};
typedef struct _FlxHeader
{
guint32 size;
guint16 type;
guint16 frames;
guint16 width,height,depth,flags;
guint32 speed;
guint16 reserved1;
/* FLC */
guint32 created,creator,updated,updater;
guint16 aspect_dx, aspect_dy;
/* EGI */
guint16 ext_flags,keyframes,totalframes;
guint32 req_memory;
guint16 max_regions,transp_num;
guchar reserved2[24];
/* FLC */
guint32 oframe1,oframe2;
guchar reserved3[40];
} FlxHeader;
#define FlxHeaderSize 128
typedef struct _FlxFrameChunk
{
guint32 size;
guint16 id;
} FlxFrameChunk;
#define FlxFrameChunkSize 6
typedef struct _FlxPrefixChunk
{
guint16 chunks;
guchar reserved[8];
} FlxPrefixChunk;
typedef struct _FlxSegmentTable
{
guint16 segments;
} FlxSegmentTable;
typedef struct _FlxHuffmanTable
{
guint16 codelength;
guint16 numcodes;
guchar reserved[6];
} FlxHuffmanTable;
typedef struct _FlxFrameType
{
guint16 chunks;
guint16 delay;
guchar reserved[6];
} FlxFrameType;
#define FlxFrameTypeSize 10
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GST_FLX_FMT_H__ */
This diff is collapsed.
/* Gnome-Streamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_FLX_DECODER_H__
#define __GST_FLX_DECODER_H__
#include <gst/gst.h>
#include "flx_color.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Definition of structure storing data for this element. */
typedef struct _GstFlxDec GstFlxDec;
struct _GstFlxDec {
GstElement element;
GstPad *sinkpad,*srcpad;
gboolean active, new_meta, new_buf;
GstBuffer *buf, *out, *delta, *frame;
gulong offset, size;
FlxColorSpaceConverter *converter;
FlxHeader hdr;
};
/* Standard definition defining a class for this element. */
typedef struct _GstFlxDecClass GstFlxDecClass;
struct _GstFlxDecClass {
GstElementClass parent_class;
};
/* Standard macros for defining types for this element. */
#define GST_TYPE_FLXDEC \
(gst_flxdec_get_type())
#define GST_FLXDEC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FLXDEC,GstFlxDec))
#define GST_FLXDEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FLXDEC,GstFlxDec))
#define GST_IS_FLXDEC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FLXDEC))
#define GST_IS_FLXDEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FLXDEC))
#define FLXDEC_BUFSIZE(buf, offset) \
((GST_BUFFER_OFFSET(buf) + GST_BUFFER_SIZE(buf)) - offset)
/* Standard function returning type information. */
GType gst_flxdec_get_type(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GST_FLX_DECODER_H__ */
Makefile
Makefile.in
*.o
*.lo
*.la
.deps
.libs
filterdir = $(libdir)/gst
filter_LTLIBRARIES = libgstmpeg1systemencode.la
libgstmpeg1systemencode_la_SOURCES = gstmpeg1systemencode.c \
buffer.c \
systems.c
noinst_HEADERS = gstmpeg1systemencode.h \
main.h \
buffer.h
libsystem_encode_la_CFLAGS = -O2 $(FOMIT_FRAME_POINTER) -funroll-all-loops -finline-functions -ffast-math $(GST_CFLAGS)
This diff is collapsed.
/* Gnome-Streamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __BUFFER_H__
#define __BUFFER_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define MPEG1MUX_BUFFER_QUEUED(mb) (g_list_length((mb)->timecode_list))
#define MPEG1MUX_BUFFER_SPACE(mb) ((mb)->length)
#define MPEG1MUX_BUFFER_DATA(mb) ((mb)->buffer)
#define MPEG1MUX_BUFFER_TYPE(mb) ((mb)->buffer)
#define MPEG1MUX_BUFFER_FIRST_TIMECODE(mb) (g_list_first((mb)->timecode_list)->data)
#define BUFFER_TYPE_VIDEO 1
#define BUFFER_TYPE_AUDIO 2
#define FRAME_TYPE_IFRAME 1
#define FRAME_TYPE_BFRAME 2
#define FRAME_TYPE_PFRAME 3
#define FRAME_TYPE_AUDIO 4
typedef struct _Mpeg1MuxBuffer Mpeg1MuxBuffer;
typedef struct _Mpeg1MuxTimecode Mpeg1MuxTimecode;
typedef struct video_struc /* Informationen ueber Video Stream */
{
unsigned int stream_length ;
unsigned int num_sequence ;
unsigned int num_seq_end ;
unsigned int num_pictures ;
unsigned int num_groups ;
unsigned int num_frames[4] ;
unsigned int avg_frames[4] ;
unsigned int horizontal_size;
unsigned int vertical_size ;
unsigned int aspect_ratio ;
unsigned int picture_rate ;
unsigned int bit_rate ;
unsigned int comp_bit_rate ;
unsigned int vbv_buffer_size;
unsigned int CSPF ;
guint64 PTS;
guint64 DTS;
guint64 current_PTS;
guint64 current_DTS;
guchar current_type;
double secs_per_frame;
gulong group_order, decoding_order;
} Video_struc;
typedef struct audio_struc /* Informationen ueber Audio Stream */
{
unsigned int stream_length ;
unsigned int num_syncword ;
unsigned int num_frames [2] ;
unsigned int framesize ;
unsigned int layer ;
unsigned int protection ;
unsigned int bit_rate ;
unsigned int frequency ;
unsigned int mode ;
unsigned int mode_extension ;
unsigned int copyright ;
unsigned int original_copy ;
unsigned int emphasis ;
guint64 PTS;
guint64 current_PTS;
double samples_per_second;
gulong decoding_order;
} Audio_struc;
struct _Mpeg1MuxTimecode {
gulong length;
gulong original_length;
guchar frame_type;
guint64 PTS;
guint64 DTS;
};
struct _Mpeg1MuxBuffer {
unsigned char *buffer;
gulong length;
gulong base;
gulong scan_pos;
gulong last_pos;
gulong current_start;
guchar buffer_type;
guchar stream_id;
gboolean new_frame;
guint64 next_frame_time;
union {
Video_struc video;
Audio_struc audio;
} info;
GList *timecode_list;
GList *queued_list;
};
Mpeg1MuxBuffer *mpeg1mux_buffer_new(guchar type, guchar id);
void mpeg1mux_buffer_queue(Mpeg1MuxBuffer *mb, GstBuffer *buf);
void mpeg1mux_buffer_shrink(Mpeg1MuxBuffer *mb, gulong size);
gulong mpeg1mux_buffer_update_queued(Mpeg1MuxBuffer *mb, guint64 scr);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __BUFFER_H__ */
This diff is collapsed.
/* Gnome-Streamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __SYSTEM_ENCODE_H__
#define __SYSTEM_ENCODE_H__
#include <config.h>
#include <gst/gst.h>
#include <libs/getbits/gstgetbits.h>
#include "buffer.h"
#include "main.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GST_TYPE_SYSTEM_ENCODE \
(gst_mpeg1_system_encode_get_type())