<div dir="ltr"><div><div><div>Hi,<br><br></div>I am using gst-omx encoder element to support hw accelerated code on my platform. In addition to encode the module also support scaling plus encode. I have added a new property in element to pass the resize parameter and its working as expected. But caps still have the old resolution as passed from upstream element. As per the gst plugin doc I am using gst_video_encoder_set_output_state() to change the caps resolution information. Can anyone comment on what I am missing here<br><br><pre><code>static void
gst_omx_video_enc_loop (GstOMXVideoEnc * self)
{</code></pre><br>....<br>...<br>.....<br>    caps = klass->get_caps (self, self->enc_out_port, self->input_state);<br>    if (!caps) {<br>      if (buf)<br>        gst_omx_port_release_buffer (self->enc_out_port, buf);<br>      GST_VIDEO_ENCODER_STREAM_UNLOCK (self);<br>      goto caps_failed;<br>    }<br><br>    GST_DEBUG_OBJECT (self, "Setting output state: %" GST_PTR_FORMAT, caps);<br><br>    state =<br>        gst_video_encoder_set_output_state (GST_VIDEO_ENCODER (self), caps,<br>        self->input_state);<br>     gst_caps_set_simple (state->caps, "width", G_TYPE_INT, 640, NULL);<br>     gst_caps_set_simple (state->caps, "height", G_TYPE_INT, 480, NULL);<br>    GST_DEBUG_OBJECT (self, "requesting caps : %" GST_PTR_FORMAT, state->caps);<br><br>    if (!gst_video_encoder_negotiate (GST_VIDEO_ENCODER (self))) {<br>      if (buf)<br>        gst_omx_port_release_buffer (self->enc_out_port, buf);<br>      GST_VIDEO_ENCODER_STREAM_UNLOCK (self);<br>      goto caps_failed;<br>    }<br><br>    GST_DEBUG_OBJECT (self, "final caps : %" GST_PTR_FORMAT, state->caps);<br>    GST_VIDEO_ENCODER_STREAM_UNLOCK (self);<br><br>....................<br><br>The output from GST_LOG is below<br><br>:gst_omx_video_enc_loop:<omxh264enc-omxh264enc0> Port settings have changed, updating caps<br>gst_omx_h264_enc_get_caps: caps is video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)baseline, level=(string)4.2 <br>0:00:00.253150223 19354 0x7f3c44002850 DEBUG            omxvideoenc gstomxvideoenc.c:924:gst_omx_video_enc_loop:<omxh264enc-omxh264enc0> Setting output state: video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)baseline, level=(string)4.2<br>0:00:00.253196485 19354 0x7f3c44002850 DEBUG            omxvideoenc gstomxvideoenc.c:931:gst_omx_video_enc_loop:<omxh264enc-omxh264enc0> Setting output state: video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)baseline, level=(string)4.2<br>0:00:00.253243548 19354 0x7f3c44002850 DEBUG            omxvideoenc gstomxvideoenc.c:940:gst_omx_video_enc_loop:<omxh264enc-omxh264enc0> before caps : video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)baseline, level=(string)4.2, width=(int)640, height=(int)480<br>0:00:00.253385517 19354 0x7f3c44002850 DEBUG            omxvideoenc gstomxvideoenc.c:949:gst_omx_video_enc_loop:<omxh264enc-omxh264enc0> final caps : video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)baseline, level=(string)4.2, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1<br><br><br></div><div>May be I am missing something in the doc, as per <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-GstVideoEncoder.html#gst-video-encoder-set-output-state">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-GstVideoEncoder.html#gst-video-encoder-set-output-state</a> , the subclass can override the resolution information in returned state but somehow its not working for me. <br></div><div><br></div><div>Any help is greatly appreciated. <br></div><div><br></div>Thanks<br></div>BK<br><br></div>