Commit 87b952d4 authored by Simon Morlat's avatar Simon Morlat

clean qtcapture, clean options, disable default audio unit (does not work)

parent 352f88d1
......@@ -123,7 +123,6 @@ AC_DEFUN([MS_CHECK_VIDEO],[
if test "$macosx_found" = "yes" ; then
enable_sdl_default=true
enable_x11_default=false
OBJCFLAGS="$OBJCFLAGS -framework QTKit "
LIBS="$LIBS -framework QTKit -framework CoreVideo"
AC_LANG_PUSH([Objective C])
AC_CHECK_HEADERS([QTKit/QTKit.h],[],[AC_MSG_ERROR([QTKit framework not found, required for video support])])
......
......@@ -268,8 +268,11 @@ static void au_card_detect(MSSndCardManager * m)
ms_error("get kAudioHardwarePropertyDevices error %ld", err);
return;
}
//first, add Default AudioUnit
ms_snd_card_manager_add_card(m,ca_card_new("Default", "",-1, MS_SND_CARD_CAP_CAPTURE|MS_SND_CARD_CAP_PLAYBACK));
/*first, add Default AudioUnit
does not work: why ?
*/
/*ms_snd_card_manager_add_card(m,ca_card_new("Default", "",-1, MS_SND_CARD_CAP_CAPTURE|MS_SND_CARD_CAP_PLAYBACK));
*/
count = slen / sizeof(AudioDeviceID);
for (i = 0; i < count; i++) {
......
......@@ -1600,11 +1600,11 @@ mblk_t *ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize){
uint8_t *jpgbuf;
DWORD err;
HANDLE fd;
BOOL res;
BOOL res;
#ifdef UNICODE
WCHAR wUnicode[1024];
MultiByteToWideChar(CP_UTF8, 0, jpgpath, -1, wUnicode, 1024);
fd = CreateFile(wUnicode, GENERIC_READ, FILE_SHARE_READ, NULL,
fd = CreateFile(wUnicode, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, 0, NULL);
#else
fd = CreateFile(jpgpath, GENERIC_READ, FILE_SHARE_READ, NULL,
......@@ -1633,8 +1633,8 @@ mblk_t *ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize){
m=ms_load_generate_yuv(reqsize);
return m;
}
err=0;
res = ReadFile(fd, jpgbuf, st_sizel, &err, NULL) ;
err=0;
res = ReadFile(fd, jpgbuf, st_sizel, &err, NULL) ;
if (err!=st_sizel){
ms_error("Could not read as much as wanted !");
......@@ -1655,11 +1655,8 @@ mblk_t *ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize){
struct stat statbuf;
uint8_t *jpgbuf;
int err;
#ifndef WIN32
int fd=open(jpgpath,O_RDONLY);
#else
int fd=open(jpgpath,O_RDONLY|O_BINARY);
#endif
if (fd!=-1){
fstat(fd,&statbuf);
if (statbuf.st_size<=0)
......
......@@ -233,12 +233,10 @@ struct v4mState;
typedef struct v4mState{
NsMsWebCam * webcam;
NSAutoreleasePool* myPool;
mblk_t *mire;
int frame_ind;
float fps;
float start_time;
int frame_count;
bool_t usemire;
}v4mState;
static void v4m_init(MSFilter *f){
......@@ -246,11 +244,9 @@ static void v4m_init(MSFilter *f){
s->myPool = [[NSAutoreleasePool alloc] init];
s->webcam= [[NsMsWebCam alloc] init];
[s->webcam retain];
s->mire=NULL;
s->start_time=0;
s->frame_count=-1;
s->fps=15;
s->usemire=(getenv("DEBUG")!=NULL);
f->data=s;
}
......@@ -273,51 +269,11 @@ static void v4m_uninit(MSFilter *f){
v4mState *s=(v4mState*)f->data;
v4m_stop(f,NULL);
freemsg(s->mire);
[s->webcam release];
[s->myPool release];
ms_free(s);
}
static mblk_t * v4m_make_mire(v4mState *s){
unsigned char *data;
int i,j,line,pos;
MSVideoSize vsize = [s->webcam getSize];
int patternw=vsize.width/6;
int patternh=vsize.height/6;
int red,green=0,blue=0;
if (s->mire==NULL){
s->mire=allocb(vsize.width*vsize.height*3,0);
s->mire->b_wptr=s->mire->b_datap->db_lim;
}
data=s->mire->b_rptr;
for (i=0;i<vsize.height;++i){
line=i*vsize.width*3;
if ( ((i+s->frame_ind)/patternh) & 0x1) red=255;
else red= 0;
for (j=0;j<vsize.width;++j){
pos=line+(j*3);
if ( ((j+s->frame_ind)/patternw) & 0x1) blue=255;
else blue= 0;
data[pos]=red;
data[pos+1]=green;
data[pos+2]=blue;
}
}
s->frame_ind++;
return s->mire;
}
static mblk_t * v4m_make_nowebcam(v4mState *s){
if (s->mire==NULL && s->frame_ind==0){
//s->mire=ms_load_nowebcam(&s->vsize, -1);
}
s->frame_ind++;
return s->mire;
}
static void v4m_process(MSFilter * obj){
v4mState *s=(v4mState*)obj->data;
uint32_t timestamp;
......
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