예제 #1
0
GstElement *
kms_utils_create_convert_for_caps (const GstCaps * caps)
{
  if (kms_utils_caps_are_audio (caps)) {
    return gst_element_factory_make ("audioconvert", NULL);
  } else {
    return gst_element_factory_make ("videoconvert", NULL);
  }
}
예제 #2
0
GstElement *
kms_utils_create_mediator_element (const GstCaps * caps)
{
  if (kms_utils_caps_are_audio (caps)) {
    return gst_element_factory_make ("audioresample", NULL);
  } else {
    return gst_element_factory_make ("videoscale", NULL);
  }
}
예제 #3
0
static GstCaps *
kms_agnostic_bin2_get_raw_caps (const GstCaps * caps)
{
  GstCaps *raw_caps = NULL;

  if (kms_utils_caps_are_audio (caps)) {
    raw_caps = gst_static_caps_get (&static_raw_audio_caps);
  } else if (kms_utils_caps_are_video (caps)) {
    raw_caps = gst_static_caps_get (&static_raw_video_caps);
  }

  return raw_caps;
}
예제 #4
0
GstElement *
kms_utils_create_rate_for_caps (const GstCaps * caps)
{
  GstElement *rate;

  if (kms_utils_caps_are_audio (caps)) {
    rate = gst_element_factory_make ("audiorate", NULL);
    g_object_set (G_OBJECT (rate), "tolerance", GST_MSECOND * 100,
        "skip-to-first", TRUE, NULL);
  } else {
    rate = gst_element_factory_make ("videorate", NULL);
    g_object_set (G_OBJECT (rate), "average-period", GST_MSECOND * 200,
        "skip-to-first", TRUE, NULL);
  }

  return rate;
}