static gboolean gst_gl_filter_query (GstBaseTransform * trans, GstPadDirection direction, GstQuery * query) { GstGLFilter *filter; gboolean res; filter = GST_GL_FILTER (trans); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_CONTEXT: { res = gst_gl_handle_context_query ((GstElement *) filter, query, &filter->display); break; } default: res = GST_BASE_TRANSFORM_CLASS (parent_class)->query (trans, direction, query); break; } return res; }
static void gst_gl_deinterlace_class_init (GstGLDeinterlaceClass * klass) { GObjectClass *gobject_class; GstElementClass *element_class; gobject_class = (GObjectClass *) klass; element_class = GST_ELEMENT_CLASS (klass); gobject_class->set_property = gst_gl_deinterlace_set_property; gobject_class->get_property = gst_gl_deinterlace_get_property; gst_element_class_set_metadata (element_class, "OpenGL deinterlacing filter", "Deinterlace", "Deinterlacing based on fragment shaders", "Julien Isorce <*****@*****.**>"); GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_deinterlace_reset; GST_GL_FILTER_CLASS (klass)->filter = gst_gl_deinterlace_filter; GST_GL_FILTER_CLASS (klass)->filter_texture = gst_gl_deinterlace_filter_texture; GST_GL_FILTER_CLASS (klass)->init_fbo = gst_gl_deinterlace_init_shader; GST_GL_BASE_FILTER_CLASS (klass)->supported_gl_api = GST_GL_API_OPENGL; }
static void gst_schrodownsample_class_init (gpointer g_class, gpointer class_data) { GObjectClass *gobject_class; GstBaseTransformClass *base_transform_class; GstSchrodownsampleClass *downsample_class; gobject_class = G_OBJECT_CLASS (g_class); base_transform_class = GST_BASE_TRANSFORM_CLASS (g_class); downsample_class = GST_SCHRODOWNSAMPLE_CLASS (g_class); gobject_class->set_property = gst_schrodownsample_set_property; gobject_class->get_property = gst_schrodownsample_get_property; g_object_class_install_property (gobject_class, ARG_WAVELET_TYPE, g_param_spec_int ("wavelet-type", "wavelet type", "wavelet type", 0, 4, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_LEVEL, g_param_spec_int ("level", "level", "level", 0, 100, 0, G_PARAM_READWRITE)); base_transform_class->transform = gst_schrodownsample_transform; base_transform_class->transform_caps = gst_schrodownsample_transform_caps; base_transform_class->get_unit_size = gst_schrodownsample_get_unit_size; }
static void gst_timestampoverlay_class_init (GstTimeStampOverlayClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *gstelement_class = GST_ELEMENT_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 (gstelement_class, gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, gst_caps_from_string (VIDEO_SRC_CAPS))); gst_element_class_add_pad_template (gstelement_class, gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, gst_caps_from_string (VIDEO_SINK_CAPS))); gst_element_class_set_static_metadata (gstelement_class, "Timestampoverlay", "Generic", "Draws the various timestamps on the " "video so they can be read off the video afterwards", "William Manley <*****@*****.**>"); gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_timestampoverlay_dispose); gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_timestampoverlay_set_clock); base_transform_class->src_event = GST_DEBUG_FUNCPTR (gst_timestampoverlay_src_event); video_filter_class->transform_frame_ip = GST_DEBUG_FUNCPTR (gst_timestampoverlay_transform_frame_ip); }
static void gst_rsvg_overlay_class_init (GstRsvgOverlayClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; GstBaseTransformClass *basetransform_class = GST_BASE_TRANSFORM_CLASS (klass); gobject_class->set_property = gst_rsvg_overlay_set_property; gobject_class->get_property = gst_rsvg_overlay_get_property; gobject_class->finalize = gst_rsvg_overlay_finalize; g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DATA, g_param_spec_string ("data", "data", "SVG data.", "", G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FILENAME, g_param_spec_string ("location", "location", "SVG file location.", "", G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FIT_TO_FRAME, g_param_spec_boolean ("fit-to-frame", "fit to frame", "Fit the SVG to fill the whole frame.", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_X, g_param_spec_int ("x", "x offset", "Specify an x offset.", -G_MAXINT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_Y, g_param_spec_int ("y", "y offset", "Specify a y offset.", -G_MAXINT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_X_RELATIVE, g_param_spec_float ("x-relative", "x relative offset", "Specify an x offset relative to the display size.", -G_MAXFLOAT, G_MAXFLOAT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_Y_RELATIVE, g_param_spec_float ("y-relative", "y relative offset", "Specify a y offset relative to the display size.", -G_MAXFLOAT, G_MAXFLOAT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_WIDTH, g_param_spec_int ("width", "width", "Specify a width in pixels.", -G_MAXINT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HEIGHT, g_param_spec_int ("height", "height", "Specify a height in pixels.", -G_MAXINT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_WIDTH_RELATIVE, g_param_spec_float ("width-relative", "relative width", "Specify a width relative to the display size.", -G_MAXFLOAT, G_MAXFLOAT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HEIGHT_RELATIVE, g_param_spec_float ("height-relative", "relative height", "Specify a height relative to the display size.", -G_MAXFLOAT, G_MAXFLOAT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); basetransform_class->set_caps = gst_rsvg_overlay_set_caps; basetransform_class->transform_ip = gst_rsvg_overlay_transform_ip; basetransform_class->stop = gst_rsvg_overlay_stop; basetransform_class->passthrough_on_same_caps = FALSE; }
static void gst_caps_setter_class_init (GstCapsSetterClass * g_class) { GObjectClass *gobject_class; GstBaseTransformClass *trans_class; gobject_class = G_OBJECT_CLASS (g_class); trans_class = GST_BASE_TRANSFORM_CLASS (g_class); GST_DEBUG_CATEGORY_INIT (caps_setter_debug, "capssetter", 0, "capssetter"); gobject_class->set_property = gst_caps_setter_set_property; gobject_class->get_property = gst_caps_setter_get_property; gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_caps_setter_finalize); g_object_class_install_property (gobject_class, PROP_CAPS, g_param_spec_boxed ("caps", "Merge caps", "Merge these caps (thereby overwriting) in the stream", GST_TYPE_CAPS, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_JOIN, g_param_spec_boolean ("join", "Join", "Match incoming caps' mime-type to mime-type of provided caps", DEFAULT_JOIN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_REPLACE, g_param_spec_boolean ("replace", "Replace", "Drop fields of incoming caps", DEFAULT_REPLACE, G_PARAM_READWRITE)); trans_class->transform_size = GST_DEBUG_FUNCPTR (gst_caps_setter_transform_size); trans_class->transform_caps = GST_DEBUG_FUNCPTR (gst_caps_setter_transform_caps); /* dummy seems needed */ trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_caps_setter_transform_ip); }
static gboolean gst_ffmpegscale_src_event (GstBaseTransform * trans, GstEvent * event) { GstFFMpegScale *scale; GstStructure *structure; gdouble pointer; gboolean res; scale = GST_FFMPEGSCALE (trans); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NAVIGATION: event = gst_event_make_writable (event); structure = gst_event_writable_structure (event); if (gst_structure_get_double (structure, "pointer_x", &pointer)) { gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, pointer * scale->in_info.width / scale->out_info.width, NULL); } if (gst_structure_get_double (structure, "pointer_y", &pointer)) { gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, pointer * scale->in_info.height / scale->out_info.height, NULL); } break; default: break; } res = GST_BASE_TRANSFORM_CLASS (parent_class)->src_event (trans, event); return res; }
static void gst_webrtc_echo_probe_class_init (GstWebrtcEchoProbeClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstBaseTransformClass *btrans_class = GST_BASE_TRANSFORM_CLASS (klass); GstAudioFilterClass *audiofilter_class = GST_AUDIO_FILTER_CLASS (klass); gobject_class->finalize = gst_webrtc_echo_probe_finalize; btrans_class->passthrough_on_same_caps = TRUE; btrans_class->src_event = GST_DEBUG_FUNCPTR (gst_webrtc_echo_probe_src_event); btrans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_webrtc_echo_probe_transform_ip); btrans_class->stop = GST_DEBUG_FUNCPTR (gst_webrtc_echo_probe_stop); audiofilter_class->setup = GST_DEBUG_FUNCPTR (gst_webrtc_echo_probe_setup); gst_element_class_add_static_pad_template (element_class, &gst_webrtc_echo_probe_src_template); gst_element_class_add_static_pad_template (element_class, &gst_webrtc_echo_probe_sink_template); gst_element_class_set_static_metadata (element_class, "Accoustic Echo Canceller probe", "Generic/Audio", "Gathers playback buffers for webrtcdsp", "Nicolas Dufresne <*****@*****.**>"); }
static void webkit_media_playready_decrypt_class_init(WebKitMediaPlayReadyDecryptClass* klass) { GObjectClass* gobjectClass = G_OBJECT_CLASS(klass); GstBaseTransformClass* baseTransformClass = GST_BASE_TRANSFORM_CLASS(klass); GstElementClass* elementClass = GST_ELEMENT_CLASS(klass); gobjectClass->dispose = webkit_media_playready_decrypt_dispose; gst_element_class_add_pad_template(elementClass, gst_static_pad_template_get(&sinkTemplate)); gst_element_class_add_pad_template(elementClass, gst_static_pad_template_get(&srcTemplate)); gst_element_class_set_static_metadata(elementClass, "Decrypt content encrypted using PlayReady Encryption", GST_ELEMENT_FACTORY_KLASS_DECRYPTOR, "Decrypts media that has been encrypted using PlayReady Encryption.", "Philippe Normand <*****@*****.**>"); GST_DEBUG_CATEGORY_INIT(webkit_media_playready_decrypt_debug_category, "webkitplayready", 0, "PlayReady decryptor"); elementClass->change_state = GST_DEBUG_FUNCPTR(webKitMediaPlayReadyDecryptChangeState); baseTransformClass->transform_ip = GST_DEBUG_FUNCPTR(webkitMediaPlayReadyDecryptTransformInPlace); baseTransformClass->transform_caps = GST_DEBUG_FUNCPTR(webkitMediaPlayReadyDecryptTransformCaps); baseTransformClass->sink_event = GST_DEBUG_FUNCPTR(webkitMediaPlayReadyDecryptSinkEventHandler); baseTransformClass->transform_ip_on_passthrough = FALSE; }
static gboolean gst_v4l2_transform_decide_allocation (GstBaseTransform * trans, GstQuery * query) { GstV4l2Transform *self = GST_V4L2_TRANSFORM (trans); gboolean ret = FALSE; GST_DEBUG_OBJECT (self, "called"); if (gst_v4l2_object_decide_allocation (self->v4l2capture, query)) { GstBufferPool *pool = GST_BUFFER_POOL (self->v4l2capture->pool); ret = GST_BASE_TRANSFORM_CLASS (parent_class)->decide_allocation (trans, query); if (!gst_buffer_pool_set_active (pool, TRUE)) goto activate_failed; } return ret; activate_failed: GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS, ("failed to activate bufferpool"), ("failed to activate bufferpool")); return TRUE; }
static void gst_audio_amplify_class_init (GstAudioAmplifyClass * klass) { GObjectClass *gobject_class; gobject_class = (GObjectClass *) klass; gobject_class->set_property = gst_audio_amplify_set_property; gobject_class->get_property = gst_audio_amplify_get_property; g_object_class_install_property (gobject_class, PROP_AMPLIFICATION, g_param_spec_float ("amplification", "Amplification", "Factor of amplification", 0.0, G_MAXFLOAT, 1.0, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); /** * GstAudioAmplify:clipping-method * * Clipping method: clip mode set values higher than the maximum to the * maximum. The wrap-negative mode pushes those values back from the * opposite side, wrap-positive pushes them back from the same side. * **/ g_object_class_install_property (gobject_class, PROP_CLIPPING_METHOD, g_param_spec_enum ("clipping-method", "Clipping method", "Selects how to handle values higher than the maximum", GST_TYPE_AUDIO_AMPLIFY_CLIPPING_METHOD, METHOD_CLIP, G_PARAM_READWRITE)); GST_AUDIO_FILTER_CLASS (klass)->setup = GST_DEBUG_FUNCPTR (gst_audio_amplify_setup); GST_BASE_TRANSFORM_CLASS (klass)->transform_ip = GST_DEBUG_FUNCPTR (gst_audio_amplify_transform_ip); }
/* initialize the plugin's class */ static void gst_aubio_tempo_class_init (GstAubioTempoClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); GstBaseTransformClass *trans_class = GST_BASE_TRANSFORM_CLASS (klass); //GstAudioFilterClass *filter_class = GST_AUDIO_FILTER_CLASS (klass); //trans_class->stop = GST_DEBUG_FUNCPTR (gst_aubio_tempo_stop); //trans_class->event = GST_DEBUG_FUNCPTR (gst_aubio_tempo_event); trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_aubio_tempo_transform_ip); trans_class->passthrough_on_same_caps = TRUE; gobject_class->finalize = gst_aubio_tempo_finalize; gobject_class->set_property = gst_aubio_tempo_set_property; gobject_class->get_property = gst_aubio_tempo_get_property; g_object_class_install_property (gobject_class, PROP_SILENT, g_param_spec_boolean ("silent", "Silent", "Produce verbose output", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MESSAGE, g_param_spec_boolean ("message", "Message", "Emit gstreamer messages", TRUE, G_PARAM_READWRITE)); GST_DEBUG_CATEGORY_INIT (aubiotempo_debug, "aubiotempo", 0, "Aubio tempo extraction"); }
static void gst_video_filter2_class_init (GstVideoFilter2Class * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass); gobject_class->set_property = gst_video_filter2_set_property; gobject_class->get_property = gst_video_filter2_get_property; gobject_class->dispose = gst_video_filter2_dispose; gobject_class->finalize = gst_video_filter2_finalize; base_transform_class->transform_caps = GST_DEBUG_FUNCPTR (gst_video_filter2_transform_caps); base_transform_class->get_unit_size = GST_DEBUG_FUNCPTR (gst_video_filter2_get_unit_size); base_transform_class->set_caps = GST_DEBUG_FUNCPTR (gst_video_filter2_set_caps); base_transform_class->start = GST_DEBUG_FUNCPTR (gst_video_filter2_start); base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_video_filter2_stop); base_transform_class->transform = GST_DEBUG_FUNCPTR (gst_video_filter2_transform); base_transform_class->transform_ip = GST_DEBUG_FUNCPTR (gst_video_filter2_transform_ip); }
static void gst_rgb2bayer_class_init (GstRGB2BayerClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass); gobject_class->finalize = gst_rgb2bayer_finalize; gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&gst_rgb2bayer_src_template)); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&gst_rgb2bayer_sink_template)); gst_element_class_set_static_metadata (element_class, "RGB to Bayer converter", "Filter/Converter/Video", "Converts video/x-raw to video/x-bayer", "David Schleef <*****@*****.**>"); base_transform_class->transform_caps = GST_DEBUG_FUNCPTR (gst_rgb2bayer_transform_caps); base_transform_class->get_unit_size = GST_DEBUG_FUNCPTR (gst_rgb2bayer_get_unit_size); base_transform_class->set_caps = GST_DEBUG_FUNCPTR (gst_rgb2bayer_set_caps); base_transform_class->transform = GST_DEBUG_FUNCPTR (gst_rgb2bayer_transform); GST_DEBUG_CATEGORY_INIT (gst_rgb2bayer_debug, "rgb2bayer", 0, "rgb2bayer element"); }
static void gst_logoinsert_class_init (GstLogoinsertClass * klass) { GObjectClass *gobject_class; GstBaseTransformClass *base_transform_class; gobject_class = G_OBJECT_CLASS (klass); base_transform_class = GST_BASE_TRANSFORM_CLASS (klass); gobject_class->set_property = gst_logoinsert_set_property; gobject_class->get_property = gst_logoinsert_get_property; gobject_class->dispose = gst_logoinsert_dispose; gobject_class->finalize = gst_logoinsert_finalize; g_object_class_install_property (gobject_class, ARG_LOCATION, g_param_spec_string ("location", "location", "location of PNG file to overlay", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, ARG_DATA, gst_param_spec_mini_object ("data", "data", "Buffer containing PNG file to overlay", GST_TYPE_BUFFER, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); base_transform_class->set_caps = gst_logoinsert_set_caps; base_transform_class->transform_ip = gst_logoinsert_transform_ip; }
static void gst_stereo_class_init (GstStereoClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstBaseTransformClass *trans_class = GST_BASE_TRANSFORM_CLASS (klass); GstAudioFilterClass *audiofilter_class = GST_AUDIO_FILTER_CLASS (klass); GstCaps *caps; gst_element_class_set_static_metadata (element_class, "Stereo effect", "Filter/Effect/Audio", "Muck with the stereo signal to enhance its 'stereo-ness'", "Erik Walthinsen <*****@*****.**>"); caps = gst_caps_from_string (ALLOWED_CAPS); gst_audio_filter_class_add_pad_templates (audiofilter_class, caps); gst_caps_unref (caps); gobject_class->set_property = gst_stereo_set_property; gobject_class->get_property = gst_stereo_get_property; g_object_class_install_property (gobject_class, ARG_ACTIVE, g_param_spec_boolean ("active", "active", "active", TRUE, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.1, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS)); trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_stereo_transform_ip); }
static void gst_cenc_decrypt_class_init (GstCencDecryptClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&gst_cenc_decrypt_sink_template)); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&gst_cenc_decrypt_src_template)); gst_element_class_set_static_metadata (element_class, "Decrypt content encrypted using ISOBMFF Common Encryption", GST_ELEMENT_FACTORY_KLASS_DECRYPTOR, "Decrypts media that has been encrypted using ISOBMFF Common Encryption.", "Alex Ashley <*****@*****.**>"); GST_DEBUG_CATEGORY_INIT (gst_cenc_decrypt_debug_category, "cencdec", 0, "CENC decryptor"); gobject_class->dispose = gst_cenc_decrypt_dispose; gobject_class->finalize = gst_cenc_decrypt_finalize; base_transform_class->start = GST_DEBUG_FUNCPTR (gst_cenc_decrypt_start); base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_cenc_decrypt_stop); base_transform_class->transform_ip = GST_DEBUG_FUNCPTR (gst_cenc_decrypt_transform_ip); base_transform_class->transform_caps = GST_DEBUG_FUNCPTR (gst_cenc_decrypt_transform_caps); base_transform_class->sink_event = GST_DEBUG_FUNCPTR (gst_cenc_decrypt_sink_event_handler); base_transform_class->transform_ip_on_passthrough = FALSE; }
/* Queue the segment event if there was no caps event */ static gboolean gst_capsfilter_sink_event (GstBaseTransform * trans, GstEvent * event) { GstCapsFilter *filter = GST_CAPSFILTER (trans); if (GST_EVENT_TYPE (event) == GST_EVENT_FLUSH_STOP) { GList *l; for (l = filter->pending_events; l;) { if (GST_EVENT_TYPE (l->data) == GST_EVENT_SEGMENT) { gst_event_unref (l->data); l = g_list_delete_link (l, l); } else { l = l->next; } } } if (!GST_EVENT_IS_STICKY (event) || GST_EVENT_TYPE (event) <= GST_EVENT_CAPS) goto done; /* If we get EOS before any buffers, just push all pending events */ if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) { GList *l; for (l = g_list_last (filter->pending_events); l; l = l->prev) { GST_LOG_OBJECT (trans, "Forwarding %s event", GST_EVENT_TYPE_NAME (l->data)); GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, l->data); } g_list_free (filter->pending_events); filter->pending_events = NULL; } else if (!gst_pad_has_current_caps (trans->sinkpad)) { GST_LOG_OBJECT (trans, "Got %s event before caps, queueing", GST_EVENT_TYPE_NAME (event)); filter->pending_events = g_list_prepend (filter->pending_events, event); return TRUE; } done: GST_LOG_OBJECT (trans, "Forwarding %s event", GST_EVENT_TYPE_NAME (event)); return GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, event); }
static void gst_frame_positionner_class_init (GstFramePositionnerClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass); gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), gst_static_pad_template_get (&gst_frame_positionner_src_template)); gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), gst_static_pad_template_get (&gst_frame_positionner_sink_template)); gobject_class->set_property = gst_frame_positionner_set_property; gobject_class->get_property = gst_frame_positionner_get_property; base_transform_class->transform_ip = GST_DEBUG_FUNCPTR (gst_frame_positionner_transform_ip); /** * gstframepositionner:alpha: * * The desired alpha for the stream. */ g_object_class_install_property (gobject_class, PROP_ALPHA, g_param_spec_double ("alpha", "alpha", "alpha of the stream", 0.0, 1.0, 1.0, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); /** * gstframepositionner:posx: * * The desired x position for the stream. */ g_object_class_install_property (gobject_class, PROP_POSX, g_param_spec_int ("posx", "posx", "x position of the stream", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); /** * gstframepositionner:posy: * * The desired y position for the stream. */ g_object_class_install_property (gobject_class, PROP_POSY, g_param_spec_int ("posy", "posy", "y position of the stream", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); /** * gstframepositionner:zorder: * * The desired z order for the stream. */ g_object_class_install_property (gobject_class, PROP_ZORDER, g_param_spec_uint ("zorder", "zorder", "z order of the stream", 0, 10000, 0, G_PARAM_READWRITE)); gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass), "frame positionner", "Metadata", "This element provides with tagging facilities", "*****@*****.**"); }
static void gst_tcambiteater_class_init (GstTcamBitEaterClass* klass) { GObjectClass* gobject_class; GstElementClass* gstelement_class; gobject_class = (GObjectClass*) klass; gstelement_class = (GstElementClass*) klass; gobject_class->set_property = gst_tcambiteater_set_property; gobject_class->get_property = gst_tcambiteater_get_property; gobject_class->finalize = gst_tcambiteater_finalize; gst_element_class_set_static_metadata(gstelement_class, "Bit depth reduction module", "Filter/Converter/Video", "Converts 64bit rgb to 32 bit", "The Imaging Source <*****@*****.**>"); #define SRC_CAPS \ GST_VIDEO_CAPS_MAKE("{ BGRx }") gst_element_class_add_pad_template(gstelement_class, gst_pad_template_new("src", GST_PAD_SRC, GST_PAD_ALWAYS, gst_caps_from_string(SRC_CAPS))); GstCaps* caps = gst_caps_from_string("video/x-raw,format=(string)RGBx64," \ "width=(int)[1,MAX],height=(int)[1,MAX],framerate=(fraction)[0/1,MAX];"); gst_element_class_add_pad_template(gstelement_class, gst_pad_template_new("sink", GST_PAD_SINK, GST_PAD_ALWAYS, caps)); GST_BASE_TRANSFORM_CLASS(klass)->transform_caps = GST_DEBUG_FUNCPTR(gst_tcambiteater_transform_caps); GST_BASE_TRANSFORM_CLASS(klass)->get_unit_size = GST_DEBUG_FUNCPTR(gst_tcambiteater_get_unit_size); GST_BASE_TRANSFORM_CLASS(klass)->set_caps = GST_DEBUG_FUNCPTR(gst_tcambiteater_set_caps); GST_BASE_TRANSFORM_CLASS(klass)->transform = GST_DEBUG_FUNCPTR(gst_tcambiteater_transform); GST_DEBUG_CATEGORY_INIT(gst_tcambiteater_debug_category, "tcambiteater", 0, "tcambiteater element"); }
static void gst_gl_filter_class_init (GstGLFilterClass * klass) { GObjectClass *gobject_class; gobject_class = (GObjectClass *) klass; gobject_class->set_property = gst_gl_filter_set_property; gobject_class->get_property = gst_gl_filter_get_property; GST_BASE_TRANSFORM_CLASS (klass)->transform_caps = gst_gl_filter_transform_caps; GST_BASE_TRANSFORM_CLASS (klass)->transform = gst_gl_filter_transform; GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_filter_start; GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_filter_stop; GST_BASE_TRANSFORM_CLASS (klass)->set_caps = gst_gl_filter_set_caps; GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size = gst_gl_filter_get_unit_size; GST_BASE_TRANSFORM_CLASS (klass)->prepare_output_buffer = gst_gl_filter_prepare_output_buffer; klass->set_caps = NULL; klass->filter = NULL; klass->display_init_cb = NULL; klass->display_reset_cb = NULL; klass->onInitFBO = NULL; klass->onStart = NULL; klass->onStop = NULL; klass->onReset = NULL; }
static void gst_skor_sink_class_init (GstSkorSinkClass * klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; GstBaseTransformClass *trans_class; GstVideoFilterClass *vfilter_class; gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; trans_class = GST_BASE_TRANSFORM_CLASS (klass); vfilter_class = GST_VIDEO_FILTER_CLASS (klass); gobject_class->set_property = gst_skor_sink_set_property; gobject_class->get_property = gst_skor_sink_get_property; gobject_class->finalize = gst_skor_sink_finalize; g_object_class_install_property (gobject_class, PROP_MESSAGE, g_param_spec_boolean ("message", "message", "Post a barcode message for each detected code", DEFAULT_MESSAGE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_ATTACH_FRAME, g_param_spec_boolean ("attach-frame", "Attach frame", "Attach a frame dump to each barcode message", DEFAULT_ATTACH_FRAME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_CACHE, g_param_spec_boolean ("cache", "cache", "Enable or disable the inter-image result cache", DEFAULT_CACHE, G_PARAM_READWRITE | GST_PARAM_MUTABLE_READY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_DATA_CONSUMER, g_param_spec_pointer ("dataconsumer", "Data Consumer", "Function pointer of type void (*)(const char *) that will be invoked for every decoded datum", G_PARAM_WRITABLE | GST_PARAM_MUTABLE_READY | G_PARAM_STATIC_STRINGS)); gst_element_class_set_details_simple(gstelement_class, "SkorSink", "Filter/Analyzer/Video", "Detect bar codes in the video streams", "Phil <*****@*****.**>"); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_skor_sink_src_template)); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_skor_sink_sink_template)); trans_class->start = GST_DEBUG_FUNCPTR (gst_skor_sink_start); trans_class->stop = GST_DEBUG_FUNCPTR (gst_skor_sink_stop); trans_class->transform_ip_on_passthrough = FALSE; vfilter_class->transform_frame_ip = GST_DEBUG_FUNCPTR (gst_skor_sink_transform_frame_ip); }
static gboolean webkitMediaCommonEncryptionDecryptSinkEventHandler(GstBaseTransform* trans, GstEvent* event) { WebKitMediaCommonEncryptionDecrypt* self = WEBKIT_MEDIA_CENC_DECRYPT(trans); WebKitMediaCommonEncryptionDecryptPrivate* priv = WEBKIT_MEDIA_CENC_DECRYPT_GET_PRIVATE(self); WebKitMediaCommonEncryptionDecryptClass* klass = WEBKIT_MEDIA_CENC_DECRYPT_GET_CLASS(self); gboolean result = FALSE; switch (GST_EVENT_TYPE(event)) { case GST_EVENT_PROTECTION: { const char* systemId; const char* origin; GstBuffer* initDataBuffer; GST_DEBUG_OBJECT(self, "received protection event"); gst_event_parse_protection(event, &systemId, &initDataBuffer, &origin); GST_DEBUG_OBJECT(self, "systemId: %s", systemId); if (!g_str_equal(systemId, klass->protectionSystemId)) { gst_event_unref(event); result = TRUE; break; } // Keep the event ref around so that the parsed event data // remains valid until the drm-key-need message has been sent. priv->protectionEvent = event; RunLoop::main().dispatch([self, initDataBuffer] { if (self) { WebKitMediaCommonEncryptionDecryptClass* klass = WEBKIT_MEDIA_CENC_DECRYPT_GET_CLASS(self); klass->requestDecryptionKey(self, initDataBuffer); if (self->priv->protectionEvent) { gst_event_unref(self->priv->protectionEvent); self->priv->protectionEvent = nullptr; } }}); result = TRUE; break; } case GST_EVENT_CUSTOM_DOWNSTREAM_OOB: { if (klass->handleKeyResponse(self, event)) { GST_DEBUG_OBJECT(self, "key received"); priv->keyReceived = true; priv->condition.notifyOne(); } gst_event_unref(event); result = TRUE; break; } default: result = GST_BASE_TRANSFORM_CLASS(parent_class)->sink_event(trans, event); break; } return result; }
static void gst_bayer2rgb_class_init (GstBayer2RGBClass * klass) { GObjectClass *gobject_class; gobject_class = (GObjectClass *) klass; gobject_class->set_property = gst_bayer2rgb_set_property; gobject_class->get_property = gst_bayer2rgb_get_property; GST_BASE_TRANSFORM_CLASS (klass)->transform_caps = GST_DEBUG_FUNCPTR (gst_bayer2rgb_transform_caps); GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size = GST_DEBUG_FUNCPTR (gst_bayer2rgb_get_unit_size); GST_BASE_TRANSFORM_CLASS (klass)->set_caps = GST_DEBUG_FUNCPTR (gst_bayer2rgb_set_caps); GST_BASE_TRANSFORM_CLASS (klass)->transform = GST_DEBUG_FUNCPTR (gst_bayer2rgb_transform); }
static gboolean gst_gl_deinterlace_start (GstBaseTransform * trans) { GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (trans); deinterlace_filter->shaderstable = g_hash_table_new (g_str_hash, g_str_equal); return GST_BASE_TRANSFORM_CLASS (parent_class)->start (trans); }
static gboolean gst_audio_fx_base_fir_filter_query (GstBaseTransform * trans, GstPadDirection direction, GstQuery * query) { GstAudioFXBaseFIRFilter *self = GST_AUDIO_FX_BASE_FIR_FILTER (trans); gboolean res = TRUE; switch (GST_QUERY_TYPE (query)) { case GST_QUERY_LATENCY: { GstClockTime min, max; gboolean live; guint64 latency; gint rate = GST_AUDIO_FILTER_RATE (self); if (rate == 0) { res = FALSE; } else if ((res = gst_pad_peer_query (GST_BASE_TRANSFORM (self)->sinkpad, query))) { gst_query_parse_latency (query, &live, &min, &max); GST_DEBUG_OBJECT (self, "Peer latency: min %" GST_TIME_FORMAT " max %" GST_TIME_FORMAT, GST_TIME_ARGS (min), GST_TIME_ARGS (max)); if (self->fft && !self->low_latency) latency = self->block_length - self->kernel_length + 1; else latency = self->latency; /* add our own latency */ latency = gst_util_uint64_scale_round (latency, GST_SECOND, rate); GST_DEBUG_OBJECT (self, "Our latency: %" GST_TIME_FORMAT, GST_TIME_ARGS (latency)); min += latency; if (max != GST_CLOCK_TIME_NONE) max += latency; GST_DEBUG_OBJECT (self, "Calculated total latency : min %" GST_TIME_FORMAT " max %" GST_TIME_FORMAT, GST_TIME_ARGS (min), GST_TIME_ARGS (max)); gst_query_set_latency (query, live, min, max); } break; } default: res = GST_BASE_TRANSFORM_CLASS (parent_class)->query (trans, direction, query); break; } return res; }
static gboolean webkitMediaPlayReadyDecryptSinkEventHandler(GstBaseTransform* trans, GstEvent* event) { gboolean result = FALSE; WebKitMediaPlayReadyDecrypt* self = WEBKIT_MEDIA_PLAYREADY_DECRYPT(trans); switch (GST_EVENT_TYPE(event)) { case GST_EVENT_PROTECTION: { const gchar* systemId; const gchar* origin; GstBuffer* initdatabuffer; GST_INFO_OBJECT(self, "received protection event"); gst_event_parse_protection(event, &systemId, &initdatabuffer, &origin); GST_DEBUG_OBJECT(self, "systemId: %s", systemId); // Ignore protection events about content we cannot handle. if (!g_str_equal(systemId, PLAYREADY_PROTECTION_SYSTEM_ID)) { gst_event_unref(event); result = TRUE; break; } // Keep the event ref around so that the parsed event data // remains valid until the drm-key-need message has been sent. self->protectionEvent = event; self->initDataBuffer = initdatabuffer; g_timeout_add(0, requestKey, self); result = TRUE; break; } case GST_EVENT_CUSTOM_DOWNSTREAM_OOB: { GST_INFO_OBJECT(self, "received OOB event"); g_mutex_lock(&self->mutex); const GstStructure* structure = gst_event_get_structure(event); if (gst_structure_has_name(structure, "dxdrm-session")) { GST_INFO_OBJECT(self, "received dxdrm session"); const GValue* value = gst_structure_get_value(structure, "session"); self->sessionMetaData = reinterpret_cast<WebCore::DiscretixSession*>(g_value_get_pointer(value)); self->streamReceived = TRUE; g_cond_signal(&self->condition); } g_mutex_unlock(&self->mutex); gst_event_unref(event); result = TRUE; break; } default: result = GST_BASE_TRANSFORM_CLASS(parent_class)->sink_event(trans, event); break; } return result; }
static gboolean gst_gl_view_convert_element_stop (GstBaseTransform * bt) { GstGLViewConvertElement *viewconvert_filter = GST_GL_VIEW_CONVERT_ELEMENT (bt); gst_gl_view_convert_reset (viewconvert_filter->viewconvert); return GST_BASE_TRANSFORM_CLASS (parent_class)->stop (bt); }
static gboolean gst_v4l2_transform_query (GstBaseTransform * trans, GstPadDirection direction, GstQuery * query) { GstV4l2Transform *self = GST_V4L2_TRANSFORM (trans); gboolean ret = TRUE; switch (GST_QUERY_TYPE (query)) { case GST_QUERY_CAPS:{ GstCaps *filter, *caps = NULL, *result = NULL; GstPad *pad, *otherpad; gst_query_parse_caps (query, &filter); if (direction == GST_PAD_SRC) { pad = GST_BASE_TRANSFORM_SRC_PAD (trans); otherpad = GST_BASE_TRANSFORM_SINK_PAD (trans); if (self->probed_srccaps) caps = gst_caps_ref (self->probed_srccaps); } else { pad = GST_BASE_TRANSFORM_SINK_PAD (trans); otherpad = GST_BASE_TRANSFORM_SRC_PAD (trans); if (self->probed_sinkcaps) caps = gst_caps_ref (self->probed_sinkcaps); } if (!caps) caps = gst_pad_get_pad_template_caps (pad); if (filter) { GstCaps *tmp = caps; caps = gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (tmp); } result = gst_pad_peer_query_caps (otherpad, caps); result = gst_caps_make_writable (result); gst_caps_append (result, caps); GST_DEBUG_OBJECT (self, "Returning %s caps %" GST_PTR_FORMAT, GST_PAD_NAME (pad), result); gst_query_set_caps_result (query, result); gst_caps_unref (result); break; } default: ret = GST_BASE_TRANSFORM_CLASS (parent_class)->query (trans, direction, query); break; } return ret; }
static gboolean gst_level_sink_event (GstBaseTransform * trans, GstEvent * event) { if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) { GstLevel *filter = GST_LEVEL (trans); gst_level_post_message (filter); } return GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, event); }