Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
New Contributor
Posts: 5
Registered: ‎12-20-2012
My Device: Alpha C
My Carrier: none

Camera Preview Buffers

Hi there,

 

Currently trying to send the camera preview buffer through an opengl shader, but basically just as a regular texture. The data i am getting from the camera buffer is:

 

Framsdesc: height1280
Framsdesc: width 720
Framsdesc: stride 4096
Framsdesc: uvoffset 5242880
Framsdesc: uvstride 4096

 

Now the only thing ive really done so far in opengl shaders is send in a regular rgb image (jpg etc.) and apply it as a texture. Does anyone recommend how i would deal with this in opengl or how to process the data any other way? Even explaining what is meant by the offset and stride might help.

 

Thanks in advance

 

 

Developer
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: Camera Preview Buffers

[ Edited ]

You might like to take a look how three.js handles it. That's a JavaScript 3D framework which can use a video stream as a texture.

 

Offset and stride are described here:

http://developer.blackberry.com/native/reference/bb10/com.qnx.doc.camera.lib_ref/topic/structcamera_...

 

This thread may help:

http://supportforums.blackberry.com/t5/Native-Development/Camera-video-buffer-and-stride-question/td...

 

This JAM session recording is worth watching:

http://hosting.desire2learncapture.com/RIM/1/watch/48.aspx

 

IIRC, it is recommended to use power-of-two sized textures in OpenGL ES.

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands