Dear All,
I wrote a avstream video capture driver based on the avshws
driver sample code. But I found that the FormatRGB24Bpp_Capture
structure's bimHeader.biHeight is -D_Y. It's negative value. It will
fail to connect the Video renderer in graphedit. If I change it to
positive D_Y, then it can render OK. But the video is upside-down. I
searched the answer in the web, it looks the negative Height is
indicate the bottom-up bitmap. The imageSynth will create a bottom-up
frame data to fill into the mapping buffer of the stream queue. But my
PCI device can generate only top-down video. And I don't want to use
CPU to flip the video data. Is there any way to fix this problem?
I ever tried to return my pin's descriptor VideoInfoHeader in
the IntersectHandler routine. If can pass the pin connection with
negative Height value and the video is correct showing. But the
negative Height setting will cause black display in YUY2 format when
use AMCAP to preview. Any response is appreciated!


Best regards
Jerry Pan

Re: AVStream driver show upside-down video for RGB24 format by Tim

Tim
Sat Feb 02 18:09:31 CST 2008

"jerrypan88@gmail.com" <jerrypan88@gmail.com> wrote:
>
> I wrote a avstream video capture driver based on the avshws
>driver sample code. But I found that the FormatRGB24Bpp_Capture
>structure's bimHeader.biHeight is -D_Y. It's negative value. It will
>fail to connect the Video renderer in graphedit. If I change it to
>positive D_Y, then it can render OK. But the video is upside-down. I
>searched the answer in the web, it looks the negative Height is
>indicate the bottom-up bitmap. The imageSynth will create a bottom-up
>frame data to fill into the mapping buffer of the stream queue. But my
>PCI device can generate only top-down video. And I don't want to use
>CPU to flip the video data. Is there any way to fix this problem?
> I ever tried to return my pin's descriptor VideoInfoHeader in
>the IntersectHandler routine. If can pass the pin connection with
>negative Height value and the video is correct showing. But the
>negative Height setting will cause black display in YUY2 format when
>use AMCAP to preview. Any response is appreciated!

Are you returning YUY2, or are you returning RGB24? YUV formats are always
top-down, so the height should be positive. If your device generates YUY2,
then you should always return YUY2, and not convert to RGB24.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: AVStream driver show upside-down video for RGB24 format by jerrypan88

jerrypan88
Sat Feb 02 22:20:05 CST 2008

On 2$B7n(B3$BF|(B, $B>e8a(B8$B;~(B09$BJ,(B, Tim Roberts <t...@probo.com> wrote:
> "jerrypa...@gmail.com" <jerrypa...@gmail.com> wrote:
>
> > I wrote a avstream video capture driver based on the avshws
> >driver sample code. But I found that the FormatRGB24Bpp_Capture
> >structure's bimHeader.biHeight is -D_Y. It's negative value. It will
> >fail to connect the Video renderer in graphedit. If I change it to
> >positive D_Y, then it can render OK. But the video is upside-down. I
> >searched the answer in the web, it looks the negative Height is
> >indicate the bottom-up bitmap. The imageSynth will create a bottom-up
> >frame data to fill into the mapping buffer of the stream queue. But my
> >PCI device can generate only top-down video. And I don't want to use
> >CPU to flip the video data. Is there any way to fix this problem?
> > I ever tried to return my pin's descriptor VideoInfoHeader in
> >the IntersectHandler routine. If can pass the pin connection with
> >negative Height value and the video is correct showing. But the
> >negative Height setting will cause black display in YUY2 format when
> >use AMCAP to preview. Any response is appreciated!
>
> Are you returning YUY2, or are you returning RGB24? YUV formats are always
> top-down, so the height should be positive. If your device generates YUY2,
> then you should always return YUY2, and not convert to RGB24.
> --
> Tim Roberts, t...@probo.com
> Providenza & Boekelheide, Inc.

Many thanks for your reply! I was expecting to return RGB24 and select
RGB24 as pin format to render in the Graphedit. Since it fail with
negative biHeight in the DispatchSetFormat, and it seems nothing I can
control in the IntersectHandler. In the IntersectHandler, I can only
accept or reject what upper caller passed CallerDataRange and
DescriptorDataRange. Basically, my device can support both YUY2 and
RGB24. For YUY2 format, the function is no problem. However, in RGB24
format, my video is upside-down.

Re: AVStream driver show upside-down video for RGB24 format by Tim

Tim
Mon Feb 04 21:51:08 CST 2008

"jerrypan88@gmail.com" <jerrypan88@gmail.com> wrote:
>
>Many thanks for your reply! I was expecting to return RGB24 and select
>RGB24 as pin format to render in the Graphedit.

That's not a problem. In your KS_DATARANGE_VIDEO structure, set the
biHeight positive for YUY2 and negative for RGB24. The other fields in
KS_DATARANGE_VIDEO should be positive; biHeight is the only one that is
negated.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: AVStream driver show upside-down video for RGB24 format by jerrypan88

jerrypan88
Tue Feb 05 05:46:31 CST 2008

On 2$B7n(B5$BF|(B, $B>e8a(B11$B;~(B51$BJ,(B, Tim Roberts <t...@probo.com> wrote:
> "jerrypa...@gmail.com" <jerrypa...@gmail.com> wrote:
>
> >Many thanks for your reply! I was expecting to return RGB24 and select
> >RGB24 as pin format to render in the Graphedit.
>
> That's not a problem. In your KS_DATARANGE_VIDEO structure, set the
> biHeight positive for YUY2 and negative for RGB24. The other fields in
> KS_DATARANGE_VIDEO should be positive; biHeight is the only one that is
> negated.
> --
> Tim Roberts, t...@probo.com
> Providenza & Boekelheide, Inc.

I did this way already. It make correct display for RGB24 format. But
I got black display with YUY2 format in AMCAP. It's the side-effect
when I change the biHeight from positive value to negative value. I
thought over to change my DMA program to transfer data with bottom up
order. It works without any problem. now. Many thanks for your reply
for my problem. I just curious if any driver use negative biHeight and
work successfully with AMCAP.

Re: AVStream driver show upside-down video for RGB24 format by Tim

Tim
Wed Feb 06 23:07:53 CST 2008

"jerrypan88@gmail.com" <jerrypan88@gmail.com> wrote:
>
>I did this way already. It make correct display for RGB24 format. But
>I got black display with YUY2 format in AMCAP. It's the side-effect
>when I change the biHeight from positive value to negative value. I
>thought over to change my DMA program to transfer data with bottom up
>order. It works without any problem. now. Many thanks for your reply
>for my problem. I just curious if any driver use negative biHeight and
>work successfully with AMCAP.

Yes, I have. It works fine with the RGB formats.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.