/* Gets a compatible profile for the active codec */
static GstVaapiProfile
get_compatible_profile (GstVaapiEncoder * encoder)
{
  const GstVaapiEncoderClassData *const cdata =
      GST_VAAPI_ENCODER_GET_CLASS (encoder)->class_data;
  GstVaapiProfile profile;
  GArray *profiles;
  guint i;

  profiles = gst_vaapi_display_get_encode_profiles (encoder->display);
  if (!profiles)
    return GST_VAAPI_PROFILE_UNKNOWN;

  // Pick a profile matching the class codec
  for (i = 0; i < profiles->len; i++) {
    profile = g_array_index (profiles, GstVaapiProfile, i);
    if (gst_vaapi_profile_get_codec (profile) == cdata->codec)
      break;
  }
  if (i == profiles->len)
    profile = GST_VAAPI_PROFILE_UNKNOWN;

  g_array_unref (profiles);
  return profile;
}
static void
dump_info(GstVaapiDisplay *display)
{
    GArray *profiles, *formats;

    profiles = gst_vaapi_display_get_decode_profiles(display);
    if (!profiles)
        g_error("could not get VA decode profiles");

    print_profiles(profiles, "decoders");
    g_array_unref(profiles);

    profiles = gst_vaapi_display_get_encode_profiles(display);
    if (!profiles)
        g_error("could not get VA encode profiles");

    print_profiles(profiles, "encoders");
    g_array_unref(profiles);

    formats = gst_vaapi_display_get_image_formats(display);
    if (!formats)
        g_error("could not get VA image formats");

    print_formats(formats, "image");
    g_array_unref(formats);

    formats = gst_vaapi_display_get_subpicture_formats(display);
    if (!formats)
        g_error("could not get VA subpicture formats");

    print_formats(formats, "subpicture");
    g_array_unref(formats);

    dump_properties(display);
}
Beispiel #3
0
static GArray *
display_get_encoder_codecs (GstVaapiDisplay * display)
{
  GArray *profiles, *codecs;

  profiles = gst_vaapi_display_get_encode_profiles (display);
  if (!profiles)
    return NULL;

  codecs = profiles_get_codecs (profiles);
  g_array_unref (profiles);
  return codecs;
}