valve: move valve element/plugin to core

https://bugzilla.gnome.org/show_bug.cgi?id=630808
This commit is contained in:
Tim-Philipp Müller 2010-12-30 01:14:29 +00:00
parent 95597d8f0e
commit 222be5f0e9
17 changed files with 1044 additions and 638 deletions

View file

@ -49,12 +49,14 @@ CRUFT_FILES = \
$(top_builddir)/gst/aacparse/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/gst/amrparse/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/gst/flacparse/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/gst/shapewipe/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/gst/imagefreeze/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/gst/shapewipe/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/gst/valve/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/sys/oss4/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/tests/check/elements/autocolorspace \
$(top_builddir)/tests/check/elements/capssetter \
$(top_builddir)/tests/check/elements/imagefreeze \
$(top_builddir)/tests/check/elements/valve \
$(top_builddir)/tests/check/pipelines/metadata \
$(top_builddir)/tests/icles/test-oss4
@ -64,6 +66,7 @@ CRUFT_DIRS = \
$(top_srcdir)/gst/flacparse \
$(top_srcdir)/gst/imagefreeze \
$(top_srcdir)/gst/shapewipe \
$(top_srcdir)/gst/valve \
$(top_srcdir)/tests/examples/shapewipe \
$(top_srcdir)/ext/alsaspdif \
$(top_srcdir)/ext/ivorbis \

View file

@ -50,8 +50,8 @@ AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
dnl *** required versions of GStreamer stuff ***
GST_REQ=0.10.31
GSTPB_REQ=0.10.31
GST_REQ=0.10.31.1
GSTPB_REQ=0.10.31.1
dnl *** autotools stuff ****
@ -178,7 +178,7 @@ AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
dnl GLib is required
AG_GST_GLIB_CHECK([2.20])
AG_GST_GLIB_CHECK([2.22])
dnl checks for gstreamer
dnl uninstalled is selected preferentially -- see pkg-config(1)
@ -343,7 +343,6 @@ AG_GST_CHECK_PLUGIN(speed)
AG_GST_CHECK_PLUGIN(subenc)
AG_GST_CHECK_PLUGIN(stereo)
AG_GST_CHECK_PLUGIN(tta)
AG_GST_CHECK_PLUGIN(valve)
AG_GST_CHECK_PLUGIN(videomaxrate)
AG_GST_CHECK_PLUGIN(videomeasure)
AG_GST_CHECK_PLUGIN(videosignal)
@ -1773,7 +1772,6 @@ gst/speed/Makefile
gst/subenc/Makefile
gst/stereo/Makefile
gst/tta/Makefile
gst/valve/Makefile
gst/videomaxrate/Makefile
gst/videomeasure/Makefile
gst/videosignal/Makefile

View file

@ -203,7 +203,6 @@ EXTRA_HFILES = \
$(top_srcdir)/gst/videosignal/gstvideoanalyse.h \
$(top_srcdir)/gst/videosignal/gstvideodetect.h \
$(top_srcdir)/gst/videosignal/gstvideomark.h \
$(top_srcdir)/gst/valve/gstvalve.h \
$(top_srcdir)/sys/directdraw/gstdirectdrawsink.h \
$(top_srcdir)/sys/dvb/gstdvbsrc.h \
$(top_srcdir)/sys/shm/gstshmsink.h \

View file

@ -122,7 +122,6 @@
<xi:include href="xml/element-trm.xml" />
<xi:include href="xml/element-tunnel.xml" />
<xi:include href="xml/element-twirl.xml" />
<xi:include href="xml/element-valve.xml" />
<xi:include href="xml/element-videoanalyse.xml" />
<xi:include href="xml/element-videodetect.xml" />
<xi:include href="xml/element-videomark.xml" />
@ -215,7 +214,6 @@
<xi:include href="xml/plugin-swfdec.xml" />
<xi:include href="xml/plugin-timidity.xml" />
<xi:include href="xml/plugin-tta.xml" />
<xi:include href="xml/plugin-valve.xml" />
<xi:include href="xml/plugin-vcdsrc.xml" />
<xi:include href="xml/plugin-videomaxrate.xml" />
<xi:include href="xml/plugin-videosignal.xml" />

View file

