mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-06 10:42:22 +00:00
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.
This commit is contained in:
parent
fa2d98afe2
commit
a2fde272f5
1 changed files with 5 additions and 1 deletions
|
@ -136,6 +136,7 @@ gst_pnmenc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state)
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
GstVideoInfo *info;
|
GstVideoInfo *info;
|
||||||
GstVideoCodecState *output_state;
|
GstVideoCodecState *output_state;
|
||||||
|
const gchar *mime_type = NULL;
|
||||||
|
|
||||||
pnmenc = GST_PNMENC (encoder);
|
pnmenc = GST_PNMENC (encoder);
|
||||||
info = &state->info;
|
info = &state->info;
|
||||||
|
@ -144,15 +145,18 @@ gst_pnmenc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state)
|
||||||
case GST_VIDEO_FORMAT_RGB:
|
case GST_VIDEO_FORMAT_RGB:
|
||||||
pnmenc->info.max = 255;
|
pnmenc->info.max = 255;
|
||||||
pnmenc->info.type = GST_PNM_TYPE_PIXMAP;
|
pnmenc->info.type = GST_PNM_TYPE_PIXMAP;
|
||||||
|
mime_type = MIME_PM;
|
||||||
break;
|
break;
|
||||||
case GST_VIDEO_FORMAT_GRAY8:
|
case GST_VIDEO_FORMAT_GRAY8:
|
||||||
pnmenc->info.max = 255;
|
pnmenc->info.max = 255;
|
||||||
pnmenc->info.type = GST_PNM_TYPE_GRAYMAP;
|
pnmenc->info.type = GST_PNM_TYPE_GRAYMAP;
|
||||||
|
mime_type = MIME_GM;
|
||||||
break;
|
break;
|
||||||
case GST_VIDEO_FORMAT_GRAY16_BE:
|
case GST_VIDEO_FORMAT_GRAY16_BE:
|
||||||
case GST_VIDEO_FORMAT_GRAY16_LE:
|
case GST_VIDEO_FORMAT_GRAY16_LE:
|
||||||
pnmenc->info.max = 65535;
|
pnmenc->info.max = 65535;
|
||||||
pnmenc->info.type = GST_PNM_TYPE_GRAYMAP;
|
pnmenc->info.type = GST_PNM_TYPE_GRAYMAP;
|
||||||
|
mime_type = MIME_GM;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
|
@ -168,7 +172,7 @@ gst_pnmenc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state)
|
||||||
|
|
||||||
output_state =
|
output_state =
|
||||||
gst_video_encoder_set_output_state (encoder,
|
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);
|
gst_video_codec_state_unref (output_state);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
Loading…
Reference in a new issue