avcodecmap: add mapping for Hap video codec
Decoder works, encoder needs more work. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7717>
This commit is contained in:
parent
7c3a468056
commit
9724227c09
@ -1219,6 +1219,7 @@ gst_ffmpeg_codecid_is_known (enum AVCodecID codec_id)
|
|||||||
case AV_CODEC_ID_APTX_HD:
|
case AV_CODEC_ID_APTX_HD:
|
||||||
case AV_CODEC_ID_AV1:
|
case AV_CODEC_ID_AV1:
|
||||||
case AV_CODEC_ID_M101:
|
case AV_CODEC_ID_M101:
|
||||||
|
case AV_CODEC_ID_HAP:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -2892,6 +2893,11 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
|
|||||||
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-m101",
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-m101",
|
||||||
NULL);
|
NULL);
|
||||||
break;
|
break;
|
||||||
|
case AV_CODEC_ID_HAP:
|
||||||
|
caps =
|
||||||
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-hap",
|
||||||
|
NULL);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
GST_DEBUG ("Unknown codec ID %d, please add mapping here", codec_id);
|
GST_DEBUG ("Unknown codec ID %d, please add mapping here", codec_id);
|
||||||
break;
|
break;
|
||||||
@ -3971,6 +3977,20 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case AV_CODEC_ID_HAP:{
|
||||||
|
const gchar *variant;
|
||||||
|
|
||||||
|
if ((variant = gst_structure_get_string (str, "variant"))) {
|
||||||
|
if (strlen (variant) == 4) {
|
||||||
|
GST_INFO ("HAP video variant '%s'", variant);
|
||||||
|
context->codec_tag =
|
||||||
|
GST_MAKE_FOURCC (variant[0], variant[1], variant[2], variant[3]);
|
||||||
|
} else {
|
||||||
|
GST_ERROR ("Unexpected HAP video variant '%s'", variant);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case AV_CODEC_ID_MSRLE:
|
case AV_CODEC_ID_MSRLE:
|
||||||
case AV_CODEC_ID_QTRLE:
|
case AV_CODEC_ID_QTRLE:
|
||||||
case AV_CODEC_ID_TSCC:
|
case AV_CODEC_ID_TSCC:
|
||||||
|
@ -1092,6 +1092,12 @@ gst_ffmpegvidenc_register (GstPlugin * plugin)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int rank = GST_RANK_SECONDARY;
|
||||||
|
|
||||||
|
if (!strcmp (in_plugin->name, "hap")) {
|
||||||
|
rank = GST_RANK_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
/* construct the type */
|
/* construct the type */
|
||||||
type_name = g_strdup_printf ("avenc_%s", in_plugin->name);
|
type_name = g_strdup_printf ("avenc_%s", in_plugin->name);
|
||||||
|
|
||||||
@ -1115,7 +1121,7 @@ gst_ffmpegvidenc_register (GstPlugin * plugin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gst_element_register (plugin, type_name, GST_RANK_SECONDARY, type)) {
|
if (!gst_element_register (plugin, type_name, rank, type)) {
|
||||||
g_free (type_name);
|
g_free (type_name);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user