@ -1602,21 +1602,6 @@ gst_twirl_get_type
gst_twirl_plugin_init
</SECTION>
<SECTION>
<FILE>element-valve</FILE>
<TITLE>valve</TITLE>
GstValve
<SUBSECTION Standard>
GstValveClass
GstValvePrivate
gst_valve_get_type
GST_IS_VALVE
GST_IS_VALVE_CLASS
GST_TYPE_VALVE
GST_VALVE
GST_VALVE_CLASS
</SECTION>
<SECTION>
<FILE>element-videoanalyse</FILE>
<TITLE>videoanalyse</TITLE>

File diff suppressed because it is too large Load diff

View file

@ -3,11 +3,14 @@ GObject
GstObject
GstBus
GstClock
GstSystemClock
GstAudioClock
GstElement
ADPCMDec
ADPCMEnc
GstAiffMux
GstAiffParse
GstAmrWbEnc
GstAsfMux
GstAsfParse
GstAssRender
@ -15,37 +18,58 @@ GObject
GstAacParse
GstAc3Parse
GstAmrParse
GstDcaParse
GstFlacParse
GstBaseMetadata
GstMetadataDemux
GstMetadataMux
GstMpegAudioParse
GstBaseRTPDepayload
GstRtpDTMFDepay
GstBaseRTPPayload
GstRtpAsfPay
GstBaseSink
AlsaSPDIFSink
GstBaseAudioSink
GstAudioSink
GstApExSink
GstNasSink
GstSDLAudioSink
GstJackAudioSink
GstChecksumSink
GstDCCPClientSink
GstDCCPServerSink
GstFBDEVSink
GstSFSink
GstShmSink
GstVideoSink
GstDfbVideoSink
GstSDLVideoSink
VdpSink
GstBaseSrc
GstDTMFSrc
GstDataURISrc
GstPushSrc
GstBaseAudioSrc
GstJackAudioSrc
GstDCCPClientSrc
GstDCCPServerSrc
GstDc1394
GstDvbSrc
GstMMS
GstMythtvSrc
GstNeonhttpSrc
GstRfbSrc
GstShmSrc
GstVCDSrc
frei0r-src-ising0r
frei0r-src-lissajous0r
frei0r-src-nois0r
frei0r-src-onecol0r
frei0r-src-partik0l
frei0r-src-plasma
GstRTPDTMFSrc
GstSFSrc
GstBaseTransform
GstAudioFilter
GstBPMDetect
GstOFA
GstStereo
GstBayer2RGB
GstCogScale
@ -62,8 +86,10 @@ GObject
GstVideoFilter
GaussBlur
GstBurn
GstChromaHold
GstChromium
GstColorEffects
GstCsp
GstDilate
GstDodge
GstExclusion
@ -82,6 +108,7 @@ GObject
GstFisheye
GstMarble
GstMirror
GstRotate
GstSquare
GstOpencvVideoFilter
GstCvDilateErode
@ -92,20 +119,97 @@ GObject
GstCvSmooth
GstCvSobel
Gstfacedetect
GstRsvgOverlay
GstSolarize
GstVideoAnalyse
GstVideoDetect
GstVideoMark
GstZBar
frei0r-filter-3-point-color-balance
frei0r-filter-3dflippo
frei0r-filter-b
frei0r-filter-baltan
frei0r-filter-bluescreen0r
frei0r-filter-brightness
frei0r-filter-bw0r
frei0r-filter-cartoon
frei0r-filter-color-distance
frei0r-filter-contrast0r
frei0r-filter-curves
frei0r-filter-dealygrab
frei0r-filter-delay0r
frei0r-filter-distort0r
frei0r-filter-edgeglow
frei0r-filter-equaliz0r
frei0r-filter-flippo
frei0r-filter-g
frei0r-filter-gamma
frei0r-filter-glow
frei0r-filter-hueshift0r
frei0r-filter-invert0r
frei0r-filter-k-means-clustering
frei0r-filter-lens-correction
frei0r-filter-letterb0xed
frei0r-filter-levels
frei0r-filter-luminance
frei0r-filter-mask0mate
frei0r-filter-nervous
frei0r-filter-nosync0r
frei0r-filter-perspective
frei0r-filter-pixeliz0r
frei0r-filter-primaries
frei0r-filter-r
frei0r-filter-rgb-parade
frei0r-filter-saturat0r
frei0r-filter-scale0tilt
frei0r-filter-scanline0r
frei0r-filter-sobel
frei0r-filter-squareblur
frei0r-filter-tehroxx0r
frei0r-filter-threelay0r
frei0r-filter-threshold0r
frei0r-filter-tint0r
frei0r-filter-transparency
frei0r-filter-twolay0r
frei0r-filter-vectorscope
frei0r-filter-vertigo
frei0r-filter-water
frei0r-filter-white-balance
GstVideoMaxRate
GstBaseVideoCodec
GstBaseVideoDecoder
GstSchroDec
GstVP8Dec
GstBaseVideoEncoder
GstDiracEnc
GstSchroEnc
GstVP8Enc
GstBaseVideoParse
GstSchroParse
GstBin
DvbBaseBin
GstAutoConvert
GstAutoVideoConvert
GstFPSDisplaySink
GstGSettingsSwitchSink
GstGSettingsAudioSink
GstGSettingsVideoSink
GstGSettingsSwitchSrc
GstGSettingsAudioSrc
GstGSettingsVideoSrc
GstPipeline
GstCameraBin
GstQTMoovRecover
GstSDPDemux
RsnDvdBin
GstBz2dec
GstBz2enc
GstCDAudio
GstCDXAParse
GstCeltDec
GstCeltEnc
GstChopMyData
GstDVBSubOverlay
GstDVDSpu
GstDtsDec
GstFaac
@ -113,34 +217,46 @@ GObject
GstFestival
GstFreeze
GstGPPMux
GstGSMDec
GstGSMEnc
GstH264Parse
GstISMLMux
GstId3BaseMux
GstId3Mux
GstInputSelector
GstInterlace
GstInvtelecine
GstIvfParse
GstJP2kDecimator
GstJifMux
GstJpegParse
GstKateDec
GstKateEnc
GstKateParse
GstKateTag
GstKateTiger
GstLiveAdder
GstMJ2Mux
GstMP4Mux
GstMSE
GstMXFDemux
GstMXFMux
GstMimDec
GstMimEnc
GstModPlug
GstMpeg2enc
GstMpeg4VParse
GstMpegPSDemux
GstMpegTSDemux
GstMplex
GstMusepackDec
GstMveDemux
GstMveMux
GstNsfDec
GstNuvDemux
GstOutputSelector
GstPcapParse
GstPitch
GstPnmdec
GstPnmenc
GstQTMux
@ -156,18 +272,170 @@ GObject
GstSegmentClip
GstAudioSegmentClip
GstVideoSegmentClip
GstSignalProcessor
ladspa-Chorus1
ladspa-Chorus2
ladspa-G2reverb
ladspa-Mvchpf-1
ladspa-Mvclpf-1
ladspa-Mvclpf-2
ladspa-Mvclpf-3
ladspa-Mvclpf-4
ladspa-Phaser1
ladspa-Phaser1+LFO
ladspa-TripleChorus
ladspa-alias
ladspa-allpass-c
ladspa-allpass-l
ladspa-allpass-n
ladspa-amPitchshift
ladspa-amp
ladspa-amp-mono
ladspa-amp-stereo
ladspa-analogueOsc
ladspa-artificialLatency
ladspa-autoPhaser
ladspa-bandpass-a-iir
ladspa-bandpass-iir
ladspa-bodeShifter
ladspa-bodeShifterCV
ladspa-butthigh-iir
ladspa-buttlow-iir
ladspa-bwxover-iir
ladspa-chebstortion
ladspa-comb
ladspa-comb-c
ladspa-comb-l
ladspa-comb-n
ladspa-combSplitter
ladspa-const
ladspa-crossoverDist
ladspa-dcRemove
ladspa-decay
ladspa-decimator
ladspa-declip
ladspa-delay-5s
ladspa-delay-c
ladspa-delay-l
ladspa-delay-n
ladspa-delayorama
ladspa-diode
ladspa-divider
ladspa-dj-eq
ladspa-dj-eq-mono
ladspa-djFlanger
ladspa-dysonCompress
ladspa-fadDelay
ladspa-fastLookaheadLimiter
ladspa-flanger
ladspa-fmOsc
ladspa-foldover
ladspa-fourByFourPole
ladspa-foverdrive
ladspa-freqTracker
ladspa-gate
ladspa-giantFlange
ladspa-gong
ladspa-gongBeater
ladspa-gsm
ladspa-gverb
ladspa-hardLimiter
ladspa-harmonicGen
ladspa-hermesFilter
ladspa-highpass-iir
ladspa-hilbert
ladspa-hpf
ladspa-imp
ladspa-impulse-fc
ladspa-inv
ladspa-karaoke
ladspa-lcrDelay
ladspa-lfoPhaser
ladspa-lowpass-iir
ladspa-lpf
ladspa-lsFilter
ladspa-matrixMSSt
ladspa-matrixSpatialiser
ladspa-matrixStMS
ladspa-mbeq
ladspa-modDelay
ladspa-multivoiceChorus
ladspa-noise-white
ladspa-notch-iir
ladspa-pitchScale
ladspa-pitchScaleHQ
ladspa-plate
ladspa-pointerCastDistortion
ladspa-rateShifter
ladspa-retroFlange
ladspa-revdelay
ladspa-ringmod-1i1o1l
ladspa-ringmod-2i1o
ladspa-satanMaximiser
ladspa-sc1
ladspa-sc2
ladspa-sc3
ladspa-sc4
ladspa-sc4m
ladspa-se4
ladspa-shaper
ladspa-sifter
ladspa-sinCos
ladspa-sine-faaa
ladspa-sine-faac
ladspa-sine-fcaa
ladspa-sine-fcac
ladspa-singlePara
ladspa-sinusWavewrapper
ladspa-smoothDecimate
ladspa-split
ladspa-stepMuxer
ladspa-surroundEncoder
ladspa-svf
ladspa-tap-autopan
ladspa-tap-chorusflanger
ladspa-tap-deesser
ladspa-tap-doubler
ladspa-tap-dynamics-m
ladspa-tap-dynamics-st
ladspa-tap-equalizer
ladspa-tap-equalizer-bw
ladspa-tap-limiter
ladspa-tap-pinknoise
ladspa-tap-pitch
ladspa-tap-reflector
ladspa-tap-reverb
ladspa-tap-rotspeak
ladspa-tap-sigmoid
ladspa-tap-stereo-echo
ladspa-tap-tremolo
ladspa-tap-tubewarmth
ladspa-tap-vibrato
ladspa-tapeDelay
ladspa-transient
ladspa-triplePara
ladspa-valve
ladspa-valveRect
ladspa-vynil
ladspa-waveTerrain
ladspa-xfade
ladspa-xfade4
ladspa-zm1
GstSirenDec
GstSirenEnc
GstSpeed
GstSrtEnc
GstTRM
GstTemplateMatch
GstTtaDec
GstTtaParse
GstVMncDec
GstValve
GstVcdParse
GstVdpVideoPostProcess
GstWildmidi
GstXvidDec
GstXvidEnc
GstY4mDec
Gstedgedetect
Gstfaceblur
Gstpyramidsegment
@ -176,8 +444,46 @@ GObject
MpegTSParse
MpegTsMux
MpegVideoParse
SatBaseVideoDecoder
GstVdpDecoder
GstVdpH264Dec
GstVdpMpeg4Dec
GstVdpMpegDec
frei0r-mixer-addition
frei0r-mixer-alpha-injection
frei0r-mixer-alphaatop
frei0r-mixer-alphain
frei0r-mixer-alphaout
frei0r-mixer-alphaover
frei0r-mixer-alphaxor
frei0r-mixer-blend
frei0r-mixer-burn
frei0r-mixer-color-only
frei0r-mixer-composition
frei0r-mixer-darken
frei0r-mixer-difference
frei0r-mixer-divide
frei0r-mixer-dodge
frei0r-mixer-grain-extract
frei0r-mixer-grain-merge
frei0r-mixer-hardlight
frei0r-mixer-hue
frei0r-mixer-lighten
frei0r-mixer-multiply
frei0r-mixer-overlay
frei0r-mixer-rgb
frei0r-mixer-saturation
frei0r-mixer-screen
frei0r-mixer-softlight
frei0r-mixer-subtract
frei0r-mixer-uv-map
frei0r-mixer-value
frei0r-mixer-xfade0r
GstPad
GstVdpOutputSrcPad
GstVdpVideoSrcPad
GstPadTemplate
GstSignalProcessorPadTemplate
GstPlugin
GstPluginFeature
GstElementFactory
@ -185,9 +491,13 @@ GObject
GstTypeFindFactory
GstRegistry
GstRingBuffer
GstAudioSinkRingBuffer
GstJackAudioSinkRingBuffer
GstJackAudioSrcRingBuffer
GstTask
GstTaskPool
GstSignalObject
GstVdpDevice
MpegTsPatInfo
MpegTsPmtInfo
GInterface
@ -195,9 +505,11 @@ GInterface
GstChildProxy
GstColorBalance
GstImplementsInterface
GstMixer
GstNavigation
GstPhotography
GstPreset
GstTagSetter
GstURIHandler
GstXOverlay
MXFDescriptiveMetadataFrameworkInterface

