mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
videoencoders: use template subset check for accept-caps
It is faster than doing a query that propagates downstream and should be enough Elements: jpegenc, pngenc, vp8enc, vp9enc, y4menc
This commit is contained in:
parent
a39bebb5fe
commit
1b27badcfd
5 changed files with 8 additions and 0 deletions
|
@ -283,6 +283,8 @@ gst_jpegenc_term_destination (j_compress_ptr cinfo)
|
||||||
static void
|
static void
|
||||||
gst_jpegenc_init (GstJpegEnc * jpegenc)
|
gst_jpegenc_init (GstJpegEnc * jpegenc)
|
||||||
{
|
{
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (jpegenc));
|
||||||
|
|
||||||
/* setup jpeglib */
|
/* setup jpeglib */
|
||||||
memset (&jpegenc->cinfo, 0, sizeof (jpegenc->cinfo));
|
memset (&jpegenc->cinfo, 0, sizeof (jpegenc->cinfo));
|
||||||
memset (&jpegenc->jerr, 0, sizeof (jpegenc->jerr));
|
memset (&jpegenc->jerr, 0, sizeof (jpegenc->jerr));
|
||||||
|
|
|
@ -199,6 +199,8 @@ done:
|
||||||
static void
|
static void
|
||||||
gst_pngenc_init (GstPngEnc * pngenc)
|
gst_pngenc_init (GstPngEnc * pngenc)
|
||||||
{
|
{
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (pngenc));
|
||||||
|
|
||||||
/* init settings */
|
/* init settings */
|
||||||
pngenc->png_struct_ptr = NULL;
|
pngenc->png_struct_ptr = NULL;
|
||||||
pngenc->png_info_ptr = NULL;
|
pngenc->png_info_ptr = NULL;
|
||||||
|
|
|
@ -726,6 +726,7 @@ gst_vp8_enc_init (GstVP8Enc * gst_vp8_enc)
|
||||||
vpx_codec_err_t status;
|
vpx_codec_err_t status;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (gst_vp8_enc, "init");
|
GST_DEBUG_OBJECT (gst_vp8_enc, "init");
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (gst_vp8_enc));
|
||||||
|
|
||||||
status =
|
status =
|
||||||
vpx_codec_enc_config_default (&vpx_codec_vp8_cx_algo, &gst_vp8_enc->cfg,
|
vpx_codec_enc_config_default (&vpx_codec_vp8_cx_algo, &gst_vp8_enc->cfg,
|
||||||
|
|
|
@ -698,6 +698,7 @@ gst_vp9_enc_init (GstVP9Enc * gst_vp9_enc)
|
||||||
vpx_codec_err_t status;
|
vpx_codec_err_t status;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (gst_vp9_enc, "init");
|
GST_DEBUG_OBJECT (gst_vp9_enc, "init");
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (gst_vp9_enc));
|
||||||
|
|
||||||
status =
|
status =
|
||||||
vpx_codec_enc_config_default (&vpx_codec_vp9_cx_algo, &gst_vp9_enc->cfg,
|
vpx_codec_enc_config_default (&vpx_codec_vp9_cx_algo, &gst_vp9_enc->cfg,
|
||||||
|
|
|
@ -114,6 +114,8 @@ gst_y4m_encode_class_init (GstY4mEncodeClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_y4m_encode_init (GstY4mEncode * filter)
|
gst_y4m_encode_init (GstY4mEncode * filter)
|
||||||
{
|
{
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (filter));
|
||||||
|
|
||||||
/* init properties */
|
/* init properties */
|
||||||
gst_y4m_encode_reset (filter);
|
gst_y4m_encode_reset (filter);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue