Пример #1
0
static GstEncodingProfile *
make_encoding_profile (gchar * audio, gchar * video, gchar * video_restriction,
    gchar * audio_preset, gchar * video_preset, gchar * container)
{
  GstEncodingContainerProfile *profile;
  GstEncodingProfile *stream;
  GstCaps *caps;

  caps = gst_caps_from_string (container);
  profile =
      gst_encoding_container_profile_new ((gchar *) "ges-test4", NULL, caps,
      NULL);
  gst_caps_unref (caps);

  if (audio) {
    caps = gst_caps_from_string (audio);
    stream = (GstEncodingProfile *)
        gst_encoding_audio_profile_new (caps, audio_preset, NULL, 0);
    gst_encoding_container_profile_add_profile (profile, stream);
    gst_caps_unref (caps);
  }

  if (video) {
    caps = gst_caps_from_string (video);
    stream = (GstEncodingProfile *)
        gst_encoding_video_profile_new (caps, video_preset, NULL, 0);
    if (video_restriction)
      gst_encoding_profile_set_restriction (stream,
          gst_caps_from_string (video_restriction));
    gst_encoding_container_profile_add_profile (profile, stream);
    gst_caps_unref (caps);
  }

  return (GstEncodingProfile *) profile;
}
Пример #2
0
static void
_encoding_profile_set_property (GObject * object, guint prop_id,
    const GValue * value, GParamSpec * pspec)
{
  GstEncodingProfile *prof = (GstEncodingProfile *) object;

  switch (prop_id) {
    case PROP_RESTRICTION_CAPS:
      gst_encoding_profile_set_restriction (prof, gst_caps_copy
          (gst_value_get_caps (value)));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}