static void gst_mir_buffer_pool_init (GstMirBufferPool * pool) { GST_DEBUG_CATEGORY_INIT (gstmirbufferpool_debug, "mirbufferpool", 0, " mir buffer pool"); }
static void gst_switch_sink_base_init (gpointer klass) { GST_DEBUG_CATEGORY_INIT (switch_debug, "switchsink", 0, "switchsink element"); }
static void gst_rtp_pt_demux_class_init (GstRtpPtDemuxClass * klass) { GObjectClass *gobject_klass; GstElementClass *gstelement_klass; gobject_klass = (GObjectClass *) klass; gstelement_klass = (GstElementClass *) klass; /** * GstRtpPtDemux::request-pt-map: * @demux: the object which received the signal * @pt: the payload type * * Request the payload type as #GstCaps for @pt. */ gst_rtp_pt_demux_signals[SIGNAL_REQUEST_PT_MAP] = g_signal_new ("request-pt-map", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRtpPtDemuxClass, request_pt_map), NULL, NULL, g_cclosure_marshal_generic, GST_TYPE_CAPS, 1, G_TYPE_UINT); /** * GstRtpPtDemux::new-payload-type: * @demux: the object which received the signal * @pt: the payload type * @pad: the pad with the new payload * * Emited when a new payload type pad has been created in @demux. */ gst_rtp_pt_demux_signals[SIGNAL_NEW_PAYLOAD_TYPE] = g_signal_new ("new-payload-type", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRtpPtDemuxClass, new_payload_type), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 2, G_TYPE_UINT, GST_TYPE_PAD); /** * GstRtpPtDemux::payload-type-change: * @demux: the object which received the signal * @pt: the new payload type * * Emited when the payload type changed. */ gst_rtp_pt_demux_signals[SIGNAL_PAYLOAD_TYPE_CHANGE] = g_signal_new ("payload-type-change", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRtpPtDemuxClass, payload_type_change), NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT); /** * GstRtpPtDemux::clear-pt-map: * @demux: the object which received the signal * * The application can call this signal to instruct the element to discard the * currently cached payload type map. */ gst_rtp_pt_demux_signals[SIGNAL_CLEAR_PT_MAP] = g_signal_new ("clear-pt-map", G_TYPE_FROM_CLASS (klass), G_SIGNAL_ACTION | G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRtpPtDemuxClass, clear_pt_map), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE); gobject_klass->finalize = gst_rtp_pt_demux_finalize; gstelement_klass->change_state = GST_DEBUG_FUNCPTR (gst_rtp_pt_demux_change_state); klass->clear_pt_map = GST_DEBUG_FUNCPTR (gst_rtp_pt_demux_clear_pt_map); gst_element_class_add_pad_template (gstelement_klass, gst_static_pad_template_get (&rtp_pt_demux_sink_template)); gst_element_class_add_pad_template (gstelement_klass, gst_static_pad_template_get (&rtp_pt_demux_src_template)); gst_element_class_set_static_metadata (gstelement_klass, "RTP Demux", "Demux/Network/RTP", "Parses codec streams transmitted in the same RTP session", "Kai Vehmanen <*****@*****.**>"); GST_DEBUG_CATEGORY_INIT (gst_rtp_pt_demux_debug, "rtpptdemux", 0, "RTP codec demuxer"); }
void gst_egl_adaption_init (void) { GST_DEBUG_CATEGORY_INIT (egladaption_debug, "egladaption", 0, "EGL adaption layer"); }
static gboolean plugin_init (GstPlugin * plugin) { guint i, count; VisList *list; GST_DEBUG_CATEGORY_INIT (libvisual_debug, "libvisual", 0, "libvisual audio visualisations"); #ifdef LIBVISUAL_PLUGINSBASEDIR gst_plugin_add_dependency_simple (plugin, "HOME/.libvisual/actor", LIBVISUAL_PLUGINSBASEDIR "/actor", NULL, GST_PLUGIN_DEPENDENCY_FLAG_NONE); #endif visual_log_set_verboseness (VISUAL_LOG_VERBOSENESS_LOW); visual_log_set_info_handler (libvisual_log_handler, (void *) GST_LEVEL_INFO); visual_log_set_warning_handler (libvisual_log_handler, (void *) GST_LEVEL_WARNING); visual_log_set_critical_handler (libvisual_log_handler, (void *) GST_LEVEL_ERROR); visual_log_set_error_handler (libvisual_log_handler, (void *) GST_LEVEL_ERROR); if (!visual_is_initialized ()) if (visual_init (NULL, NULL) != 0) return FALSE; list = visual_actor_get_list (); count = visual_collection_size (VISUAL_COLLECTION (list)); for (i = 0; i < count; i++) { VisPluginRef *ref = visual_list_get (list, i); VisPluginData *visplugin = NULL; gboolean skip = FALSE; GType type; gchar *name; GTypeInfo info = { sizeof (GstVisualGLClass), NULL, NULL, gst_visual_gl_class_init, NULL, ref, sizeof (GstVisualGL), 0, NULL }; visplugin = visual_plugin_load (ref); if (ref->info->plugname == NULL) continue; /* Blacklist some plugins */ if (strcmp (ref->info->plugname, "gstreamer") == 0 || strcmp (ref->info->plugname, "gdkpixbuf") == 0) { skip = TRUE; } else { /* only register plugins that support GL */ skip = !(gst_visual_gl_actor_plugin_is_gl (visplugin->info->plugin, visplugin->info->plugname)); } visual_plugin_unload (visplugin); if (!skip) { name = g_strdup_printf ("GstVisualGL%s", ref->info->plugname); make_valid_name (name); type = g_type_register_static (GST_TYPE_VISUAL_GL, name, &info, 0); g_free (name); name = g_strdup_printf ("libvisual_gl_%s", ref->info->plugname); make_valid_name (name); if (!gst_element_register (plugin, name, GST_RANK_NONE, type)) { g_free (name); return FALSE; } g_free (name); } } return TRUE; }
#endif #ifdef G_OS_WIN32 #include <windows.h> #ifdef X509_NAME #undef X509_NAME #endif #endif #include <openssl/ssl.h> GST_DEBUG_CATEGORY_STATIC (gst_dtls_certificate_debug); #define GST_CAT_DEFAULT gst_dtls_certificate_debug G_DEFINE_TYPE_WITH_CODE (GstDtlsCertificate, gst_dtls_certificate, G_TYPE_OBJECT, GST_DEBUG_CATEGORY_INIT (gst_dtls_certificate_debug, "dtlscertificate", 0, "DTLS Certificate")); #define GST_DTLS_CERTIFICATE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GST_TYPE_DTLS_CERTIFICATE, GstDtlsCertificatePrivate)) enum { PROP_0, PROP_PEM, NUM_PROPERTIES }; static GParamSpec *properties[NUM_PROPERTIES]; #define DEFAULT_PEM NULL struct _GstDtlsCertificatePrivate
GST_PAD_SINK, GST_PAD_REQUEST, GST_STATIC_CAPS_ANY); static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("application/x-dtls") ); GST_DEBUG_CATEGORY_STATIC (gst_dtls_enc_debug); #define GST_CAT_DEFAULT gst_dtls_enc_debug #define gst_dtls_enc_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstDtlsEnc, gst_dtls_enc, GST_TYPE_ELEMENT, GST_DEBUG_CATEGORY_INIT (gst_dtls_enc_debug, "dtlsenc", 0, "DTLS Encoder")); enum { SIGNAL_ON_KEY_RECEIVED, NUM_SIGNALS }; static guint signals[NUM_SIGNALS]; enum { PROP_0, PROP_CONNECTION_ID, PROP_IS_CLIENT,
static gboolean is_shot_change (int frame_number); #endif enum { PROP_0 }; #define VIDEO_CAPS \ GST_VIDEO_CAPS_MAKE("{ I420, Y42B, Y41B, Y444 }") /* class initialization */ G_DEFINE_TYPE_WITH_CODE (GstSceneChange, gst_scene_change, GST_TYPE_VIDEO_FILTER, GST_DEBUG_CATEGORY_INIT (gst_scene_change_debug_category, "scenechange", 0, "debug category for scenechange element")); static void gst_scene_change_class_init (GstSceneChangeClass * 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), "Scene change detector",
void gst_jack_audio_client_init (void) { GST_DEBUG_CATEGORY_INIT (gst_jack_audio_client_debug, "jackclient", 0, "jackclient helpers"); }
struct _KmsRecorderEndpointPrivate { GstElement *pipeline; GstClockTime paused_time; GstClockTime paused_start; gboolean use_dvr; struct state_controller state_manager; KmsLoop *loop; KmsConfController *controller; }; /* class initialization */ G_DEFINE_TYPE_WITH_CODE (KmsRecorderEndpoint, kms_recorder_endpoint, KMS_TYPE_URI_ENDPOINT, GST_DEBUG_CATEGORY_INIT (kms_recorder_endpoint_debug_category, PLUGIN_NAME, 0, "debug category for recorderendpoint element")); static void destroy_ulong (gpointer data) { g_slice_free (gulong, data); } static void send_eos (GstElement * appsrc) { GstFlowReturn ret; GST_DEBUG ("Send EOS to %s", GST_ELEMENT_NAME (appsrc)); g_signal_emit_by_name (appsrc, "end-of-stream", &ret);
static void gst_audio_fx_base_fir_filter_class_init (GstAudioFXBaseFIRFilterClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; GstAudioFilterClass *filter_class = (GstAudioFilterClass *) klass; GstCaps *caps; GST_DEBUG_CATEGORY_INIT (gst_audio_fx_base_fir_filter_debug, "audiofxbasefirfilter", 0, "FIR filter base class"); gobject_class->finalize = gst_audio_fx_base_fir_filter_finalize; gobject_class->set_property = gst_audio_fx_base_fir_filter_set_property; gobject_class->get_property = gst_audio_fx_base_fir_filter_get_property; /** * GstAudioFXBaseFIRFilter::low-latency: * * Work in low-latency mode. This mode is much slower for large filter sizes * but the latency is always only the pre-latency of the filter. * * Since: 0.10.18 */ g_object_class_install_property (gobject_class, PROP_LOW_LATENCY, g_param_spec_boolean ("low-latency", "Low latency", "Operate in low latency mode. This mode is slower but the " "latency will only be the filter pre-latency. " "Can only be changed in states < PAUSED!", DEFAULT_LOW_LATENCY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstAudioFXBaseFIRFilter::drain-on-changes: * * Whether the filter should be drained when its coeficients change * * Note: Currently this only works if the kernel size is not changed! * Support for drainless kernel size changes will be added in the future. * * Since: 0.10.18 */ g_object_class_install_property (gobject_class, PROP_DRAIN_ON_CHANGES, g_param_spec_boolean ("drain-on-changes", "Drain on changes", "Drains the filter when its coeficients change", DEFAULT_DRAIN_ON_CHANGES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); caps = gst_caps_from_string (ALLOWED_CAPS); gst_audio_filter_class_add_pad_templates (GST_AUDIO_FILTER_CLASS (klass), caps); gst_caps_unref (caps); trans_class->transform = GST_DEBUG_FUNCPTR (gst_audio_fx_base_fir_filter_transform); trans_class->start = GST_DEBUG_FUNCPTR (gst_audio_fx_base_fir_filter_start); trans_class->stop = GST_DEBUG_FUNCPTR (gst_audio_fx_base_fir_filter_stop); trans_class->sink_event = GST_DEBUG_FUNCPTR (gst_audio_fx_base_fir_filter_sink_event); trans_class->query = GST_DEBUG_FUNCPTR (gst_audio_fx_base_fir_filter_query); trans_class->transform_size = GST_DEBUG_FUNCPTR (gst_audio_fx_base_fir_filter_transform_size); filter_class->setup = GST_DEBUG_FUNCPTR (gst_audio_fx_base_fir_filter_setup); }
int main (int argc, char *argv[]) { App *app = &s_app; GError *error = NULL; GstBus *bus; gst_init (&argc, &argv); GST_DEBUG_CATEGORY_INIT (appsrc_playbin_debug, "appsrc-playbin", 0, "appsrc playbin example"); if (argc < 2) { g_print ("usage: %s <filename>\n", argv[0]); return -1; } /* try to open the file as an mmapped file */ app->file = g_mapped_file_new (argv[1], FALSE, &error); if (error) { g_print ("failed to open file: %s\n", error->message); g_error_free (error); return -2; } /* get some vitals, this will be used to read data from the mmapped file and * feed it to appsrc. */ app->length = g_mapped_file_get_length (app->file); app->data = (guint8 *) g_mapped_file_get_contents (app->file); app->offset = 0; /* create a mainloop to get messages */ app->loop = g_main_loop_new (NULL, TRUE); app->playbin = gst_element_factory_make ("playbin2", NULL); g_assert (app->playbin); bus = gst_pipeline_get_bus (GST_PIPELINE (app->playbin)); /* add watch for messages */ gst_bus_add_watch (bus, (GstBusFunc) bus_message, app); /* set to read from appsrc */ g_object_set (app->playbin, "uri", "appsrc://", NULL); /* get notification when the source is created so that we get a handle to it * and can configure it */ g_signal_connect (app->playbin, "deep-notify::source", (GCallback) found_source, app); /* go to playing and wait in a mainloop. */ gst_element_set_state (app->playbin, GST_STATE_PLAYING); /* this mainloop is stopped when we receive an error or EOS */ g_main_loop_run (app->loop); GST_DEBUG ("stopping"); gst_element_set_state (app->playbin, GST_STATE_NULL); /* free the file */ g_mapped_file_free (app->file); gst_object_unref (bus); g_main_loop_unref (app->loop); return 0; }
static void gst_xvidenc_class_init (GstXvidEncClass * klass) { GstElementClass *gstelement_class; GObjectClass *gobject_class; GParamSpec *pspec; gobject_class = G_OBJECT_CLASS (klass); gstelement_class = GST_ELEMENT_CLASS (klass); parent_class = g_type_class_peek_parent (klass); GST_DEBUG_CATEGORY_INIT (xvidenc_debug, "xvidenc", 0, "XviD encoder"); gobject_class->finalize = gst_xvidenc_finalize; gobject_class->set_property = gst_xvidenc_set_property; gobject_class->get_property = gst_xvidenc_get_property; /* prop handling */ xvidenc_prop_count = 0; xvidenc_pspec_quark = g_quark_from_static_string ("xvid-enc-param-spec-data"); pspec = g_param_spec_enum ("profile", "Profile", "XviD/MPEG-4 encoding profile", GST_TYPE_XVIDENC_PROFILE, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, profile); pspec = g_param_spec_enum ("quant-type", "Quantizer Type", "Quantizer type", GST_TYPE_XVIDENC_QUANT_TYPE, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, quant_type); pspec = g_param_spec_enum ("pass", "Encoding pass/type", "Encoding pass/type", GST_TYPE_XVIDENC_PASS, XVIDENC_CBR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, pass); pspec = g_param_spec_int ("bitrate", "Bitrate", "[CBR|PASS2] Target video bitrate (bps)", 0, G_MAXINT, 1800000, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, bitrate); pspec = g_param_spec_int ("quantizer", "Quantizer", "[QUANT] Quantizer to apply for constant quantizer mode", 2, 31, 2, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, quant); pspec = g_param_spec_string ("statsfile", "Statistics Filename", "[PASS1|PASS2] Filename to store data for 2-pass encoding", "xvid-stats.log", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, filename); pspec = g_param_spec_int ("max-key-interval", "Max. Key Interval", "Maximum number of frames between two keyframes (< 0 is in sec)", -100, G_MAXINT, -10, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, max_key_interval); pspec = g_param_spec_boolean ("closed-gop", "Closed GOP", "Closed GOP", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, closed_gop); pspec = g_param_spec_int ("motion", "ME Quality", "Quality of Motion Estimation", 0, 6, 6, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, motion); pspec = g_param_spec_boolean ("me-chroma", "ME Chroma", "Enable use of Chroma planes for Motion Estimation", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, me_chroma); pspec = g_param_spec_int ("me-vhq", "ME DCT/Frequency", "Extent in which to use DCT to minimize encoding length", 0, 4, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, me_vhq); pspec = g_param_spec_boolean ("me-quarterpel", "ME Quarterpel", "Use quarter pixel precision for motion vector search", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, me_quarterpel); pspec = g_param_spec_boolean ("lumimasking", "Lumimasking", "Enable lumimasking - apply more compression to dark or bright areas", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, lumimasking); pspec = g_param_spec_int ("max-bframes", "Max B-Frames", "Maximum B-frames in a row", 0, G_MAXINT, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, max_bframes); pspec = g_param_spec_int ("bquant-ratio", "B-quantizer ratio", "Ratio in B-frame quantizer computation", 0, 200, 150, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, bquant_ratio); pspec = g_param_spec_int ("bquant-offset", "B-quantizer offset", "Offset in B-frame quantizer computation", 0, 200, 100, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, bquant_offset); pspec = g_param_spec_int ("bframe-threshold", "B-Frame Threshold", "Higher threshold yields more chance that B-frame is used", -255, 255, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, bframe_threshold); pspec = g_param_spec_boolean ("gmc", "Global Motion Compensation", "Allow generation of Sprite Frames for Pan/Zoom/Rotating images", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, gmc); pspec = g_param_spec_boolean ("trellis", "Trellis Quantization", "Enable Trellis Quantization", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, trellis); pspec = g_param_spec_boolean ("interlaced", "Interlaced Material", "Enable for interlaced video material", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, interlaced); pspec = g_param_spec_boolean ("cartoon", "Cartoon Material", "Adjust thresholds for flat looking cartoons", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, cartoon); pspec = g_param_spec_boolean ("greyscale", "Disable Chroma", "Do not write chroma data in encoded video", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, greyscale); pspec = g_param_spec_boolean ("hqacpred", "High quality AC prediction", "Enable high quality AC prediction", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, hqacpred); pspec = g_param_spec_int ("max-iquant", "Max Quant I-Frames", "Upper bound for I-frame quantization", 0, 31, 31, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, max_iquant); pspec = g_param_spec_int ("min-iquant", "Min Quant I-Frames", "Lower bound for I-frame quantization", 0, 31, 2, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, min_iquant); pspec = g_param_spec_int ("max-pquant", "Max Quant P-Frames", "Upper bound for P-frame quantization", 0, 31, 31, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, max_pquant); pspec = g_param_spec_int ("min-pquant", "Min Quant P-Frames", "Lower bound for P-frame quantization", 0, 31, 2, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, min_pquant); pspec = g_param_spec_int ("max-bquant", "Max Quant B-Frames", "Upper bound for B-frame quantization", 0, 31, 31, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, max_bquant); pspec = g_param_spec_int ("min-bquant", "Min Quant B-Frames", "Lower bound for B-frame quantization", 0, 31, 2, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, min_bquant); pspec = g_param_spec_int ("reaction-delay-factor", "Reaction Delay Factor", "[CBR] Reaction delay factor", -1, 100, -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, reaction_delay_factor); pspec = g_param_spec_int ("averaging-period", "Averaging Period", "[CBR] Number of frames for which XviD averages bitrate", -1, 100, -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, averaging_period); pspec = g_param_spec_int ("buffer", "Buffer Size", "[CBR] Size of the video buffers", -1, G_MAXINT, -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, buffer); pspec = g_param_spec_int ("keyframe-boost", "Keyframe boost", "[PASS2] Bitrate boost for keyframes", 0, 100, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, keyframe_boost); pspec = g_param_spec_int ("curve-compression-high", "Curve Compression High", "[PASS2] Shrink factor for upper part of bitrate curve", 0, 100, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, curve_compression_high); pspec = g_param_spec_int ("curve-compression-low", "Curve Compression Low", "[PASS2] Growing factor for lower part of bitrate curve", 0, 100, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, curve_compression_low); pspec = g_param_spec_int ("flow-control-strength", "Flow Control Strength", "[PASS2] Overflow control strength per frame", -1, 100, 5, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, overflow_control_strength); pspec = g_param_spec_int ("max-overflow-improvement", "Max Overflow Improvement", "[PASS2] Amount in % that flow control can increase frame size compared to ideal curve", -1, 100, 5, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, max_overflow_improvement); pspec = g_param_spec_int ("max-overflow-degradation", "Max Overflow Degradation", "[PASS2] Amount in % that flow control can decrease frame size compared to ideal curve", -1, 100, 5, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, max_overflow_degradation); pspec = g_param_spec_int ("keyframe-reduction", "Keyframe Reduction", "[PASS2] Keyframe size reduction in % of those within threshold", -1, 100, 20, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, kfreduction); pspec = g_param_spec_int ("keyframe-threshold", "Keyframe Threshold", "[PASS2] Distance between keyframes not to be subject to reduction", -1, 100, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, kfthreshold); pspec = g_param_spec_int ("container-frame-overhead", "Container Frame Overhead", "[PASS2] Average container overhead per frame", -1, 100, -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gst_xvidenc_add_pspec (gobject_class, pspec, container_frame_overhead); gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_xvidenc_change_state); }
PROP_THRESHOLD }; #define DEFAULT_THRESHOLD 90 /* pad templates */ #define VIDEO_CAPS GST_VIDEO_CAPS_MAKE( \ "{ I420, Y444, Y42B, Y41B, YUY2, UYVY, AYUV, NV12, NV21, YV12 }") /* class initialization */ G_DEFINE_TYPE_WITH_CODE (GstZebraStripe, gst_zebra_stripe, GST_TYPE_VIDEO_FILTER, GST_DEBUG_CATEGORY_INIT (gst_zebra_stripe_debug_category, "zebrastripe", 0, "debug category for zebrastripe element")); static void gst_zebra_stripe_class_init (GstZebraStripeClass * 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_CAPS))); gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass),
static gboolean plugin_init (GstPlugin * plugin) { guint i, count; VisList *list; GST_DEBUG_CATEGORY_INIT (libvisual_debug, "libvisual", 0, "libvisual audio visualisations"); visual_log_set_verboseness (VISUAL_LOG_VERBOSENESS_LOW); visual_log_set_info_handler (libvisual_log_handler, (void *) GST_LEVEL_INFO); visual_log_set_warning_handler (libvisual_log_handler, (void *) GST_LEVEL_WARNING); visual_log_set_critical_handler (libvisual_log_handler, (void *) GST_LEVEL_ERROR); visual_log_set_error_handler (libvisual_log_handler, (void *) GST_LEVEL_ERROR); if (!visual_is_initialized ()) if (visual_init (NULL, NULL) != 0) return FALSE; list = visual_actor_get_list (); #if !defined(VISUAL_API_VERSION) count = visual_list_count (list); #elif VISUAL_API_VERSION >= 4000 && VISUAL_API_VERSION < 5000 count = visual_collection_size (VISUAL_COLLECTION (list)); #endif for (i = 0; i < count; i++) { VisPluginRef *ref = visual_list_get (list, i); VisPluginData *visplugin = NULL; gboolean skip = FALSE; GType type; gchar *name; GTypeInfo info = { sizeof (GstVisualClass), NULL, NULL, gst_visual_class_init, NULL, ref, sizeof (GstVisual), 0, NULL }; visplugin = visual_plugin_load (ref); if (ref->info->plugname == NULL) continue; /* Blacklist some plugins */ if (strcmp (ref->info->plugname, "gstreamer") == 0 || strcmp (ref->info->plugname, "gdkpixbuf") == 0) { skip = TRUE; } else { /* Ignore plugins that only support GL output for now */ skip = gst_visual_actor_plugin_is_gl (visplugin->info->plugin, visplugin->info->plugname); } visual_plugin_unload (visplugin); if (!skip) { name = g_strdup_printf ("GstVisual%s", ref->info->plugname); make_valid_name (name); type = g_type_register_static (GST_TYPE_VISUAL, name, &info, 0); g_free (name); name = g_strdup_printf ("libvisual_%s", ref->info->plugname); make_valid_name (name); if (!gst_element_register (plugin, name, GST_RANK_NONE, type)) { g_free (name); return FALSE; } g_free (name); } } return TRUE; }
static void _do_init(GType datasrc_type) { GST_DEBUG_CATEGORY_INIT(webkit_data_src_debug, "webkit_data_src", 0, "datasrc element"); g_type_add_interface_static(datasrc_type, GST_TYPE_URI_HANDLER, &urihandler_info); }
static void gst_dv1394src_class_init (GstDV1394SrcClass * klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; GstBaseSrcClass *gstbasesrc_class; GstPushSrcClass *gstpushsrc_class; gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; gstbasesrc_class = (GstBaseSrcClass *) klass; gstpushsrc_class = (GstPushSrcClass *) klass; gobject_class->set_property = gst_dv1394src_set_property; gobject_class->get_property = gst_dv1394src_get_property; gobject_class->dispose = gst_dv1394src_dispose; gstelement_class->provide_clock = gst_dv1394src_provide_clock; gstelement_class->change_state = gst_dv1394_src_change_state; gst_dv1394src_signals[SIGNAL_FRAME_DROPPED] = g_signal_new ("frame-dropped", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstDV1394SrcClass, frame_dropped), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PORT, g_param_spec_int ("port", "Port", "Port number (-1 automatic)", -1, 16, DEFAULT_PORT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_CHANNEL, g_param_spec_int ("channel", "Channel", "Channel number for listening", 0, 64, DEFAULT_CHANNEL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_CONSECUTIVE, g_param_spec_int ("consecutive", "consecutive frames", "send n consecutive frames after skipping", 1, G_MAXINT, DEFAULT_CONSECUTIVE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SKIP, g_param_spec_int ("skip", "skip frames", "skip n frames", 0, G_MAXINT, DEFAULT_SKIP, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DROP_INCOMPLETE, g_param_spec_boolean ("drop-incomplete", "drop incomplete", "drop incomplete frames", DEFAULT_DROP_INCOMPLETE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_USE_AVC, g_param_spec_boolean ("use-avc", "Use AV/C", "Use AV/C VTR control", DEFAULT_USE_AVC, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_GUID, g_param_spec_uint64 ("guid", "GUID", "select one of multiple DV devices by its GUID. use a hexadecimal " "like 0xhhhhhhhhhhhhhhhh. (0 = no guid)", 0, G_MAXUINT64, DEFAULT_GUID, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstDV1394Src:device-name * * Descriptive name of the currently opened device * * Since: 0.10.7 **/ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DEVICE_NAME, g_param_spec_string ("device-name", "device name", "user-friendly name of the device", "Default", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); gstbasesrc_class->negotiate = NULL; gstbasesrc_class->start = gst_dv1394src_start; gstbasesrc_class->stop = gst_dv1394src_stop; gstbasesrc_class->unlock = gst_dv1394src_unlock; gstbasesrc_class->query = gst_dv1394src_query; gstpushsrc_class->create = gst_dv1394src_create; gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&src_factory)); gst_element_class_set_static_metadata (gstelement_class, "Firewire (1394) DV video source", "Source/Video", "Source for DV video data from firewire port", "Erik Walthinsen <*****@*****.**>, " "Daniel Fischer <*****@*****.**>, " "Wim Taymans <*****@*****.**>, " "Zaheer Abbas Merali <zaheerabbas at merali dot org>"); GST_DEBUG_CATEGORY_INIT (dv1394src_debug, "dv1394src", 0, "DV firewire source"); }
static void gst_spectrum_class_init (GstSpectrumClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstBaseTransformClass *trans_class = GST_BASE_TRANSFORM_CLASS (klass); GstAudioFilterClass *filter_class = GST_AUDIO_FILTER_CLASS (klass); GstCaps *caps; gobject_class->set_property = gst_spectrum_set_property; gobject_class->get_property = gst_spectrum_get_property; gobject_class->finalize = gst_spectrum_finalize; trans_class->start = GST_DEBUG_FUNCPTR (gst_spectrum_start); trans_class->stop = GST_DEBUG_FUNCPTR (gst_spectrum_stop); trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_spectrum_transform_ip); trans_class->passthrough_on_same_caps = TRUE; filter_class->setup = GST_DEBUG_FUNCPTR (gst_spectrum_setup); /** * GstSpectrum:post-messages * * Post messages on the bus with spectrum information. * * Since: 0.10.17 */ g_object_class_install_property (gobject_class, PROP_POST_MESSAGES, g_param_spec_boolean ("post-messages", "Post Messages", "Whether to post a 'spectrum' element message on the bus for each " "passed interval", DEFAULT_POST_MESSAGES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_MESSAGE_MAGNITUDE, g_param_spec_boolean ("message-magnitude", "Magnitude", "Whether to add a 'magnitude' field to the structure of any " "'spectrum' element messages posted on the bus", DEFAULT_MESSAGE_MAGNITUDE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_MESSAGE_PHASE, g_param_spec_boolean ("message-phase", "Phase", "Whether to add a 'phase' field to the structure of any " "'spectrum' element messages posted on the bus", DEFAULT_MESSAGE_PHASE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_INTERVAL, g_param_spec_uint64 ("interval", "Interval", "Interval of time between message posts (in nanoseconds)", 1, G_MAXUINT64, DEFAULT_INTERVAL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_BANDS, g_param_spec_uint ("bands", "Bands", "Number of frequency bands", 0, G_MAXUINT, DEFAULT_BANDS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_THRESHOLD, g_param_spec_int ("threshold", "Threshold", "dB threshold for result. All lower values will be set to this", G_MININT, 0, DEFAULT_THRESHOLD, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstSpectrum:multi-channel * * Send separate results for each channel * * Since: 0.10.29 */ g_object_class_install_property (gobject_class, PROP_MULTI_CHANNEL, g_param_spec_boolean ("multi-channel", "Multichannel results", "Send separate results for each channel", DEFAULT_MULTI_CHANNEL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); GST_DEBUG_CATEGORY_INIT (gst_spectrum_debug, "spectrum", 0, "audio spectrum analyser element"); gst_element_class_set_static_metadata (element_class, "Spectrum analyzer", "Filter/Analyzer/Audio", "Run an FFT on the audio signal, output spectrum data", "Erik Walthinsen <*****@*****.**>, " "Stefan Kost <*****@*****.**>, " "Sebastian Dröge <*****@*****.**>"); caps = gst_caps_from_string (ALLOWED_CAPS); gst_audio_filter_class_add_pad_templates (filter_class, caps); gst_caps_unref (caps); }
ServerMethods::StaticConstructor::StaticConstructor() { GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, GST_DEFAULT_NAME, 0, GST_DEFAULT_NAME); }
static void gst_gdk_pixbuf_overlay_class_init (GstGdkPixbufOverlayClass * klass) { GstVideoFilterClass *videofilter_class = GST_VIDEO_FILTER_CLASS (klass); GstBaseTransformClass *basetrans_class = GST_BASE_TRANSFORM_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->set_property = gst_gdk_pixbuf_overlay_set_property; gobject_class->get_property = gst_gdk_pixbuf_overlay_get_property; gobject_class->finalize = gst_gdk_pixbuf_overlay_finalize; basetrans_class->start = GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_overlay_start); basetrans_class->stop = GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_overlay_stop); basetrans_class->before_transform = GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_overlay_before_transform); videofilter_class->set_info = GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_overlay_set_info); videofilter_class->transform_frame_ip = GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_overlay_transform_frame_ip); g_object_class_install_property (gobject_class, PROP_LOCATION, g_param_spec_string ("location", "location", "Location of image file to overlay", NULL, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_OFFSET_X, g_param_spec_int ("offset-x", "X Offset", "For positive value, horizontal offset of overlay image in pixels from" " left of video image. For negative value, horizontal offset of overlay" " image in pixels from right of video image", G_MININT, G_MAXINT, 0, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_OFFSET_Y, g_param_spec_int ("offset-y", "Y Offset", "For positive value, vertical offset of overlay image in pixels from" " top of video image. For negative value, vertical offset of overlay" " image in pixels from bottom of video image", G_MININT, G_MAXINT, 0, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_RELATIVE_X, g_param_spec_double ("relative-x", "Relative X Offset", "Horizontal offset of overlay image in fractions of video image " "width, from top-left corner of video image" " (in relative positioning)", -1.0, 1.0, 0.0, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_RELATIVE_Y, g_param_spec_double ("relative-y", "Relative Y Offset", "Vertical offset of overlay image in fractions of video image " "height, from top-left corner of video image" " (in relative positioning)", -1.0, 1.0, 0.0, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_OVERLAY_WIDTH, g_param_spec_int ("overlay-width", "Overlay Width", "Width of overlay image in pixels (0 = same as overlay image)", 0, G_MAXINT, 0, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_OVERLAY_HEIGHT, g_param_spec_int ("overlay-height", "Overlay Height", "Height of overlay image in pixels (0 = same as overlay image)", 0, G_MAXINT, 0, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_ALPHA, g_param_spec_double ("alpha", "Alpha", "Global alpha of overlay image", 0.0, 1.0, 1.0, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstGdkPixbufOverlay:pixbuf: * * GdkPixbuf object to render. * * Since: 1.6 */ g_object_class_install_property (gobject_class, PROP_PIXBUF, g_param_spec_object ("pixbuf", "Pixbuf", "GdkPixbuf object to render", GDK_TYPE_PIXBUF, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstGdkPixbufOverlay:positioning-mode: * * Positioning mode of offset-x and offset-y properties. Determines how * negative x/y offsets will be interpreted. By default negative values * are for positioning relative to the right/bottom edge of the video * image, but you can use this property to select absolute positioning * relative to a (0, 0) origin in the top-left corner. That way negative * offsets will be to the left/above the video image, which allows you to * smoothly slide logos into and out of the frame if desired. * * Since: 1.6 */ g_object_class_install_property (gobject_class, PROP_POSITIONING_MODE, g_param_spec_enum ("positioning-mode", "Positioning mode", "Positioning mode of offset-x and offset-y properties", GST_TYPE_GDK_PIXBUF_POSITIONING_MODE, DEFAULT_POSITIONING_MODE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /* FIXME the following actually act as a RELATIVE_X/RELATIVE_Y, * but those were already slightly mutated/abused with ABSOLUTE positioning, * so let's keep that and follow suit * Suffice it to say all that could do with cleanup (2.0 ??) */ /** * GstGdkPixbufOverlay:coef-x: * * In absolute positioning mode, the x coordinate of overlay image's * top-left corner is now given by * offset-x + (relative-x * overlay_width) + (coef-x * video_width). * This allows to align the image absolutely and relatively * to any edge or center position. * * Since: 1.12 */ g_object_class_install_property (gobject_class, PROP_COEF_X, g_param_spec_double ("coef-x", "Relative X Offset", "Horizontal offset of overlay image in fractions of video image " "width, from top-left corner of video image (absolute positioning)", -1.0, 1.0, 0.0, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstGdkPixbufOverlay:coef-y: * * In absolute positioning mode, the y coordinate of overlay image's * top-left corner is now given by * offset-y + (relative-y * overlay_height) + (coef-y * video_height). * This allows to align the image absolutely and relatively * to any edge or center position. * * Since: 1.12 */ g_object_class_install_property (gobject_class, PROP_COEF_Y, g_param_spec_double ("coef-y", "Relative Y Offset", "Vertical offset of overlay image in fractions of video image " "height, from top-left corner of video image (absolute positioning)", -1.0, 1.0, 0.0, GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); gst_element_class_add_static_pad_template (element_class, &sink_template); gst_element_class_add_static_pad_template (element_class, &src_template); gst_element_class_set_static_metadata (element_class, "GdkPixbuf Overlay", "Filter/Effect/Video", "Overlay an image onto a video stream", "Tim-Philipp Müller <tim centricular net>"); GST_DEBUG_CATEGORY_INIT (gdkpixbufoverlay_debug, "gdkpixbufoverlay", 0, "debug category for gdkpixbufoverlay element"); }
static void gst_mfxpostproc_class_init (GstMfxPostprocClass * klass) { GObjectClass *const object_class = G_OBJECT_CLASS (klass); GstElementClass *const element_class = GST_ELEMENT_CLASS (klass); GstBaseTransformClass *const trans_class = GST_BASE_TRANSFORM_CLASS (klass); GstPadTemplate *pad_template; GST_DEBUG_CATEGORY_INIT (gst_debug_mfxpostproc, GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC); gst_mfx_plugin_base_class_init (GST_MFX_PLUGIN_BASE_CLASS (klass)); object_class->finalize = gst_mfxpostproc_finalize; object_class->set_property = gst_mfxpostproc_set_property; object_class->get_property = gst_mfxpostproc_get_property; trans_class->transform_caps = gst_mfxpostproc_transform_caps; trans_class->transform = gst_mfxpostproc_transform; trans_class->set_caps = gst_mfxpostproc_set_caps; trans_class->stop = gst_mfxpostproc_stop; trans_class->query = gst_mfxpostproc_query; trans_class->propose_allocation = gst_mfxpostproc_propose_allocation; trans_class->decide_allocation = gst_mfxpostproc_decide_allocation; trans_class->before_transform = gst_mfxpostproc_before_transform; gst_element_class_set_static_metadata (element_class, "MFX video postprocessing", "Filter/Converter/Video;Filter/Converter/Video/Scaler;" "Filter/Effect/Video;Filter/Effect/Video/Deinterlace", GST_PLUGIN_DESC, "Ishmael Sameen <*****@*****.**>"); /* sink pad */ pad_template = gst_static_pad_template_get (&gst_mfxpostproc_sink_factory); gst_element_class_add_pad_template (element_class, pad_template); /* src pad */ pad_template = gst_static_pad_template_get (&gst_mfxpostproc_src_factory); gst_element_class_add_pad_template (element_class, pad_template); g_object_class_install_property (object_class, PROP_ASYNC_DEPTH, g_param_spec_uint ("async-depth", "Asynchronous Depth", "Number of async operations before explicit sync", 0, 20, DEFAULT_ASYNC_DEPTH, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMfxPostproc:deinterlace-mode * * This selects whether the deinterlacing should always be applied * or if they should only be applied on content that has the * "interlaced" flag on the caps. */ g_object_class_install_property (object_class, PROP_DEINTERLACE_MODE, g_param_spec_enum ("deinterlace-mode", "Deinterlace mode", "Deinterlace mode to use", GST_MFX_TYPE_DEINTERLACE_MODE, DEFAULT_DEINTERLACE_MODE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMfxPostproc:width * * The forced output width in pixels. If set to zero, the width is * calculated from the height if aspect ration is preserved, or * inherited from the sink caps width */ g_object_class_install_property (object_class, PROP_WIDTH, g_param_spec_uint ("width", "Width", "Forced output width", 0, 8192, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMfxPostproc:height * * The forced output height in pixels. If set to zero, the height is * calculated from the width if aspect ration is preserved, or * inherited from the sink caps height */ g_object_class_install_property (object_class, PROP_HEIGHT, g_param_spec_uint ("height", "Height", "Forced output height", 0, 8192, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMfxPostproc:force-aspect-ratio * * When enabled, scaling respects video aspect ratio; when disabled, * the video is distorted to fit the width and height properties. */ g_object_class_install_property (object_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)); /** * GstMfxPostproc:framerate * * The forced output frame rate specified as a floating-point value */ g_object_class_install_property (object_class, PROP_FRAMERATE, gst_param_spec_fraction ("framerate", "Frame rate", "Forced output frame rate", 0, 1, G_MAXINT, 1, 0, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMfxPostproc:denoise * * The level of noise reduction to apply. */ g_object_class_install_property (object_class, PROP_DENOISE, g_param_spec_uint ("denoise", "Denoising Level", "The level of denoising to apply", 0, 100, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMfxPostproc:detail * * The level of detail / edge enhancement to apply for positive values. */ g_object_class_install_property (object_class, PROP_DETAIL, g_param_spec_uint ("detail", "Detail Level", "The level of detail / edge enhancement to apply", 0, 100, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMfxPostproc:hue * * The color hue, expressed as a float value. Range is -180.0 to * 180.0. Default value is 0.0 and represents no modification. */ g_object_class_install_property (object_class, PROP_HUE, g_param_spec_float ("hue", "Hue", "The color hue value", -180.0, 180.0, 0.0, GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMfxPostproc:saturation * * The color saturation, expressed as a float value. Range is 0.0 to * 10.0. Default value is 1.0 and represents no modification. */ g_object_class_install_property (object_class, PROP_SATURATION, g_param_spec_float ("saturation", "Saturation", "The color saturation value", 0.0, 10.0, 1.0, GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMfxPostproc:brightness * * The color brightness, expressed as a float value. Range is -100.0 * to 100.0. Default value is 0.0 and represents no modification. */ g_object_class_install_property (object_class, PROP_BRIGHTNESS, g_param_spec_float ("brightness", "Brightness", "The color brightness value", -100.0, 100.0, 0.0, GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstMfxPostproc:contrast * * The color contrast, expressed as a float value. Range is 0.0 to * 10.0. Default value is 1.0 and represents no modification. */ g_object_class_install_property (object_class, PROP_CONTRAST, g_param_spec_float ("contrast", "Contrast", "The color contrast value", 0.0, 10.0, 1.0, GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); #ifndef WITH_MSS_2016 /** * GstMfxPostproc:rotation * * The rotation angle for the surface, expressed in GstMfxRotation. */ g_object_class_install_property (object_class, PROP_ROTATION, g_param_spec_enum ("rotation", "Rotation", "The rotation angle", GST_MFX_TYPE_ROTATION, DEFAULT_ROTATION, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); #endif /** * GstMfxPostproc: frc-algorithm * The framerate conversion algorithm to convert framerate of the video, * expressed in GstMfxFrcAlgorithm. */ g_object_class_install_property (object_class, PROP_FRC_ALGORITHM, g_param_spec_enum ("frc-algorithm", "Algorithm", "The algorithm type", GST_MFX_TYPE_FRC_ALGORITHM, DEFAULT_FRC_ALG, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); }
static void gst_curl_base_sink_class_init (GstCurlBaseSinkClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstBaseSinkClass *gstbasesink_class = (GstBaseSinkClass *) klass; GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GST_DEBUG_CATEGORY_INIT (gst_curl_base_sink_debug, "curlbasesink", 0, "curl base sink element"); GST_DEBUG_OBJECT (klass, "class_init"); gst_element_class_set_static_metadata (element_class, "Curl base sink", "Sink/Network", "Upload data over the network to a server using libcurl", "Patricia Muscalu <*****@*****.**>"); gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_curl_base_sink_event); gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_curl_base_sink_render); gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_curl_base_sink_start); gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_curl_base_sink_stop); gstbasesink_class->unlock = GST_DEBUG_FUNCPTR (gst_curl_base_sink_unlock); gstbasesink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_curl_base_sink_unlock_stop); gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_curl_base_sink_finalize); gobject_class->set_property = gst_curl_base_sink_set_property; gobject_class->get_property = gst_curl_base_sink_get_property; klass->handle_transfer = handle_transfer; klass->transfer_read_cb = gst_curl_base_sink_transfer_read_cb; klass->transfer_data_buffer = gst_curl_base_sink_transfer_data_buffer; /* FIXME: check against souphttpsrc and use same names for same properties */ g_object_class_install_property (gobject_class, PROP_LOCATION, g_param_spec_string ("location", "Location", "URI location to write to", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_USER_NAME, g_param_spec_string ("user", "User name", "User name to use for server authentication", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_USER_PASSWD, g_param_spec_string ("passwd", "User password", "User password to use for server authentication", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_FILE_NAME, g_param_spec_string ("file-name", "Base file name", "The base file name for the uploaded images", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_TIMEOUT, g_param_spec_int ("timeout", "Timeout", "Number of seconds waiting to write before timeout", 0, G_MAXINT, DEFAULT_TIMEOUT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_QOS_DSCP, g_param_spec_int ("qos-dscp", "QoS diff srv code point", "Quality of Service, differentiated services code point (0 default)", DSCP_MIN, DSCP_MAX, DEFAULT_QOS_DSCP, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&sinktemplate)); }
static void ges_container_class_init (GESContainerClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GESTimelineElementClass *element_class = GES_TIMELINE_ELEMENT_CLASS (klass); GST_DEBUG_CATEGORY_INIT (ges_container_debug, "gescontainer", GST_DEBUG_FG_YELLOW, "ges container"); g_type_class_add_private (klass, sizeof (GESContainerPrivate)); object_class->get_property = _get_property; object_class->set_property = _set_property; object_class->dispose = _dispose; object_class->finalize = _finalize; /** * GESContainer:height: * * The span of priorities which this container occupies. */ properties[PROP_HEIGHT] = g_param_spec_uint ("height", "Height", "The span of priorities this container occupies", 0, G_MAXUINT, 1, G_PARAM_READABLE); g_object_class_install_property (object_class, PROP_HEIGHT, properties[PROP_HEIGHT]); /** * GESContainer::child-added: * @container: the #GESContainer * @element: the #GESTimelineElement that was added. * * Will be emitted after a child was added to @container. * Usually you should connect with #g_signal_connect_after * as in the first emission stage, the signal emission might * get stopped internally. */ ges_container_signals[CHILD_ADDED_SIGNAL] = g_signal_new ("child-added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESContainerClass, child_added), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_TIMELINE_ELEMENT); /** * GESContainer::child-removed: * @container: the #GESContainer * @element: the #GESTimelineElement that was removed. * * Will be emitted after a child was removed from @container. */ ges_container_signals[CHILD_REMOVED_SIGNAL] = g_signal_new ("child-removed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESContainerClass, child_removed), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_TIMELINE_ELEMENT); element_class->set_start = _set_start; element_class->set_duration = _set_duration; element_class->set_inpoint = _set_inpoint; element_class->list_children_properties = _list_children_properties; element_class->lookup_child = _lookup_child; element_class->get_track_types = _get_track_types; element_class->paste = _paste; element_class->deep_copy = _deep_copy; /* No default implementations */ klass->remove_child = NULL; klass->add_child = NULL; klass->ungroup = NULL; klass->group = NULL; klass->grouping_priority = 0; klass->edit = NULL; }
static void gst_shmdata_src_class_init (GstShmdataSrcClass * klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; GstBaseSrcClass *gstbasesrc_class; GstPushSrcClass *gstpush_src_class; gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; gstbasesrc_class = (GstBaseSrcClass *) klass; gstpush_src_class = (GstPushSrcClass *) klass; gobject_class->set_property = gst_shmdata_src_set_property; gobject_class->get_property = gst_shmdata_src_get_property; gobject_class->finalize = gst_shmdata_src_finalize; gstelement_class->change_state = gst_shmdata_src_change_state; gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_shmdata_src_start); gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_shmdata_src_stop); gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_shmdata_src_unlock); gstbasesrc_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_shmdata_src_unlock_stop); gstpush_src_class->create = gst_shmdata_src_create; g_object_class_install_property (gobject_class, PROP_SOCKET_PATH, g_param_spec_string ("socket-path", "Path to the control socket", "The path to the control socket used to control the shared memory" " transport", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property ( gobject_class, PROP_CAPS, g_param_spec_string ( "caps", "Data type exposed in the shared memory", "The data type (caps) exposed in the shared memory, and proposed for negociation", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property ( gobject_class, PROP_BYTES_SINCE_LAST_REQUEST, g_param_spec_uint64 ( "bytes", "Bytes number since last request", "The number of bytes that passed the shmdata since last request", 0, G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property ( gobject_class, PROP_COPY_BUFFERS, g_param_spec_boolean ("copy-buffers", "copy buffers into the pipeline", "False if buffers from shared memory are used into the pipeline", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&srctemplate)); gst_element_class_set_static_metadata (gstelement_class, "Shmdata Source", "Source", "Receive data from a shmdata", "Nicolas Bouillot <*****@*****.**>"); GST_DEBUG_CATEGORY_INIT (shmdatasrc_debug, "shmdatasrc", 0, "Shmdata Source"); }
static void gst_rtsp_media_factory_class_init (GstRTSPMediaFactoryClass * klass) { GObjectClass *gobject_class; g_type_class_add_private (klass, sizeof (GstRTSPMediaFactoryPrivate)); gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = gst_rtsp_media_factory_get_property; gobject_class->set_property = gst_rtsp_media_factory_set_property; gobject_class->finalize = gst_rtsp_media_factory_finalize; /** * GstRTSPMediaFactory::launch: * * The gst_parse_launch() line to use for constructing the pipeline in the * default prepare vmethod. * * The pipeline description should return a GstBin as the toplevel element * which can be accomplished by enclosing the dscription with brackets '(' * ')'. * * The description should return a pipeline with payloaders named pay0, pay1, * etc.. Each of the payloaders will result in a stream. * * Support for dynamic payloaders can be accomplished by adding payloaders * named dynpay0, dynpay1, etc.. */ g_object_class_install_property (gobject_class, PROP_LAUNCH, g_param_spec_string ("launch", "Launch", "A launch description of the pipeline", DEFAULT_LAUNCH, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_SHARED, g_param_spec_boolean ("shared", "Shared", "If media from this factory is shared", DEFAULT_SHARED, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_SUSPEND_MODE, g_param_spec_enum ("suspend-mode", "Suspend Mode", "Control how media will be suspended", GST_TYPE_RTSP_SUSPEND_MODE, DEFAULT_SUSPEND_MODE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_EOS_SHUTDOWN, g_param_spec_boolean ("eos-shutdown", "EOS Shutdown", "Send EOS down the pipeline before shutting down", DEFAULT_EOS_SHUTDOWN, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PROFILES, g_param_spec_flags ("profiles", "Profiles", "Allowed transfer profiles", GST_TYPE_RTSP_PROFILE, DEFAULT_PROFILES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PROTOCOLS, g_param_spec_flags ("protocols", "Protocols", "Allowed lower transport protocols", GST_TYPE_RTSP_LOWER_TRANS, DEFAULT_PROTOCOLS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_BUFFER_SIZE, g_param_spec_uint ("buffer-size", "Buffer Size", "The kernel UDP buffer size to use", 0, G_MAXUINT, DEFAULT_BUFFER_SIZE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_LATENCY, g_param_spec_uint ("latency", "Latency", "Latency used for receiving media in milliseconds", 0, G_MAXUINT, DEFAULT_LATENCY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_TRANSPORT_MODE, g_param_spec_flags ("transport-mode", "Transport Mode", "If media from this factory is for PLAY or RECORD", GST_TYPE_RTSP_TRANSPORT_MODE, DEFAULT_TRANSPORT_MODE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); gst_rtsp_media_factory_signals[SIGNAL_MEDIA_CONSTRUCTED] = g_signal_new ("media-constructed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPMediaFactoryClass, media_constructed), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GST_TYPE_RTSP_MEDIA); gst_rtsp_media_factory_signals[SIGNAL_MEDIA_CONFIGURE] = g_signal_new ("media-configure", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPMediaFactoryClass, media_configure), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GST_TYPE_RTSP_MEDIA); klass->gen_key = default_gen_key; klass->create_element = default_create_element; klass->construct = default_construct; klass->configure = default_configure; klass->create_pipeline = default_create_pipeline; GST_DEBUG_CATEGORY_INIT (rtsp_media_debug, "rtspmediafactory", 0, "GstRTSPMediaFactory"); }
static void gst_video_parse_class_init (GstVideoParseClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); gobject_class->set_property = gst_video_parse_set_property; gobject_class->get_property = gst_video_parse_get_property; g_object_class_install_property (gobject_class, PROP_FORMAT, g_param_spec_enum ("format", "Format", "Format of images in raw stream", GST_TYPE_VIDEO_FORMAT, GST_VIDEO_FORMAT_I420, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_int ("width", "Width", "Width of images in raw stream", 0, INT_MAX, 320, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_int ("height", "Height", "Height of images in raw stream", 0, INT_MAX, 240, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_FRAMERATE, gst_param_spec_fraction ("framerate", "Frame Rate", "Frame rate of images in raw stream", 0, 1, G_MAXINT, 1, 25, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PAR, gst_param_spec_fraction ("pixel-aspect-ratio", "Pixel Aspect Ratio", "Pixel aspect ratio of images in raw stream", 1, 100, 100, 1, 1, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_INTERLACED, g_param_spec_boolean ("interlaced", "Interlaced flag", "True if video is interlaced", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_TOP_FIELD_FIRST, g_param_spec_boolean ("top-field-first", "Top field first", "True if top field is earlier than bottom field", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_STRIDES, g_param_spec_string ("strides", "Strides", "Stride of each planes in bytes using string format: 's0,s1,s2,s3'", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_OFFSETS, g_param_spec_string ("offsets", "Offsets", "Offset of each planes in bytes using string format: 'o0,o1,o2,o3'", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_FRAMESIZE, g_param_spec_uint ("framesize", "Framesize", "Size of an image in raw stream (0: default)", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); gst_element_class_set_static_metadata (gstelement_class, "Video Parse", "Filter/Video", "Converts stream into video frames (deprecated: use rawvideoparse instead)", "David Schleef <*****@*****.**>, " "Sebastian Dröge <*****@*****.**>"); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&static_sink_template)); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&static_src_template)); GST_DEBUG_CATEGORY_INIT (gst_video_parse_debug, "videoparse", 0, "videoparse element"); }
gboolean add_glsyncmeta; gboolean want_eglimage; GstBuffer *last_buffer; }; static void gst_gl_buffer_pool_finalize (GObject * object); GST_DEBUG_CATEGORY_STATIC (GST_CAT_GL_BUFFER_POOL); #define GST_CAT_DEFAULT GST_CAT_GL_BUFFER_POOL #define GST_GL_BUFFER_POOL_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_GL_BUFFER_POOL, GstGLBufferPoolPrivate)) #define gst_gl_buffer_pool_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLBufferPool, gst_gl_buffer_pool, GST_TYPE_BUFFER_POOL, GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_BUFFER_POOL, "glbufferpool", 0, "GL Buffer Pool")); static const gchar ** gst_gl_buffer_pool_get_options (GstBufferPool * pool) { static const gchar *options[] = { GST_BUFFER_POOL_OPTION_VIDEO_META, GST_BUFFER_POOL_OPTION_GL_SYNC_META, GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT, GST_BUFFER_POOL_OPTION_GL_TEXTURE_TARGET_2D, GST_BUFFER_POOL_OPTION_GL_TEXTURE_TARGET_RECTANGLE, NULL }; return options; }
static void gst_soup_http_client_sink_class_init (GstSoupHttpClientSinkClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); GstBaseSinkClass *base_sink_class = GST_BASE_SINK_CLASS (klass); gobject_class->set_property = gst_soup_http_client_sink_set_property; gobject_class->get_property = gst_soup_http_client_sink_get_property; gobject_class->dispose = gst_soup_http_client_sink_dispose; gobject_class->finalize = gst_soup_http_client_sink_finalize; g_object_class_install_property (gobject_class, PROP_LOCATION, g_param_spec_string ("location", "Location", "URI to send to", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_USER_AGENT, g_param_spec_string ("user-agent", "User-Agent", "Value of the User-Agent HTTP request header field", DEFAULT_USER_AGENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_AUTOMATIC_REDIRECT, g_param_spec_boolean ("automatic-redirect", "automatic-redirect", "Automatically follow HTTP redirects (HTTP Status Code 3xx)", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PROXY, g_param_spec_string ("proxy", "Proxy", "HTTP proxy server URI", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_USER_ID, g_param_spec_string ("user-id", "user-id", "user id for authentication", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_USER_PW, g_param_spec_string ("user-pw", "user-pw", "user password for authentication", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PROXY_ID, g_param_spec_string ("proxy-id", "proxy-id", "user id for proxy authentication", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PROXY_PW, g_param_spec_string ("proxy-pw", "proxy-pw", "user password for proxy authentication", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_SESSION, g_param_spec_object ("session", "session", "SoupSession object to use for communication", SOUP_TYPE_SESSION, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_COOKIES, g_param_spec_boxed ("cookies", "Cookies", "HTTP request cookies", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_RETRY_DELAY, g_param_spec_int ("retry-delay", "Retry Delay", "Delay in seconds between retries after a failure", 1, G_MAXINT, 5, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_RETRIES, g_param_spec_int ("retries", "Retries", "Maximum number of retries, zero to disable, -1 to retry forever", -1, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstSoupHttpClientSink::http-log-level: * * If set and > 0, captures and dumps HTTP session data as * log messages if log level >= GST_LEVEL_TRACE * * Since: 1.4 */ g_object_class_install_property (gobject_class, PROP_SOUP_LOG_LEVEL, g_param_spec_enum ("http-log-level", "HTTP log level", "Set log level for soup's HTTP session log", SOUP_TYPE_LOGGER_LOG_LEVEL, DEFAULT_SOUP_LOG_LEVEL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); gst_element_class_add_static_pad_template (gstelement_class, &gst_soup_http_client_sink_sink_template); gst_element_class_set_static_metadata (gstelement_class, "HTTP client sink", "Generic", "Sends streams to HTTP server via PUT", "David Schleef <*****@*****.**>"); base_sink_class->set_caps = GST_DEBUG_FUNCPTR (gst_soup_http_client_sink_set_caps); if (0) base_sink_class->get_times = GST_DEBUG_FUNCPTR (gst_soup_http_client_sink_get_times); base_sink_class->start = GST_DEBUG_FUNCPTR (gst_soup_http_client_sink_start); base_sink_class->stop = GST_DEBUG_FUNCPTR (gst_soup_http_client_sink_stop); base_sink_class->unlock = GST_DEBUG_FUNCPTR (gst_soup_http_client_sink_unlock); base_sink_class->event = GST_DEBUG_FUNCPTR (gst_soup_http_client_sink_event); if (0) base_sink_class->preroll = GST_DEBUG_FUNCPTR (gst_soup_http_client_sink_preroll); base_sink_class->render = GST_DEBUG_FUNCPTR (gst_soup_http_client_sink_render); GST_DEBUG_CATEGORY_INIT (souphttpclientsink_dbg, "souphttpclientsink", 0, "souphttpclientsink element"); }
static void init_debug (void) { GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, GST_DEFAULT_NAME, 0, GST_DEFAULT_NAME); }
/* pad templates */ static GstStaticPadTemplate gst_openh264dec_sink_template = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS("video/x-h264, stream-format=(string)byte-stream, alignment=(string)au,profile=(string){constrained-baseline,baseline}")); static GstStaticPadTemplate gst_openh264dec_src_template = GST_STATIC_PAD_TEMPLATE("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS(GST_VIDEO_CAPS_MAKE("I420"))); /* class initialization */ G_DEFINE_TYPE_WITH_CODE(GstOpenh264Dec, gst_openh264dec, GST_TYPE_VIDEO_DECODER, GST_DEBUG_CATEGORY_INIT(gst_openh264dec_debug_category, "openh264dec", 0, "debug category for openh264dec element")); static void gst_openh264dec_class_init(GstOpenh264DecClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); GstVideoDecoderClass *video_decoder_class = GST_VIDEO_DECODER_CLASS(klass); g_type_class_add_private(klass, sizeof(GstOpenh264DecPrivate)); /* 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_static_pad_template_get(&gst_openh264dec_sink_template)); gst_element_class_add_pad_template(GST_ELEMENT_CLASS(klass), gst_static_pad_template_get(&gst_openh264dec_src_template));