Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linuxtv-softmpeg] Re: softmpeg plugin and vesafb



Meinrad,

Look at src/v_directfb.c and you can see the problem.  In the "init"
function, if the destination surface is anything besides UYVY, I420, or
YV12, init returns -1.

Then, in the "prepare"  function, if the destination surface is not of
type I420, YV12, or UYVY, the function will print "illegal surface format"
and won't copy the frame to the destination surface.

Of course, the issue here is that there's no YCrCb to RGB conversion code
yet, so if you only have an RGB destination surface, you're out of luck.

I'm using an SiS 315 series video chipset, and apparently directfb does
not provide access to its video surface, so I'm roughly in the same boat
with needing to display decoded frames to an RGB surface.

I have been playing with libsoftmpeg for several days now, trying to
achieve smooth playback of 30 frames per second video.  All the values are
hardcoded for PAL format, so I changed everything I thought would matter
for the new frame rate.

I also noticed that the softmpeg_decoder_process_ts_data wants a number of
bytes divisible by 188.  I'm using a hauppauge pvr350 to hardware encode
mpeg video, and reading from it simply does not give a number of bytes
divisible by 188.  So I hacked in something that keeps any spare bytes for
the next read.  I don't know if the problem I saw here is legitimate or
not.  Maybe the dvb cards always provide 188 byte chunks when you read
from them??

I also wrote some crappy code for converting the YCrCb frames to RGB.
It could be done a lot better, but it is enough to let me see some frames
of video.  I think that Intel has some nice pages on so called YUV to RGB
colorspace conversion that could be used as a basis for software
conversion routines.  My first instinct would be to rip off the code that
Xine uses for this, but that would taint the LGPL license of libsoftmpeg.
The best approach (I think), is to find public domain code, or LGPL code
that does colorspace conversion.  I don't intend to mess with this aspect
much more because it's pointless if you have hardware support.

I've diffed my cvs checkout for anyone who wants to see the changes I've
made.  I was planning on getting further before releasing anything, but
since it may help someone right away, I will provide what I have so far.

See http://www.bnichols.org/tmp_patches/

There is the cvs diff there, and a new file yuv2rgb.h that should go in
the src/ directory of the libsoftmpeg source.  It provides lookup tables
that my code for the YCrCb to RGB conversion uses.

I provided in src/internal.h a define called FRAME_DELAY.  It should be
set to the number of milliseconds between frames for the video source you
want to play.  For PAL, it's 40, for NTSC, it's 33.3 (repeating), but
since it's used as an integer everywhere, I set it to 33.  This will throw
off the av sync code probably, so maybe something more elaborate needs to
be done.

I don't guarantee anything about my changes to the code.  I have not
achieved smooth playback yet, not even just for audio.  For some reason I
have not determined yet, the audio buffer consistently underflows for me.
There does seem to be a problem in how the delay is calculated when the
audio buffer gets to large.  I'm looking into it.

Later,

Bryce



On Thu, 27 May 2004, Meinrad Sauter wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> I'm trying to use the softmpeg plugin for video output on my vdr machines
> framebuffer device. Unfortunately only vesafb is supported for my hardware
> (FSC Multitainer).
> I compiled and installed directfb, fusionsound, libsoftmpeg and the plugin
> without too many problems, but after vdr startup I only see an empty window
> on the screen (vdr runs without problems on the ff card, though).
> The output from strace gives a hint that theres a problem with video decoding:
>
> write(2, "{-} [  135:   0.003] SoftMPEG/in"..., 35{-} [  135:   0.003]
> SoftMPEG/init/) = 35
> write(2, "unsupported pixelformat for the "..., 82unsupported pixelformat for
> the destination surface, no hw acceleration available.) = 82
> gettimeofday({1085594968, 712102}, NULL) = 0
> getpid()                                = 135
> write(2, "{!} [  135:   0.003] SoftMPEG - "..., 79{!} [  135:   0.003]
> SoftMPEG - ERROR in video_decoder_create at video.c:105:  ) = 79
> write(2, "initialization of video output d"..., 46initialization of video
> output device failed.
> ) = 46
> gettimeofday({1085594968, 712359}, NULL) = 0
> getpid()                                = 135
> write(2, "{!} [  135:   0.004] SoftMPEG - "..., 85{!} [  135:   0.004]
> SoftMPEG - ERROR in softmpeg_decoder_create at softmpeg.c:213:  ) = 85
> write(2, "ocreating video decoder instance"..., 40ocreating video decoder
> instance failed
> ) = 40
>
>
> Any Ideas or is softmpeg simply not working on vesafb devices?
>
> My system:
> Kernel 2.6.6
> DirectFB, Fusionsound, libsoftmpeg: Current CVS
> vdr-1.3.6
> libavcodec-0.4.8
>
> Regards
> Meinrad
>
> - --
> Meinrad Sauter
> email: meinrad.sauter@gmx.de
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
>
> iD8DBQFAtfHMaP+jEXEoU7wRAkWSAKC6s9fC9jkBB30GXVyAVXq9AlwViQCgrHKz
> LqhVbxwmGe/+4pgY0jChJ5A=
> =t3eU
> -----END PGP SIGNATURE-----
>
>
> --
> Info:  To unsubscribe send a mail to ecartis@linuxtv.org with
> "unsubscribe linuxtv-softmpeg" as subject.
>
>


-- 
Info:  To unsubscribe send a mail to ecartis@linuxtv.org with 
"unsubscribe linuxtv-softmpeg" as subject.



Home | Main Index | Thread Index