From 647b180a8805f9f8b5fdd35c1bbc0a8e03d3e91f Mon Sep 17 00:00:00 2001 From: Arindam Nath Date: Fri, 31 Jul 2015 12:36:36 +0530 Subject: [PATCH 2/4] gstomxvideoenc: fix srcpad caps when scaling property is specified if scaling parameter is specified then use the scaling width and height to configure the encoder state. Signed-off-by: Brijesh Singh Signed-off-by: Arindam Nath --- omx/gstomxvideoenc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index 1a0ecea..c372a0d 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -805,6 +805,14 @@ gst_omx_video_enc_handle_output_frame (GstOMXVideoEnc * self, GstOMXPort * port, gst_video_encoder_set_output_state (GST_VIDEO_ENCODER (self), caps, self->input_state); state->codec_data = codec_data; + if (GST_OMX_VIDEO_ENC(self)->scaling_width != + GST_OMX_VIDEO_ENC_SCALING_WIDTH_DEFAULT || + GST_OMX_VIDEO_ENC(self)->scaling_height != + GST_OMX_VIDEO_ENC_SCALING_HEIGHT_DEFAULT) { + state->info.width = self->scaling_width; + state->info.height = self->scaling_height; + } + if (!gst_video_encoder_negotiate (GST_VIDEO_ENCODER (self))) { gst_video_codec_frame_unref (frame); return GST_FLOW_NOT_NEGOTIATED; @@ -928,6 +936,11 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self) state = gst_video_encoder_set_output_state (GST_VIDEO_ENCODER (self), caps, self->input_state); + if (self->scaling_width != GST_OMX_VIDEO_ENC_SCALING_WIDTH_DEFAULT || + self->scaling_height != GST_OMX_VIDEO_ENC_SCALING_HEIGHT_DEFAULT) { + state->info.width = self->scaling_width; + state->info.height = self->scaling_height; + } gst_video_codec_state_unref (state); if (!gst_video_encoder_negotiate (GST_VIDEO_ENCODER (self))) { -- 1.9.1