#define PLUGIN_LICENSE "LGPL"
static gboolean
-plugin_init (GstPlugin *plugin)
+plugin_init (GstPlugin * plugin)
{
- gst_element_register(plugin, "vaapidecode",
- GST_RANK_PRIMARY + 1,
- GST_TYPE_VAAPIDECODE);
- gst_element_register(plugin, "vaapipostproc",
- GST_RANK_PRIMARY,
- GST_TYPE_VAAPIPOSTPROC);
- gst_element_register(plugin, "vaapisink",
- GST_RANK_PRIMARY,
- GST_TYPE_VAAPISINK);
+ gst_element_register (plugin, "vaapidecode",
+ GST_RANK_PRIMARY + 1, GST_TYPE_VAAPIDECODE);
+ gst_element_register (plugin, "vaapipostproc",
+ GST_RANK_PRIMARY, GST_TYPE_VAAPIPOSTPROC);
+ gst_element_register (plugin, "vaapisink",
+ GST_RANK_PRIMARY, GST_TYPE_VAAPISINK);
#if USE_ENCODERS
- gst_element_register(plugin, "vaapiencode_h264",
- GST_RANK_PRIMARY,
- GST_TYPE_VAAPIENCODE_H264);
- gst_element_register(plugin, "vaapiencode_mpeg2",
- GST_RANK_PRIMARY,
- GST_TYPE_VAAPIENCODE_MPEG2);
+ gst_element_register (plugin, "vaapiencode_h264",
+ GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_H264);
+ gst_element_register (plugin, "vaapiencode_mpeg2",
+ GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_MPEG2);
#endif
#if USE_JPEG_ENCODER
- gst_element_register(plugin, "vaapiencode_jpeg",
- GST_RANK_PRIMARY,
- GST_TYPE_VAAPIENCODE_JPEG);
+ gst_element_register (plugin, "vaapiencode_jpeg",
+ GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_JPEG);
#endif
#if USE_VP8_ENCODER
- gst_element_register(plugin, "vaapiencode_vp8",
- GST_RANK_PRIMARY,
- GST_TYPE_VAAPIENCODE_VP8);
+ gst_element_register (plugin, "vaapiencode_vp8",
+ GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_VP8);
#endif
#if USE_H265_ENCODER
- gst_element_register(plugin, "vaapiencode_h265",
- GST_RANK_PRIMARY,
- GST_TYPE_VAAPIENCODE_H265);
+ gst_element_register (plugin, "vaapiencode_h265",
+ GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_H265);
#endif
#if GST_CHECK_VERSION(1,4,0)
- gst_element_register(plugin, "vaapidecodebin",
- GST_RANK_PRIMARY + 2,
- GST_TYPE_VAAPI_DECODE_BIN);
+ gst_element_register (plugin, "vaapidecodebin",
+ GST_RANK_PRIMARY + 2, GST_TYPE_VAAPI_DECODE_BIN);
#endif
- return TRUE;
+ return TRUE;
}
-GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR,
- vaapi, PLUGIN_DESC, plugin_init,
- PACKAGE_VERSION, PLUGIN_LICENSE, PACKAGE, PACKAGE_BUGREPORT)
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR,
+ vaapi, PLUGIN_DESC, plugin_init,
+ PACKAGE_VERSION, PLUGIN_LICENSE, PACKAGE, PACKAGE_BUGREPORT)
/* Remove the vaapipostproc if already added and reset the ghost pad target */
static void
-disable_vpp (GstVaapiDecodeBin *vaapidecbin)
+disable_vpp (GstVaapiDecodeBin * vaapidecbin)
{
GstPad *pad;
GstStateChangeReturn ret;
GstState state;
/*Fixme: Add run-time disabling support */
- ret = gst_element_get_state (GST_ELEMENT (vaapidecbin), &state, NULL, GST_CLOCK_TIME_NONE);
+ ret =
+ gst_element_get_state (GST_ELEMENT (vaapidecbin), &state, NULL,
+ GST_CLOCK_TIME_NONE);
if (ret != GST_STATE_CHANGE_SUCCESS || state > GST_STATE_NULL) {
GST_WARNING_OBJECT (vaapidecbin, "Failed to set disable-vpp property!,,"
"No support for run-time disabling, Ignoring the user request to disable VPP.");
gst_element_set_state (vaapidecbin->postproc, GST_STATE_NULL);
gst_bin_remove (GST_BIN (vaapidecbin), vaapidecbin->postproc);
- pad =
- gst_element_get_static_pad (GST_ELEMENT (vaapidecbin->queue),
- "src");
- gst_ghost_pad_set_target ((GstGhostPad *) vaapidecbin->ghost_pad_src,
- pad);
+ pad = gst_element_get_static_pad (GST_ELEMENT (vaapidecbin->queue), "src");
+ gst_ghost_pad_set_target ((GstGhostPad *) vaapidecbin->ghost_pad_src, pad);
gst_object_unref (pad);
}
-
+
static void
gst_vaapi_decode_bin_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec)
default:
break;
}
- return GST_ELEMENT_CLASS (gst_vaapiencode_parent_class)->
- change_state (element, transition);
+ return
+ GST_ELEMENT_CLASS (gst_vaapiencode_parent_class)->change_state (element,
+ transition);
}
static gboolean
/* *INDENT-ON* */
/* jpeg encode */
-G_DEFINE_TYPE (GstVaapiEncodeJpeg, gst_vaapiencode_jpeg,
- GST_TYPE_VAAPIENCODE);
+G_DEFINE_TYPE (GstVaapiEncodeJpeg, gst_vaapiencode_jpeg, GST_TYPE_VAAPIENCODE);
static void
gst_vaapiencode_jpeg_init (GstVaapiEncodeJpeg * encode)
gst_element_class_set_static_metadata (element_class,
"VA-API JPEG encoder",
"Codec/Encoder/Image",
- GST_PLUGIN_DESC, "Sreerenj Balachandran <sreerenj.balachandran@intel.com>");
+ GST_PLUGIN_DESC,
+ "Sreerenj Balachandran <sreerenj.balachandran@intel.com>");
/* sink pad */
gst_element_class_add_pad_template (element_class,
v = 0;
g_object_get (element, "io-mode", &v, NULL);
- is_dmabuf_capable = v == 5; /* "dmabuf-import" enum value */
+ is_dmabuf_capable = v == 5; /* "dmabuf-import" enum value */
break;
} else if (GST_IS_BASE_TRANSFORM (element)) {
element_name = gst_element_get_name (element);
error_no_pool:
{
GST_ELEMENT_ERROR (plugin, STREAM, FAILED,
- ("no buffer pool was negotiated"),
- ("no buffer pool was negotiated"));
+ ("no buffer pool was negotiated"), ("no buffer pool was negotiated"));
return GST_FLOW_ERROR;
}
error_active_pool:
{
GST_ELEMENT_ERROR (plugin, STREAM, FAILED,
- ("failed to activate buffer pool"),
- ("failed to activate buffer pool"));
+ ("failed to activate buffer pool"), ("failed to activate buffer pool"));
return GST_FLOW_ERROR;
}
error_map_dst_buffer:
static GstCaps *
new_gl_texture_upload_meta_caps (void)
{
- return gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES (
- GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, "{ RGBA, BGRA }"));
+ return
+ gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
+ (GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META,
+ "{ RGBA, BGRA }"));
}
GstVaapiCapsFeature
GstCaps *out_caps;
GstVideoFormat out_format;
- out_caps= gst_pad_get_allowed_caps (pad);
+ out_caps = gst_pad_get_allowed_caps (pad);
if (!out_caps) {
feature = GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED;
goto cleanup;
}
out_format = format == GST_VIDEO_FORMAT_ENCODED ?
- GST_VIDEO_FORMAT_I420 : format;
+ GST_VIDEO_FORMAT_I420 : format;
gl_texture_upload_caps = new_gl_texture_upload_meta_caps ();
if (!gl_texture_upload_caps)
gst_vaapi_plugin_base_close (GST_VAAPI_PLUGIN_BASE (postproc));
postproc->field_duration = GST_CLOCK_TIME_NONE;
- gst_video_info_init(&postproc->sinkpad_info);
- gst_video_info_init(&postproc->srcpad_info);
- gst_video_info_init(&postproc->filter_pool_info);
+ gst_video_info_init (&postproc->sinkpad_info);
+ gst_video_info_init (&postproc->srcpad_info);
+ gst_video_info_init (&postproc->filter_pool_info);
return TRUE;
}
if ((postproc->flags & GST_VAAPI_POSTPROC_FLAG_SKINTONE) &&
!gst_vaapi_filter_set_skintone (postproc->filter,
- postproc->skintone_enhance))
+ postproc->skintone_enhance))
return GST_FLOW_NOT_SUPPORTED;
inbuf_meta = gst_buffer_get_vaapi_video_meta (inbuf);
GST_VIDEO_INFO_FPS_N (&vi) = fps_n;
GST_VIDEO_INFO_FPS_D (&vi) = fps_d;
}
-
// Signal the other pad that we only generate progressive frames
GST_VIDEO_INFO_INTERLACE_MODE (&vi) = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
static GstFlowReturn
gst_vaapipostproc_prepare_output_buffer (GstBaseTransform * trans,
- GstBuffer * inbuf,
- GstBuffer ** outbuf_ptr)
+ GstBuffer * inbuf, GstBuffer ** outbuf_ptr)
{
GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans);
vmeta->unmap = gst_video_meta_unmap_vaapi_memory;
}
}
-
#if (USE_GLX || USE_EGL)
if (priv->has_texture_upload_meta)
gst_buffer_add_texture_upload_meta (buffer);
gst_vaapi_display_get_type ()
GType
-gst_vaapi_display_get_type (void) G_GNUC_CONST;
+gst_vaapi_display_get_type (void)
+ G_GNUC_CONST;
G_DEFINE_BOXED_TYPE (GstVaapiDisplay, gst_vaapi_display,
(GBoxedCopyFunc) gst_vaapi_display_ref,
(GBoxedFreeFunc) gst_vaapi_display_unref);
-GstContext *
-gst_vaapi_video_context_new_with_display (GstVaapiDisplay * display,
- gboolean persistent)
+ GstContext *gst_vaapi_video_context_new_with_display (GstVaapiDisplay *
+ display, gboolean persistent)
{
GstContext *context;
GstStructure *structure;
/* --- GstVaapiVideoMemory --- */
/* ------------------------------------------------------------------------ */
-static void
-gst_vaapi_video_memory_reset_image (GstVaapiVideoMemory * mem);
+static void gst_vaapi_video_memory_reset_image (GstVaapiVideoMemory * mem);
static guchar *
get_image_data (GstVaapiImage * image)
{
g_return_val_if_fail (GST_VAAPI_IS_VIDEO_META (meta), NULL);
- return ensure_surface_proxy (meta) ? GST_VAAPI_SURFACE_PROXY_SURFACE (meta->
- proxy) : NULL;
+ return ensure_surface_proxy (meta) ?
+ GST_VAAPI_SURFACE_PROXY_SURFACE (meta->proxy) : NULL;
}
/**