2002-10-10 21:19:12 +00:00
|
|
|
/* GStreamer
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2003-06-29 19:46:12 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2002-10-10 21:19:12 +00:00
|
|
|
#include <string.h>
|
2004-07-27 21:51:32 +00:00
|
|
|
#include "gstsmpte.h"
|
2003-07-06 20:49:52 +00:00
|
|
|
#include <gst/video/video.h>
|
2002-10-10 21:19:12 +00:00
|
|
|
#include "paint.h"
|
|
|
|
|
|
|
|
/* elementfactory information */
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_perform_seek), (gst_wavparse_peek_chunk_info),
(gst_wavparse_peek_chunk), (gst_wavparse_stream_headers),
(gst_wavparse_parse_stream_init), (gst_wavparse_send_event),
(gst_wavparse_add_src_pad), (gst_wavparse_stream_data),
(gst_wavparse_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +00:00
|
|
|
static const GstElementDetails smpte_details =
|
2006-03-30 15:37:05 +00:00
|
|
|
GST_ELEMENT_DETAILS ("SMPTE transitions",
|
|
|
|
"Filter/Editor/Video",
|
|
|
|
"Apply the standard SMPTE transitions on video images",
|
|
|
|
"Wim Taymans <wim.taymans@chello.be>");
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
static GstStaticPadTemplate gst_smpte_src_template =
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420")
|
|
|
|
)
|
|
|
|
);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
static GstStaticPadTemplate gst_smpte_sink1_template =
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink1",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420")
|
|
|
|
)
|
|
|
|
);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
static GstStaticPadTemplate gst_smpte_sink2_template =
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink2",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420")
|
|
|
|
)
|
|
|
|
);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* SMPTE signals and args */
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2002-10-10 21:19:12 +00:00
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2002-10-10 21:19:12 +00:00
|
|
|
ARG_0,
|
|
|
|
ARG_TYPE,
|
2002-10-13 18:46:10 +00:00
|
|
|
ARG_BORDER,
|
|
|
|
ARG_DEPTH,
|
2004-05-21 22:39:30 +00:00
|
|
|
ARG_FPS
|
2002-10-10 21:19:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define GST_TYPE_SMPTE_TRANSITION_TYPE (gst_smpte_transition_type_get_type())
|
|
|
|
static GType
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_transition_type_get_type (void)
|
2002-10-10 21:19:12 +00:00
|
|
|
{
|
|
|
|
static GType smpte_transition_type = 0;
|
|
|
|
GEnumValue *smpte_transitions;
|
|
|
|
|
|
|
|
if (!smpte_transition_type) {
|
|
|
|
const GList *definitions;
|
2004-03-14 22:34:33 +00:00
|
|
|
gint i = 0;
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
definitions = gst_mask_get_definitions ();
|
2004-03-14 22:34:33 +00:00
|
|
|
smpte_transitions =
|
2004-03-15 19:32:27 +00:00
|
|
|
g_new0 (GEnumValue, g_list_length ((GList *) definitions) + 1);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
while (definitions) {
|
|
|
|
GstMaskDefinition *definition = (GstMaskDefinition *) definitions->data;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2002-10-10 21:19:12 +00:00
|
|
|
definitions = g_list_next (definitions);
|
|
|
|
|
|
|
|
smpte_transitions[i].value = definition->type;
|
2005-11-22 18:11:58 +00:00
|
|
|
smpte_transitions[i].value_nick = definition->short_name;
|
|
|
|
smpte_transitions[i].value_name = definition->long_name;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2002-10-10 21:19:12 +00:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
smpte_transition_type =
|
2004-03-15 19:32:27 +00:00
|
|
|
g_enum_register_static ("GstSMPTETransitionType", smpte_transitions);
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
|
|
|
return smpte_transition_type;
|
2004-03-14 22:34:33 +00:00
|
|
|
}
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void gst_smpte_class_init (GstSMPTEClass * klass);
|
|
|
|
static void gst_smpte_base_init (GstSMPTEClass * klass);
|
|
|
|
static void gst_smpte_init (GstSMPTE * smpte);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
static GstFlowReturn gst_smpte_collected (GstCollectPads * pads,
|
|
|
|
GstSMPTE * smpte);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void gst_smpte_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_smpte_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
static GstElementClass *parent_class = NULL;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2002-10-10 21:19:12 +00:00
|
|
|
/*static guint gst_smpte_signals[LAST_SIGNAL] = { 0 }; */
|
|
|
|
|
|
|
|
static GType
|
|
|
|
gst_smpte_get_type (void)
|
|
|
|
{
|
|
|
|
static GType smpte_type = 0;
|
|
|
|
|
|
|
|
if (!smpte_type) {
|
|
|
|
static const GTypeInfo smpte_info = {
|
2004-03-14 22:34:33 +00:00
|
|
|
sizeof (GstSMPTEClass),
|
|
|
|
(GBaseInitFunc) gst_smpte_base_init,
|
2002-10-10 21:19:12 +00:00
|
|
|
NULL,
|
2004-03-14 22:34:33 +00:00
|
|
|
(GClassInitFunc) gst_smpte_class_init,
|
2002-10-10 21:19:12 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2004-03-14 22:34:33 +00:00
|
|
|
sizeof (GstSMPTE),
|
2002-10-10 21:19:12 +00:00
|
|
|
0,
|
2004-03-14 22:34:33 +00:00
|
|
|
(GInstanceInitFunc) gst_smpte_init,
|
2002-10-10 21:19:12 +00:00
|
|
|
};
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
smpte_type =
|
2004-03-15 19:32:27 +00:00
|
|
|
g_type_register_static (GST_TYPE_ELEMENT, "GstSMPTE", &smpte_info, 0);
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
|
|
|
return smpte_type;
|
|
|
|
}
|
|
|
|
|
2003-11-02 22:26:51 +00:00
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_base_init (GstSMPTEClass * klass)
|
2003-11-02 22:26:51 +00:00
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_smpte_sink1_template));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_smpte_sink2_template));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_smpte_src_template));
|
2003-11-02 22:26:51 +00:00
|
|
|
gst_element_class_set_details (element_class, &smpte_details);
|
|
|
|
}
|
|
|
|
|
2002-10-10 21:19:12 +00:00
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_class_init (GstSMPTEClass * klass)
|
2002-10-10 21:19:12 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2006-04-08 21:21:45 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
gobject_class->set_property = gst_smpte_set_property;
|
|
|
|
gobject_class->get_property = gst_smpte_get_property;
|
|
|
|
|
|
|
|
_gst_mask_init ();
|
|
|
|
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TYPE,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_enum ("type", "Type", "The type of transition to use",
|
2004-03-15 19:32:27 +00:00
|
|
|
GST_TYPE_SMPTE_TRANSITION_TYPE, 1, G_PARAM_READWRITE));
|
2002-10-13 18:46:10 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FPS,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_float ("fps", "FPS",
|
2004-03-15 19:32:27 +00:00
|
|
|
"Frames per second if no input files are given", 0., G_MAXFLOAT, 25.,
|
|
|
|
G_PARAM_READWRITE));
|
2002-10-13 18:46:10 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BORDER,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_int ("border", "Border",
|
2004-03-15 19:32:27 +00:00
|
|
|
"The border width of the transition", 0, G_MAXINT, 0,
|
|
|
|
G_PARAM_READWRITE));
|
2002-10-13 18:46:10 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DEPTH,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_int ("depth", "Depth", "Depth of the mask in bits", 1, 24,
|
2004-03-15 19:32:27 +00:00
|
|
|
16, G_PARAM_READWRITE));
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* wht yel cya grn mag red blu blk -I Q */
|
2004-03-14 22:34:33 +00:00
|
|
|
static int y_colors[] = { 255, 226, 179, 150, 105, 76, 29, 16, 16, 0 };
|
|
|
|
static int u_colors[] = { 128, 0, 170, 46, 212, 85, 255, 128, 0, 128 };
|
|
|
|
static int v_colors[] = { 128, 155, 0, 21, 235, 255, 107, 128, 128, 255 };
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
fill_i420 (guint8 * data, gint width, gint height, gint color)
|
2002-10-10 21:19:12 +00:00
|
|
|
{
|
2002-10-13 18:46:10 +00:00
|
|
|
gint size = width * height, size4 = size >> 2;
|
2002-10-10 21:19:12 +00:00
|
|
|
guint8 *yp = data;
|
2002-10-13 18:46:10 +00:00
|
|
|
guint8 *up = data + size;
|
|
|
|
guint8 *vp = data + size + size4;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2002-10-13 18:46:10 +00:00
|
|
|
memset (yp, y_colors[color], size);
|
|
|
|
memset (up, u_colors[color], size4);
|
|
|
|
memset (vp, v_colors[color], size4);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_update_mask (GstSMPTE * smpte, gint type, gint depth, gint width,
|
|
|
|
gint height)
|
2002-10-13 18:46:10 +00:00
|
|
|
{
|
|
|
|
GstMask *newmask;
|
|
|
|
|
|
|
|
newmask = gst_mask_factory_new (type, depth, width, height);
|
|
|
|
if (newmask) {
|
|
|
|
if (smpte->mask) {
|
|
|
|
gst_mask_destroy (smpte->mask);
|
|
|
|
}
|
|
|
|
smpte->mask = newmask;
|
|
|
|
smpte->type = type;
|
|
|
|
smpte->depth = depth;
|
|
|
|
smpte->width = width;
|
|
|
|
smpte->height = height;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gst_smpte_setcaps (GstPad * pad, GstCaps * caps)
|
2002-10-10 21:19:12 +00:00
|
|
|
{
|
|
|
|
GstSMPTE *smpte;
|
2003-12-22 01:47:09 +00:00
|
|
|
GstStructure *structure;
|
|
|
|
gboolean ret;
|
2002-10-10 21:19:12 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
smpte = GST_SMPTE (GST_PAD_PARENT (pad));
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
ret = gst_structure_get_int (structure, "width", &smpte->width);
|
|
|
|
ret &= gst_structure_get_int (structure, "height", &smpte->height);
|
|
|
|
ret &= gst_structure_get_double (structure, "framerate", &smpte->fps);
|
2004-03-14 22:34:33 +00:00
|
|
|
if (!ret)
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
return FALSE;
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_update_mask (smpte, smpte->type, smpte->depth, smpte->width,
|
|
|
|
smpte->height);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
/* forward to the next plugin */
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
return TRUE;
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void
|
|
|
|
gst_smpte_init (GstSMPTE * smpte)
|
2002-10-10 21:19:12 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
smpte->sinkpad1 =
|
2006-03-15 16:17:12 +00:00
|
|
|
gst_pad_new_from_static_template (&gst_smpte_sink1_template, "sink1");
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gst_pad_set_setcaps_function (smpte->sinkpad1, gst_smpte_setcaps);
|
2002-10-10 21:19:12 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad1);
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
smpte->sinkpad2 =
|
2006-03-15 16:17:12 +00:00
|
|
|
gst_pad_new_from_static_template (&gst_smpte_sink2_template, "sink2");
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gst_pad_set_setcaps_function (smpte->sinkpad2, gst_smpte_setcaps);
|
2002-10-10 21:19:12 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad2);
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
smpte->srcpad =
|
2006-03-15 16:17:12 +00:00
|
|
|
gst_pad_new_from_static_template (&gst_smpte_src_template, "src");
|
2002-10-10 21:19:12 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (smpte), smpte->srcpad);
|
|
|
|
|
Fix for collect pads API change. Also fix textoverlay state change function.
Original commit message from CVS:
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_finalize),
(gst_text_overlay_init), (gst_text_overlay_text_pad_linked),
(gst_text_overlay_text_pad_unlinked), (gst_text_overlay_pop_video),
(gst_text_overlay_pop_text), (gst_text_overlay_collected),
(gst_text_overlay_change_state):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_init),
(gst_matroska_mux_reset), (gst_matroska_mux_request_new_pad),
(gst_matroska_mux_best_pad), (gst_matroska_mux_change_state):
* gst/smpte/gstsmpte.c: (gst_smpte_init), (gst_smpte_collected):
* gst/videomixer/videomixer.c: (gst_videomixer_init),
(gst_videomixer_request_new_pad), (gst_videomixer_fill_queues),
(gst_videomixer_change_state):
Fix for collect pads API change. Also fix textoverlay state
change function.
2005-11-21 12:13:48 +00:00
|
|
|
smpte->collect = gst_collect_pads_new ();
|
|
|
|
gst_collect_pads_set_function (smpte->collect,
|
2006-03-24 17:11:56 +00:00
|
|
|
(GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_smpte_collected), smpte);
|
Fix for collect pads API change. Also fix textoverlay state change function.
Original commit message from CVS:
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_finalize),
(gst_text_overlay_init), (gst_text_overlay_text_pad_linked),
(gst_text_overlay_text_pad_unlinked), (gst_text_overlay_pop_video),
(gst_text_overlay_pop_text), (gst_text_overlay_collected),
(gst_text_overlay_change_state):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_init),
(gst_matroska_mux_reset), (gst_matroska_mux_request_new_pad),
(gst_matroska_mux_best_pad), (gst_matroska_mux_change_state):
* gst/smpte/gstsmpte.c: (gst_smpte_init), (gst_smpte_collected):
* gst/videomixer/videomixer.c: (gst_videomixer_init),
(gst_videomixer_request_new_pad), (gst_videomixer_fill_queues),
(gst_videomixer_change_state):
Fix for collect pads API change. Also fix textoverlay state
change function.
2005-11-21 12:13:48 +00:00
|
|
|
gst_collect_pads_start (smpte->collect);
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
|
Fix for collect pads API change. Also fix textoverlay state change function.
Original commit message from CVS:
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_finalize),
(gst_text_overlay_init), (gst_text_overlay_text_pad_linked),
(gst_text_overlay_text_pad_unlinked), (gst_text_overlay_pop_video),
(gst_text_overlay_pop_text), (gst_text_overlay_collected),
(gst_text_overlay_change_state):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_init),
(gst_matroska_mux_reset), (gst_matroska_mux_request_new_pad),
(gst_matroska_mux_best_pad), (gst_matroska_mux_change_state):
* gst/smpte/gstsmpte.c: (gst_smpte_init), (gst_smpte_collected):
* gst/videomixer/videomixer.c: (gst_videomixer_init),
(gst_videomixer_request_new_pad), (gst_videomixer_fill_queues),
(gst_videomixer_change_state):
Fix for collect pads API change. Also fix textoverlay state
change function.
2005-11-21 12:13:48 +00:00
|
|
|
gst_collect_pads_add_pad (smpte->collect, smpte->sinkpad1,
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
sizeof (GstCollectData));
|
Fix for collect pads API change. Also fix textoverlay state change function.
Original commit message from CVS:
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_finalize),
(gst_text_overlay_init), (gst_text_overlay_text_pad_linked),
(gst_text_overlay_text_pad_unlinked), (gst_text_overlay_pop_video),
(gst_text_overlay_pop_text), (gst_text_overlay_collected),
(gst_text_overlay_change_state):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_init),
(gst_matroska_mux_reset), (gst_matroska_mux_request_new_pad),
(gst_matroska_mux_best_pad), (gst_matroska_mux_change_state):
* gst/smpte/gstsmpte.c: (gst_smpte_init), (gst_smpte_collected):
* gst/videomixer/videomixer.c: (gst_videomixer_init),
(gst_videomixer_request_new_pad), (gst_videomixer_fill_queues),
(gst_videomixer_change_state):
Fix for collect pads API change. Also fix textoverlay state
change function.
2005-11-21 12:13:48 +00:00
|
|
|
gst_collect_pads_add_pad (smpte->collect, smpte->sinkpad2,
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
sizeof (GstCollectData));
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
smpte->width = 320;
|
|
|
|
smpte->height = 200;
|
2003-07-06 20:49:52 +00:00
|
|
|
smpte->fps = 25.;
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
smpte->duration = 512;
|
2002-10-10 21:19:12 +00:00
|
|
|
smpte->position = 0;
|
|
|
|
smpte->type = 1;
|
2002-10-13 18:46:10 +00:00
|
|
|
smpte->border = 0;
|
|
|
|
smpte->depth = 16;
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_update_mask (smpte, smpte->type, smpte->depth, smpte->width,
|
|
|
|
smpte->height);
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_blend_i420 (guint8 * in1, guint8 * in2, guint8 * out, GstMask * mask,
|
|
|
|
gint width, gint height, gint border, gint pos)
|
2002-10-10 21:19:12 +00:00
|
|
|
{
|
2002-10-13 18:46:10 +00:00
|
|
|
guint32 *maskp;
|
|
|
|
gint value;
|
2002-10-17 21:36:20 +00:00
|
|
|
gint i, j;
|
2002-10-13 18:46:10 +00:00
|
|
|
gint min, max;
|
2004-03-14 22:34:33 +00:00
|
|
|
guint8 *in1u, *in1v, *in2u, *in2v, *outu, *outv;
|
2002-10-13 18:46:10 +00:00
|
|
|
gint lumsize = width * height;
|
|
|
|
gint chromsize = lumsize >> 2;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if (border == 0)
|
|
|
|
border++;
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
min = pos - border;
|
2002-10-13 18:46:10 +00:00
|
|
|
max = pos;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
in1u = in1 + lumsize;
|
|
|
|
in1v = in1u + chromsize;
|
|
|
|
in2u = in2 + lumsize;
|
|
|
|
in2v = in2u + chromsize;
|
|
|
|
outu = out + lumsize;
|
|
|
|
outv = outu + chromsize;
|
|
|
|
|
2002-10-13 18:46:10 +00:00
|
|
|
maskp = mask->data;
|
|
|
|
|
2002-10-17 21:36:20 +00:00
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
for (j = 0; j < width; j++) {
|
|
|
|
value = *maskp++;
|
|
|
|
value = ((CLAMP (value, min, max) - min) << 8) / border;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2002-10-17 21:36:20 +00:00
|
|
|
*out++ = ((*in1++ * value) + (*in2++ * (256 - value))) >> 8;
|
|
|
|
if (!(i & 1) && !(j & 1)) {
|
2004-03-15 19:32:27 +00:00
|
|
|
*outu++ = ((*in1u++ * value) + (*in2u++ * (256 - value))) >> 8;
|
|
|
|
*outv++ = ((*in1v++ * value) + (*in2v++ * (256 - value))) >> 8;
|
2002-10-17 21:36:20 +00:00
|
|
|
}
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_smpte_collected (GstCollectPads * pads, GstSMPTE * smpte)
|
2002-10-10 21:19:12 +00:00
|
|
|
{
|
|
|
|
GstBuffer *outbuf;
|
|
|
|
GstClockTime ts;
|
|
|
|
GstBuffer *in1 = NULL, *in2 = NULL;
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
GSList *collected;
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2002-10-13 18:46:10 +00:00
|
|
|
ts = smpte->position * GST_SECOND / smpte->fps;
|
2002-10-10 21:19:12 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
for (collected = pads->data; collected; collected = g_slist_next (collected)) {
|
|
|
|
GstCollectData *data;
|
|
|
|
|
|
|
|
data = (GstCollectData *) collected->data;
|
|
|
|
|
|
|
|
if (data->pad == smpte->sinkpad1)
|
Fix for collect pads API change. Also fix textoverlay state change function.
Original commit message from CVS:
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_finalize),
(gst_text_overlay_init), (gst_text_overlay_text_pad_linked),
(gst_text_overlay_text_pad_unlinked), (gst_text_overlay_pop_video),
(gst_text_overlay_pop_text), (gst_text_overlay_collected),
(gst_text_overlay_change_state):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_init),
(gst_matroska_mux_reset), (gst_matroska_mux_request_new_pad),
(gst_matroska_mux_best_pad), (gst_matroska_mux_change_state):
* gst/smpte/gstsmpte.c: (gst_smpte_init), (gst_smpte_collected):
* gst/videomixer/videomixer.c: (gst_videomixer_init),
(gst_videomixer_request_new_pad), (gst_videomixer_fill_queues),
(gst_videomixer_change_state):
Fix for collect pads API change. Also fix textoverlay state
change function.
2005-11-21 12:13:48 +00:00
|
|
|
in1 = gst_collect_pads_pop (pads, data);
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
else if (data->pad == smpte->sinkpad2)
|
Fix for collect pads API change. Also fix textoverlay state change function.
Original commit message from CVS:
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_finalize),
(gst_text_overlay_init), (gst_text_overlay_text_pad_linked),
(gst_text_overlay_text_pad_unlinked), (gst_text_overlay_pop_video),
(gst_text_overlay_pop_text), (gst_text_overlay_collected),
(gst_text_overlay_change_state):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_init),
(gst_matroska_mux_reset), (gst_matroska_mux_request_new_pad),
(gst_matroska_mux_best_pad), (gst_matroska_mux_change_state):
* gst/smpte/gstsmpte.c: (gst_smpte_init), (gst_smpte_collected):
* gst/videomixer/videomixer.c: (gst_videomixer_init),
(gst_videomixer_request_new_pad), (gst_videomixer_fill_queues),
(gst_videomixer_change_state):
Fix for collect pads API change. Also fix textoverlay state
change function.
2005-11-21 12:13:48 +00:00
|
|
|
in2 = gst_collect_pads_pop (pads, data);
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
2003-02-25 21:34:10 +00:00
|
|
|
|
|
|
|
if (in1 == NULL) {
|
2002-10-10 21:19:12 +00:00
|
|
|
in1 = gst_buffer_new_and_alloc (smpte->width * smpte->height * 3);
|
|
|
|
fill_i420 (GST_BUFFER_DATA (in1), smpte->width, smpte->height, 7);
|
|
|
|
}
|
2003-02-25 21:34:10 +00:00
|
|
|
if (in2 == NULL) {
|
2002-10-10 21:19:12 +00:00
|
|
|
in2 = gst_buffer_new_and_alloc (smpte->width * smpte->height * 3);
|
|
|
|
fill_i420 (GST_BUFFER_DATA (in2), smpte->width, smpte->height, 0);
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if (smpte->position < smpte->duration) {
|
2002-10-10 21:19:12 +00:00
|
|
|
outbuf = gst_buffer_new_and_alloc (smpte->width * smpte->height * 3);
|
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
/* set caps if not done yet */
|
2002-10-10 21:19:12 +00:00
|
|
|
if (!GST_PAD_CAPS (smpte->srcpad)) {
|
2003-12-22 01:47:09 +00:00
|
|
|
GstCaps *caps;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
caps =
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_caps_copy (gst_static_caps_get (&gst_smpte_src_template.
|
|
|
|
static_caps));
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_caps_set_simple (caps, "width", G_TYPE_INT, smpte->width, "height",
|
2004-03-15 19:32:27 +00:00
|
|
|
G_TYPE_INT, smpte->height, "framerate", G_TYPE_DOUBLE, smpte->fps,
|
|
|
|
NULL);
|
2003-12-22 01:47:09 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gst_pad_set_caps (smpte->srcpad, caps);
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (smpte->srcpad));
|
2002-10-10 21:19:12 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_blend_i420 (GST_BUFFER_DATA (in1),
|
2004-03-15 19:32:27 +00:00
|
|
|
GST_BUFFER_DATA (in2),
|
|
|
|
GST_BUFFER_DATA (outbuf),
|
|
|
|
smpte->mask, smpte->width, smpte->height,
|
|
|
|
smpte->border,
|
|
|
|
((1 << smpte->depth) + smpte->border) *
|
|
|
|
smpte->position / smpte->duration);
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
} else {
|
2002-10-10 21:19:12 +00:00
|
|
|
outbuf = in2;
|
|
|
|
gst_buffer_ref (in2);
|
|
|
|
}
|
|
|
|
|
|
|
|
smpte->position++;
|
|
|
|
|
|
|
|
if (in1)
|
|
|
|
gst_buffer_unref (in1);
|
|
|
|
if (in2)
|
|
|
|
gst_buffer_unref (in2);
|
|
|
|
|
|
|
|
GST_BUFFER_TIMESTAMP (outbuf) = ts;
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
|
|
|
|
return gst_pad_push (smpte->srcpad, outbuf);
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
2002-10-10 21:19:12 +00:00
|
|
|
{
|
|
|
|
GstSMPTE *smpte;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
smpte = GST_SMPTE (object);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_TYPE:
|
|
|
|
{
|
|
|
|
gint type = g_value_get_enum (value);
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_update_mask (smpte, type, smpte->depth,
|
2004-03-15 19:32:27 +00:00
|
|
|
smpte->width, smpte->height);
|
2002-10-13 18:46:10 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case ARG_BORDER:
|
|
|
|
smpte->border = g_value_get_int (value);
|
|
|
|
break;
|
2003-07-06 20:49:52 +00:00
|
|
|
case ARG_FPS:
|
|
|
|
smpte->fps = g_value_get_float (value);
|
|
|
|
break;
|
2002-10-13 18:46:10 +00:00
|
|
|
case ARG_DEPTH:
|
|
|
|
{
|
|
|
|
gint depth = g_value_get_int (value);
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_update_mask (smpte, smpte->type, depth,
|
2004-03-15 19:32:27 +00:00
|
|
|
smpte->width, smpte->height);
|
2002-10-10 21:19:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_smpte_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
2002-10-10 21:19:12 +00:00
|
|
|
{
|
|
|
|
GstSMPTE *smpte;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
smpte = GST_SMPTE (object);
|
2002-10-10 21:19:12 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_TYPE:
|
|
|
|
if (smpte->mask) {
|
2004-03-15 19:32:27 +00:00
|
|
|
g_value_set_enum (value, smpte->mask->type);
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
|
|
|
break;
|
2002-10-13 18:46:10 +00:00
|
|
|
case ARG_FPS:
|
2003-07-06 20:49:52 +00:00
|
|
|
g_value_set_float (value, smpte->fps);
|
2002-10-13 18:46:10 +00:00
|
|
|
break;
|
|
|
|
case ARG_BORDER:
|
|
|
|
g_value_set_int (value, smpte->border);
|
|
|
|
break;
|
|
|
|
case ARG_DEPTH:
|
|
|
|
g_value_set_int (value, smpte->depth);
|
|
|
|
break;
|
2002-10-10 21:19:12 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
plugin_init (GstPlugin * plugin)
|
2002-10-10 21:19:12 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
return gst_element_register (plugin, "smpte", GST_RANK_NONE, GST_TYPE_SMPTE);
|
2002-10-10 21:19:12 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"smpte",
|
|
|
|
"Apply the standard SMPTE transitions on video images",
|
2005-11-14 02:13:35 +00:00
|
|
|
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|