[MPlayer-dev-eng] Feedback wanted regarding dvd playing in mplayer.
James Courtier-Dutton
James at superbug.demon.co.uk
Fri Sep 5 20:27:53 CEST 2003
Alex Beregszaszi wrote:
> Hi,
>
>
>>I am about to make changes to the libdvdnav api, and would like some
>>feedback from yourselves as to any improvements/changes you would like
>>
>>see in libdvdnav, so that it might work better with mplayer.
>>Are you interested in using libdvdnav?
>
> Yes, if the API changes.
> However, I never looked at that code, nor I have coded something for it,
> I've heard lot of comments on the mplayer lists about the issue.
Unluckily, I only really follow the dvd-devel list, so I would not have
seen any of those comments.
>
> libdvdnav has own functions for dvd reading and data handling, altought
> it would be better, if the caller could pass all the datas/pointers or
> callbacks would be involved (stream reader callback)
>
> For example (pseudocode)
>
> my_stream_reader(char *buf, int len)
> {
> ...
> mplayer_stream_read(buf, len)
> ...
> }
>
> ...
> dvdvnav_init(my_stream_reader)
> ...
> loop{
> ...
> dvdvnav_events()
> ...
> }
> ...
>
> This way the caller can use it's current structure for buffer handling,
> and mplayer can use the caching system together with dvdnav.
>
> This is the main point I've heard against current dvdnav.
>
I will explain a bit some of the requirements for DVD playback, which I
think might relate to yourselves.
For the Video/audio stream: -
VOB Sectors are read off the DVD and then passed to demuxers.
Certain events happen during the playing of a DVD. Some events have to
be acted upon at an exact position in the stream, some events can be
handled without any link to where stream playback is at.
E.g. Chapter change being sent to the GUI for info display does not have
to match the stream exactly.
E.g. When a user activates a menu item, and it causes the menu to
change, the stream sent to the demuxers will contain discontiuities, so
it is best to insert discontinuity control data into the stream, so the
demuxers, decoders etc. can use that info to reset them selves during a
menu change.
Certain sectors on a DVD are NAV packs, and these are required to be
read and decoded immeadiately, so that libdvdnav knows which sectors to
read next. The NAV packs also have to be sent and demuxed,decoded inside
the stream, because they contain details of where the menu buttons
appear, and these have to be in sync with the video being displayed on
the screen.
DVDs are separated up into different types of data.
.IFO files contain info that only libdvdnav needs to see.
.VOB files contain the actual video/audio etc., but also contain NAV
packs, that are needed by libdvdnav as well as the video out.
So, I can see that the main requirement from libdvdnav for mplayer is
that your application should be able to do it's own buffer management
and also separate stream from events.
My problem, is how do we insert special control data into the stream, if
we don't control the format of the buffer. Basically, we cannot separate
the stream from some of the events, because the event's action is linked
to a particular video frame.
Another problem arises because the read_physical_sector() function in
the current libdvdnav will decrypt the data with libdvdcss if needed, as
well as actually reading the sector from the DVD.
I am also unclear as to where the "mplayer caching" happens.
Cheers
James
More information about the MPlayer-dev-eng
mailing list