View file

@ -1,25 +1,44 @@
GstBin GstChildProxy
GstPipeline GstChildProxy
GstCameraBin GstChildProxy GstImplementsInterface GstColorBalance GstTagSetter
GstQTMoovRecover GstChildProxy
GstCameraBin GstChildProxy GstImplementsInterface GstColorBalance GstTagSetter GstPhotography
GstGSettingsSwitchSink GstChildProxy
GstGSettingsAudioSink GstChildProxy
GstGSettingsVideoSink GstChildProxy
GstGSettingsSwitchSrc GstChildProxy
GstGSettingsAudioSrc GstChildProxy
GstGSettingsVideoSrc GstChildProxy
RsnDvdBin GstChildProxy GstURIHandler
DvbBaseBin GstChildProxy GstURIHandler
GstSDPDemux GstChildProxy
GstAutoConvert GstChildProxy
GstAutoVideoConvert GstChildProxy
GstSDPDemux GstChildProxy
GstFPSDisplaySink GstChildProxy
GstXvidEnc GstPreset
GstMpeg2enc GstPreset
GstSDLVideoSink GstImplementsInterface GstXOverlay GstNavigation
GstDfbVideoSink GstImplementsInterface GstNavigation GstColorBalance
GstKateEnc GstTagSetter
GstKateTag GstTagSetter
VdpSink GstImplementsInterface GstNavigation GstXOverlay
GstApExSink GstImplementsInterface GstMixer
GstCeltEnc GstTagSetter GstPreset
GstCDAudio GstURIHandler
GstMythtvSrc GstURIHandler
GstMMS GstURIHandler
GstNeonhttpSrc GstURIHandler
GstVCDSrc GstURIHandler
GstDataURISrc GstURIHandler
GstMetadataMux GstTagSetter
GstAmrWbEnc GstPreset
GstFaac GstPreset
GstAsfMux GstTagSetter
GstXvidEnc GstPreset
GstDiracEnc GstPreset
GstVP8Enc GstTagSetter GstPreset
GstKateEnc GstTagSetter
GstKateTag GstTagSetter
GstJifMux GstTagSetter
GstId3BaseMux GstTagSetter
GstId3Mux GstTagSetter
GstJifMux GstTagSetter
GstQTMux GstTagSetter
GstMP4Mux GstTagSetter
GstISMLMux GstTagSetter
GstGPPMux GstTagSetter
GstMJ2Mux GstTagSetter
GstAsfMux GstTagSetter

View file

@ -1,6 +1,8 @@
GstChildProxy GstObject
GstImplementsInterface GstElement
GstColorBalance GstImplementsInterface GstElement
GstXOverlay GstImplementsInterface GstElement
GstTagSetter GstElement
GstPhotography GstImplementsInterface GstElement
GstColorBalance GstImplementsInterface GstElement
GstMixer GstImplementsInterface GstElement
MXFDescriptiveMetadataFrameworkInterface MXFDescriptiveMetadata
GstPhotography GstImplementsInterface GstElement

View file

@ -1,34 +0,0 @@
<plugin>
<name>valve</name>
<description>Valve</description>
<filename>../../gst/valve/.libs/libgstvalve.so</filename>
<basename>libgstvalve.so</basename>
<version>0.10.20.1</version>
<license>LGPL</license>
<source>gst-plugins-bad</source>
<package>GStreamer Bad Plug-ins git</package>
<origin>Unknown package origin</origin>
<elements>
<element>
<name>valve</name>
<longname>Valve element</longname>
<class>Filter</class>
<description>This element drops all packets when drop is TRUE</description>
<author>Olivier Crete &lt;olivier.crete@collabora.co.uk&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
</elements>
</plugin>

View file

@ -111,7 +111,6 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/gstreamer-%{majorminor}/libgstmxf.so
%{_libdir}/gstreamer-%{majorminor}/libgstvmnc.so
%{_libdir}/gstreamer-%{majorminor}/libgstvideosignal.so
%{_libdir}/gstreamer-%{majorminor}/libgstvalve.so
%{_libdir}/gstreamer-%{majorminor}/libgstautoconvert.so
%{_libdir}/gstreamer-%{majorminor}/libgstdtmf.so
%{_libdir}/gstreamer-%{majorminor}/libgstliveadder.so

