different behavior for buffer at vid_get_viewport_fb() - General Discussion and Assistance - CHDK Forum

different behavior for buffer at vid_get_viewport_fb()

  • 3 Replies
  • 2255 Views
different behavior for buffer at vid_get_viewport_fb()
« on: 18 / January / 2009, 12:26:22 »
Advertisements
Hi,
I wrote a stereo pair display routine that combines two viewport images into a stereo pair.  It works in play more.  It needs to stash the viewport images from the left image and then the right image.  Then it calculates and displays the stereo image (either as a side by side pair or as an anaglyph).
In Allbest's (51) build I used the buffer at vid_get_viewport_fb() (the record viewport) to stash the left image while the user moved to display the right image.  This worked fine since the record viewport wasn't used during play mode.  But in the CHDK builds (629, 679) this buffer gets overwritten in play mode with the current display image.  So my routine stopped working.  (My camera is an A720is.)

From my perspective this behavior wastes a buffer needlessly.  The same data is available at  vid_get_viewport_fb_d().  Why have two copies of it?

I don't know how to find where in the code this viewport is getting overwritten.  I have turned off edgeoverlay, histogram and zebra with no change in behavior.  Could it be that the CHDK build somehow changes the camera behavior?  Can anyone help?

Thanks,
Jon
« Last Edit: 18 / January / 2009, 12:32:17 by hiker_jon »

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: different behavior for buffer at vid_get_viewport_fb()
« Reply #1 on: 18 / January / 2009, 13:52:25 »
You might want to specify your camera model & sub.

At least vid_get_viewport_fb_d() has been fixed for a few models recently to fix histogram and zebra in play mode (a570, a590 to name two models).


Oh and you can of course see the history of those functions in svn http://tools.assembla.com/chdk/browser/trunk/platform. The old allbest tree is archived in another branch if you need to go far back.
« Last Edit: 18 / January / 2009, 13:54:37 by fudgey »

Re: different behavior for buffer at vid_get_viewport_fb()
« Reply #2 on: 19 / January / 2009, 11:58:21 »
I guess I am hoping that maybe somebody who happened to change something will see the post and comment.  The behavior is of the record viewport in play mode and so I doubt that many people have messed with this.

My camera is an A720is, there is only one sub.  I also have an A590is 1.01B and the behavior of the CHDK build is the same.  I can't compare on this camera with the Allbest build because I don't think Allbest ever supported the A590is.  (If there is an Allbest build with 590 support please let me know where I can get it.)   The behavior in the CHDK build is not new.  It goes back to at least build 609 which is the first one I started using.

I have tried to track down any references to this routine to see if I can find anything.  So far no success.  Maybe some other change causes the camera to behave differently.
Jon

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: different behavior for buffer at vid_get_viewport_fb()
« Reply #3 on: 19 / January / 2009, 13:00:15 »
Last allbest was about #504, the migration from allbest to juciphox as trunk was done Sep 13th 2008. #609 is from early December.

It's possible that this was added to juciphox before this migration. I believe they are both in the same svn timeline. You could pull, build and test old (trunk back to 505-ish and juciphox branch below that) revisions from svn until you can pinpoint where things changed.

I can't think of anything in CHDK that would store images to rec viewport in play mode (or in any mode..., they all write to malloced RAM buffers), especially since you've disabled zebra, histo and edge overlay (none of which should do that anyway even with broken addresses since if I'm not mistaken, they only write their OSD overlays, not copies of images).



 

Related Topics