Re: Camera preview orientation on HTC-Universal
- From: cputoaster <cputoaster@xxxxxxxxxxxxx>
- Date: Tue, 27 Dec 2005 11:19:02 +0100
As reality forces me to program device-dependent features, I would need a way to reliably identify the (broken) device at runtime. What is the recommended way? The IMEI is not the ideal way, it is tied to GSM and might even need some priviledged access.
Cheers, Andres
Gary Daniels [MS] wrote:
Rendering the preview pin as you did below should always result in the image being upright on the screen. It sounds to me like you're seeing a camera driver bug.
OEM's can replace the Windows Mobile camera application with their own which does not use DirectShow or the DirectShow camera driver. That would mean the application is not using the same camera driver as you're using when you use DirectShow. A big indicator of this is if the camera application is full screen, the DirectShow based Windows Mobile camera application doesn't support full screen preview.
I'd recommend contacting HTC and seeing if they're aware of this problem.
Gary Daniels Windows CE Multimedia and Graphics
This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
"cputoaster" <cputoaster@xxxxxxxxxxxxx> wrote in message news:eji6Lc8$FHA.516@xxxxxxxxxxxxxxxxxxxxxxx
Gary, thx for the prompt response.
Gary Daniels [MS] wrote:
When you set the format on the preview pin, are you creating your own media type to set or retrieving one from the driver and just tweaking it to what you want?
I use the standard media types:
// create the complete graph hr = m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, m_pVideoCaptureFilter, pBFilter, NULL );
Even with pBFilter (which is a filter derived from CTransInPlaceFilter and therefore naturally should not change the media-type) replaced by NULL, the image gets rotated and flipped.
Btw, the caps show that the pin is not capable of h- or v-flipping. Camera roll is supposedly supported (yeah, I can roll the device ;-) ) but (as expected) does not have any effect.
A special flag was developed (BI_SRCPREROTATE) which tells GDI and the video renderer that the orientation of the image from the camera is in the correct orientation (don't rotate when rendering it). This is necessary because as you rotate the shell on the device you also physically rotate the device. When the display driver rotates bitmaps to render the shell and UI it needs to know that this particular bitmap shouldn't be rotated. The flag is or'd into the biCompression field in the BITMAPINFO structure.
I will play around with this, at least it should therefore be possible to use the same transform for both screen rotations. Even if this would probably mean that I have to implement a more complex (non-in-place) filter, right?
I suspect you created your own format structure from scratch and did not set this flag, resulting in GDI rotating your preview along with the physical rotation of the device.
Not that I am aware of. If you want I can send you the relevant source (copyright blablabla...).
Thx a lot, Andres
Gary Daniels Windows CE Multimedia and Graphics
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
"cputoaster" <cputoaster@xxxxxxxxxxxxx> wrote in message news:%23%23ykxPz$FHA.1600@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
after I actually got the capture and filter to work, I am having a strange problem. The input from the camera gets displayed "flipped over the diagonal", meaning it is rotated by 90 degrees and then flipped horizontally. And this changes depending on screen rotation. While I can rotate the image manually by writing a filter (I already did), it is certainly the wrong way and will cut off 1/4 of the image (if I do it per in-place-filter).
How can I tell the output renderer to NOT rotate / flip the content? The original video recording app can do it correctly, so there must be some flags on that camera or output renderer to set. I did already try the documented flip and roll attributes, without luck.
Andres
.
- Follow-Ups:
- Re: Camera preview orientation on HTC-Universal
- From: cputoaster
- Re: Camera preview orientation on HTC-Universal
- References:
- Camera preview orientation on HTC-Universal
- From: cputoaster
- Re: Camera preview orientation on HTC-Universal
- From: Gary Daniels [MS]
- Re: Camera preview orientation on HTC-Universal
- From: cputoaster
- Re: Camera preview orientation on HTC-Universal
- From: Gary Daniels [MS]
- Camera preview orientation on HTC-Universal
- Prev by Date: CameraControlProperty HTC-Prodigy
- Next by Date: Re: Camera preview orientation on HTC-Universal
- Previous by thread: Re: Camera preview orientation on HTC-Universal
- Next by thread: Re: Camera preview orientation on HTC-Universal
- Index(es):
Relevant Pages
|