Skip to content

Instantly share code, notes, and snippets.

View anselmobattisti's full-sized avatar
🇧🇷
Aqui é Brasil!

Anselmo Battisti anselmobattisti

🇧🇷
Aqui é Brasil!
View GitHub Profile
@anselmobattisti
anselmobattisti / gstreaner_udp_cast_ogg_music.c
Created August 20, 2019 22:32
Gstremaer udp cast ogg audio
/*
Plugin Name: Foward
What it do: This is the simplest plugins that can be done. It's unique function is delivery a stream
to an application via UDP. It's use gstreamer
Pipeline: SRC -> Forward -> Application
Parameters:
- DEST: The IP and PORT that the stream must be delivered
@anselmobattisti
anselmobattisti / gstreamer-audio-ogg.c
Created August 20, 2019 22:15
Simple program in c that uses gstreamer to play a ogg audio
#include <gst/gst.h>
// gst-launch-1.0 videotestsrc ! videobalance saturation=0 ! x264enc ! video/x-h264, stream-format=byte-stream ! rtph264pay ! udpsink host=35.153.160.117 port=5000
int main (int argc, char *argv[]) {
GstElement *pipeline, *src;
GstElement *x264enc;
// GstElement *x264enc,
// GstElement *rtph264pay,
GstElement *autovideosink;
@anselmobattisti
anselmobattisti / ogg-audio-udp-gstreamer
Created August 20, 2019 00:56
Send oggaudio via udp gstreamer
Server
gst-launch-1.0 -v filesrc location=../../../samples/musica.ogg ! oggdemux ! vorbisdec ! audioconvert ! rtpL24pay ! udpsink host=localhost auto-multicast=true port=5000
Client
gst-launch-1.0 -v udpsrc uri=udp://localhost:5000 caps="application/x-rtp,channels=(int)2,format=(string)S16LE,media=(string)audio,payload=(int)96,clock-rate=(int)44100,encoding-name=(string)L24" ! rtpL24depay ! audioconvert ! autoaudiosink sync=false
@anselmobattisti
anselmobattisti / gsteramer_get_name.c
Created July 24, 2019 21:49
Get the name os an object gstreamer
#include <glib.h>
#include <gst/gst.h>
int main(int argc, char *argv[]) {
gst_init (&argc, &argv);
GstElement *element;
element = gst_element_factory_make("fakesrc","source");
@anselmobattisti
anselmobattisti / email.php
Created February 19, 2019 19:40
send email using joomla
# Invoke JMail Class
$mailer = JFactory::getMailer();
# Set sender array so that my name will show up neatly in your inbox
$mailer->setSender($data[‘mailfrom’]);
# Add a recipient — this can be a single address (string) or an array of addresses
$mailer->addRecipient($user->email);
// here works!
// this code will set display error in php in a very good way!
// ----------------------------------------------------------------------------------------------------
// - Display Errors
// ----------------------------------------------------------------------------------------------------
ini_set('display_errors', 'On');
ini_set('html_errors', 0);
// ----------------------------------------------------------------------------------------------------
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package exercico_ci_1;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.chart.CategoryAxis;
<?
// -------------------
// Lendo arquivo local
// -------------------
$filename = "acervo.csv";
$handle = fopen ($filename, "r");
$conteudo = fread ($handle, filesize ($filename));
/*
// -----------------------------------
const moment = require('moment-timezone')
return moment.utc(date, 'YYYY-MM-DD"T"HH:mm:ss.fffffff"Z"').format('DD/MM/YYYY')
@anselmobattisti
anselmobattisti / component.vue
Created February 3, 2018 14:10
To access this inside a nested function create a local variable and store this in this valiable, like the example above
methods: {
save (evt) {
let self = this
evt.preventDefault()
this.$validator.validateAll().then((result) => {
if (result) {
EventBus.$emit('startLoading')
dbUser.save(this.user)
.then((resp) => {
EventBus.$emit('stoptLoading')