summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrijesh Singh <brijeshkumar.singh@amd.com>2015-01-15 20:34:56 -0500
committerfedora21 <fedora21@localhost.amd.com>2015-02-05 16:49:48 -0500
commitce180b46b089243989e456b6e5e9ceb947456e8a (patch)
tree9245e36982f83475d08d002e1fe21b1b42d4536d
parentb5379e83f90ab4adf8d6aa338d35c9392be13fdb (diff)
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 <brijeshkumar.singh@amd.com>
-rw-r--r--omx/gstomxvideoenc.c13
1 files changed, 13 insertions, 0 deletions
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))) {