Skip to content

Commit 80fcb44

Browse files
committed
Merge branch 'feature/add-multichannel-support-to-elements' into develop
2 parents 21c1429 + 967a113 commit 80fcb44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3937
-838
lines changed

ext/tiovx/gsttiovx.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@
6666
#include <gst/gst.h>
6767

6868
#include "gsttiovxcolorconvert.h"
69+
#include "gsttiovxdemux.h"
6970
#include "gsttiovxdlcolorblend.h"
7071
#include "gsttiovxdlpreproc.h"
7172
#include "gsttiovxisp.h"
7273
#include "gsttiovxldc.h"
7374
#include "gsttiovxmosaic.h"
7475
#include "gsttiovxmultiscaler.h"
76+
#include "gsttiovxmux.h"
7577
#include "gst-libs/gst/tiovx/gsttiovxutils.h"
7678

7779
/* entry point to initialize the plug-in
@@ -132,6 +134,20 @@ ti_ovx_init (GstPlugin * plugin)
132134
goto out;
133135
}
134136

137+
ret = gst_element_register (plugin, "tiovxmux", GST_RANK_NONE,
138+
GST_TYPE_TIOVX_MUX);
139+
if (!ret) {
140+
GST_ERROR ("Failed to register the tiovxmux element");
141+
goto out;
142+
}
143+
144+
ret = gst_element_register (plugin, "tiovxdemux", GST_RANK_NONE,
145+
GST_TYPE_TIOVX_DEMUX);
146+
if (!ret) {
147+
GST_ERROR ("Failed to register the tiovxdemux element");
148+
goto out;
149+
}
150+
135151
gst_tiovx_init_debug ();
136152

137153
ret = TRUE;

ext/tiovx/gsttiovxcolorconvert.c

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,35 @@ enum
110110
#define TIOVX_COLOR_CONVERT_SUPPORTED_FORMATS_SINK "{RGB, RGBx, NV12, NV21, UYVY, YUY2, I420}"
111111
#define TIOVX_COLOR_CONVERT_SUPPORTED_WIDTH "[1 , 8192]"
112112
#define TIOVX_COLOR_CONVERT_SUPPORTED_HEIGHT "[1 , 8192]"
113+
#define TIOVX_COLOR_CONVERT_SUPPORTED_CHANNELS "[1 , 16]"
113114

114115
/* Src caps */
115-
#define TIOVX_COLOR_CONVERT_STATIC_CAPS_SRC \
116-
"video/x-raw, " \
117-
"format = (string) " TIOVX_COLOR_CONVERT_SUPPORTED_FORMATS_SRC ", " \
118-
"width = " TIOVX_COLOR_CONVERT_SUPPORTED_WIDTH ", " \
119-
"height = " TIOVX_COLOR_CONVERT_SUPPORTED_HEIGHT ", " \
120-
"framerate = " GST_VIDEO_FPS_RANGE
116+
#define TIOVX_COLOR_CONVERT_STATIC_CAPS_SRC \
117+
"video/x-raw, " \
118+
"format = (string) " TIOVX_COLOR_CONVERT_SUPPORTED_FORMATS_SRC ", " \
119+
"width = " TIOVX_COLOR_CONVERT_SUPPORTED_WIDTH ", " \
120+
"height = " TIOVX_COLOR_CONVERT_SUPPORTED_HEIGHT ", " \
121+
"num-channels = 1" \
122+
"; " \
123+
"video/x-raw(" GST_CAPS_FEATURE_BATCHED_MEMORY "), " \
124+
"format = (string) " TIOVX_COLOR_CONVERT_SUPPORTED_FORMATS_SRC ", " \
125+
"width = " TIOVX_COLOR_CONVERT_SUPPORTED_WIDTH ", " \
126+
"height = " TIOVX_COLOR_CONVERT_SUPPORTED_HEIGHT ", " \
127+
"num-channels = " TIOVX_COLOR_CONVERT_SUPPORTED_CHANNELS \
121128

122129
/* Sink caps */
123-
#define TIOVX_COLOR_CONVERT_STATIC_CAPS_SINK \
124-
"video/x-raw, " \
125-
"format = (string) " TIOVX_COLOR_CONVERT_SUPPORTED_FORMATS_SINK ", " \
126-
"width = " TIOVX_COLOR_CONVERT_SUPPORTED_WIDTH ", " \
127-
"height = " TIOVX_COLOR_CONVERT_SUPPORTED_HEIGHT ", " \
128-
"framerate = " GST_VIDEO_FPS_RANGE
130+
#define TIOVX_COLOR_CONVERT_STATIC_CAPS_SINK \
131+
"video/x-raw, " \
132+
"format = (string) " TIOVX_COLOR_CONVERT_SUPPORTED_FORMATS_SINK ", " \
133+
"width = " TIOVX_COLOR_CONVERT_SUPPORTED_WIDTH ", " \
134+
"height = " TIOVX_COLOR_CONVERT_SUPPORTED_HEIGHT ", " \
135+
"num-channels = 1" \
136+
"; " \
137+
"video/x-raw(" GST_CAPS_FEATURE_BATCHED_MEMORY "), " \
138+
"format = (string) " TIOVX_COLOR_CONVERT_SUPPORTED_FORMATS_SINK ", " \
139+
"width = " TIOVX_COLOR_CONVERT_SUPPORTED_WIDTH ", " \
140+
"height = " TIOVX_COLOR_CONVERT_SUPPORTED_HEIGHT ", " \
141+
"num-channels = " TIOVX_COLOR_CONVERT_SUPPORTED_CHANNELS
129142

130143
/* Pads definitions */
131144
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
@@ -495,6 +508,7 @@ gst_tiovx_color_convert_init_module (GstTIOVXSiso * trans, vx_context context,
495508
TIOVXColorConvertModuleObj *colorconvert = NULL;
496509
GstVideoInfo in_info;
497510
GstVideoInfo out_info;
511+
gboolean ret = FALSE;
498512

499513
g_return_val_if_fail (trans, FALSE);
500514
g_return_val_if_fail (VX_SUCCESS == vxGetStatus ((vx_reference) context),
@@ -510,16 +524,16 @@ gst_tiovx_color_convert_init_module (GstTIOVXSiso * trans, vx_context context,
510524

511525
if (!gst_video_info_from_caps (&in_info, in_caps)) {
512526
GST_ERROR_OBJECT (self, "Failed to get video info from input caps");
513-
return FALSE;
527+
goto exit;
514528
}
515529
if (!gst_video_info_from_caps (&out_info, out_caps)) {
516530
GST_ERROR_OBJECT (self, "Failed to get video info from output caps");
517-
return FALSE;
531+
goto exit;
518532
}
519533

520534
/* Configure TIOVXColorConvertModuleObj */
521535
colorconvert = &self->obj;
522-
colorconvert->num_channels = DEFAULT_NUM_CHANNELS;
536+
colorconvert->num_channels = num_channels;
523537
colorconvert->input.bufq_depth = num_channels;
524538
colorconvert->output.bufq_depth = num_channels;
525539

@@ -539,10 +553,13 @@ gst_tiovx_color_convert_init_module (GstTIOVXSiso * trans, vx_context context,
539553
status = tiovx_color_convert_module_init (context, colorconvert);
540554
if (VX_SUCCESS != status) {
541555
GST_ERROR_OBJECT (self, "Module init failed with error: %d", status);
542-
return FALSE;
556+
goto exit;
543557
}
558+
ret = TRUE;
544559

545-
return TRUE;
560+
exit:
561+
562+
return ret;
546563
}
547564

548565
static gboolean

0 commit comments

Comments
 (0)