videoencoders: use template subset check for accept-caps

It is faster than doing a query that propagates downstream and
should be enough

Elements: openjpegenc, schroenc, webpenc, pnmenc
This commit is contained in:
Thiago Santos 2015-08-16 07:06:44 -03:00
parent 07ee52db5d
commit a6dc5e19a2
4 changed files with 8 additions and 0 deletions

View file

@ -203,6 +203,8 @@ gst_openjpeg_enc_class_init (GstOpenJPEGEncClass * klass)
static void
gst_openjpeg_enc_init (GstOpenJPEGEnc * self)
{
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (self));
opj_set_default_encoder_parameters (&self->params);
self->params.cp_fixed_quality = 1;

View file

@ -240,6 +240,8 @@ gst_schro_enc_init (GstSchroEnc * schro_enc)
{
GST_DEBUG ("gst_schro_enc_init");
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (schro_enc));
/* Normally, we'd create the encoder in ->start(), but we use the
* encoder to store object properties. So it needs to be created
* here. */

View file

@ -163,6 +163,8 @@ gst_webp_enc_class_init (GstWebpEncClass * klass)
static void
gst_webp_enc_init (GstWebpEnc * webpenc)
{
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (webpenc));
webpenc->lossless = DEFAULT_LOSSLESS;
webpenc->quality = DEFAULT_QUALITY;
webpenc->speed = DEFAULT_SPEED;

View file

@ -111,6 +111,8 @@ gst_pnmenc_get_property (GObject * object, guint prop_id, GValue * value,
static void
gst_pnmenc_init (GstPnmenc * s)
{
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (s));
/* Set default encoding as RAW as ASCII takes up 4 time more bytes */
s->info.encoding = GST_PNM_ENCODING_RAW;
}