Commit 303b2d3b authored by Aymeric Moizard's avatar Aymeric Moizard
Browse files

use RGB24_REV mode for winvideods

parent bb913e44
......@@ -96,44 +96,6 @@ HRESULT ( Callback)(IMediaSample* pSample, REFERENCE_TIME* sTime, REFERENCE_TIME
{
buf=allocb(size,0);
memcpy(buf->b_wptr, byte_buf, size);
if (s->pix_fmt==MS_RGB24)
{
/* Conversion from top down bottom up (BGR to RGB and flip) */
unsigned long Index,nPixels;
unsigned char *blue;
unsigned char tmp;
short iPixelSize;
blue=buf->b_wptr;
nPixels=s->vsize.width*s->vsize.height;
iPixelSize=24/8;
for(Index=0;Index!=nPixels;Index++) // For each pixel
{
tmp=*blue;
*blue=*(blue+2);
*(blue+2)=tmp;
blue+=iPixelSize;
}
unsigned char *pLine1, *pLine2;
int iLineLen,iIndex;
iLineLen=s->vsize.width*iPixelSize;
pLine1=buf->b_wptr;
pLine2=&(buf->b_wptr)[iLineLen * (s->vsize.height - 1)];
for( ;pLine1<pLine2;pLine2-=(iLineLen*2))
{
for(iIndex=0;iIndex!=iLineLen;pLine1++,pLine2++,iIndex++)
{
tmp=*pLine1;
*pLine1=*pLine2;
*pLine2=tmp;
}
}
}
buf->b_wptr+=size;
ms_mutex_lock(&s->mutex);
......@@ -1273,10 +1235,16 @@ static int v4w_get_pix_fmt(MSFilter *f,void *arg){
V4wState *s=(V4wState*)f->data;
if (s->rotregvalue==0){
_v4w_test(s, NULL); /* check supported format */
*((MSPixFmt*)arg) = (MSPixFmt)s->pix_fmt;
if (s->pix_fmt==MS_RGB24)
*((MSPixFmt*)arg) = (MSPixFmt)MS_RGB24_REV;
else
*((MSPixFmt*)arg) = (MSPixFmt)s->pix_fmt;
return 0;
}
*((MSPixFmt*)arg) = (MSPixFmt)s->pix_fmt;
if (s->pix_fmt==MS_RGB24)
*((MSPixFmt*)arg) = (MSPixFmt)MS_RGB24_REV;
else
*((MSPixFmt*)arg) = (MSPixFmt)s->pix_fmt;
return 0;
}
......
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