RGBA转化成YV12 或YUV420格式的源代码 本代码是freecamera的一部分,freecamera源代码存在:http://gitorious.org/freecamera#define BPP 4#define SCALEBITS 10#define ONE_HALF (1 << (SCALEBITS - 1))#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
linux下ALSA播放声音的源程序 author: CarlsonLee(carlsonlee.freec@hotmail.com), 本代码是freecamera的一部分,freecamera源代码存在:http://gitorious.org/freecamera #include <stdio.h>/* Use the newer ALSA API */#define ALSA_PCM_NEW_HW_PARAMS_API#include <a
linux下c代码如何把指定文件作为附件,通过evolution发送邮件 author: CarlsonLee(carlsonlee.freec@hotmail.com), 本代码是freecamera的一部分,freecamera源代码存在:http://gitorious.org/freecamerastatic char * get_evo_cmd (void) { char *tmp = NULL; char *retval; char *cm
linux下ALSA录制声音的源程序 author: CarlsonLee(carlsonlee.freec@hotmail.com), 本代码是freecamera的一部分,freecamera源代码存在:http://gitorious.org/freecamera /* Use the newer ALSA API */#define ALSA_PCM_NEW_HW_PARAMS_API#include <alsa/asoundlib.h>
linux下webcam进行拍照, gstreamer架构 author: CarlsonLee(carlsonlee.freec@hotmail.com), 本代码是freecamera的一部分,freecamera源代码存在:http://gitorious.org/freecamera#include <glib.h>#include <string.h>#include <stdlib.h>#include <stdio.h>#include <unistd.h>
linux下webcam进行录像, gstreamer架构 author: CarlsonLee(carlsonlee.freec@hotmail.com), 本代码是freecamera的一部分,freecamera源代码存在:http://gitorious.org/freecamera#include <glib.h>#include <string.h>#include <stdio.h>#include <unistd.h>#include <stdlib.h>
YUV420 或 YV12 图像缩放 author: CarlsonLee(carlsonlee.freec@hotmail.com), 本代码是freecamera的一部分,freecamera源代码存在:http://gitorious.org/freecamera///scaletypedef struct _VSImage { guchar *pixels; int width;
encode YUV420 to jpeg, using libjpeg #include <stdlib.h>#include <stdio.h>#include "jpeglib.h"#include <setjmp.h>#include <glib.h>gboolean jpeg_enc_yv12(guchar* buffer, gint width, gint height, gint quality, char* filename){
linux 下 列出所有alsa设备代码 static void device_list(void){ snd_ctl_t *handle; int card, err, dev, idx; snd_ctl_card_info_t *info; snd_pcm_info_t *pcminfo; snd_ctl_card_info_alloca(&info); snd_pcm_
encode YUV420 to ogg, theora codec #include <stdio.h>#include <getopt.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <sys/time.h>#include <math.h>#include "theora/theoraenc.h"
decoder jpeg to rgb 24, using libjpeg #include <stdio.h> #include <setjmp.h> #include "jpeglib.h" #include "jerror.h" struct my_error_mgr { struct jpeg_error_mgr pub; /* "public" fields */
linux上获得本地IP地址和MAC地址(get local ip address and mac address) #include <stdio.h>#include <unistd.h>#include <netdb.h>#include <arpa/inet.h>#include <stdlib.h>#include <sys/ioctl.h>#include <sys/types.h>#include <sys/socket.h>#include <net/if.h>
test video frame rate & bitrate code in linux static long get_tick_count(){ struct timeval tv; gettimeofday(&tv, NULL); return (tv.tv_sec * 1000 + tv.tv_usec/1000);}static void test_fps_bitrate(int frame_size){ sta
encode RGB24 to jpeg, using libjpeg #include <stdio.h>#include "jpeglib.h"#include <setjmp.h>extern JSAMPLE * image_buffer; /* Points to large array of R,G,B-order data */extern int image_height; /* Number of rows in image */e
ubuntu搭建subversion服务器, build svn server in ubuntu ubuntu搭建subversion服务器:(建立一个project_name版本控制服务器) 1,安装 subversion,apache2,libapache2-svn(Apache2的Subversion模块)。 sudo apt-get -y install apache2 subversion libapache2-svn 2,增加用户和组 (1,建立subversion组,同时在这里建立用户名) sud
读取 bmp 文件头信息, read bmp infomation #include <stdio.h>typedef signed char INT8; typedef signed short INT16; typedef signed int INT32; typedef unsigned char UINT8; typedef unsigned short UINT16; typ