+2005-12-06 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
+ (gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_pixfmt),
+ (gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
+ * ext/ffmpeg/gstffmpegcodecmap.h:
+ * ext/ffmpeg/gstffmpegdeinterlace.c:
+ (gst_ffmpegdeinterlace_pad_link), (gst_ffmpegdeinterlace_init),
+ (gst_ffmpegdeinterlace_chain):
+ * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_class_init),
+ (gst_ffmpegenc_chain_audio):
+ * ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_loop):
+ * ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_write):
+ * ext/ffmpeg/gstffmpegscale.c: (gst_ffmpegscale_pad_link),
+ (gst_ffmpegscale_init), (gst_ffmpegscale_chain),
+ (gst_ffmpegscale_change_state):
+ * ext/libpostproc/gstpostproc.c: (change_context), (change_mode),
+ (gst_postproc_base_init), (gst_postproc_class_init),
+ (gst_postproc_init), (gst_postproc_link), (gst_postproc_chain),
+ (gst_postproc_change_state), (gst_postproc_set_property),
+ (gst_postproc_get_property), (gst_postproc_register):
+ expand tabs
+
=== release 0.10.0 ===
2005-12-05 <thomas (at) apestaart (dot) org>
* but I'm too lazy today. Maybe later.
*/
-#define GST_FF_VID_CAPS_NEW(mimetype, ...) \
- (context != NULL) ? \
- gst_caps_new_simple (mimetype, \
- "width", G_TYPE_INT, context->width, \
- "height", G_TYPE_INT, context->height, \
- "framerate", GST_TYPE_FRACTION, context->time_base.den, \
- context->time_base.num, __VA_ARGS__, NULL) \
- : \
- gst_caps_new_simple (mimetype, \
- "width", GST_TYPE_INT_RANGE, 16, 4096, \
- "height", GST_TYPE_INT_RANGE, 16, 4096, \
- "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, \
+#define GST_FF_VID_CAPS_NEW(mimetype, ...) \
+ (context != NULL) ? \
+ gst_caps_new_simple (mimetype, \
+ "width", G_TYPE_INT, context->width, \
+ "height", G_TYPE_INT, context->height, \
+ "framerate", GST_TYPE_FRACTION, context->time_base.den, \
+ context->time_base.num, __VA_ARGS__, NULL) \
+ : \
+ gst_caps_new_simple (mimetype, \
+ "width", GST_TYPE_INT_RANGE, 16, 4096, \
+ "height", GST_TYPE_INT_RANGE, 16, 4096, \
+ "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, \
G_MAXINT, 1, __VA_ARGS__, NULL)
/* same for audio - now with channels/sample rate
*/
-#define GST_FF_AUD_CAPS_NEW(mimetype, ...) \
- (context != NULL) ? \
- gst_caps_new_simple (mimetype, \
- "rate", G_TYPE_INT, context->sample_rate, \
- "channels", G_TYPE_INT, context->channels, \
- __VA_ARGS__, NULL) \
- : \
- gst_caps_new_simple (mimetype, \
- "rate", GST_TYPE_INT_RANGE, 8000, 96000, \
- "channels", GST_TYPE_INT_RANGE, 1, 2, \
- __VA_ARGS__, NULL)
+#define GST_FF_AUD_CAPS_NEW(mimetype, ...) \
+ (context != NULL) ? \
+ gst_caps_new_simple (mimetype, \
+ "rate", G_TYPE_INT, context->sample_rate, \
+ "channels", G_TYPE_INT, context->channels, \
+ __VA_ARGS__, NULL) \
+ : \
+ gst_caps_new_simple (mimetype, \
+ "rate", GST_TYPE_INT_RANGE, 8000, 96000, \
+ "channels", GST_TYPE_INT_RANGE, 1, 2, \
+ __VA_ARGS__, NULL)
/* Convert a FFMPEG codec ID and optional AVCodecContext
* to a GstCaps. If the context is ommitted, no fixed values
switch (context->codec_tag) {
case GST_MAKE_FOURCC ('D', 'I', 'V', 'X'):
caps = GST_FF_VID_CAPS_NEW ("video/x-divx",
- "divxversion", G_TYPE_INT, 5, NULL);
+ "divxversion", G_TYPE_INT, 5, NULL);
break;
case GST_MAKE_FOURCC ('m', 'p', '4', 'v'):
default:
case CODEC_ID_MSRLE:
caps = GST_FF_VID_CAPS_NEW ("video/x-rle",
- "layout", G_TYPE_STRING, "microsoft", NULL);
+ "layout", G_TYPE_STRING, "microsoft", NULL);
if (context) {
gst_caps_set_simple (caps,
- "depth", G_TYPE_INT, (gint) context->bits_per_sample, NULL);
+ "depth", G_TYPE_INT, (gint) context->bits_per_sample, NULL);
} else {
gst_caps_set_simple (caps, "depth", GST_TYPE_INT_RANGE, 1, 64, NULL);
}
case CODEC_ID_MSVIDEO1:
caps = GST_FF_VID_CAPS_NEW ("video/x-msvideocodec",
- "msvideoversion", G_TYPE_INT, 1, NULL);
+ "msvideoversion", G_TYPE_INT, 1, NULL);
break;
case CODEC_ID_WMV3:
case PIX_FMT_GRAY8:
bpp = depth = 8;
caps = GST_FF_VID_CAPS_NEW ("video/x-raw-gray",
- "bpp", G_TYPE_INT, bpp,
- "depth", G_TYPE_INT, depth, NULL);
+ "bpp", G_TYPE_INT, bpp,
+ "depth", G_TYPE_INT, depth, NULL);
break;
default:
/* give up ... */
if (caps == NULL) {
if (bpp != 0) {
if (r_mask != 0) {
- caps = GST_FF_VID_CAPS_NEW ("video/x-raw-rgb",
- "bpp", G_TYPE_INT, bpp,
- "depth", G_TYPE_INT, depth,
- "red_mask", G_TYPE_INT, r_mask,
- "green_mask", G_TYPE_INT, g_mask,
- "blue_mask", G_TYPE_INT, b_mask,
- "endianness", G_TYPE_INT, endianness, NULL);
- if (a_mask) {
- gst_caps_set_simple (caps, "alpha_mask", G_TYPE_INT, a_mask, NULL);
- }
+ caps = GST_FF_VID_CAPS_NEW ("video/x-raw-rgb",
+ "bpp", G_TYPE_INT, bpp,
+ "depth", G_TYPE_INT, depth,
+ "red_mask", G_TYPE_INT, r_mask,
+ "green_mask", G_TYPE_INT, g_mask,
+ "blue_mask", G_TYPE_INT, b_mask,
+ "endianness", G_TYPE_INT, endianness, NULL);
+ if (a_mask) {
+ gst_caps_set_simple (caps, "alpha_mask", G_TYPE_INT, a_mask, NULL);
+ }
} else {
- caps = GST_FF_VID_CAPS_NEW ("video/x-raw-rgb",
- "bpp", G_TYPE_INT, bpp,
- "depth", G_TYPE_INT, depth,
- "endianness", G_TYPE_INT, endianness, NULL);
- if (context) {
- gst_ffmpeg_set_palette (caps, context);
- }
+ caps = GST_FF_VID_CAPS_NEW ("video/x-raw-rgb",
+ "bpp", G_TYPE_INT, bpp,
+ "depth", G_TYPE_INT, depth,
+ "endianness", G_TYPE_INT, endianness, NULL);
+ if (context) {
+ gst_ffmpeg_set_palette (caps, context);
+ }
}
} else if (fmt) {
caps = GST_FF_VID_CAPS_NEW ("video/x-raw-yuv",
- "format", GST_TYPE_FOURCC, fmt, NULL);
+ "format", GST_TYPE_FOURCC, fmt, NULL);
}
}
context->time_base.num = gst_value_get_fraction_denominator (fps);
GST_DEBUG ("setting framerate %d/%d = %lf",
- context->time_base.den, context->time_base.num,
- 1. * context->time_base.den / context->time_base.num);
+ context->time_base.den, context->time_base.num,
+ 1. * context->time_base.den / context->time_base.num);
}
if (!raw)
if (!context->extradata) {
gint halfpel_flag, thirdpel_flag, low_delay, unknown_svq3_flag;
guint16 flags;
-
+
if (gst_structure_get_int (str, "halfpel_flag", &halfpel_flag) ||
gst_structure_get_int (str, "thirdpel_flag", &thirdpel_flag) ||
gst_structure_get_int (str, "low_delay", &low_delay) ||
if ((codec = avcodec_find_decoder_by_name (ext)) ||
(codec = avcodec_find_encoder_by_name (ext))) {
id = codec->id;
- audio = TRUE;
+ audio = TRUE;
}
}
} else if (!strncmp (mimetype, "video/x-gst_ff-", 15)) {
GstCaps *
gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
AVCodecContext *context,
- gboolean encode);
+ gboolean encode);
/*
* _codectype_to_caps () gets the GstCaps that belongs to
void
gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
- enum CodecType codec_type,
- const GstCaps *caps,
- AVCodecContext *context);
+ enum CodecType codec_type,
+ const GstCaps *caps,
+ AVCodecContext *context);
/*
* caps_with_codectype () transforms a GstCaps that belongs to
gboolean
gst_ffmpeg_formatid_get_codecids (const gchar *format_name,
- enum CodecID ** video_codec_list,
- enum CodecID ** audio_codec_list);
+ enum CodecID ** video_codec_list,
+ enum CodecID ** audio_codec_list);
/*
* Since FFMpeg has such really cool and useful descriptions
int
gst_ffmpeg_avpicture_fill (AVPicture * picture,
- uint8_t * ptr,
- enum PixelFormat pix_fmt,
- int width,
- int height);
+ uint8_t * ptr,
+ enum PixelFormat pix_fmt,
+ int width,
+ int height);
/*
* convert an image, we only use this for copying the image, ie,
*/
int
gst_ffmpeg_img_convert (AVPicture * dst, int dst_pix_fmt,
- const AVPicture * src, int src_pix_fmt,
- int src_width, int src_height);
+ const AVPicture * src, int src_pix_fmt,
+ int src_width, int src_height);
/*
* Convert from/to a GStreamer <-> FFMpeg timestamp.
deinterlace->width = width;
deinterlace->height = height;
deinterlace->to_size = avpicture_get_size (deinterlace->pixfmt,
- deinterlace->width, deinterlace->height);
+ deinterlace->width, deinterlace->height);
return GST_PAD_LINK_OK;
}
gst_ffmpegdeinterlace_init (GstFFMpegDeinterlace * deinterlace)
{
deinterlace->sinkpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_ffmpegdeinterlace_sink_template),
- "sink");
+ (&gst_ffmpegdeinterlace_sink_template),
+ "sink");
gst_pad_set_link_function (deinterlace->sinkpad, gst_ffmpegdeinterlace_pad_link);
gst_pad_set_getcaps_function (deinterlace->sinkpad, gst_ffmpegdeinterlace_getcaps);
gst_pad_set_chain_function (deinterlace->sinkpad, gst_ffmpegdeinterlace_chain);
gst_element_add_pad (GST_ELEMENT (deinterlace), deinterlace->sinkpad);
deinterlace->srcpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_ffmpegdeinterlace_src_template),
- "src");
+ (&gst_ffmpegdeinterlace_src_template),
+ "src");
gst_element_add_pad (GST_ELEMENT (deinterlace), deinterlace->srcpad);
gst_pad_set_link_function (deinterlace->srcpad, gst_ffmpegdeinterlace_pad_link);
gst_pad_set_getcaps_function (deinterlace->srcpad, gst_ffmpegdeinterlace_getcaps);
}
outbuf = gst_pad_alloc_buffer_and_set_caps (deinterlace->srcpad,
- GST_BUFFER_OFFSET_NONE, deinterlace->to_size);
+ GST_BUFFER_OFFSET_NONE, deinterlace->to_size);
gst_ffmpeg_avpicture_fill (&deinterlace->from_frame,
- GST_BUFFER_DATA (inbuf),
- deinterlace->pixfmt,
- deinterlace->width, deinterlace->height);
+ GST_BUFFER_DATA (inbuf),
+ deinterlace->pixfmt,
+ deinterlace->width, deinterlace->height);
gst_ffmpeg_avpicture_fill (&deinterlace->to_frame,
- GST_BUFFER_DATA (outbuf),
- deinterlace->pixfmt,
- deinterlace->width, deinterlace->height);
+ GST_BUFFER_DATA (outbuf),
+ deinterlace->pixfmt,
+ deinterlace->width, deinterlace->height);
avpicture_deinterlace (&deinterlace->to_frame, &deinterlace->from_frame,
- deinterlace->pixfmt, deinterlace->width, deinterlace->height);
+ deinterlace->pixfmt, deinterlace->width, deinterlace->height);
gst_buffer_stamp (outbuf, (const GstBuffer *) inbuf);
"Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass),
ARG_RTP_PAYLOAD_SIZE,
- g_param_spec_ulong ("rtp_payload_size", "RTP Payload Size",
+ g_param_spec_ulong ("rtp_payload_size", "RTP Payload Size",
"Target GOB length", 0, G_MAXULONG, 0, G_PARAM_READWRITE));
} else if (klass->in_plugin->type == CODEC_TYPE_AUDIO) {
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BIT_RATE,
/* this is panic! we got a buffer, but still don't have enough
* data. Merge them and retry in the next cycle... */
ffmpegenc->cache = gst_buffer_span (ffmpegenc->cache, 0, inbuf,
- GST_BUFFER_SIZE (ffmpegenc->cache) + GST_BUFFER_SIZE (inbuf));
+ GST_BUFFER_SIZE (ffmpegenc->cache) + GST_BUFFER_SIZE (inbuf));
} else if (in_size == size) {
/* exactly the same! how wonderful */
ffmpegenc->cache = inbuf;
GST_BUFFER_DURATION (subbuf) =
GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (subbuf) / size;
subbuf = gst_buffer_span (ffmpegenc->cache, 0, subbuf,
- GST_BUFFER_SIZE (ffmpegenc->cache) + GST_BUFFER_SIZE (subbuf));
+ GST_BUFFER_SIZE (ffmpegenc->cache) + GST_BUFFER_SIZE (subbuf));
ffmpegenc->cache = NULL;
} else {
subbuf = gst_buffer_create_sub (inbuf, size - in_size, frame_size);
gst_tag_list_free (tags);
}
- /* set the streamheader flag for gstffmpegprotocol if codec supports it */
- if (!strcmp (ffmpegmux->context->oformat->name, "flv") ) {
- open_flags |= GST_FFMPEG_URL_STREAMHEADER;
- }
+ /* set the streamheader flag for gstffmpegprotocol if codec supports it */
+ if (!strcmp (ffmpegmux->context->oformat->name, "flv") ) {
+ open_flags |= GST_FFMPEG_URL_STREAMHEADER;
+ }
if (url_fopen (&ffmpegmux->context->pb,
ffmpegmux->context->filename, open_flags) < 0) {
("Failed to write file header - check codec settings"));
return;
}
-
+
/* flush the header so it will be used as streamheader */
put_flush_packet (&ffmpegmux->context->pb);
}
g_value_init (&list, GST_TYPE_FIXED_LIST);
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_IN_CAPS);
-
+
g_value_init (&value, GST_TYPE_BUFFER);
g_value_set_boxed (&value, outbuf);
gst_value_list_append_value (&list, &value);
/* only set the first buffer */
info->set_streamheader = FALSE;
}
-
+
gst_pad_push (info->pad, GST_DATA (outbuf));
return size;
if (scale->res != NULL) img_resample_close (scale->res);
scale->res = img_resample_init (scale->to_width, scale->to_height,
- scale->from_width, scale->from_height);
+ scale->from_width, scale->from_height);
}
gst_ffmpegscale_init (GstFFMpegScale * scale)
{
scale->sinkpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_ffmpegscale_sink_template),
- "sink");
+ (&gst_ffmpegscale_sink_template),
+ "sink");
gst_pad_set_link_function (scale->sinkpad, gst_ffmpegscale_pad_link);
gst_pad_set_getcaps_function (scale->sinkpad, gst_ffmpegscale_getcaps);
gst_pad_set_chain_function (scale->sinkpad, gst_ffmpegscale_chain);
gst_element_add_pad (GST_ELEMENT (scale), scale->sinkpad);
scale->srcpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_ffmpegscale_src_template),
- "src");
+ (&gst_ffmpegscale_src_template),
+ "src");
gst_element_add_pad (GST_ELEMENT (scale), scale->srcpad);
gst_pad_set_link_function (scale->srcpad, gst_ffmpegscale_pad_link);
gst_pad_set_getcaps_function (scale->srcpad, gst_ffmpegscale_getcaps);
outbuf = gst_pad_alloc_buffer_and_set_caps (scale->srcpad, GST_BUFFER_OFFSET_NONE, scale->to_size);
gst_ffmpeg_avpicture_fill (&scale->from_frame,
- GST_BUFFER_DATA (inbuf),
- scale->pixfmt,
- scale->from_width, scale->from_height);
+ GST_BUFFER_DATA (inbuf),
+ scale->pixfmt,
+ scale->from_width, scale->from_height);
gst_ffmpeg_avpicture_fill (&scale->to_frame,
- GST_BUFFER_DATA (outbuf),
- scale->pixfmt,
- scale->to_width, scale->to_height);
+ GST_BUFFER_DATA (outbuf),
+ scale->pixfmt,
+ scale->to_width, scale->to_height);
img_resample (scale->res, &scale->to_frame, &scale->from_frame);
switch (transition) {
case GST_STATE_CHANGE_READY_TO_NULL:
if (scale->res != NULL)
- img_resample_close (scale->res);
+ img_resample_close (scale->res);
break;
}
typedef struct _PostProcDetails PostProcDetails;
struct _PostProcDetails {
- char *shortname;
- char *longname;
- char *description;
+ char *shortname;
+ char *longname;
+ char *description;
};
static PostProcDetails filterdetails[] = {
- {"hb", "hdeblock", "horizontal deblocking filter"},
- {"vb", "vdeblock", "vertical deblocking filter"},
- {"h1", "x1hdeblock", "experimental horizontal deblocking filter 1"},
- {"v1", "x1vdeblock", "experimental vertical deblocking filter 1"},
- {"ha", "ahdeblock", "another horizontal deblocking filter"},
- {"va", "avdeblock", "another vertical deblocking filter"},
- {"dr", "dering", "deringing filter"},
- {"al", "autolevels", "automatic brightness/contrast filter"},
- {"lb", "linblenddeint", "linear blend interpolater"},
- {"li", "linipoldeint", "linear interpolation deinterlacer"},
- {"ci", "cubicipoldeint", "cubic interpolation deinterlacer"},
- {"md", "mediandeint", "median deinterlacer"},
- {"fd", "ffmpegdeint", "ffmpeg deinterlacer"},
- {"l5", "lowpass5", "FIR lowpass deinterlacer"},
- {"tn", "tmpnoise", "temporal noise reducer"},
- {"fq", "forcequant", "force quantizer"},
- {"de", "default", "default filters"},
- {NULL, NULL, NULL}
+ {"hb", "hdeblock", "horizontal deblocking filter"},
+ {"vb", "vdeblock", "vertical deblocking filter"},
+ {"h1", "x1hdeblock", "experimental horizontal deblocking filter 1"},
+ {"v1", "x1vdeblock", "experimental vertical deblocking filter 1"},
+ {"ha", "ahdeblock", "another horizontal deblocking filter"},
+ {"va", "avdeblock", "another vertical deblocking filter"},
+ {"dr", "dering", "deringing filter"},
+ {"al", "autolevels", "automatic brightness/contrast filter"},
+ {"lb", "linblenddeint", "linear blend interpolater"},
+ {"li", "linipoldeint", "linear interpolation deinterlacer"},
+ {"ci", "cubicipoldeint", "cubic interpolation deinterlacer"},
+ {"md", "mediandeint", "median deinterlacer"},
+ {"fd", "ffmpegdeint", "ffmpeg deinterlacer"},
+ {"l5", "lowpass5", "FIR lowpass deinterlacer"},
+ {"tn", "tmpnoise", "temporal noise reducer"},
+ {"fq", "forcequant", "force quantizer"},
+ {"de", "default", "default filters"},
+ {NULL, NULL, NULL}
};
-typedef struct _GstPostProc GstPostProc;
+typedef struct _GstPostProc GstPostProc;
-struct _GstPostProc {
- GstElement element;
+struct _GstPostProc {
+ GstElement element;
- GstPad *sinkpad, *srcpad;
- guint quality;
- gint width, height;
+ GstPad *sinkpad, *srcpad;
+ guint quality;
+ gint width, height;
- gint ystride, ustride, vstride;
- gint ysize, usize, vsize;
+ gint ystride, ustride, vstride;
+ gint ysize, usize, vsize;
- pp_mode_t *mode;
- pp_context_t *context;
+ pp_mode_t *mode;
+ pp_context_t *context;
};
-typedef struct _GstPostProcClass GstPostProcClass;
+typedef struct _GstPostProcClass GstPostProcClass;
-struct _GstPostProcClass {
- GstElementClass parent_class;
+struct _GstPostProcClass {
+ GstElementClass parent_class;
- gint filterid;
+ gint filterid;
};
enum {
};
/* hashtable, key = gtype, value = filterdetails index */
-static GHashTable *global_plugins;
+static GHashTable *global_plugins;
/* TODO : add support for the other format supported by libpostproc */
static GstStaticPadTemplate gst_postproc_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
- GST_PAD_SRC,
- GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV("I420"))
- );
-
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV("I420"))
+ );
+
static GstStaticPadTemplate gst_postproc_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
- GST_PAD_SINK,
- GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV("I420"))
- );
-
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV("I420"))
+ );
+
GST_DEBUG_CATEGORY (postproc_debug);
#define GST_CAT_DEFAULT postproc_debug
-static void gst_postproc_class_init (GstPostProcClass * klass);
-static void gst_postproc_base_init (GstPostProcClass * klass);
-static void gst_postproc_init (GstPostProc * pproc);
-static void gst_postproc_dispose (GObject * object);
+static void gst_postproc_class_init (GstPostProcClass * klass);
+static void gst_postproc_base_init (GstPostProcClass * klass);
+static void gst_postproc_init (GstPostProc * pproc);
+static void gst_postproc_dispose (GObject * object);
-static GstPadLinkReturn gst_postproc_link (GstPad * pad, const GstCaps * caps);
+static GstPadLinkReturn gst_postproc_link (GstPad * pad, const GstCaps * caps);
-static void gst_postproc_chain (GstPad * pad, GstData * data);
+static void gst_postproc_chain (GstPad * pad, GstData * data);
-static GstStateChangeReturn gst_postproc_change_state (GstElement * element,
+static GstStateChangeReturn gst_postproc_change_state (GstElement * element,
GstStateChange transition);
-static void gst_postproc_set_property ( GObject * object, guint prop_id,
- const GValue * value,
- GParamSpec *pspec );
-static void gst_postproc_get_property ( GObject * object, guint prop_id,
- GValue * value, GParamSpec *pspec );
+static void gst_postproc_set_property ( GObject * object, guint prop_id,
+ const GValue * value,
+ GParamSpec *pspec );
+static void gst_postproc_get_property ( GObject * object, guint prop_id,
+ GValue * value, GParamSpec *pspec );
-static GstElementClass *parent_class = NULL;
+static GstElementClass *parent_class = NULL;
#ifndef GST_DISABLE_GST_DEBUG
static void
static void
change_context ( GstPostProc * postproc , gint width, gint height )
{
- GstCPUFlags flags;
- int ppflags;
+ GstCPUFlags flags;
+ int ppflags;
/*
TODO : We need to find out what CPU flags we have in order to set
MMX/MMX2/3DNOW optimizations
*/
GST_DEBUG ("change_context, width:%d, height:%d",
- width, height);
+ width, height);
if ((width != postproc->width) && (height != postproc->height)) {
if (postproc->context)
postproc->usize = postproc->ustride * ROUND_UP_2 (height) / 2;
postproc->vsize = postproc->vstride * ROUND_UP_2 (height) / 2;
GST_DEBUG ("new strides are (YUV) : %d %d %d",
- postproc->ystride, postproc->ustride, postproc->vstride);
+ postproc->ystride, postproc->ustride, postproc->vstride);
}
}
if (postproc->mode)
pp_free_mode (postproc->mode);
postproc->mode = pp_get_mode_by_name_and_quality (filterdetails[klass->filterid].shortname,
- postproc->quality);
+ postproc->quality);
}
static void
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstElementDetails details;
- gint ppidx;
+ gint ppidx;
ppidx = GPOINTER_TO_INT (g_hash_table_lookup (global_plugins,
GINT_TO_POINTER (G_OBJECT_CLASS_TYPE (gobject_class))));
g_free(details.description);
gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&gst_postproc_src_template));
+ gst_static_pad_template_get (&gst_postproc_src_template));
gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&gst_postproc_sink_template));
+ gst_static_pad_template_get (&gst_postproc_sink_template));
klass->filterid = ppidx;
}
static void
gst_postproc_class_init (GstPostProcClass * klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
g_object_class_install_property (gobject_class, ARG_QUALITY,
g_param_spec_uint ("quality", "Quality",
- "Quality level of filter (6:best)",
- 0, 6, 6, G_PARAM_READWRITE));
+ "Quality level of filter (6:best)",
+ 0, 6, 6, G_PARAM_READWRITE));
gobject_class->dispose = gst_postproc_dispose;
gobject_class->set_property = gst_postproc_set_property;
GST_FLAG_SET (postproc, GST_ELEMENT_WORK_IN_PLACE);
postproc->sinkpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_postproc_sink_template),
- "sink");
+ (&gst_postproc_sink_template),
+ "sink");
gst_pad_set_link_function (postproc->sinkpad, gst_postproc_link);
gst_pad_set_chain_function (postproc->sinkpad, gst_postproc_chain);
gst_element_add_pad (GST_ELEMENT (postproc), postproc->sinkpad);
postproc->srcpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_postproc_src_template),
- "src");
+ (&gst_postproc_src_template),
+ "src");
gst_element_add_pad (GST_ELEMENT (postproc), postproc->srcpad);
postproc->quality = 6;
static GstPadLinkReturn
gst_postproc_link (GstPad * pad, const GstCaps * caps)
{
- GstPostProc *postproc;
- GstStructure *structure;
- GstPad *otherpad;
- gboolean res;
- GstPadLinkReturn ret;
- gint width, height;
+ GstPostProc *postproc;
+ GstStructure *structure;
+ GstPad *otherpad;
+ gboolean res;
+ GstPadLinkReturn ret;
+ gint width, height;
/* create/replace pp_context here */
postproc = (GstPostProc *) gst_pad_get_parent (pad);
static void
gst_postproc_chain (GstPad * pad, GstData * data)
{
- GstPostProc *postproc;
- GstBuffer *in, *out;
- int stride[3];
- unsigned char * outplane[3];
+ GstPostProc *postproc;
+ GstBuffer *in, *out;
+ int stride[3];
+ unsigned char * outplane[3];
GST_DEBUG("chaining");
outplane[2] = outplane[1] + postproc->usize;
GST_DEBUG ("calling pp_postprocess, width:%d, height:%d",
- postproc->width, postproc->height);
+ postproc->width, postproc->height);
pp_postprocess (outplane, stride,
- outplane, stride,
- postproc->width,
- postproc->height,
- "", 0,
- postproc->mode, postproc->context, 1);
+ outplane, stride,
+ postproc->width,
+ postproc->height,
+ "", 0,
+ postproc->mode, postproc->context, 1);
gst_buffer_stamp (out, in);
gst_pad_push (postproc->srcpad, GST_DATA (out));
/*
void pp_postprocess(uint8_t * src[3], int srcStride[3],
- uint8_t * dst[3], int dstStride[3],
- int horizontalSize, int verticalSize,
- QP_STORE_T *QP_store, int QP_stride,
- pp_mode_t *mode, pp_context_t *ppContext, int pict_type);
-
- src is the src buffer data
- srcStride is ->ystride, ->ustride, ->vstride
- dst same as src
- dstStride same as srcStride
- horizontalSize and VerticalsSize are obvious
- QP_store can be null and qp_stride too
- mode = mode
- context = context
- pict_type = 0
+ uint8_t * dst[3], int dstStride[3],
+ int horizontalSize, int verticalSize,
+ QP_STORE_T *QP_store, int QP_stride,
+ pp_mode_t *mode, pp_context_t *ppContext, int pict_type);
+
+ src is the src buffer data
+ srcStride is ->ystride, ->ustride, ->vstride
+ dst same as src
+ dstStride same as srcStride
+ horizontalSize and VerticalsSize are obvious
+ QP_store can be null and qp_stride too
+ mode = mode
+ context = context
+ pict_type = 0
*/
}
static GstStateChangeReturn
gst_postproc_change_state (GstElement * element, GstStateChange transition)
{
- GstPostProc *postproc = (GstPostProc *) element;
+ GstPostProc *postproc = (GstPostProc *) element;
/* don't go to play if we don't have mode and context */
switch (transition) {
static void
gst_postproc_set_property ( GObject * object, guint prop_id,
- const GValue * value,
- GParamSpec *pspec )
+ const GValue * value,
+ GParamSpec *pspec )
{
- GstPostProc *postproc = (GstPostProc *) object;
+ GstPostProc *postproc = (GstPostProc *) object;
gint quality;
switch (prop_id) {
static void
gst_postproc_get_property ( GObject * object, guint prop_id,
- GValue * value, GParamSpec *pspec )
+ GValue * value, GParamSpec *pspec )
{
- GstPostProc *postproc = (GstPostProc *) object;
+ GstPostProc *postproc = (GstPostProc *) object;
switch (prop_id) {
case ARG_QUALITY:
gboolean
gst_postproc_register(GstPlugin * plugin)
{
- GTypeInfo typeinfo = {
+ GTypeInfo typeinfo = {
sizeof (GstPostProcClass),
(GBaseInitFunc) gst_postproc_base_init,
NULL,
(GInstanceInitFunc) gst_postproc_init,
};
GType type;
- int i;
+ int i;
global_plugins = g_hash_table_new (NULL, NULL);
for (i = 0; filterdetails[i].shortname; i++) {
- gchar *type_name;
+ gchar *type_name;
g_hash_table_insert (global_plugins,
- GINT_TO_POINTER (0),
- GINT_TO_POINTER (i));
+ GINT_TO_POINTER (0),
+ GINT_TO_POINTER (i));
/* create type_name */
type_name = g_strdup_printf("postproc_%s", filterdetails[i].longname);
type = g_type_register_static (GST_TYPE_ELEMENT, type_name, &typeinfo, 0);
g_hash_table_insert (global_plugins,
- GINT_TO_POINTER (type),
- GINT_TO_POINTER (i));
+ GINT_TO_POINTER (type),
+ GINT_TO_POINTER (i));
/* register element */
if (!gst_element_register (plugin, type_name, GST_RANK_PRIMARY, type)) {