mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pipewiresrc: remove useless fixate function
This commit is contained in:
parent
e44a5818ae
commit
1231b033e6
1 changed files with 0 additions and 50 deletions
|
|
@ -80,8 +80,6 @@ static GstStateChangeReturn
|
|||
gst_pipewire_src_change_state (GstElement * element, GstStateChange transition);
|
||||
|
||||
static gboolean gst_pipewire_src_negotiate (GstBaseSrc * basesrc);
|
||||
static GstCaps *gst_pipewire_src_src_fixate (GstBaseSrc * bsrc,
|
||||
GstCaps * caps);
|
||||
|
||||
static GstFlowReturn gst_pipewire_src_create (GstPushSrc * psrc,
|
||||
GstBuffer ** buffer);
|
||||
|
|
@ -277,7 +275,6 @@ gst_pipewire_src_class_init (GstPipeWireSrcClass * klass)
|
|||
gst_static_pad_template_get (&gst_pipewire_src_template));
|
||||
|
||||
gstbasesrc_class->negotiate = gst_pipewire_src_negotiate;
|
||||
gstbasesrc_class->fixate = gst_pipewire_src_src_fixate;
|
||||
gstbasesrc_class->unlock = gst_pipewire_src_unlock;
|
||||
gstbasesrc_class->unlock_stop = gst_pipewire_src_unlock_stop;
|
||||
gstbasesrc_class->start = gst_pipewire_src_start;
|
||||
|
|
@ -314,53 +311,6 @@ gst_pipewire_src_init (GstPipeWireSrc * src)
|
|||
|
||||
}
|
||||
|
||||
static GstCaps *
|
||||
gst_pipewire_src_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
|
||||
{
|
||||
GstStructure *structure;
|
||||
const gchar *name;
|
||||
|
||||
caps = gst_caps_make_writable (caps);
|
||||
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
name = gst_structure_get_name (structure);
|
||||
|
||||
if (g_str_has_prefix (name, "video/") || g_str_has_prefix (name, "image/")) {
|
||||
gst_structure_fixate_field_nearest_int (structure, "width", 320);
|
||||
gst_structure_fixate_field_nearest_int (structure, "height", 240);
|
||||
gst_structure_fixate_field_nearest_fraction (structure, "framerate", 30, 1);
|
||||
|
||||
|
||||
if (strcmp (name, "video/x-raw") == 0) {
|
||||
if (gst_structure_has_field (structure, "pixel-aspect-ratio"))
|
||||
gst_structure_fixate_field_nearest_fraction (structure,
|
||||
"pixel-aspect-ratio", 1, 1);
|
||||
else
|
||||
gst_structure_set (structure, "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
|
||||
NULL);
|
||||
if (gst_structure_has_field (structure, "colorimetry"))
|
||||
gst_structure_fixate_field_string (structure, "colorimetry", "bt601");
|
||||
if (gst_structure_has_field (structure, "chroma-site"))
|
||||
gst_structure_fixate_field_string (structure, "chroma-site", "mpeg2");
|
||||
|
||||
if (gst_structure_has_field (structure, "interlace-mode"))
|
||||
gst_structure_fixate_field_string (structure, "interlace-mode",
|
||||
"progressive");
|
||||
else
|
||||
gst_structure_set (structure, "interlace-mode", G_TYPE_STRING,
|
||||
"progressive", NULL);
|
||||
}
|
||||
} else if (gst_structure_has_name (structure, "audio/x-raw")) {
|
||||
gst_structure_fixate_field_string (structure, "format", "S16LE");
|
||||
gst_structure_fixate_field_nearest_int (structure, "channels", 2);
|
||||
gst_structure_fixate_field_nearest_int (structure, "rate", 44100);
|
||||
}
|
||||
|
||||
caps = GST_BASE_SRC_CLASS (parent_class)->fixate (bsrc, caps);
|
||||
|
||||
return caps;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GstPipeWireSrc *src;
|
||||
guint id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue