GstElement *encoder_parser = NULL;
GstElement *encoder_bin = NULL;
gboolean gst_ret = FALSE;
+ gboolean use_zerocopy = FALSE;
const gchar *src_type = NULL;
node_plug_s encoder_info = {0,};
node_plug_s parser_info = {0,};
ms_debug("No Video encoding format is set! Default will be: [%s]", MEDIA_STREAMER_DEFAULT_VIDEO_FORMAT);
}
- /* Creating Scaler, Converter */
- video_scale = ms_element_create(DEFAULT_VIDEO_SCALE, NULL);
- video_convert = ms_element_create(DEFAULT_VIDEO_CONVERT, NULL);
/* Creating Video Encoder */
encoder_info.info = ms_node_get_klass_by_its_type(MEDIA_STREAMER_NODE_TYPE_VIDEO_ENCODER);
/* Creating bin - Video Encoder */
encoder_bin = gst_bin_new("video_encoder");
- if (!video_convert || !video_scale || !encoder_elem || !encoder_bin) {
+ if (!encoder_elem || !encoder_bin)
+ goto ERROR;
+
+ use_zerocopy = ms_ini_get_boolean("general:use zerocopy", DEFAULT_USE_ZEROCOPY);
+ if (use_zerocopy) {
+ ms_info("Video encoder uses zerocopy");
+ gst_bin_add(GST_BIN(encoder_bin), encoder_elem);
+ __ms_add_ghostpad(encoder_elem, "src", encoder_bin, "src");
+ __ms_add_ghostpad(encoder_elem, "sink", encoder_bin, "sink");
+
+ ms_debug_fleave();
+ return encoder_bin;
+ }
+
+ /* Creating Scaler, Converter */
+ video_scale = ms_element_create(DEFAULT_VIDEO_SCALE, NULL);
+ video_convert = ms_element_create(DEFAULT_VIDEO_CONVERT, NULL);
+
+ if (!video_convert || !video_scale) {
goto ERROR;
}