View file

@ -1,9 +0,0 @@
plugin_LTLIBRARIES = libgstvalve.la
libgstvalve_la_SOURCES = gstvalve.c gstvalve.h
libgstvalve_la_CFLAGS = $(GST_CFLAGS)
libgstvalve_la_LIBADD = $(GST_LIBS)
libgstvalve_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstvalve_la_LIBTOOLFLAGS = --tag=disable-static

View file

@ -1,284 +0,0 @@
/* GStreamer
* Copyright 2007-2009 Collabora Ltd
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
* Copyright 2007-2009 Nokia Corporation
*
* 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.
*
*/
/**
* SECTION:element-valve
*
* The valve is a simple element that drops buffers when the #GstValve::drop
* property is set to %TRUE and lets then through otherwise.
*
* Any downstream error received while the #GstValve::drop property is %FALSE
* is ignored. So downstream element can be set to %GST_STATE_NULL and removed,
* without using pad blocking.
*
* Last reviewed on 2008-02-10 (0.10.11)
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstvalve.h"
#include <string.h>
GST_DEBUG_CATEGORY (valve_debug);
#define GST_CAT_DEFAULT (valve_debug)
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
/* Valve signals and args */
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum
{
ARG_0,
ARG_DROP,
};
static void gst_valve_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_valve_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
static gboolean gst_valve_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_valve_buffer_alloc (GstPad * pad, guint64 offset,
guint size, GstCaps * caps, GstBuffer ** buf);
static GstFlowReturn gst_valve_chain (GstPad * pad, GstBuffer * buffer);
static GstCaps *gst_valve_getcaps (GstPad * pad);
#define _do_init(bla) \
GST_DEBUG_CATEGORY_INIT (valve_debug, "valve", 0, "Valve");
GST_BOILERPLATE_FULL (GstValve, gst_valve, GstElement,
GST_TYPE_ELEMENT, _do_init);
static void
gst_valve_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_set_details_simple (element_class, "Valve element",
"Filter",
"This element drops all packets when drop is TRUE",
"Olivier Crete <olivier.crete@collabora.co.uk>");
}
static void
gst_valve_class_init (GstValveClass * klass)
{
GObjectClass *gobject_class;
gobject_class = (GObjectClass *) klass;
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_valve_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_valve_get_property);
g_object_class_install_property (gobject_class, ARG_DROP,
g_param_spec_boolean ("drop",
"Drops all buffers if TRUE",
"If this property if TRUE, the element will drop all buffers, "
"if its FALSE, it will let them through",
FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void
gst_valve_init (GstValve * valve, GstValveClass * klass)
{
valve->drop = FALSE;
valve->discont = FALSE;
valve->srcpad = gst_pad_new_from_static_template (&srctemplate, "src");
gst_pad_set_getcaps_function (valve->srcpad,
GST_DEBUG_FUNCPTR (gst_valve_getcaps));
gst_element_add_pad (GST_ELEMENT (valve), valve->srcpad);
valve->sinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink");
gst_pad_set_chain_function (valve->sinkpad,
GST_DEBUG_FUNCPTR (gst_valve_chain));
gst_pad_set_event_function (valve->sinkpad,
GST_DEBUG_FUNCPTR (gst_valve_event));
gst_pad_set_bufferalloc_function (valve->sinkpad,
GST_DEBUG_FUNCPTR (gst_valve_buffer_alloc));
gst_pad_set_getcaps_function (valve->sinkpad,
GST_DEBUG_FUNCPTR (gst_valve_getcaps));
gst_element_add_pad (GST_ELEMENT (valve), valve->sinkpad);
}
static void
gst_valve_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec)
{
GstValve *valve = GST_VALVE (object);
switch (prop_id) {
case ARG_DROP:
g_atomic_int_set (&valve->drop, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_valve_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec)
{
GstValve *valve = GST_VALVE (object);
switch (prop_id) {
case ARG_DROP:
g_value_set_boolean (value, g_atomic_int_get (&valve->drop));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static GstFlowReturn
gst_valve_chain (GstPad * pad, GstBuffer * buffer)
{
GstValve *valve = GST_VALVE (GST_OBJECT_PARENT (pad));
GstFlowReturn ret = GST_FLOW_OK;
if (g_atomic_int_get (&valve->drop)) {
gst_buffer_unref (buffer);
valve->discont = TRUE;
} else {
if (valve->discont) {
buffer = gst_buffer_make_metadata_writable (buffer);
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
}
ret = gst_pad_push (valve->srcpad, buffer);
}
/* Ignore errors if "drop" was changed while the thread was blocked
* downwards
*/
if (g_atomic_int_get (&valve->drop))
ret = GST_FLOW_OK;
return ret;
}
static gboolean
gst_valve_event (GstPad * pad, GstEvent * event)
{
GstValve *valve = GST_VALVE (gst_pad_get_parent_element (pad));
gboolean ret = TRUE;
if (g_atomic_int_get (&valve->drop))
gst_event_unref (event);
else
ret = gst_pad_push_event (valve->srcpad, event);
/* Ignore errors if "drop" was changed while the thread was blocked
* downwards.
*/
if (g_atomic_int_get (&valve->drop))
ret = TRUE;
gst_object_unref (valve);
return ret;
}
static GstFlowReturn
gst_valve_buffer_alloc (GstPad * pad, guint64 offset, guint size,
GstCaps * caps, GstBuffer ** buf)
{
GstValve *valve = GST_VALVE (gst_pad_get_parent_element (pad));
GstFlowReturn ret = GST_FLOW_OK;
if (g_atomic_int_get (&valve->drop))
*buf = NULL;
else
ret = gst_pad_alloc_buffer (valve->srcpad, offset, size, caps, buf);
/* Ignore errors if "drop" was changed while the thread was blocked
* downwards
*/
if (g_atomic_int_get (&valve->drop))
ret = GST_FLOW_OK;
gst_object_unref (valve);
return ret;
}
static GstCaps *
gst_valve_getcaps (GstPad * pad)
{
GstValve *valve = GST_VALVE (gst_pad_get_parent (pad));
GstCaps *caps;
if (pad == valve->sinkpad)
caps = gst_pad_peer_get_caps (valve->srcpad);
else
caps = gst_pad_peer_get_caps (valve->sinkpad);
if (caps == NULL)
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
gst_object_unref (valve);
return caps;
}
static gboolean
plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "valve",
GST_RANK_MARGINAL, GST_TYPE_VALVE);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"valve",
"Valve",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)

View file

@ -1,82 +0,0 @@
/*
* Farsight Voice+Video library
*
* Copyright 2007 Collabora Ltd,
* Copyright 2007 Nokia Corporation
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
*
* 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_VALVE_H__
#define __GST_VALVE_H__
#include <gst/gst.h>
G_BEGIN_DECLS
/* #define's don't like whitespacey bits */
#define GST_TYPE_VALVE \
(gst_valve_get_type())
#define GST_VALVE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), \
GST_TYPE_VALVE,GstValve))
#define GST_VALVE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), \
GST_TYPE_VALVE,GstValveClass))
#define GST_IS_VALVE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VALVE))
#define GST_IS_VALVE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VALVE))
typedef struct _GstValve GstValve;
typedef struct _GstValveClass GstValveClass;
typedef struct _GstValvePrivate GstValvePrivate;
/**
* GstValve:
*
* The private valve structure
*/
struct _GstValve
{
/*< private >*/
GstElement parent;
/* atomic boolean */
volatile gint drop;
/* Protected by the stream lock */
gboolean discont;
GstPad *srcpad;
GstPad *sinkpad;
/*< private > */
gpointer _gst_reserved[GST_PADDING];
};
struct _GstValveClass
{
GstElementClass parent_class;
/*< private > */
gpointer _gst_reserved[GST_PADDING];
};
GType gst_valve_get_type (void);
G_END_DECLS
#endif /* __GST_VALVE_H__ */

