On 10/09/06, Claudio Ciccani <[EMAIL PROTECTED]> wrote:

The driver in DirectFB-extra was developed for the xine video provider.
It's intended to be used for internal purposes only.
The driver in xine-lib is more or less a port of the code from df_xine
and it is intended to be used by common applications.

OK, that makes sense.

What kind of features does libcle266mpegdec provide? Video motion
compesation?
The best solution for a VMC decoder would be writing video output driver
instead of a video decoder.

The library provides a complete MPEG-2 video decoder: you pass
elementary stream data in and you get pictures out, hence the decision
to write a decoder plug-in for it.  The hardware itself does all the
motion compensation, the IDCTs and the variable length decoding of the
motion vectors and DCT coefficients.

Do you know of any likely problems with the rest of the video_out_dfb
plug-in if the frame surfaces happen to be in video memory?  I've
attached the patch I'm currently using against video_out_dfb to allow
this.

Mark
diff -u -r1.35 video_out_dfb.c
--- video_out_dfb.c     23 Jun 2006 08:30:57 -0000      1.35
+++ video_out_dfb.c     9 Sep 2006 18:50:21 -0000
@@ -48,6 +48,9 @@
 
 #include "video_out_dfb.h"
 
+#define VO_CAP_DFBV 0x00010000
+#define XINE_IMGFMT_DFBV (('V'<<24)|('B'<<16)|('F'<<8)|'D')
+
 
 /* TODO: add more matrices */
 static const DVProcMatrix proc_matrices[] = {
@@ -561,7 +564,7 @@
 vo_dfb_get_capabilities( vo_driver_t *vo_driver )
 {
      dfb_driver_t *this = (dfb_driver_t*) vo_driver;
-     uint32_t      caps = VO_CAP_YV12 | VO_CAP_YUY2;
+     uint32_t      caps = VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_DFBV;
 
      if (this->ovl)
           caps |= VO_CAP_UNSCALED_OVERLAY;
@@ -602,6 +605,27 @@
 }
 
 static void
+vo_dfb_duplicate_frame_data( vo_frame_t *vo_frame,
+                             vo_frame_t *vo_original)
+{
+     dfb_frame_t  *frame = (dfb_frame_t*) vo_frame;
+     dfb_frame_t  *original = (dfb_frame_t*) vo_original;
+
+     CardState state;
+     DFBRectangle rect = {0, 0, frame->surface->width, frame->surface->height};
+     DFBRegion clip;
+
+     dfb_state_init(&state, NULL);
+     dfb_region_from_rectangle(&clip, &rect);
+     dfb_state_set_destination(&state, frame->surface);
+     dfb_state_set_source(&state, original->surface);
+     dfb_state_set_clip(&state, &clip);
+     dfb_state_set_blitting_flags( &state, DSBLIT_NOFX );
+     dfb_gfxcard_blit( &rect, 0, 0, &state );
+     dfb_state_destroy( &state );
+}
+
+static void
 vo_dfb_frame_dispose( vo_frame_t *vo_frame )
 {
      dfb_frame_t *frame = (dfb_frame_t*) vo_frame;
@@ -804,9 +828,21 @@
           }
           
           if (!frame->surface) {
-               err = dfb_surface_create( NULL, width, height, 
this->dest_format,
-                                        CSP_SYSTEMONLY, DSCAPS_SYSTEMONLY,
-                                        NULL, &frame->surface );
+               if (format == XINE_IMGFMT_DFBV)
+               {
+                    lprintf("creating in video memory\n");
+                    err = dfb_surface_create( NULL, width, height, 
this->dest_format,
+                                              CSP_VIDEOONLY, DSCAPS_VIDEOONLY,
+                                              NULL, &frame->surface );
+                    frame->vo_frame.proc_duplicate_frame_data =
+                         vo_dfb_duplicate_frame_data;
+               }
+               else
+               {
+                    err = dfb_surface_create( NULL, width, height, 
this->dest_format,
+                                              CSP_SYSTEMONLY, 
DSCAPS_SYSTEMONLY,
+                                              NULL, &frame->surface );
+               }
           }
           else {
                dfb_surface_unlock( frame->surface, 0 );
@@ -814,6 +850,8 @@
                                            width, height, this->dest_format );
           }
 
+          vo_frame->accel_data = frame->surface;
+
           if (err != DFB_OK) {
                xprintf( this->xine, XINE_VERBOSITY_DEBUG,
                         "video_out_dfb: "
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to