* Patrick.Debois ([EMAIL PROTECTED]) wrote:
> On Sun, 26 May 2002, Denis Oliver Kropp wrote:
> 
> > Quoting Patrick.Debois ([EMAIL PROTECTED]):
> > > Hi,
> > > 
> > > i'm currently looking around in the directfb library.
> > > Using it i would like to display my television with it.
> > > That works out ok but the problem is to tune the video device.
> > > It gets locked by the videoprovider. So therefore i have 
> > > to stop the provider,release it and then open the device again by myself. 
> > > I've noticed there is a data->fd structure. Is it available while 
> > > displaying a videoprovider so there is stop needed?
> > 
> > There are two dirty ways to solve the problem. You can include the private
> > structure and access the fd or you comment out the goto at line 160 in
> > 'drivers/media/video/videodev.c' (2.4.19-pre8). Older kernels had line
> > a with "busy=1" that could be commented out.
> > 
> > A clean way would be to define an interface for tuning that can be retrieved
> > by e.g. IDirectFBVideoProvider::GetTuner(). The video provider could then pass
> > the fd to the other interface which would also be in the v4l module.
> > 
> Would it not be better to name it IDirectFBVideoProvider::GetDevice ? 
> Besides the Tuning facilities i would also like to change channels, get 
> info about mono,stereo signal and so on. 
> I don't think it's the task of directfb to implement these kind of 
> features and a generic getdevice should be sufficient. 

How about IDirectFBVideoProvider::GetChannels()

which returns something like DFBVideoChannels:

typedef enum {
   DVF_NONE      = 0x000,
   DVF_TUNER     = 0x001,
   DVF_CHAPTERS  = 0x002,
   DVF_ANGLES    = 0x004
   DVF_SUBTITLES = 0x010,
   DVF_AUDIO     = 0x020
   /* More ?*/
} DFBVideoChannelsClass;

typedef enum {
   DAT_NONE,
   DAT_MONO,
   DAT_STEREO,
   DAT_DOLBY_STEREO, /* 4 channel surround (decoded in 2 channels)
   DAT_AC3,
   DAT_DTS,
   /* more ? */
} DFBAudioTypeClass;

typedef struct {
   DFBVideoChannelsClass  clazz;
   
   DFBVideoChannelsDescription *tuner, *chapters, *angles, *subtitles, *audio;
} DFBVideoChannels;

typedef struct {
   int num_channels;
   char **name;       /* array of station/chapter/angle/subtitle/audio names */

   char **description /* usefull for EPG ? */

   int **id;                        /* array of id's used to set the channel */

   DFBAudioTypeClass **audio_clazz; /* array */
   double **aspect_ratio;           /* array */
   
   double **bitrate;                /* array */
   double **fps;                    /* array */
} DFBVideoChannelsDescription;


IDirectFBVideoProvider::SetVideoChannel( IDirectFBVideoProvider *thiz,
                                         DFBVideoChannelsClass   class,
                                                                                 int   
                  id );

IDirectFBVideoProvider::GetVideoChannel( IDirectFBVideoProvider *thiz,
                                         DFBVideoChannelsClass   class,
                                                                                 int   
                 *id );


IMHO, this would be very usefull for a DirectFB developer.
I know you want a small library, but if you've first decided to have
IDirectFBVideoProvider you might as well make it very usefull.
The alternative is to use mplayer with MultiAppCore to play your videos.

The addition of this would make it easy for a DirectFB app to be a KICKASS multimedia 
player/center/settop-box/etc

It wouldn't take many lines of code to add this to DirectFB and  every
videoprovider.

(BTW: v4l provider would propably need to have some .xawtvrc file to
parse for which channels it should use)

Playing single (normal) MPEG/AVIs would mean it has one chapter (and one
audio channel)

I don't know how DVD menus work, but maybe some of you know how that can
be incorporated?


Hope you like my idea :)

Regards Hallvar Helleseth


-- 
Info:  To unsubscribe send a mail to [EMAIL PROTECTED] with 
"unsubscribe directfb-dev" as subject.

Reply via email to