What are the appropriate steps to rotate the viewfinder of the camera?

Another screen problem is driving me crazy.

I'm quite confused as to what are appropriate measures to turn the viewfinder window when the user rotates the device.

I seem to be able to get things market during the passage of a landscape to a landscape upside.  But to me something else gives basically the things that I can't begin to describe.  For example, when I go from landscape to portrait, I always get the bottom half of the screen to be the dark tone and the view backwards.

Say vf_win is the window of the viewfinder and the size is the size of the vf_win and the angle is the angle of rotation new peripheral.

So I first turn to the viewfinder window by

screen_set_window_property_iv(vf_win, SCREEN_PROPERTY_SOURCE_SIZE, size);
screen_set_window_property_iv(vf_win, SCREEN_PROPERTY_BUFFER_SIZE, size);
rc = screen_set_window_property_iv(vf_win, SCREEN_PROPERTY_ROTATION, &angle);

then rotate the camera by means of

rc = camera_set_device_orientation(handle, angle);
rc = camera_set_videovf_property( handle, CAMERA_IMGPROP_ROTATION, &angle);

?

I think the above is certainly false since I couldn't get the results I wanted.

Any help is greatly appreciated.

The sample application does not work quite right when launched in portrait on the playbook, because the default configuration of the camera is for landscape.  Down in the device drivers, we don't really know anything about how the device is held and what is intention of the user/application, so we rely on the app by telling us a lot of information to make things.  Don't forget, this is the API of the lowest level available for access to the camera.  There is an API of Cascades photo being developed which encapsulates C API to the top and tries to simlify things at the expense of flexibility.

On PB, the video viewfinder frames 1920 x 1080 by default, but several other formats are supported (this whole landscape well!).  Use camera_get_video_vf_resolutions() to retrieve the complete list.  If you need to make in a picture window, you must specify either a rotation of output using camera_set_videovf_property (handle, CAMERA_IMGPROP_ROTATION, 90 or 270) or by adjusting your rotation of window screen using screen_set_window_property_iv (win, SCREEN_PROPERTY_ROTATION, 90 or 270) and optionally resize the window by using SCREEN_PROPERTY_SIZE.

The first option above actually produces a video image 1080 x 1920 returned in a window of the non-tourne screen.  The second option is still dealing with buffers of window of 1920 x 1080, but when the window is composite, it is blitted to the side.  We have 2 ways of doing this is because we have a requirement to be able to save videos in formats portrait without having to rely on the advice of metadata to display the videos properly as Apple or Android have to do (this is the reason for the 1st method).  For the second method (form) this is because not all applications require the video must rotate, nor necessarily all hardware platforms support video output in this mode.

To answer your last question - definition of resolution 1024 x 576 vf and a rotation of 90 on playbook will give the following result:

-buffers that have a width of 576 and a height of 1024 pixels of video output.

-You can then display the viewfinder in a window size 576 x 1024 (or however you choose to scale)

-buffers sent by the sensor of the camera would be rotated 90 degrees to the right before being delivered through these pads size 576 x 1024

Represent it visually?

If you keep the playbook in house orientation and a person stood in front of the camera, the image would rotate 90 degrees to the right so that their head is located to the right of the frame and feet to the left.

How is it useful?

If you happened to take the playbook oriented 90 degrees counterclockwise (eg. logo blackberry is on the right side) and displays this buffer image 576 x 1024, head of the person would now be at the top of the screen.

Once again, this can easily get somewhat confusing and really benefits greatly from visuals.  I keep a stack of post-it notes at hand and am constantly draw lines of frame and stick men on them and turning them accordingly

See you soon,.

Sean

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • All the sound abruptly stopped HP dv5

    I hope you can help.  My sound - all keyboad, alert sounds, music, speakers - all, suddenly stopped working. I have a: Pavilion dv5 laptop Model dv5 1210TU p/n NT689PA #ABG Running on Windows Vista, 32-bit operating system Sound is turned on and the

  • How can I fix error code 0 x 80040154 inform me please

    How can I fix error code 0 x 80040154 inform me please

  • ENVY TouchSmart j051sa 15 HP

    I just noticed that the TouchSmart from HP ENVY 15-j051sa I bought actually watch as a TouchSmart from HP ENVY 15-j051ea when I put in the serial number etc. What is the difference in the numbers of model 15-j051sa and 15-j051ea (his and ea)?

  • Q5 whaen question upgraded to os 10.2.1 suspended blackBerry camera

    HI1 feb on28th what version 10.2.1 I upgraded my Blackberry 10 on it after upgrading my camera is suspended and no photos I restart holding my camera. but it doesn't take no change camera does not work. and there we more I m having model q5 blackberr

  • Are the components appearance customizable/revertable

    Hey all, I know that the problems with the beta 2 appearance is at the bottom of the nature of the minds of most people, but I was wondering, they changed the buttons, drop-down lists, etc. to a white style which is nice but my applications were styl