This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mem = gst_allocator_alloc(NULL, 3, NULL); | |
size = gst_memory_get_sizes(mem, NULL, &maxsize); | |
g_print("mem 1:\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, "abc", 3); | |
gst_memory_unmap(mem, &info); | |
gst_buffer_insert_memory(buf, -1, mem); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Library for Linux GPIO Sysfs Interface with Glib library | |
* | |
* Copyright (c) 2016 Yasushi SHOJI <yashi@atmark-techno.com> | |
* | |
* The MIT License (MIT) | |
* | |
* Permission is hereby granted, free of charge, to any person | |
* obtaining a copy of this software and associated documentation | |
* files (the "Software"), to deal in the Software without |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <gst/base/gstadapter.h> | |
int main(int argc, char *argv[]) | |
{ | |
GstAdapter *a; | |
GstBuffer *b; | |
gst_init(&argc, &argv); | |
a = gst_adapter_new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <gst/base/gstadapter.h> | |
int main(int argc, char *argv[]) | |
{ | |
GstAdapter *a; | |
GstBuffer *b, *b1, *b2; | |
gst_init(&argc, &argv); | |
a = gst_adapter_new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <gst/base/gstadapter.h> | |
int main(int argc, char *argv[]) | |
{ | |
GstAdapter *a; | |
GstBuffer *b; | |
char *buf; | |
char const * p; | |
GstMapInfo i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*- compile-command: "gcc -Wall -Wextra -g libc.c" -*- */ | |
#include <regex.h> | |
#include <string.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
regex_t re; | |
const char *pattern = "^b"; | |
int ret; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*- compile-command: "gcc -Wall -Wextra -g $(pkg-config --cflags --libs libpcre2-8) pcre.c" -*- */ | |
#define PCRE2_CODE_UNIT_WIDTH 8 | |
#include <pcre2.h> | |
#include <string.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
pcre2_code *re; | |
PCRE2_SPTR pattern = (PCRE2_SPTR)"^b"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -*- compile-command: "g++ -Wall -Wextra -g -lre2 re2.cc" -*- | |
#include <re2/re2.h> | |
#include <string.h> | |
#include <stdio.h> | |
using namespace re2; | |
int main() | |
{ | |
const char *pattern = "^b"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <gst/gst.h> | |
static gboolean bus_call (G_GNUC_UNUSED GstBus *bus, GstMessage *msg, gpointer data) | |
{ | |
GMainLoop *loop = (GMainLoop *) data; | |
switch (GST_MESSAGE_TYPE (msg)) { | |
case GST_MESSAGE_EOS: | |
g_print ("End of stream\n"); |