Guys,
I Have found my problem...
When I have tried the Thespecial sample in first page of this topic, with
Code: Select all
videoPlayer = new murmuurVIDEO(irrVideo, device->getTimer(), 1024, 768, videoOutput);
I have found this problem in sws_scale():
Unhandled exception at 0x066d6570 in FFMpeg2.exe: 0xC0000005: Access violation.
Every time I tried to create the murmuurVIDEO with bigger desiredW and desiredH than my original video height and width, this error happens...
So I have changed the creation call to:
Code: Select all
videoPlayer = new murmuurVIDEO(irrVideo, device->getTimer(), 350, 240, videoOutput);
The program runs, but the image is all messed... Why?
I have found the answer ...
when I look for my IImage pitch with _imCurrentImage->getPitch(), I've found 1400 bytes per line, that is 361 pixels per line multiply by 4 bytes per pixel.
But...
when I look for my ITexture pitch with _txCurrentTexture->getPitch(), I've found 2048 bytes per line, that is 512 pixels per line multiply by 4 bytes per pixel.
So, appear that the driver is free to add padding at the end of each scanline, and this is frequently done with non-power-of-2 textures. In this case, the driver seems to be padding each scanline to a multiple of 32 pixels.
Just to confirm, I have changed that values to 256x128 that are power-of-2 numbers...:
Code: Select all
videoPlayer = new murmuurVIDEO(irrVideo, device->getTimer(), 256, 128, videoOutput);
So, my messed image problem has disappeared and now my video is shown correctly...
Apologize me for my ignorance and for change this values...
But I'm still with 2 problems:
1- sws_scale() only works if my Video size is bigger than the "new murmuurVIDEO" size values. If width or height of the video is smaller than the width / height values supplied during criation, the program drops Access Violation.
2- The video still playing slowly... Appear that some frames are droped... The audio works perfecly, but the video is not smooth...
One more time, Apologize me for the prior problem... but I will be happy if anyone can help me with those 2 other problems...