mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-03 10:43:55 +00:00
androidmedia: Don't query supported color formats for non-video codecs
This commit is contained in:
parent
95dd8d9662
commit
90c4a6ecd0
1 changed files with 39 additions and 38 deletions
|
@ -1605,10 +1605,8 @@ scan_codecs (GstPlugin * plugin)
|
||||||
const gchar *supported_type_str = NULL;
|
const gchar *supported_type_str = NULL;
|
||||||
jobject capabilities = NULL;
|
jobject capabilities = NULL;
|
||||||
jclass capabilities_class = NULL;
|
jclass capabilities_class = NULL;
|
||||||
jfieldID color_formats_id, profile_levels_id;
|
jfieldID profile_levels_id, color_formats_id;
|
||||||
jobject color_formats = NULL;
|
|
||||||
jobject profile_levels = NULL;
|
jobject profile_levels = NULL;
|
||||||
jint *color_formats_elems = NULL;
|
|
||||||
jsize n_elems, k;
|
jsize n_elems, k;
|
||||||
|
|
||||||
gst_codec_type = &gst_codec_info->supported_types[j];
|
gst_codec_type = &gst_codec_info->supported_types[j];
|
||||||
|
@ -1668,42 +1666,45 @@ scan_codecs (GstPlugin * plugin)
|
||||||
goto next_supported_type;
|
goto next_supported_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
color_formats =
|
|
||||||
(*env)->GetObjectField (env, capabilities, color_formats_id);
|
|
||||||
if ((*env)->ExceptionCheck (env)) {
|
|
||||||
GST_ERROR ("Failed to get color formats");
|
|
||||||
(*env)->ExceptionDescribe (env);
|
|
||||||
(*env)->ExceptionClear (env);
|
|
||||||
valid_codec = FALSE;
|
|
||||||
goto next_supported_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
n_elems = (*env)->GetArrayLength (env, color_formats);
|
|
||||||
if ((*env)->ExceptionCheck (env)) {
|
|
||||||
GST_ERROR ("Failed to get color formats array length");
|
|
||||||
(*env)->ExceptionDescribe (env);
|
|
||||||
(*env)->ExceptionClear (env);
|
|
||||||
valid_codec = FALSE;
|
|
||||||
goto next_supported_type;
|
|
||||||
}
|
|
||||||
gst_codec_type->n_color_formats = n_elems;
|
|
||||||
gst_codec_type->color_formats = g_new0 (gint, n_elems);
|
|
||||||
color_formats_elems =
|
|
||||||
(*env)->GetIntArrayElements (env, color_formats, NULL);
|
|
||||||
if ((*env)->ExceptionCheck (env)) {
|
|
||||||
GST_ERROR ("Failed to get color format elements");
|
|
||||||
(*env)->ExceptionDescribe (env);
|
|
||||||
(*env)->ExceptionClear (env);
|
|
||||||
valid_codec = FALSE;
|
|
||||||
goto next_supported_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (k = 0; k < n_elems; k++) {
|
|
||||||
GST_INFO ("Color format %d: 0x%x", k, color_formats_elems[k]);
|
|
||||||
gst_codec_type->color_formats[k] = color_formats_elems[k];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_str_has_prefix (gst_codec_type->mime, "video/")) {
|
if (g_str_has_prefix (gst_codec_type->mime, "video/")) {
|
||||||
|
jobject color_formats = NULL;
|
||||||
|
jint *color_formats_elems = NULL;
|
||||||
|
|
||||||
|
color_formats =
|
||||||
|
(*env)->GetObjectField (env, capabilities, color_formats_id);
|
||||||
|
if ((*env)->ExceptionCheck (env)) {
|
||||||
|
GST_ERROR ("Failed to get color formats");
|
||||||
|
(*env)->ExceptionDescribe (env);
|
||||||
|
(*env)->ExceptionClear (env);
|
||||||
|
valid_codec = FALSE;
|
||||||
|
goto next_supported_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
n_elems = (*env)->GetArrayLength (env, color_formats);
|
||||||
|
if ((*env)->ExceptionCheck (env)) {
|
||||||
|
GST_ERROR ("Failed to get color formats array length");
|
||||||
|
(*env)->ExceptionDescribe (env);
|
||||||
|
(*env)->ExceptionClear (env);
|
||||||
|
valid_codec = FALSE;
|
||||||
|
goto next_supported_type;
|
||||||
|
}
|
||||||
|
gst_codec_type->n_color_formats = n_elems;
|
||||||
|
gst_codec_type->color_formats = g_new0 (gint, n_elems);
|
||||||
|
color_formats_elems =
|
||||||
|
(*env)->GetIntArrayElements (env, color_formats, NULL);
|
||||||
|
if ((*env)->ExceptionCheck (env)) {
|
||||||
|
GST_ERROR ("Failed to get color format elements");
|
||||||
|
(*env)->ExceptionDescribe (env);
|
||||||
|
(*env)->ExceptionClear (env);
|
||||||
|
valid_codec = FALSE;
|
||||||
|
goto next_supported_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (k = 0; k < n_elems; k++) {
|
||||||
|
GST_INFO ("Color format %d: 0x%x", k, color_formats_elems[k]);
|
||||||
|
gst_codec_type->color_formats[k] = color_formats_elems[k];
|
||||||
|
}
|
||||||
|
|
||||||
if (!n_elems) {
|
if (!n_elems) {
|
||||||
GST_ERROR ("No supported color formats for video codec");
|
GST_ERROR ("No supported color formats for video codec");
|
||||||
valid_codec = FALSE;
|
valid_codec = FALSE;
|
||||||
|
|
Loading…
Reference in a new issue