summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2004-03-06 04:51:15 +0000
committerDavid Schleef <ds@schleef.org>2004-03-06 04:51:15 +0000
commita6b4e965a83b42554347dc47efb373b09899dc9f (patch)
treee2c0ef88fb128d33570812855539339760b46160 /ext
parent1586deb83300784311573f63963436d2d39480bf (diff)
downloadgst-plugins-bad-a6b4e965a83b42554347dc47efb373b09899dc9f.tar.gz
gst-plugins-bad-a6b4e965a83b42554347dc47efb373b09899dc9f.tar.bz2
gst-plugins-bad-a6b4e965a83b42554347dc47efb373b09899dc9f.zip
ext/aalib/gstaasink.c: Add fixate function. (bug #131128)
Original commit message from CVS: * ext/aalib/gstaasink.c: (gst_aasink_fixate), (gst_aasink_init): Add fixate function. (bug #131128) * ext/sdl/sdlvideosink.c: (gst_sdlvideosink_init), (gst_sdlvideosink_fixate): Add fixate function. * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_link): Fix attempt to print a non-pointer using GST_PTR_FORMAT. * gst/wavparse/gstwavparse.c: (gst_wavparse_parse_fmt): Fix missing break that was causing ulaw to be interpreted as raw int.
Diffstat (limited to 'ext')
-rw-r--r--ext/sdl/sdlvideosink.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/sdl/sdlvideosink.c b/ext/sdl/sdlvideosink.c
index e882f97f..aada0eb3 100644
--- a/ext/sdl/sdlvideosink.c
+++ b/ext/sdl/sdlvideosink.c
@@ -65,6 +65,7 @@ static void gst_sdlvideosink_destroy (GstSDLVideoSink *sdl);
static GstPadLinkReturn
gst_sdlvideosink_sinkconnect (GstPad *pad,
const GstCaps *caps);
+static GstCaps * gst_sdlvideosink_fixate (GstPad *pad, const GstCaps *caps);
static void gst_sdlvideosink_chain (GstPad *pad,
GstData *data);
@@ -266,6 +267,8 @@ gst_sdlvideosink_init (GstSDLVideoSink *sdlvideosink)
gst_sdlvideosink_chain);
gst_pad_set_link_function (GST_VIDEOSINK_PAD (sdlvideosink),
gst_sdlvideosink_sinkconnect);
+ gst_pad_set_fixate_function (GST_VIDEOSINK_PAD (sdlvideosink),
+ gst_sdlvideosink_fixate);
sdlvideosink->width = -1;
sdlvideosink->height = -1;
@@ -506,6 +509,32 @@ gst_sdlvideosink_create (GstSDLVideoSink *sdlvideosink)
return TRUE;
}
+static GstCaps *
+gst_sdlvideosink_fixate (GstPad *pad, const GstCaps *caps)
+{
+ GstStructure *structure;
+ GstCaps *newcaps;
+
+ if (gst_caps_get_size (caps) > 1) return NULL;
+
+ newcaps = gst_caps_copy (caps);
+ structure = gst_caps_get_structure (newcaps, 0);
+
+ if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 320)) {
+ return newcaps;
+ }
+ if (gst_caps_structure_fixate_field_nearest_int (structure, "height", 240)) {
+ return newcaps;
+ }
+ if (gst_caps_structure_fixate_field_nearest_double (structure, "framerate",
+ 30.0)) {
+ return newcaps;
+ }
+
+ gst_caps_free (newcaps);
+ return NULL;
+}
+
static GstPadLinkReturn
gst_sdlvideosink_sinkconnect (GstPad *pad,
const GstCaps *vscapslist)