static GstPadTemplate * gst_merger_src_template_factory (void) { return gst_pad_template_new ("srcv", GST_PAD_SRC, GST_PAD_ALWAYS, gst_merger_get_vin_capslist ()); }
static void gst_v4l2src_class_init (GstV4l2SrcClass * klass) { GObjectClass *gobject_class; GstElementClass *element_class; GstBaseSrcClass *basesrc_class; GstPushSrcClass *pushsrc_class; gobject_class = G_OBJECT_CLASS (klass); element_class = GST_ELEMENT_CLASS (klass); basesrc_class = GST_BASE_SRC_CLASS (klass); pushsrc_class = GST_PUSH_SRC_CLASS (klass); gobject_class->dispose = gst_v4l2src_dispose; gobject_class->finalize = (GObjectFinalizeFunc) gst_v4l2src_finalize; gobject_class->set_property = gst_v4l2src_set_property; gobject_class->get_property = gst_v4l2src_get_property; element_class->change_state = gst_v4l2src_change_state; gst_v4l2_object_install_properties_helper (gobject_class, DEFAULT_PROP_DEVICE); /** * GstV4l2Src::prepare-format: * @v4l2src: the v4l2src instance * @fd: the file descriptor of the current device * @caps: the caps of the format being set * * This signal gets emitted before calling the v4l2 VIDIOC_S_FMT ioctl * (set format). This allows for any custom configuration of the device to * happen prior to the format being set. * This is mostly useful for UVC H264 encoding cameras which need the H264 * Probe & Commit to happen prior to the normal Probe & Commit. * * Since: 0.10.32 */ gst_v4l2_signals[SIGNAL_PRE_SET_FORMAT] = g_signal_new ("prepare-format", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_INT, GST_TYPE_CAPS); gst_element_class_set_static_metadata (element_class, "Video (video4linux2) Source", "Source/Video", "Reads frames from a Video4Linux2 device", "Edgard Lima <*****@*****.**>, " "Stefan Kost <*****@*****.**>"); gst_element_class_add_pad_template (element_class, gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, gst_v4l2_object_get_all_caps ())); basesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_v4l2src_get_caps); basesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_v4l2src_set_caps); basesrc_class->start = GST_DEBUG_FUNCPTR (gst_v4l2src_start); basesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_v4l2src_unlock); basesrc_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_v4l2src_unlock_stop); basesrc_class->stop = GST_DEBUG_FUNCPTR (gst_v4l2src_stop); basesrc_class->query = GST_DEBUG_FUNCPTR (gst_v4l2src_query); basesrc_class->fixate = GST_DEBUG_FUNCPTR (gst_v4l2src_fixate); basesrc_class->negotiate = GST_DEBUG_FUNCPTR (gst_v4l2src_negotiate); basesrc_class->decide_allocation = GST_DEBUG_FUNCPTR (gst_v4l2src_decide_allocation); pushsrc_class->fill = GST_DEBUG_FUNCPTR (gst_v4l2src_fill); klass->v4l2_class_devices = NULL; GST_DEBUG_CATEGORY_INIT (v4l2src_debug, "v4l2src", 0, "V4L2 source element"); }
static void gst_ffmpegmux_base_init (gpointer g_class) { GstFFMpegMuxClass *klass = (GstFFMpegMuxClass *) g_class; GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); GstElementDetails details; GstPadTemplate *videosinktempl, *audiosinktempl, *srctempl; AVOutputFormat *in_plugin; GstCaps *srccaps, *audiosinkcaps, *videosinkcaps; enum CodecID *video_ids = NULL, *audio_ids = NULL; in_plugin = (AVOutputFormat *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass), GST_FFMUX_PARAMS_QDATA); g_assert (in_plugin != NULL); /* construct the element details struct */ details.longname = g_strdup_printf ("FFmpeg %s muxer", in_plugin->long_name); details.klass = g_strdup ("Codec/Muxer"); details.description = g_strdup_printf ("FFmpeg %s muxer", in_plugin->long_name); details.author = "Wim Taymans <*****@*****.**>, " "Ronald Bultje <*****@*****.**>"; gst_element_class_set_details (element_class, &details); g_free (details.longname); g_free (details.klass); g_free (details.description); /* Try to find the caps that belongs here */ srccaps = gst_ffmpeg_formatid_to_caps (in_plugin->name); if (!srccaps) { GST_DEBUG ("Couldn't get source caps for muxer '%s', skipping format", in_plugin->name); goto beach; } if (!gst_ffmpeg_formatid_get_codecids (in_plugin->name, &video_ids, &audio_ids, in_plugin)) { gst_caps_unref (srccaps); GST_DEBUG ("Couldn't get sink caps for muxer '%s'. Most likely because no input format mapping exists.", in_plugin->name); goto beach; } videosinkcaps = video_ids ? gst_ffmpegmux_get_id_caps (video_ids) : NULL; audiosinkcaps = audio_ids ? gst_ffmpegmux_get_id_caps (audio_ids) : NULL; /* fix up allowed caps for some muxers */ /* FIXME : This should be in gstffmpegcodecmap.c ! */ if (strcmp (in_plugin->name, "flv") == 0) { const gint rates[] = { 44100, 22050, 11025 }; gst_ffmpeg_mux_simple_caps_set_int_list (audiosinkcaps, "rate", 3, rates); } else if (strcmp (in_plugin->name, "gif") == 0) { if (videosinkcaps) gst_caps_unref (videosinkcaps); videosinkcaps = gst_caps_from_string ("video/x-raw-rgb, bpp=(int)24, depth=(int)24"); } /* pad templates */ srctempl = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, srccaps); gst_element_class_add_pad_template (element_class, srctempl); if (audiosinkcaps) { audiosinktempl = gst_pad_template_new ("audio_%d", GST_PAD_SINK, GST_PAD_REQUEST, audiosinkcaps); gst_element_class_add_pad_template (element_class, audiosinktempl); } if (videosinkcaps) { videosinktempl = gst_pad_template_new ("video_%d", GST_PAD_SINK, GST_PAD_REQUEST, videosinkcaps); gst_element_class_add_pad_template (element_class, videosinktempl); } beach: klass->in_plugin = in_plugin; }
static void gst_kms_sink_class_init (GstKMSSinkClass * klass) { GObjectClass *gobject_class; GstElementClass *element_class; GstBaseSinkClass *basesink_class; GstVideoSinkClass *videosink_class; GstCaps *caps; gobject_class = G_OBJECT_CLASS (klass); element_class = GST_ELEMENT_CLASS (klass); basesink_class = GST_BASE_SINK_CLASS (klass); videosink_class = GST_VIDEO_SINK_CLASS (klass); gst_element_class_set_static_metadata (element_class, "KMS video sink", "Sink/Video", GST_PLUGIN_DESC, "Víctor Jáquez <*****@*****.**>"); caps = gst_kms_sink_caps_template_fill (); gst_element_class_add_pad_template (element_class, gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, caps)); gst_caps_unref (caps); basesink_class->start = GST_DEBUG_FUNCPTR (gst_kms_sink_start); basesink_class->stop = GST_DEBUG_FUNCPTR (gst_kms_sink_stop); basesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_kms_sink_set_caps); basesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_kms_sink_get_caps); basesink_class->propose_allocation = gst_kms_sink_propose_allocation; basesink_class->get_times = gst_kms_sink_get_times; videosink_class->show_frame = gst_kms_sink_show_frame; gobject_class->finalize = gst_kms_sink_finalize; gobject_class->set_property = gst_kms_sink_set_property; gobject_class->get_property = gst_kms_sink_get_property; /** * kmssink:driver-name: * * If you have a system with multiple GPUs, you can choose which GPU * to use setting the DRM device driver name. Otherwise, the first * one from an internal list is used. */ g_properties[PROP_DRIVER_NAME] = g_param_spec_string ("driver-name", "device name", "DRM device driver name", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT); /** * kmssink:connector-id: * * A GPU has several output connectors, for example: LVDS, VGA, * HDMI, etc. By default the first LVDS is tried, then the first * eDP, and at the end, the first connected one. */ g_properties[PROP_CONNECTOR_ID] = g_param_spec_int ("connector-id", "Connector ID", "DRM connector id", -1, G_MAXINT32, -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT); /** * kmssink:plane-id: * * There could be several planes associated with a CRTC. * By default the first plane that's possible to use with a given * CRTC is tried. */ g_properties[PROP_PLANE_ID] = g_param_spec_int ("plane-id", "Plane ID", "DRM plane id", -1, G_MAXINT32, -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT); g_object_class_install_properties (gobject_class, PROP_N, g_properties); }
/* initialize the cvsmooth's class */ static void gst_cv_smooth_class_init (GstCvSmoothClass * klass) { GObjectClass *gobject_class; GstOpencvBaseTransformClass *gstopencvbasefilter_class; GstElementClass *gstelement_class; GstCaps * caps; GstPadTemplate * templ; gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; gstopencvbasefilter_class = (GstOpencvBaseTransformClass *) klass; parent_class = g_type_class_peek_parent (klass); gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_cv_smooth_finalize); gobject_class->set_property = gst_cv_smooth_set_property; gobject_class->get_property = gst_cv_smooth_get_property; /* add sink and source pad templates */ caps = gst_opencv_caps_from_cv_image_type (CV_8UC1); gst_caps_append (caps, gst_opencv_caps_from_cv_image_type (CV_8UC3)); templ = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, gst_caps_ref (caps)); gst_element_class_add_pad_template (gstelement_class, templ); templ = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, caps); gst_element_class_add_pad_template (gstelement_class, templ); gstopencvbasefilter_class->cv_trans_ip_func = gst_cv_smooth_transform_ip; gstopencvbasefilter_class->cv_trans_func = gst_cv_smooth_transform; g_object_class_install_property (gobject_class, PROP_SMOOTH_TYPE, g_param_spec_enum ("type", "type", "Smooth Type", GST_TYPE_CV_SMOOTH_TYPE, DEFAULT_CV_SMOOTH_TYPE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS) ); g_object_class_install_property (gobject_class, PROP_PARAM1, g_param_spec_int ("param1", "param1 (aperture width)", "The aperture width (Must be positive and odd)." "Check cvSmooth OpenCV docs: http://opencv.willowgarage.com" "/documentation/image_filtering.html#cvSmooth", 1, G_MAXINT, DEFAULT_PARAM1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PARAM2, g_param_spec_int ("param2", "param2 (aperture height)", "The aperture height, if zero, the width is used." "(Must be positive and odd or zero, unuset in median and bilateral " "types). Check cvSmooth OpenCV docs: http://opencv.willowgarage.com" "/documentation/image_filtering.html#cvSmooth", 0, G_MAXINT, DEFAULT_PARAM2, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PARAM3, g_param_spec_double ("param3", "param3 (gaussian standard deviation or " "color sigma", "If type is gaussian, this means the standard deviation." "If type is bilateral, this means the color-sigma. If zero, " "Default values are used." "Check cvSmooth OpenCV docs: http://opencv.willowgarage.com" "/documentation/image_filtering.html#cvSmooth", 0, G_MAXDOUBLE, DEFAULT_PARAM3, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PARAM4, g_param_spec_double ("param4", "param4 (spatial sigma, bilateral only)", "Only used in bilateral type, means the spatial-sigma." "Check cvSmooth OpenCV docs: http://opencv.willowgarage.com" "/documentation/image_filtering.html#cvSmooth", 0, G_MAXDOUBLE, DEFAULT_PARAM4, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); }
/* initialize the cameracalibration's class */ static void gst_camera_calibrate_class_init (GstCameraCalibrateClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstOpencvVideoFilterClass *opencvfilter_class = GST_OPENCV_VIDEO_FILTER_CLASS (klass); GstCaps *caps; GstPadTemplate *templ; gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_camera_calibrate_finalize); gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_camera_calibrate_dispose); gobject_class->set_property = gst_camera_calibrate_set_property; gobject_class->get_property = gst_camera_calibrate_get_property; opencvfilter_class->cv_trans_ip_func = gst_camera_calibrate_transform_frame_ip; g_object_class_install_property (gobject_class, PROP_CALIBRATON_PATTERN, g_param_spec_enum ("pattern", "Calibration Pattern", "One of the chessboard, circles, or asymmetric circle pattern", GST_TYPE_CAMERA_CALIBRATION_PATTERN, DEFAULT_CALIBRATON_PATTERN, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_BOARD_WIDTH, g_param_spec_int ("board-width", "Board Width", "The board width in number of items", 1, G_MAXINT, DEFAULT_BOARD_WIDTH, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_BOARD_HEIGHT, g_param_spec_int ("board-height", "Board Height", "The board height in number of items", 1, G_MAXINT, DEFAULT_BOARD_WIDTH, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_SQUARE_SIZE, g_param_spec_float ("square-size", "Square Size", "The size of a square in your defined unit (point, millimeter, etc.)", 0.0, G_MAXFLOAT, DEFAULT_SQUARE_SIZE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_ASPECT_RATIO, g_param_spec_float ("aspect-ratio", "Aspect Ratio", "The aspect ratio", 0.0, G_MAXFLOAT, DEFAULT_ASPECT_RATIO, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_CORNER_SUB_PIXEL, g_param_spec_boolean ("corner-sub-pixel", "Corner Sub Pixel", "Improve corner detection accuracy for chessboard", DEFAULT_CORNER_SUB_PIXEL, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_ZERO_TANGENT_DISTORTION, g_param_spec_boolean ("zero-tangent-distorsion", "Zero Tangent Distorsion", "Assume zero tangential distortion", DEFAULT_ZERO_TANGENT_DISTORTION, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_CENTER_PRINCIPAL_POINT, g_param_spec_boolean ("center-principal-point", "Center Principal Point", "Fix the principal point at the center", DEFAULT_CENTER_PRINCIPAL_POINT, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_USE_FISHEYE, g_param_spec_boolean ("use-fisheye", "Use Fisheye", "Use fisheye camera model for calibration", DEFAULT_USE_FISHEYE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_DELAY, g_param_spec_int ("delay", "Delay", "Sampling periodicity in ms", 0, G_MAXINT, DEFAULT_DELAY, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_FRAME_COUNT, g_param_spec_int ("frame-count", "Frame Count", "The number of frames to use from the input for calibration", 1, G_MAXINT, DEFAULT_FRAME_COUNT, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_SHOW_CORNERS, g_param_spec_boolean ("show-corners", "Show Corners", "Show corners", DEFAULT_SHOW_CORNERS, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_SETTINGS, g_param_spec_string ("settings", "Settings", "Camera correction parameters (opaque string of serialized OpenCV objects)", NULL, (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); gst_element_class_set_static_metadata (element_class, "cameracalibrate", "Filter/Effect/Video", "Performs camera calibration", "Philippe Renon <*****@*****.**>"); /* add sink and source pad templates */ caps = gst_opencv_caps_from_cv_image_type (CV_8UC4); gst_caps_append (caps, gst_opencv_caps_from_cv_image_type (CV_8UC3)); gst_caps_append (caps, gst_opencv_caps_from_cv_image_type (CV_8UC1)); templ = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, gst_caps_ref (caps)); gst_element_class_add_pad_template (element_class, templ); templ = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, caps); gst_element_class_add_pad_template (element_class, templ); }
static void gst_v4l2sink_class_init (GstV4l2SinkClass * klass) { GObjectClass *gobject_class; GstElementClass *element_class; GstBaseSinkClass *basesink_class; gobject_class = G_OBJECT_CLASS (klass); element_class = GST_ELEMENT_CLASS (klass); basesink_class = GST_BASE_SINK_CLASS (klass); gobject_class->dispose = gst_v4l2sink_dispose; gobject_class->finalize = (GObjectFinalizeFunc) gst_v4l2sink_finalize; gobject_class->set_property = gst_v4l2sink_set_property; gobject_class->get_property = gst_v4l2sink_get_property; element_class->change_state = gst_v4l2sink_change_state; gst_v4l2_object_install_properties_helper (gobject_class, DEFAULT_PROP_DEVICE); g_object_class_install_property (gobject_class, PROP_OVERLAY_TOP, g_param_spec_int ("overlay-top", "Overlay top", "The topmost (y) coordinate of the video overlay; top left corner of screen is 0,0", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_OVERLAY_LEFT, g_param_spec_int ("overlay-left", "Overlay left", "The leftmost (x) coordinate of the video overlay; top left corner of screen is 0,0", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_OVERLAY_WIDTH, g_param_spec_uint ("overlay-width", "Overlay width", "The width of the video overlay; default is equal to negotiated image width", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_OVERLAY_HEIGHT, g_param_spec_uint ("overlay-height", "Overlay height", "The height of the video overlay; default is equal to negotiated image height", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_CROP_TOP, g_param_spec_int ("crop-top", "Crop top", "The topmost (y) coordinate of the video crop; top left corner of image is 0,0", 0x80000000, 0x7fffffff, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CROP_LEFT, g_param_spec_int ("crop-left", "Crop left", "The leftmost (x) coordinate of the video crop; top left corner of image is 0,0", 0x80000000, 0x7fffffff, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CROP_WIDTH, g_param_spec_uint ("crop-width", "Crop width", "The width of the video crop; default is equal to negotiated image width", 0, 0xffffffff, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CROP_HEIGHT, g_param_spec_uint ("crop-height", "Crop height", "The height of the video crop; default is equal to negotiated image height", 0, 0xffffffff, 0, G_PARAM_READWRITE)); gst_element_class_set_static_metadata (element_class, "Video (video4linux2) Sink", "Sink/Video", "Displays frames on a video4linux2 device", "Rob Clark <*****@*****.**>,"); gst_element_class_add_pad_template (element_class, gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, gst_v4l2_object_get_all_caps ())); basesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_v4l2sink_get_caps); basesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_v4l2sink_set_caps); basesink_class->propose_allocation = GST_DEBUG_FUNCPTR (gst_v4l2sink_propose_allocation); basesink_class->render = GST_DEBUG_FUNCPTR (gst_v4l2sink_show_frame); klass->v4l2_class_devices = NULL; GST_DEBUG_CATEGORY_INIT (v4l2sink_debug, "v4l2sink", 0, "V4L2 sink element"); }
static void kms_pointer_detector_class_init (KmsPointerDetectorClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass); GstVideoFilterClass *video_filter_class = GST_VIDEO_FILTER_CLASS (klass); /* Setting up pads and setting metadata should be moved to base_class_init if you intend to subclass this class. */ gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, gst_caps_from_string (VIDEO_SRC_CAPS))); gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, gst_caps_from_string (VIDEO_SINK_CAPS))); gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass), "Pointer detector element", "Video/Filter", "Detects pointer an raises events with its position", "Francisco Rivero <*****@*****.**>"); gobject_class->set_property = kms_pointer_detector_set_property; gobject_class->get_property = kms_pointer_detector_get_property; gobject_class->dispose = kms_pointer_detector_dispose; gobject_class->finalize = kms_pointer_detector_finalize; base_transform_class->start = GST_DEBUG_FUNCPTR (kms_pointer_detector_start); base_transform_class->stop = GST_DEBUG_FUNCPTR (kms_pointer_detector_stop); video_filter_class->set_info = GST_DEBUG_FUNCPTR (kms_pointer_detector_set_info); video_filter_class->transform_frame_ip = GST_DEBUG_FUNCPTR (kms_pointer_detector_transform_frame_ip); /* Properties initialization */ g_object_class_install_property (gobject_class, PROP_NUM_REGIONS, g_param_spec_int ("num-regions-eval", "num regions eval", "Number of regions evaluated when searching for similar regions", 20, 400, 150, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WINDOW_SCALE, g_param_spec_int ("scale-search-window", "scale search window", "Fix the size of the searching window", 2, 100, 5, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SHOW_DEBUG_INFO, g_param_spec_boolean ("show-debug-region", "show debug region", "show evaluation regions over the image", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WINDOWS_LAYOUT, g_param_spec_boxed ("windows-layout", "windows layout", "supply the positions and dimensions of windows into the main window", GST_TYPE_STRUCTURE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_MESSAGE, g_param_spec_boolean ("message", "message", "Put a window-in or window-out message in the bus if " "an object enters o leaves a window", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SHOW_WINDOWS_LAYOUT, g_param_spec_boolean ("show-windows-layout", "show windows layout", "show windows layout over the image", TRUE, G_PARAM_READWRITE)); }
static void gst_mpg123_audio_dec_class_init (GstMpg123AudioDecClass * klass) { GObjectClass *object_class; GstAudioDecoderClass *base_class; GstElementClass *element_class; GstPadTemplate *src_template; int error; GST_DEBUG_CATEGORY_INIT (mpg123_debug, "mpg123", 0, "mpg123 mp3 decoder"); object_class = G_OBJECT_CLASS (klass); base_class = GST_AUDIO_DECODER_CLASS (klass); element_class = GST_ELEMENT_CLASS (klass); object_class->finalize = gst_mpg123_audio_dec_finalize; gst_element_class_set_static_metadata (element_class, "mpg123 mp3 decoder", "Codec/Decoder/Audio", "Decodes mp3 streams using the mpg123 library", "Carlos Rafael Giani <*****@*****.**>"); /* Not using static pad template for srccaps, since the comma-separated list of formats needs to be created depending on whatever mpg123 supports */ { const int *format_list; const long *rates_list; size_t num, i; GString *s; s = g_string_new ("audio/x-raw, "); mpg123_encodings (&format_list, &num); g_string_append (s, "format = { "); for (i = 0; i < num; ++i) { switch (format_list[i]) { case MPG123_ENC_SIGNED_16: g_string_append (s, (i > 0) ? ", " : ""); g_string_append (s, GST_AUDIO_NE (S16)); break; case MPG123_ENC_UNSIGNED_16: g_string_append (s, (i > 0) ? ", " : ""); g_string_append (s, GST_AUDIO_NE (U16)); break; case MPG123_ENC_SIGNED_24: g_string_append (s, (i > 0) ? ", " : ""); g_string_append (s, GST_AUDIO_NE (S24)); break; case MPG123_ENC_UNSIGNED_24: g_string_append (s, (i > 0) ? ", " : ""); g_string_append (s, GST_AUDIO_NE (U24)); break; case MPG123_ENC_SIGNED_32: g_string_append (s, (i > 0) ? ", " : ""); g_string_append (s, GST_AUDIO_NE (S32)); break; case MPG123_ENC_UNSIGNED_32: g_string_append (s, (i > 0) ? ", " : ""); g_string_append (s, GST_AUDIO_NE (U32)); break; case MPG123_ENC_FLOAT_32: g_string_append (s, (i > 0) ? ", " : ""); g_string_append (s, GST_AUDIO_NE (F32)); break; default: GST_DEBUG ("Ignoring mpg123 format %d", format_list[i]); break; } } g_string_append (s, " }, "); mpg123_rates (&rates_list, &num); g_string_append (s, "rate = (int) { "); for (i = 0; i < num; ++i) { g_string_append_printf (s, "%s%lu", (i > 0) ? ", " : "", rates_list[i]); } g_string_append (s, "}, "); g_string_append (s, "channels = (int) [ 1, 2 ], "); g_string_append (s, "layout = (string) interleaved"); src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, gst_caps_from_string (s->str)); g_string_free (s, TRUE); } gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&sink_template)); gst_element_class_add_pad_template (element_class, src_template); base_class->start = GST_DEBUG_FUNCPTR (gst_mpg123_audio_dec_start); base_class->stop = GST_DEBUG_FUNCPTR (gst_mpg123_audio_dec_stop); base_class->handle_frame = GST_DEBUG_FUNCPTR (gst_mpg123_audio_dec_handle_frame); base_class->set_format = GST_DEBUG_FUNCPTR (gst_mpg123_audio_dec_set_format); base_class->flush = GST_DEBUG_FUNCPTR (gst_mpg123_audio_dec_flush); error = mpg123_init (); if (G_UNLIKELY (error != MPG123_OK)) GST_ERROR ("Could not initialize mpg123 library: %s", mpg123_plain_strerror (error)); else GST_TRACE ("mpg123 library initialized"); }
static void gst_decklink_video_src_class_init (GstDecklinkVideoSrcClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstBaseSrcClass *basesrc_class = GST_BASE_SRC_CLASS (klass); GstPushSrcClass *pushsrc_class = GST_PUSH_SRC_CLASS (klass); GstCaps *templ_caps; gobject_class->set_property = gst_decklink_video_src_set_property; gobject_class->get_property = gst_decklink_video_src_get_property; gobject_class->finalize = gst_decklink_video_src_finalize; element_class->change_state = GST_DEBUG_FUNCPTR (gst_decklink_video_src_change_state); element_class->provide_clock = GST_DEBUG_FUNCPTR (gst_decklink_video_src_provide_clock); basesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_decklink_video_src_get_caps); basesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_decklink_video_src_set_caps); basesrc_class->query = GST_DEBUG_FUNCPTR (gst_decklink_video_src_query); basesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_decklink_video_src_unlock); basesrc_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_decklink_video_src_unlock_stop); pushsrc_class->create = GST_DEBUG_FUNCPTR (gst_decklink_video_src_create); g_object_class_install_property (gobject_class, PROP_MODE, g_param_spec_enum ("mode", "Playback Mode", "Video Mode to use for playback", GST_TYPE_DECKLINK_MODE, DEFAULT_MODE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT))); g_object_class_install_property (gobject_class, PROP_CONNECTION, g_param_spec_enum ("connection", "Connection", "Video input connection to use", GST_TYPE_DECKLINK_CONNECTION, DEFAULT_CONNECTION, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT))); g_object_class_install_property (gobject_class, PROP_DEVICE_NUMBER, g_param_spec_int ("device-number", "Device number", "Output device instance to use", 0, G_MAXINT, 0, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT))); g_object_class_install_property (gobject_class, PROP_BUFFER_SIZE, g_param_spec_uint ("buffer-size", "Buffer Size", "Size of internal buffer in number of video frames", 1, G_MAXINT, DEFAULT_BUFFER_SIZE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); templ_caps = gst_decklink_mode_get_template_caps (); gst_element_class_add_pad_template (element_class, gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, templ_caps)); gst_caps_unref (templ_caps); gst_element_class_set_static_metadata (element_class, "Decklink Video Source", "Video/Src", "Decklink Source", "David Schleef <*****@*****.**>, " "Sebastian Dröge <*****@*****.**>"); GST_DEBUG_CATEGORY_INIT (gst_decklink_video_src_debug, "decklinkvideosrc", 0, "debug category for decklinkvideosrc element"); }
static void gst_decklink_video_sink_class_init (GstDecklinkVideoSinkClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstBaseSinkClass *basesink_class = GST_BASE_SINK_CLASS (klass); GstCaps *templ_caps; gobject_class->set_property = gst_decklink_video_sink_set_property; gobject_class->get_property = gst_decklink_video_sink_get_property; gobject_class->finalize = gst_decklink_video_sink_finalize; element_class->change_state = GST_DEBUG_FUNCPTR (gst_decklink_video_sink_change_state); element_class->provide_clock = GST_DEBUG_FUNCPTR (gst_decklink_video_sink_provide_clock); basesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_decklink_video_sink_get_caps); basesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_decklink_video_sink_set_caps); basesink_class->prepare = GST_DEBUG_FUNCPTR (gst_decklink_video_sink_prepare); basesink_class->render = GST_DEBUG_FUNCPTR (gst_decklink_video_sink_render); // FIXME: These are misnamed in basesink! basesink_class->start = GST_DEBUG_FUNCPTR (gst_decklink_video_sink_open); basesink_class->stop = GST_DEBUG_FUNCPTR (gst_decklink_video_sink_close); basesink_class->propose_allocation = GST_DEBUG_FUNCPTR (gst_decklink_video_sink_propose_allocation); g_object_class_install_property (gobject_class, PROP_MODE, g_param_spec_enum ("mode", "Playback Mode", "Video Mode to use for playback", GST_TYPE_DECKLINK_MODE, GST_DECKLINK_MODE_NTSC, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT))); g_object_class_install_property (gobject_class, PROP_DEVICE_NUMBER, g_param_spec_int ("device-number", "Device number", "Output device instance to use", 0, G_MAXINT, 0, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT))); g_object_class_install_property (gobject_class, PROP_VIDEO_FORMAT, g_param_spec_enum ("video-format", "Video format", "Video format type to use for playback", GST_TYPE_DECKLINK_VIDEO_FORMAT, GST_DECKLINK_VIDEO_FORMAT_8BIT_YUV, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT))); g_object_class_install_property (gobject_class, PROP_TIMECODE_FORMAT, g_param_spec_enum ("timecode-format", "Timecode format", "Timecode format type to use for playback", GST_TYPE_DECKLINK_TIMECODE_FORMAT, GST_DECKLINK_TIMECODE_FORMAT_RP188ANY, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT))); templ_caps = gst_decklink_mode_get_template_caps (); templ_caps = gst_caps_make_writable (templ_caps); /* For output we support any framerate and only really care about timestamps */ gst_caps_map_in_place (templ_caps, reset_framerate, NULL); gst_element_class_add_pad_template (element_class, gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, templ_caps)); gst_caps_unref (templ_caps); gst_element_class_set_static_metadata (element_class, "Decklink Video Sink", "Video/Sink", "Decklink Sink", "David Schleef <*****@*****.**>, " "Sebastian Dröge <*****@*****.**>"); GST_DEBUG_CATEGORY_INIT (gst_decklink_video_sink_debug, "decklinkvideosink", 0, "debug category for decklinkvideosink element"); }
static GstPadTemplate * gst_video_scale_sink_template_factory (void) { return gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, gst_video_scale_get_capslist ()); }
static void gst_gl_mixer_bin_class_init (GstGLMixerBinClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstCaps *upload_caps; g_type_class_add_private (klass, sizeof (GstGLMixerBinPrivate)); GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "glmixerbin", 0, "opengl mixer bin"); element_class->request_new_pad = gst_gl_mixer_bin_request_new_pad; element_class->release_pad = gst_gl_mixer_bin_release_pad; element_class->change_state = gst_gl_mixer_bin_change_state; gobject_class->get_property = gst_gl_mixer_bin_get_property; gobject_class->set_property = gst_gl_mixer_bin_set_property; gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_gl_mixer_bin_dispose); gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_gl_mixer_bin_finalize); g_object_class_install_property (gobject_class, PROP_MIXER, g_param_spec_object ("mixer", "GL mixer element", "The GL mixer chain to use", GST_TYPE_ELEMENT, GST_PARAM_MUTABLE_READY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_LATENCY, g_param_spec_int64 ("latency", "Buffer latency", "Additional latency in live mode to allow upstream " "to take longer to produce buffers for the current " "position", 0, (G_MAXLONG == G_MAXINT64) ? G_MAXINT64 : (G_MAXLONG * GST_SECOND - 1), DEFAULT_LATENCY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_START_TIME_SELECTION, g_param_spec_enum ("start-time-selection", "Start Time Selection", "Decides which start time is output", gst_gl_mixer_bin_start_time_selection_get_type (), DEFAULT_START_TIME_SELECTION, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_START_TIME, g_param_spec_uint64 ("start-time", "Start Time", "Start time to use if start-time-selection=set", 0, G_MAXUINT64, DEFAULT_START_TIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMixerBin::create-element: * @object: the #GstGLMixerBin * * Will be emitted when we need the processing element/s that this bin will use * * Returns: a new #GstElement */ gst_gl_mixer_bin_signals[SIGNAL_CREATE_ELEMENT] = g_signal_new ("create-element", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, GST_TYPE_ELEMENT, 0); gst_element_class_add_static_pad_template (element_class, &src_factory); upload_caps = gst_gl_upload_get_input_template_caps (); gst_element_class_add_pad_template (element_class, gst_pad_template_new ("sink_%u", GST_PAD_SINK, GST_PAD_REQUEST, upload_caps)); gst_caps_unref (upload_caps); gst_element_class_set_metadata (element_class, "OpenGL video_mixer empty bin", "Bin/Filter/Effect/Video/Mixer", "OpenGL video_mixer empty bin", "Matthew Waters <*****@*****.**>"); }
static void gst_ks_video_src_class_init (GstKsVideoSrcClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); GstBaseSrcClass *gstbasesrc_class = GST_BASE_SRC_CLASS (klass); GstPushSrcClass *gstpushsrc_class = GST_PUSH_SRC_CLASS (klass); g_type_class_add_private (klass, sizeof (GstKsVideoSrcPrivate)); parent_class = g_type_class_peek_parent (klass); gst_element_class_set_static_metadata (gstelement_class, "KsVideoSrc", "Source/Video", "Stream data from a video capture device through Windows kernel streaming", "Ole André Vadla Ravnås <*****@*****.**>\n" "Haakon Sporsheim <*****@*****.**>\n" "Andres Colubri <*****@*****.**>"); gst_element_class_add_pad_template (gstelement_class, gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, ks_video_get_all_caps ())); gobject_class->finalize = gst_ks_video_src_finalize; gobject_class->get_property = gst_ks_video_src_get_property; gobject_class->set_property = gst_ks_video_src_set_property; gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_ks_video_src_change_state); gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_ks_video_src_set_clock); gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_ks_video_src_get_caps); gstbasesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_ks_video_src_set_caps); gstbasesrc_class->fixate = GST_DEBUG_FUNCPTR (gst_ks_video_src_fixate); gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_ks_video_src_query); gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_ks_video_src_unlock); gstbasesrc_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_ks_video_src_unlock_stop); gstpushsrc_class->create = GST_DEBUG_FUNCPTR (gst_ks_video_src_create); g_object_class_install_property (gobject_class, PROP_DEVICE_PATH, g_param_spec_string ("device-path", "Device Path", "The device path", DEFAULT_DEVICE_PATH, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_DEVICE_NAME, g_param_spec_string ("device-name", "Device Name", "The human-readable device name", DEFAULT_DEVICE_NAME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_DEVICE_INDEX, g_param_spec_int ("device-index", "Device Index", "The zero-based device index", -1, G_MAXINT, DEFAULT_DEVICE_INDEX, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_DO_STATS, g_param_spec_boolean ("do-stats", "Enable statistics", "Enable logging of statistics", DEFAULT_DO_STATS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_FPS, g_param_spec_int ("fps", "Frames per second", "Last measured framerate, if statistics are enabled", -1, G_MAXINT, -1, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_ENABLE_QUIRKS, g_param_spec_boolean ("enable-quirks", "Enable quirks", "Enable driver-specific quirks", DEFAULT_ENABLE_QUIRKS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); }
static GstPadTemplate * gst_merger_sinkr_template_factory (void) { return gst_pad_template_new ("sink_r", GST_PAD_SINK, GST_PAD_ALWAYS, gst_merger_get_vout_capslist ()); }
static void gst_vaapidecode_class_init (GstVaapiDecodeClass * klass) { GObjectClass *const object_class = G_OBJECT_CLASS (klass); GstElementClass *const element_class = GST_ELEMENT_CLASS (klass); GstVideoDecoderClass *const vdec_class = GST_VIDEO_DECODER_CLASS (klass); GstPadTemplate *pad_template; GstVaapiDecoderMap *map; gchar *name, *longname, *description; GstCaps *caps; GST_DEBUG_CATEGORY_INIT (gst_debug_vaapidecode, GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC); parent_class = g_type_class_peek_parent (klass); gst_vaapi_plugin_base_class_init (GST_VAAPI_PLUGIN_BASE_CLASS (klass)); object_class->finalize = gst_vaapidecode_finalize; vdec_class->open = GST_DEBUG_FUNCPTR (gst_vaapidecode_open); vdec_class->close = GST_DEBUG_FUNCPTR (gst_vaapidecode_close); vdec_class->start = GST_DEBUG_FUNCPTR (gst_vaapidecode_start); vdec_class->stop = GST_DEBUG_FUNCPTR (gst_vaapidecode_stop); vdec_class->set_format = GST_DEBUG_FUNCPTR (gst_vaapidecode_set_format); vdec_class->flush = GST_DEBUG_FUNCPTR (gst_vaapidecode_flush); vdec_class->parse = GST_DEBUG_FUNCPTR (gst_vaapidecode_parse); vdec_class->handle_frame = GST_DEBUG_FUNCPTR (gst_vaapidecode_handle_frame); vdec_class->finish = GST_DEBUG_FUNCPTR (gst_vaapidecode_finish); vdec_class->drain = GST_DEBUG_FUNCPTR (gst_vaapidecode_drain); vdec_class->decide_allocation = GST_DEBUG_FUNCPTR (gst_vaapidecode_decide_allocation); vdec_class->src_query = GST_DEBUG_FUNCPTR (gst_vaapidecode_src_query); vdec_class->sink_query = GST_DEBUG_FUNCPTR (gst_vaapidecode_sink_query); vdec_class->getcaps = GST_DEBUG_FUNCPTR (gst_vaapidecode_sink_getcaps); vdec_class->sink_event = GST_DEBUG_FUNCPTR (gst_vaapidecode_sink_event); map = (GstVaapiDecoderMap *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass), GST_VAAPI_DECODE_PARAMS_QDATA); if (map->codec) { name = g_ascii_strup (map->name, -1); longname = g_strdup_printf ("VA-API %s decoder", name); description = g_strdup_printf ("A VA-API based %s video decoder", name); g_free (name); } else { longname = g_strdup ("VA-API decoder"); description = g_strdup (GST_PLUGIN_DESC); } element_class->set_context = gst_vaapi_base_set_context; gst_element_class_set_static_metadata (element_class, longname, "Codec/Decoder/Video/Hardware", description, "Gwenole Beauchesne <*****@*****.**>, " "Halley Zhao <*****@*****.**>, " "Sreerenj Balachandran <*****@*****.**>, " "Wind Yuan <*****@*****.**>"); g_free (longname); g_free (description); if (map->install_properties) map->install_properties (object_class); /* sink pad */ caps = gst_caps_from_string (map->caps_str); pad_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, caps); gst_caps_unref (caps); gst_element_class_add_pad_template (element_class, pad_template); /* src pad */ gst_element_class_add_static_pad_template (element_class, &gst_vaapidecode_src_factory); }
static void gst_video_mark_class_init (GstSimpleVideoMarkClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass); GstVideoFilterClass *video_filter_class = GST_VIDEO_FILTER_CLASS (klass); gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, gst_caps_from_string (VIDEO_CAPS))); gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, gst_caps_from_string (VIDEO_CAPS))); gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass), "Video marker", "Filter/Effect/Video", "Marks a video signal with a pattern", "Wim Taymans <*****@*****.**>"); gobject_class->set_property = gst_video_mark_set_property; gobject_class->get_property = gst_video_mark_get_property; gobject_class->dispose = gst_video_mark_dispose; gobject_class->finalize = gst_video_mark_finalize; base_transform_class->start = GST_DEBUG_FUNCPTR (gst_video_mark_start); base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_video_mark_stop); video_filter_class->set_info = GST_DEBUG_FUNCPTR (gst_video_mark_set_info); video_filter_class->transform_frame_ip = GST_DEBUG_FUNCPTR (gst_video_mark_transform_frame_ip); g_object_class_install_property (gobject_class, PROP_PATTERN_WIDTH, g_param_spec_int ("pattern-width", "Pattern width", "The width of the pattern markers", 1, G_MAXINT, DEFAULT_PATTERN_WIDTH, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PATTERN_HEIGHT, g_param_spec_int ("pattern-height", "Pattern height", "The height of the pattern markers", 1, G_MAXINT, DEFAULT_PATTERN_HEIGHT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PATTERN_COUNT, g_param_spec_int ("pattern-count", "Pattern count", "The number of pattern markers", 0, G_MAXINT, DEFAULT_PATTERN_COUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PATTERN_DATA_COUNT, g_param_spec_int ("pattern-data-count", "Pattern data count", "The number of extra data pattern markers", 0, 64, DEFAULT_PATTERN_DATA_COUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PATTERN_DATA, g_param_spec_uint64 ("pattern-data", "Pattern data", "The extra data pattern markers", 0, G_MAXUINT64, DEFAULT_PATTERN_DATA, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_ENABLED, g_param_spec_boolean ("enabled", "Enabled", "Enable or disable the filter", DEFAULT_ENABLED, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_LEFT_OFFSET, g_param_spec_int ("left-offset", "Left Offset", "The offset from the left border where the pattern starts", 0, G_MAXINT, DEFAULT_LEFT_OFFSET, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_BOTTOM_OFFSET, g_param_spec_int ("bottom-offset", "Bottom Offset", "The offset from the bottom border where the pattern starts", 0, G_MAXINT, DEFAULT_BOTTOM_OFFSET, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); }
static void gst_ffmpegmux_base_init (gpointer g_class) { GstFFMpegMuxClass *klass = (GstFFMpegMuxClass *) g_class; GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); GstPadTemplate *videosinktempl, *audiosinktempl, *srctempl; AVOutputFormat *in_plugin; GstCaps *srccaps, *audiosinkcaps, *videosinkcaps; enum AVCodecID *video_ids = NULL, *audio_ids = NULL; gchar *longname, *description, *name; const char *replacement; gboolean is_formatter; in_plugin = (AVOutputFormat *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass), GST_FFMUX_PARAMS_QDATA); g_assert (in_plugin != NULL); name = g_strdup (in_plugin->name); g_strdelimit (name, ".,|-<> ", '_'); /* construct the element details struct */ replacement = gst_ffmpegmux_get_replacement (in_plugin->name); is_formatter = gst_ffmpegmux_is_formatter (in_plugin->name); if (replacement != NULL) { longname = g_strdup_printf ("libav %s %s (not recommended, use %s instead)", in_plugin->long_name, is_formatter ? "formatter" : "muxer", replacement); description = g_strdup_printf ("libav %s %s (not recommended, use %s instead)", in_plugin->long_name, is_formatter ? "formatter" : "muxer", replacement); } else { longname = g_strdup_printf ("libav %s %s", in_plugin->long_name, is_formatter ? "formatter" : "muxer"); description = g_strdup_printf ("libav %s %s", in_plugin->long_name, is_formatter ? "formatter" : "muxer"); } gst_element_class_set_metadata (element_class, longname, is_formatter ? "Formatter/Metadata" : "Codec/Muxer", description, "Wim Taymans <*****@*****.**>, " "Ronald Bultje <*****@*****.**>"); g_free (longname); g_free (description); /* Try to find the caps that belongs here */ srccaps = gst_ffmpeg_formatid_to_caps (name); if (!srccaps) { GST_DEBUG ("Couldn't get source caps for muxer '%s', skipping", name); goto beach; } if (!gst_ffmpeg_formatid_get_codecids (in_plugin->name, &video_ids, &audio_ids, in_plugin)) { gst_caps_unref (srccaps); GST_DEBUG ("Couldn't get sink caps for muxer '%s'. Most likely because " "no input format mapping exists.", name); goto beach; } videosinkcaps = video_ids ? gst_ffmpegmux_get_id_caps (video_ids) : NULL; audiosinkcaps = audio_ids ? gst_ffmpegmux_get_id_caps (audio_ids) : NULL; /* fix up allowed caps for some muxers */ /* FIXME : This should be in gstffmpegcodecmap.c ! */ if (strcmp (in_plugin->name, "flv") == 0) { const gint rates[] = { 44100, 22050, 11025 }; gst_ffmpeg_mux_simple_caps_set_int_list (audiosinkcaps, "rate", 3, rates); } else if (strcmp (in_plugin->name, "dv") == 0) { gst_caps_set_simple (audiosinkcaps, "rate", G_TYPE_INT, 48000, "channels", G_TYPE_INT, 2, NULL); } else if (strcmp (in_plugin->name, "gif") == 0) { if (videosinkcaps) gst_caps_unref (videosinkcaps); videosinkcaps = gst_caps_from_string ("video/x-raw, format=(string)RGB"); } /* pad templates */ srctempl = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, srccaps); gst_element_class_add_pad_template (element_class, srctempl); gst_caps_unref (srccaps); if (audiosinkcaps) { audiosinktempl = gst_pad_template_new ("audio_%u", GST_PAD_SINK, GST_PAD_REQUEST, audiosinkcaps); gst_element_class_add_pad_template (element_class, audiosinktempl); gst_caps_unref (audiosinkcaps); } if (videosinkcaps) { videosinktempl = gst_pad_template_new ("video_%u", GST_PAD_SINK, GST_PAD_REQUEST, videosinkcaps); gst_element_class_add_pad_template (element_class, videosinktempl); gst_caps_unref (videosinkcaps); } beach: klass->in_plugin = in_plugin; g_free (name); }
static void gst_gl_sink_bin_class_init (GstGLSinkBinClass * klass) { GObjectClass *gobject_class; GstElementClass *element_class; GstCaps *upload_caps; gobject_class = (GObjectClass *) klass; element_class = GST_ELEMENT_CLASS (klass); element_class->change_state = gst_gl_sink_bin_change_state; gobject_class->set_property = gst_gl_sink_bin_set_property; gobject_class->get_property = gst_gl_sink_bin_get_property; g_object_class_install_property (gobject_class, PROP_FORCE_ASPECT_RATIO, g_param_spec_boolean ("force-aspect-ratio", "Force aspect ratio", "When enabled, scaling will respect original aspect ratio", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_SINK, g_param_spec_object ("sink", "GL sink element", "The GL sink chain to use", GST_TYPE_ELEMENT, GST_PARAM_MUTABLE_READY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /* base sink */ g_object_class_install_property (gobject_class, PROP_SYNC, g_param_spec_boolean ("sync", "Sync", "Sync on the clock", DEFAULT_SYNC, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_MAX_LATENESS, g_param_spec_int64 ("max-lateness", "Max Lateness", "Maximum number of nanoseconds that a buffer can be late before it " "is dropped (-1 unlimited)", -1, G_MAXINT64, DEFAULT_MAX_LATENESS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_QOS, g_param_spec_boolean ("qos", "Qos", "Generate Quality-of-Service events upstream", DEFAULT_QOS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_ASYNC, g_param_spec_boolean ("async", "Async", "Go asynchronously to PAUSED", DEFAULT_ASYNC, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_TS_OFFSET, g_param_spec_int64 ("ts-offset", "TS Offset", "Timestamp offset in nanoseconds", G_MININT64, G_MAXINT64, DEFAULT_TS_OFFSET, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_ENABLE_LAST_SAMPLE, g_param_spec_boolean ("enable-last-sample", "Enable Last Buffer", "Enable the last-sample property", DEFAULT_ENABLE_LAST_SAMPLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_LAST_SAMPLE, g_param_spec_boxed ("last-sample", "Last Sample", "The last sample received in the sink", GST_TYPE_SAMPLE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_BLOCKSIZE, g_param_spec_uint ("blocksize", "Block size", "Size in bytes to pull per buffer (0 = default)", 0, G_MAXUINT, DEFAULT_BLOCKSIZE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_RENDER_DELAY, g_param_spec_uint64 ("render-delay", "Render Delay", "Additional render delay of the sink in nanoseconds", 0, G_MAXUINT64, DEFAULT_RENDER_DELAY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_THROTTLE_TIME, g_param_spec_uint64 ("throttle-time", "Throttle time", "The time to keep between rendered buffers (0 = disabled)", 0, G_MAXUINT64, DEFAULT_THROTTLE_TIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_MAX_BITRATE, g_param_spec_uint64 ("max-bitrate", "Max Bitrate", "The maximum bits per second to render (0 = disabled)", 0, G_MAXUINT64, DEFAULT_MAX_BITRATE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /* colorbalance */ g_object_class_install_property (gobject_class, PROP_CONTRAST, g_param_spec_double ("contrast", "Contrast", "contrast", 0.0, 2.0, DEFAULT_PROP_CONTRAST, GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_BRIGHTNESS, g_param_spec_double ("brightness", "Brightness", "brightness", -1.0, 1.0, DEFAULT_PROP_BRIGHTNESS, GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_HUE, g_param_spec_double ("hue", "Hue", "hue", -1.0, 1.0, DEFAULT_PROP_HUE, GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_SATURATION, g_param_spec_double ("saturation", "Saturation", "saturation", 0.0, 2.0, DEFAULT_PROP_SATURATION, GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstGLSinkBin::create-element: * @object: the #GstGLSinkBin * * Will be emitted when we need the processing element/s that this bin will use * * Returns: a new #GstElement */ gst_gl_sink_bin_signals[SIGNAL_CREATE_ELEMENT] = g_signal_new ("create-element", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, GST_TYPE_ELEMENT, 0); gst_element_class_set_metadata (element_class, "GL Sink Bin", "Sink/Video", "Infrastructure to process GL textures", "Matthew Waters <*****@*****.**>"); upload_caps = gst_gl_upload_get_input_template_caps (); gst_element_class_add_pad_template (element_class, gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, upload_caps)); gst_caps_unref (upload_caps); }
static void gst_video_detect_class_init (GstSimpleVideoMarkDetectClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass); GstVideoFilterClass *video_filter_class = GST_VIDEO_FILTER_CLASS (klass); gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, gst_caps_from_string (VIDEO_CAPS))); gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, gst_caps_from_string (VIDEO_CAPS))); gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass), "Video detecter", "Filter/Effect/Video", "Detect patterns in a video signal", "Wim Taymans <*****@*****.**>"); gobject_class->set_property = gst_video_detect_set_property; gobject_class->get_property = gst_video_detect_get_property; gobject_class->dispose = gst_video_detect_dispose; gobject_class->finalize = gst_video_detect_finalize; base_transform_class->start = GST_DEBUG_FUNCPTR (gst_video_detect_start); base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_video_detect_stop); video_filter_class->set_info = GST_DEBUG_FUNCPTR (gst_video_detect_set_info); video_filter_class->transform_frame_ip = GST_DEBUG_FUNCPTR (gst_video_detect_transform_frame_ip); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MESSAGE, g_param_spec_boolean ("message", "Message", "Post detected data as bus messages", DEFAULT_MESSAGE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PATTERN_WIDTH, g_param_spec_int ("pattern-width", "Pattern width", "The width of the pattern markers", 1, G_MAXINT, DEFAULT_PATTERN_WIDTH, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PATTERN_HEIGHT, g_param_spec_int ("pattern-height", "Pattern height", "The height of the pattern markers", 1, G_MAXINT, DEFAULT_PATTERN_HEIGHT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PATTERN_COUNT, g_param_spec_int ("pattern-count", "Pattern count", "The number of pattern markers", 0, G_MAXINT, DEFAULT_PATTERN_COUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PATTERN_DATA_COUNT, g_param_spec_int ("pattern-data-count", "Pattern data count", "The number of extra data pattern markers", 0, G_MAXINT, DEFAULT_PATTERN_DATA_COUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PATTERN_CENTER, g_param_spec_double ("pattern-center", "Pattern center", "The center of the black/white separation (0.0 = lowest, 1.0 highest)", 0.0, 1.0, DEFAULT_PATTERN_CENTER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PATTERN_SENSITIVITY, g_param_spec_double ("pattern-sensitivity", "Pattern sensitivity", "The sensitivity around the center for detecting the markers " "(0.0 = lowest, 1.0 highest)", 0.0, 1.0, DEFAULT_PATTERN_SENSITIVITY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_LEFT_OFFSET, g_param_spec_int ("left-offset", "Left Offset", "The offset from the left border where the pattern starts", 0, G_MAXINT, DEFAULT_LEFT_OFFSET, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_BOTTOM_OFFSET, g_param_spec_int ("bottom-offset", "Bottom Offset", "The offset from the bottom border where the pattern starts", 0, G_MAXINT, DEFAULT_BOTTOM_OFFSET, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); }