mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
avcodecmap: handle simple and advanced-simple profile in MPEG4
Always enable 4MV flag for MPEG4 Pare the profile property and enable more features for advanced-simple profile. video/x-xvid is advanced-simple profile so enable more features. We now also support encoding of video/x-xvid so add this to the caps. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=651320
This commit is contained in:
parent
3dda75f493
commit
2ef3c94b82
1 changed files with 19 additions and 6 deletions
|
@ -1001,6 +1001,8 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
|
|||
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/mpeg",
|
||||
"mpegversion", G_TYPE_INT, 4, "systemstream", G_TYPE_BOOLEAN, FALSE,
|
||||
NULL);
|
||||
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
||||
encode, "video/x-xvid", NULL));
|
||||
if (encode) {
|
||||
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
||||
encode, "video/x-divx", "divxversion", G_TYPE_INT, 5, NULL));
|
||||
|
@ -1008,8 +1010,6 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
|
|||
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
||||
encode, "video/x-divx", "divxversion", GST_TYPE_INT_RANGE, 4,
|
||||
5, NULL));
|
||||
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
||||
encode, "video/x-xvid", NULL));
|
||||
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
||||
encode, "video/x-3ivx", NULL));
|
||||
}
|
||||
|
@ -2944,16 +2944,29 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
|
|||
{
|
||||
const gchar *mime = gst_structure_get_name (str);
|
||||
|
||||
context->flags |= CODEC_FLAG_4MV;
|
||||
|
||||
if (!strcmp (mime, "video/x-divx"))
|
||||
context->codec_tag = GST_MAKE_FOURCC ('D', 'I', 'V', 'X');
|
||||
else if (!strcmp (mime, "video/x-xvid"))
|
||||
else if (!strcmp (mime, "video/x-xvid")) {
|
||||
context->codec_tag = GST_MAKE_FOURCC ('X', 'V', 'I', 'D');
|
||||
else if (!strcmp (mime, "video/x-3ivx"))
|
||||
/* Advanced Simple Profile */
|
||||
context->flags |= CODEC_FLAG_GMC | CODEC_FLAG_QPEL;
|
||||
} else if (!strcmp (mime, "video/x-3ivx"))
|
||||
context->codec_tag = GST_MAKE_FOURCC ('3', 'I', 'V', '1');
|
||||
else if (!strcmp (mime, "video/mpeg"))
|
||||
else if (!strcmp (mime, "video/mpeg")) {
|
||||
const gchar *profile;
|
||||
|
||||
context->codec_tag = GST_MAKE_FOURCC ('m', 'p', '4', 'v');
|
||||
}
|
||||
|
||||
profile = gst_structure_get_string (str, "profile");
|
||||
if (profile) {
|
||||
if (g_strcmp0 (profile, "advanced-simple") == 0)
|
||||
context->flags |= CODEC_FLAG_GMC | CODEC_FLAG_QPEL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case AV_CODEC_ID_SVQ3:
|
||||
/* FIXME: this is a workaround for older gst-plugins releases
|
||||
|
|
Loading…
Reference in a new issue