androidmedia: Add support for AV1

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4156>
This commit is contained in:
Sebastian Dröge 2023-03-11 14:59:58 +02:00 committed by GStreamer Marge Bot
parent bf903a05f4
commit fe580cacb8
3 changed files with 17 additions and 0 deletions

View file

@ -2405,6 +2405,15 @@ gst_amc_codec_info_to_caps (const GstAmcCodecInfo * codec_info,
"height", GST_TYPE_INT_RANGE, 16, 4096,
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
encoded_ret = gst_caps_merge_structure (encoded_ret, tmp);
} else if (strcmp (type->mime, "video/av01") == 0) {
tmp = gst_structure_new ("video/x-av1",
"stream-format", G_TYPE_STRING, "obu-stream",
"alignment", G_TYPE_STRING, "tu",
"width", GST_TYPE_INT_RANGE, 16, 4096,
"height", GST_TYPE_INT_RANGE, 16, 4096,
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
encoded_ret = gst_caps_merge_structure (encoded_ret, tmp);
} else if (strcmp (type->mime, "video/mpeg2") == 0) {
tmp = gst_structure_new ("video/mpeg",

View file

@ -323,6 +323,8 @@ caps_to_mime (GstCaps * caps)
return "video/x-vnd.on2.vp8";
} else if (strcmp (name, "video/x-vp9") == 0) {
return "video/x-vnd.on2.vp9";
} else if (strcmp (name, "video/x-av1") == 0) {
return "video/av01";
} else if (strcmp (name, "video/x-divx") == 0) {
return "video/mp4v-es";
}

View file

@ -232,6 +232,8 @@ create_amc_format (GstAmcVideoEnc * encoder, GstVideoCodecState * input_state,
mime = "video/x-vnd.on2.vp8";
} else if (strcmp (name, "video/x-vp9") == 0) {
mime = "video/x-vnd.on2.vp9";
} else if (strcmp (name, "video/x-av1") == 0) {
mime = "video/av01";
} else {
GST_ERROR_OBJECT (encoder, "Failed to convert caps(%s/...) to any mime",
name);
@ -459,6 +461,10 @@ caps_from_amc_format (GstAmcFormat * amc_format)
caps = gst_caps_new_empty_simple ("video/x-vp8");
} else if (strcmp (mime, "video/x-vnd.on2.vp9") == 0) {
caps = gst_caps_new_empty_simple ("video/x-vp9");
} else if (strcmp (mime, "video/av01") == 0) {
caps = gst_caps_new_simple ("video/x-av1",
"stream-format", G_TYPE_STRING, "obu-stream",
"alignment", G_TYPE_STRING, "tu", NULL);
}
gst_caps_set_simple (caps, "width", G_TYPE_INT, width,