mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
sys/oss/gstosssrc.*: Cache probed caps, so _get_caps() during recording doesn't cause ioctl calls which may disrupt t...
Original commit message from CVS: Patch by: Mark Nauwelaerts <manauw skynet be> * sys/oss/gstosssrc.c: (gst_oss_src_init), (gst_oss_src_getcaps), (gst_oss_src_close): * sys/oss/gstosssrc.h: Cache probed caps, so _get_caps() during recording doesn't cause ioctl calls which may disrupt the recording (fixes #521875).
This commit is contained in:
parent
aec7206df9
commit
fd1c1295dc
3 changed files with 30 additions and 4 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2008-03-11 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
Patch by: Mark Nauwelaerts <manauw skynet be>
|
||||
|
||||
* sys/oss/gstosssrc.c: (gst_oss_src_init), (gst_oss_src_getcaps),
|
||||
(gst_oss_src_close):
|
||||
* sys/oss/gstosssrc.h:
|
||||
Cache probed caps, so _get_caps() during recording doesn't cause
|
||||
ioctl calls which may disrupt the recording (fixes #521875).
|
||||
|
||||
2008-03-11 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||
|
||||
* gst/qtdemux/qtdemux.c: (gst_qtdemux_perform_seek),
|
||||
|
|
|
@ -243,6 +243,7 @@ gst_oss_src_init (GstOssSrc * osssrc, GstOssSrcClass * g_class)
|
|||
osssrc->fd = -1;
|
||||
osssrc->device = g_strdup (device);
|
||||
osssrc->device_name = g_strdup (DEFAULT_DEVICE_NAME);
|
||||
osssrc->probed_caps = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -263,12 +264,23 @@ gst_oss_src_getcaps (GstBaseSrc * bsrc)
|
|||
osssrc = GST_OSS_SRC (bsrc);
|
||||
|
||||
if (osssrc->fd == -1) {
|
||||
caps = gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD
|
||||
(bsrc)));
|
||||
} else {
|
||||
caps = gst_oss_helper_probe_caps (osssrc->fd);
|
||||
GST_DEBUG_OBJECT (osssrc, "device not open, using template caps");
|
||||
return NULL; /* base class will get template caps for us */
|
||||
}
|
||||
|
||||
if (osssrc->probed_caps) {
|
||||
GST_LOG_OBJECT (osssrc, "Returning cached caps");
|
||||
return gst_caps_ref (osssrc->probed_caps);
|
||||
}
|
||||
|
||||
caps = gst_oss_helper_probe_caps (osssrc->fd);
|
||||
|
||||
if (caps) {
|
||||
osssrc->probed_caps = gst_caps_ref (caps);
|
||||
}
|
||||
|
||||
GST_INFO_OBJECT (osssrc, "returning caps %" GST_PTR_FORMAT, caps);
|
||||
|
||||
return caps;
|
||||
}
|
||||
|
||||
|
@ -395,6 +407,8 @@ gst_oss_src_close (GstAudioSrc * asrc)
|
|||
oss->mixer = NULL;
|
||||
}
|
||||
|
||||
gst_caps_replace (&oss->probed_caps, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,8 @@ struct _GstOssSrc {
|
|||
gchar *device;
|
||||
gchar *device_name;
|
||||
|
||||
GstCaps *probed_caps;
|
||||
|
||||
GstOssMixer *mixer;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue