summaryrefslogtreecommitdiff
path: root/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c')
-rw-r--r--gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c b/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c
index ea43f7b..880c82e 100644
--- a/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c
+++ b/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c
@@ -476,6 +476,9 @@ static void gst_tividdec2_init(GstTIViddec2 *viddec2, GstTIViddec2Class *gclass)
viddec2->rtCodecThread = TRUE;
+ viddec2->width = 0;
+ viddec2->height = 0;
+
/* Initialize GValue members */
memset(&viddec2->framerate, 0, sizeof(GValue));
g_value_init(&viddec2->framerate, GST_TYPE_FRACTION);
@@ -635,6 +638,16 @@ static gboolean gst_tividdec2_set_sink_caps(GstPad *pad, GstCaps *caps)
framerateDen);
}
}
+
+ if (viddec2->width == 0 &&
+ !gst_structure_get_int(capStruct, "width", &viddec2->width)) {
+ viddec2->width = 0;
+ }
+
+ if (viddec2->height == 0 &&
+ !gst_structure_get_int(capStruct, "height", &viddec2->height)) {
+ viddec2->height = 0;
+ }
}
/* MPEG Decode */
@@ -708,10 +721,11 @@ static gboolean gst_tividdec2_set_sink_caps(GstPad *pad, GstCaps *caps)
if (!viddec2->engineName) {
viddec2->engineName = codec->CE_EngineName;
}
+
if (!viddec2->codecName) {
viddec2->codecName = codec->CE_CodecName;
}
-
+
gst_object_unref(viddec2);
GST_LOG("sink caps negotiation successful\n");
@@ -955,6 +969,7 @@ static GstFlowReturn gst_tividdec2_chain(GstPad * pad, GstBuffer * buf)
GstFlowReturn flow = GST_FLOW_OK;
gboolean checkResult;
+
/* If the decode thread aborted, signal it to let it know it's ok to
* shut down, and communicate the failure to the pipeline.
*/
@@ -1370,6 +1385,12 @@ static gboolean gst_tividdec2_codec_start (GstTIViddec2 *viddec2,
break;
}
+ /* If height and width is passed then configure codec params with this information */
+ if (viddec2->width > 0 && viddec2->height > 0) {
+ params.maxWidth = viddec2->width;
+ params.maxHeight = viddec2->height;
+ }
+
GST_LOG("opening video decoder \"%s\"\n", viddec2->codecName);
viddec2->hVd = Vdec2_create(viddec2->hEngine, (Char*)viddec2->codecName,
&params, &dynParams);