visual: use CAPS event to configure caps

This commit is contained in:
Wim Taymans 2011-05-09 15:37:46 +02:00
parent 5acab64178
commit 62536eaa6e
4 changed files with 138 additions and 122 deletions

View File

@ -1,4 +1,5 @@
GObject GObject
GInitiallyUnowned
GstObject GstObject
GstPad GstPad
GstPadTemplate GstPadTemplate
@ -12,16 +13,12 @@ GObject
GstPlayBaseBin GstPlayBaseBin
GstPlayBin GstPlayBin
GstPlayBin2 GstPlayBin2
GstDecodeBin2 GstEncodeBin
GstURIDecodeBin
GstDecodeBin GstDecodeBin
GstPlaySink GstPlaySink
GstSubtitleOverlay GstSubtitleOverlay
GstEncodeBin GstDecodeBin2
GstVorbisEnc GstURIDecodeBin
GstVorbisDec
GstVorbisParse
GstVorbisTag
GstVisual GstVisual
GstVisualjess GstVisualjess
GstVisualbumpscope GstVisualbumpscope
@ -32,44 +29,46 @@ GObject
GstVisuallv_scope GstVisuallv_scope
GstVisualoinksie GstVisualoinksie
GstBaseSrc GstBaseSrc
GstGnomeVFSSrc
GstGioBaseSrc
GstGioSrc
GstGioStreamSrc
GstPushSrc GstPushSrc
GstCddaBaseSrc GstCddaBaseSrc
GstCdParanoiaSrc GstCdParanoiaSrc
GstBaseAudioSrc GstBaseAudioSrc
GstAudioSrc GstAudioSrc
GstAlsaSrc GstAlsaSrc
GstV4lElement
GstV4lSrc
GstVideoTestSrc GstVideoTestSrc
GstTCPClientSrc GstTCPClientSrc
GstTCPServerSrc GstTCPServerSrc
GstGioBaseSrc
GstGioSrc
GstGioStreamSrc
GstGnomeVFSSrc
GstAppSrc GstAppSrc
GstAudioTestSrc GstAudioTestSrc
GstBaseSink GstBaseSink
GstGnomeVFSSink
GstGioBaseSink GstGioBaseSink
GstGioSink GstGioSink
GstGioStreamSink GstGioStreamSink
GstBaseAudioSink GstBaseAudioSink
GstAudioSink GstAudioSink
GstAlsaSink GstAlsaSink
GstGnomeVFSSink
GstVideoSink GstVideoSink
GstXImageSink
GstXvImageSink GstXvImageSink
GstXImageSink
GstAppSink GstAppSink
GstTCPClientSink GstTCPClientSink
GstMultiFdSink GstMultiFdSink
GstTCPServerSink GstTCPServerSink
GstTheoraDec
GstTheoraEnc
GstTheoraParse
GstBaseTextOverlay
GstTextOverlay GstTextOverlay
GstTimeOverlay GstTimeOverlay
GstClockOverlay GstClockOverlay
GstTextRender GstTextRender
GstAlsaMixerElement
GstTheoraDec
GstTheoraEnc
GstTheoraParse
GstOggDemux GstOggDemux
GstOggMux GstOggMux
GstOgmParse GstOgmParse
@ -78,22 +77,27 @@ GObject
GstOgmTextParse GstOgmTextParse
GstOggParse GstOggParse
GstOggAviParse GstOggAviParse
GstAdder GstVorbisEnc
GstVorbisDec
GstVorbisParse
GstVorbisTag
GstAlsaMixerElement
GstSubParse
GstSsaParse
GstBaseTransform GstBaseTransform
GstAudioFilter
GstVolume
GstVideoFilter GstVideoFilter
GstVideoScale GstVideoScale
GstFFMpegCsp GstFFMpegCsp
GstAudioFilter
GstVolume
GstAudioConvert
GstAudioResample GstAudioResample
GstVideoRate GstAudioConvert
GstStreamSelector
GstGDPDepay GstGDPDepay
GstGDPPay GstGDPPay
GstSubParse
GstSsaParse
GstAudioRate GstAudioRate
GstAdder
GstVideoRate
GstStreamSelector
GstBus GstBus
GstTask GstTask
GstTaskPool GstTaskPool
@ -105,10 +109,11 @@ GObject
GstRingBuffer GstRingBuffer
GstAudioSrcRingBuffer GstAudioSrcRingBuffer
GstAudioSinkRingBuffer GstAudioSinkRingBuffer
GstSignalObject
GstMixerTrack GstMixerTrack
GstMixerOptions
GstStreamInfo GstStreamInfo
GstEncodingProfile
GstTunerNorm
GstTunerChannel
GstColorBalanceChannel GstColorBalanceChannel
PangoFontMap PangoFontMap
PangoFcFontMap PangoFcFontMap
@ -120,14 +125,15 @@ GInterface
GTypePlugin GTypePlugin
GstChildProxy GstChildProxy
GstURIHandler GstURIHandler
GstTagSetter
GstPreset GstPreset
GstTagSetter
GstImplementsInterface GstImplementsInterface
GstMixer GstMixer
GstPropertyProbe GstPropertyProbe
GstNavigation GstNavigation
GstXOverlay GstXOverlay
GstColorBalance GstColorBalance
GstTuner
GstStreamVolume GstStreamVolume
PangoCairoFontMap PangoCairoFontMap
GFile GFile

View File

