Quantcast
Channel: Adobe Community : All Content - AIR Development
Viewing all articles
Browse latest Browse all 2954

Rotate RAW CAMERA (because its stuck sideways when in portrait(bug)) in air for android

$
0
0

 

I'm using the Flex Hero Pre-release 4.5 and this is Flex Mobile application for android.

 

I have a situation where the raw camera is being displayed on the screen and it's being transmitted in a netstream. Apparently right now in AIR for android if you’re simply using the raw camera in portrait it doesnt actually shoot the camera in portrait...it’s 90 degrees in the wrong direction. So, here’s a code snippet where i rotated the video and it looks great on the phone. however, i need to attach the cam to a netstream and send it...but it sends sideways video, and i dont really want to adjust it on the far end. and I can’t attach a video to a netstream...Anyone have any ideas what I could do rather than just waiting for an AIR update for this?

 

//i know i have width and height mixed up, its because im rotating it in a second and i dont want it to be stretched
                                nearVideo
=newVideo(near_video.height,near_video.width);

var m:Matrix=newMatrix();
//rotate here
m
.rotate(Math.PI/2);
this.nearVideo.transform.matrix = m;
//repositioning it so it looks like its fitting in the container correctly
nearVideo
.x=near_video.width;
nearVideo
.y=(near_video.height-near_video.height);

if(Camera.isSupported)
{
nearCam
=Camera.getCamera();
}

nearCam
.setMode(near_video.height,near_video.width,10);
nearVideo
.attachCamera(nearCam);
near_video
.addChild(nearVideo);

//now its all great on screen...but when this comes up

sendStream
.attachCamera(nearCam);

//i’m sending sideways video...

Viewing all articles
Browse latest Browse all 2954

Trending Articles