Commit 785d2e62 authored by Simon Morlat's avatar Simon Morlat

make a beautiful mire

parent 0765d7dc
......@@ -59,20 +59,20 @@ static void mire_preprocess(MSFilter *f){
d->starttime=f->ticker->time;
}
static void plane_draw(uint8_t *p, int w, int h, int lsz, int index){
static void plane_draw(uint8_t *p, int w, int h, int lsz, int index, int color1, int color2){
int i,j;
for(i=0;i<h;++i){
for(j=0;j<w;++j){
p[j]= (( (i/50)*50 + (j/50)*50 + index ) & 0x1)*200;
p[j]= (( ((i+index)/80) + ((j+index)/80) ) & 0x1) ? color1 : color2;
}
p+=lsz;
}
}
static void mire_draw(MireData *d){
plane_draw(d->pict.planes[0],d->pict.w,d->pict.h,d->pict.strides[0],d->index*2);
plane_draw(d->pict.planes[1],d->pict.w/2,d->pict.h/2,d->pict.strides[1],d->index);
plane_draw(d->pict.planes[2],d->pict.w/2,d->pict.h/2,d->pict.strides[2],d->index);
plane_draw(d->pict.planes[0],d->pict.w,d->pict.h,d->pict.strides[0],d->index*2,150,12);
plane_draw(d->pict.planes[1],d->pict.w/2,d->pict.h/2,d->pict.strides[1],d->index,100,60);
plane_draw(d->pict.planes[2],d->pict.w/2,d->pict.h/2,d->pict.strides[2],d->index,200,100);
}
static void mire_process(MSFilter *f){
......
......@@ -77,7 +77,7 @@ extern void libmswebrtc_init();
#define MEDIASTREAM_MAX_ICE_CANDIDATES 3
extern MSWebCamDesc mire_desc;
static int cond=1;
......@@ -658,7 +658,7 @@ void setup_media_streams(MediastreamDatas* args) {
ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL);
}
ms_init();
ms_init();
#if TARGET_OS_IPHONE || defined(ANDROID)
#if defined (HAVE_X264) && defined (VIDEO_ENABLED)
......@@ -683,6 +683,10 @@ void setup_media_streams(MediastreamDatas* args) {
rtp_profile_set_payload(&av_profile,114,args->custom_pt);
rtp_profile_set_payload(&av_profile,115,&payload_type_lpc1015);
#ifdef VIDEO_ENABLED
cam=ms_web_cam_new(&mire_desc);
if (cam) ms_web_cam_manager_add_cam(ms_web_cam_manager_get(), cam);
cam=NULL;
rtp_profile_set_payload(&av_profile,26,&payload_type_jpeg);
rtp_profile_set_payload(&av_profile,98,&payload_type_h263_1998);
rtp_profile_set_payload(&av_profile,97,&payload_type_theora);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment