From a2fde272f511449d10da339f29ee297d950215bf Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Thu, 19 May 2016 01:04:36 +1000 Subject: [PATCH] pnmenc: Make output caps match the srcpad template Don't output 'image/pnm', which isn't even in the template caps. Instead, output a mime-type consistent with what we are encoding. --- gst/pnm/gstpnmenc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/pnm/gstpnmenc.c b/gst/pnm/gstpnmenc.c index 0d9ea17fd8..ff8e088532 100644 --- a/gst/pnm/gstpnmenc.c +++ b/gst/pnm/gstpnmenc.c @@ -136,6 +136,7 @@ gst_pnmenc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state) gboolean ret = TRUE; GstVideoInfo *info; GstVideoCodecState *output_state; + const gchar *mime_type = NULL; pnmenc = GST_PNMENC (encoder); info = &state->info; @@ -144,15 +145,18 @@ gst_pnmenc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state) case GST_VIDEO_FORMAT_RGB: pnmenc->info.max = 255; pnmenc->info.type = GST_PNM_TYPE_PIXMAP; + mime_type = MIME_PM; break; case GST_VIDEO_FORMAT_GRAY8: pnmenc->info.max = 255; pnmenc->info.type = GST_PNM_TYPE_GRAYMAP; + mime_type = MIME_GM; break; case GST_VIDEO_FORMAT_GRAY16_BE: case GST_VIDEO_FORMAT_GRAY16_LE: pnmenc->info.max = 65535; pnmenc->info.type = GST_PNM_TYPE_GRAYMAP; + mime_type = MIME_GM; break; default: ret = FALSE; @@ -168,7 +172,7 @@ gst_pnmenc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state) output_state = gst_video_encoder_set_output_state (encoder, - gst_caps_new_empty_simple ("image/pnm"), state); + gst_caps_new_empty_simple (mime_type), state); gst_video_codec_state_unref (output_state); done: