Skip to content

Instantly share code, notes, and snippets.

View yashi's full-sized avatar

Yasushi SHOJI yashi

View GitHub Profile
#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);
#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);
#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);
pipeline.each do |elem|
puts elem.name
end
#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);
@yashi
yashi / pad.c
Last active December 9, 2015 13:51
#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_print("message: eos\n");
g_main_loop_quit(mainloop);
struct GstBuffer {
GstMiniObject mini_object;
GstBufferPool *pool;
/* timestamp */
GstClockTime pts;
GstClockTime dts;
GstClockTime duration;
typedef struct
{
GstBuffer buffer;
gsize slice_size;
/* the memory blocks */
guint len;
GstMemory *mem[GST_BUFFER_MEM_MAX];
@yashi
yashi / mem.c
Created December 10, 2015 13:59
#include <gst/gst.h>
#include <string.h>
int main(int argc, char *argv[])
{
GstBuffer *buf;
GstMemory *mem;
GstMapInfo info;
gsize size;
gsize maxsize;
@yashi
yashi / mem2.c
Created December 11, 2015 09:29
mem = gst_allocator_alloc(NULL, 6, NULL);
size = gst_memory_get_sizes(mem, NULL, &maxsize);
g_print("mem 2:\n");
g_print(" size: %" G_GSIZE_FORMAT "\n", size);
g_print(" maxsize: %" G_GSIZE_FORMAT "\n", maxsize);
gst_memory_map(mem, &info, GST_MAP_WRITE);
memcpy(info.data, "12345", 6);
gst_memory_unmap(mem, &info);
gst_buffer_insert_memory(buf, -1, mem);