blob: f1952e8dcd2b9c78e1b385fea3b01656e1d324d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
From 647b180a8805f9f8b5fdd35c1bbc0a8e03d3e91f Mon Sep 17 00:00:00 2001
From: Arindam Nath <arindam.nath@amd.com>
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 <brijeshkumar.singh@amd.com>
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
---
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
|