View file

@ -171,7 +171,6 @@ check_PROGRAMS = \
$(check_mimic) \
elements/rtpmux \
$(check_schro) \
elements/valve \
$(check_vp8) \
$(check_zbar) \
$(check_orc) \
@ -235,9 +234,6 @@ elements_kate_LDADD = $(GST_BASE_LIBS) $(LDADD)
elements_rtpmux_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(AM_CFLAGS)
elements_rtpmux_LDADD = $(GST_BASE_LIBS) $(LDADD) -lgstrtp-0.10
elements_valve_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(AM_CFLAGS)
elements_valve_LDADD = $(GST_BASE_LIBS) $(LDADD) -lgstrtp-0.10
elements_assrender_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(AM_CFLAGS)
elements_assrender_LDADD = $(GST_BASE_LIBS) $(LDADD) -lgstvideo-0.10 -lgstapp-0.10

View file

@ -38,7 +38,6 @@ selector
spectrum
timidity
y4menc
valve
videorecordingbin
viewfinderbin
vp8dec

View file

@ -1,135 +0,0 @@
/* GStreamer
*
* unit test for the valve element
*
* Copyright 2009 Collabora Ltd.
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
* Copyright 2009 Nokia Corp.
*
* 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 <gst/check/gstcheck.h>
#include <gst/rtp/gstrtpbuffer.h>
#include <gst/gst.h>
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int"));
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int"));
gboolean event_received = FALSE;
gboolean buffer_allocated = FALSE;
static gboolean
event_func (GstPad * pad, GstEvent * event)
{
event_received = TRUE;
gst_event_unref (event);
return TRUE;
}
static GstFlowReturn
bufferalloc_func (GstPad * pad, guint64 offset, guint size, GstCaps * caps,
GstBuffer ** buf)
{
buffer_allocated = TRUE;
*buf = gst_buffer_new_and_alloc (size);
GST_BUFFER_OFFSET (*buf) = offset;
gst_buffer_set_caps (*buf, caps);
return GST_FLOW_OK;
}
GST_START_TEST (test_valve_basic)
{
GstElement *valve;
GstPad *sink;
GstPad *src;
GstBuffer *buf;
GstCaps *caps;
valve = gst_check_setup_element ("valve");
sink = gst_check_setup_sink_pad_by_name (valve, &sinktemplate, "src");
src = gst_check_setup_src_pad_by_name (valve, &srctemplate, "sink");
gst_pad_set_event_function (sink, event_func);
gst_pad_set_bufferalloc_function (sink, bufferalloc_func);
gst_pad_set_active (src, TRUE);
gst_pad_set_active (sink, TRUE);
gst_element_set_state (valve, GST_STATE_PLAYING);
g_object_set (valve, "drop", FALSE, NULL);
fail_unless (gst_pad_push_event (src, gst_event_new_eos ()) == TRUE);
fail_unless (event_received == TRUE);
fail_unless (gst_pad_alloc_buffer (src, 0, 10, NULL, &buf) == GST_FLOW_OK);
fail_unless (buffer_allocated == TRUE);
gst_buffer_unref (buf);
fail_unless (gst_pad_push (src, gst_buffer_new ()) == GST_FLOW_OK);
fail_unless (gst_pad_push (src, gst_buffer_new ()) == GST_FLOW_OK);
fail_unless (g_list_length (buffers) == 2);
caps = gst_pad_get_caps (src);
fail_unless (caps && gst_caps_is_equal (caps,
gst_pad_get_pad_template_caps (src)));
gst_caps_unref (caps);
gst_check_drop_buffers ();
event_received = buffer_allocated = FALSE;
g_object_set (valve, "drop", TRUE, NULL);
fail_unless (gst_pad_push_event (src, gst_event_new_eos ()) == TRUE);
fail_unless (event_received == FALSE);
fail_unless (gst_pad_alloc_buffer (src, 0, 10, NULL, &buf) == GST_FLOW_OK);
fail_unless (buffer_allocated == FALSE);
gst_buffer_unref (buf);
fail_unless (gst_pad_push (src, gst_buffer_new ()) == GST_FLOW_OK);
fail_unless (gst_pad_push (src, gst_buffer_new ()) == GST_FLOW_OK);
fail_unless (buffers == NULL);
caps = gst_pad_get_caps (src);
fail_unless (caps && gst_caps_is_equal (caps,
gst_pad_get_pad_template_caps (src)));
gst_caps_unref (caps);
gst_pad_set_active (src, FALSE);
gst_pad_set_active (sink, FALSE);
gst_check_teardown_src_pad (valve);
gst_check_teardown_sink_pad (valve);
gst_check_teardown_element (valve);
}
GST_END_TEST;
static Suite *
valve_suite (void)
{
Suite *s = suite_create ("valve");
TCase *tc_chain;
tc_chain = tcase_create ("valve_basic");
tcase_add_test (tc_chain, test_valve_basic);
suite_add_tcase (s, tc_chain);
return s;
}
GST_CHECK_MAIN (valve)