@ -3,28 +3,30 @@ GstPipeline GstChildProxy
GstPlayBaseBin GstChildProxy GstPlayBaseBin GstChildProxy
GstPlayBin GstChildProxy GstPlayBin GstChildProxy
GstPlayBin2 GstChildProxy GstStreamVolume GstPlayBin2 GstChildProxy GstStreamVolume
GstDecodeBin2 GstChildProxy GstEncodeBin GstChildProxy
GstURIDecodeBin GstChildProxy
GstDecodeBin GstChildProxy GstDecodeBin GstChildProxy
GstPlaySink GstChildProxy GstPlaySink GstChildProxy
GstSubtitleOverlay GstChildProxy GstSubtitleOverlay GstChildProxy
GstEncodeBin GstChildProxy GstDecodeBin2 GstChildProxy
GstVorbisEnc GstTagSetter GstPreset GstURIDecodeBin GstChildProxy
GstVorbisTag GstTagSetter GstGnomeVFSSrc GstURIHandler
GstGioSrc GstURIHandler
GstCddaBaseSrc GstURIHandler GstCddaBaseSrc GstURIHandler
GstCdParanoiaSrc GstURIHandler GstCdParanoiaSrc GstURIHandler
GstAlsaSrc GstImplementsInterface GstMixer GstPropertyProbe GstAlsaSrc GstImplementsInterface GstMixer GstPropertyProbe
GstGioSrc GstURIHandler GstV4lElement GstImplementsInterface GstTuner GstXOverlay GstColorBalance GstPropertyProbe
GstGnomeVFSSrc GstURIHandler GstV4lSrc GstImplementsInterface GstTuner GstXOverlay GstColorBalance GstPropertyProbe
GstAppSrc GstURIHandler GstAppSrc GstURIHandler
GstGnomeVFSSink GstURIHandler
GstGioSink GstURIHandler GstGioSink GstURIHandler
GstAlsaSink GstPropertyProbe GstAlsaSink GstPropertyProbe
GstGnomeVFSSink GstURIHandler
GstXImageSink GstImplementsInterface GstNavigation GstXOverlay
GstXvImageSink GstImplementsInterface GstNavigation GstXOverlay GstColorBalance GstPropertyProbe GstXvImageSink GstImplementsInterface GstNavigation GstXOverlay GstColorBalance GstPropertyProbe
GstXImageSink GstImplementsInterface GstNavigation GstXOverlay
GstAppSink GstURIHandler GstAppSink GstURIHandler
GstAlsaMixerElement GstImplementsInterface GstMixer GstPropertyProbe
GstTheoraEnc GstPreset GstTheoraEnc GstPreset
GstOggMux GstPreset GstOggMux GstPreset
GstVorbisEnc GstTagSetter GstPreset
GstVorbisTag GstTagSetter
GstAlsaMixerElement GstImplementsInterface GstMixer GstPropertyProbe
GstVolume GstImplementsInterface GstMixer GstStreamVolume GstVolume GstImplementsInterface GstMixer GstStreamVolume
PangoCairoFcFontMap PangoCairoFontMap PangoCairoFcFontMap PangoCairoFontMap

View File

@ -4,6 +4,7 @@ GstImplementsInterface GstElement
GstMixer GstImplementsInterface GstElement GstMixer GstImplementsInterface GstElement
GstXOverlay GstImplementsInterface GstElement GstXOverlay GstImplementsInterface GstElement
GstColorBalance GstImplementsInterface GstElement GstColorBalance GstImplementsInterface GstElement
GstTuner GstImplementsInterface GstElement
GstStreamVolume GObject GstStreamVolume GObject
PangoCairoFontMap PangoFontMap PangoCairoFontMap PangoFontMap
GFile GObject GFile GObject

View File

@ -215,7 +215,6 @@ gst_visual_init (GstVisual * visual)
{ {
/* create the sink and src pads */ /* create the sink and src pads */
visual->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); visual->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink");
gst_pad_set_setcaps_function (visual->sinkpad, gst_visual_sink_setcaps);
gst_pad_set_chain_function (visual->sinkpad, gst_visual_chain); gst_pad_set_chain_function (visual->sinkpad, gst_visual_chain);
gst_pad_set_event_function (visual->sinkpad, gst_visual_sink_event); gst_pad_set_event_function (visual->sinkpad, gst_visual_sink_event);
gst_element_add_pad (GST_ELEMENT (visual), visual->sinkpad); gst_element_add_pad (GST_ELEMENT (visual), visual->sinkpad);
@ -395,7 +394,7 @@ gst_vis_src_negotiate (GstVisual * visual)
GstStructure *structure; GstStructure *structure;
GstCaps *caps; GstCaps *caps;
GstQuery *query; GstQuery *query;
GstBufferPool *pool; GstBufferPool *pool = NULL;
guint size, min, max, prefix, alignment; guint size, min, max, prefix, alignment;
caps = gst_pad_get_caps (visual->srcpad); caps = gst_pad_get_caps (visual->srcpad);
@ -492,6 +491,14 @@ gst_visual_sink_event (GstPad * pad, GstEvent * event)
gst_visual_reset (visual); gst_visual_reset (visual);
res = gst_pad_push_event (visual->srcpad, event); res = gst_pad_push_event (visual->srcpad, event);
break; break;
case GST_EVENT_CAPS:
{
GstCaps *caps;
gst_event_parse_caps (event, &caps);
res = gst_visual_sink_setcaps (pad, caps);
break;
}
case GST_EVENT_NEWSEGMENT: case GST_EVENT_NEWSEGMENT:
{ {
GstFormat format; GstFormat format;
@ -514,7 +521,7 @@ gst_visual_sink_event (GstPad * pad, GstEvent * event)
break; break;
} }
default: default:
res = gst_pad_push_event (visual->srcpad, event); res = gst_pad_event_default (visual->srcpad, event);
break; break;
} }