Skip to content

Instantly share code, notes, and snippets.

View yashi's full-sized avatar

Yasushi SHOJI yashi

View GitHub Profile
@yashi
yashi / gist:759ace2a249e75d2ca18
Created November 11, 2014 06:04
Appending GstBuffers
/* -*- compile-command: "gcc -Wall -Wextra -g $(pkg-config --cflags --libs gstreamer-1.0) a.c" -*- */
#include <gst/gst.h>
void dump_buf(GstBuffer *buf)
{
gsize max;
gsize bufsize;
gsize offset;
bufsize = gst_buffer_get_sizes(buf, &offset, &max);
/* -*- compile-command: "gcc -Wall -Wextra -g $(pkg-config --cflags --libs gio-2.0) transfer-full-out.c" -*- */
#include <gio/gio.h>
#include <stdio.h>
int main()
{
GFile *file;
char *buf;
gsize len;
/* -*- compile-command: "gcc -Wall -Wextra -g $(pkg-config --cflags --libs gio-2.0) transfer-full-in.c" -*- */
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
void *buf;
gsize len;
GBytes *bytes;
#+Title: test for unordered list
#+OPTIONS: author:nil creator:nil timestamp:nil
* lists
- element 1
- element 2
- else
diff --git a/ceu2rtp.c b/ceu2rtp.c
index 17c43d5..18efc86 100644
--- a/ceu2rtp.c
+++ b/ceu2rtp.c
@@ -50,7 +50,7 @@ enum {
#define DEFAULT_FRAME_RATE_RESOLUTION (30)
#define DEFAULT_FRAME_RATE_TICK (1)
#define DEFAULT_MAX_GOP_LENGTH (30)
-#define DEFAULT_B_PIC_MODE (3)
+#define DEFAULT_B_PIC_MODE GST_ACMH264ENC_B_PIC_MODE_0_B_PIC
#define VERSION "1.0.0"
#define PACKAGE "dropper package"
#include <gst/gst.h>
#include <glib.h>
#include <gst/base/gstbasetransform.h>
#include "drop.h"
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
@yashi
yashi / test.c
Last active December 5, 2015 13:05
#include <gst/gst.h>
int main(int argc, char *argv[])
{
GMainLoop *mainloop;
GstElement *pipeline;
GError *error = NULL;
gst_init(&argc, &argv);
$ gst-launch-1.0 videotestsrc ! autovideosink
#include <gst/gst.h>
int main(int argc, char *argv[])
{
GMainLoop *mainloop;
GstElement *pipeline;
GError *error = NULL;
gst_init(&argc, &argv);
@yashi
yashi / cat.c
Created December 5, 2015 13:49
#include <gst/gst.h>
gboolean on_message(GstBus *bus, GstMessage *message, gpointer p)
{
GMainLoop *mainloop = p;
(void)bus;
if ((GST_MESSAGE_TYPE(message) & GST_MESSAGE_EOS))
g_main_loop_quit(mainloop);