Claudio "KLaN" Ciccani wrote:
samh wrote:
Claudio "KLaN" Ciccani wroteï
/samh wrote:
i got directfb-extra from cvs
but xine-videoprovider doesn't work with VeXP i think the problem is on VeXP because everything fine on Xine
how can i solve this problem with my EPIA-M
Can you report console output ?
Best regards, Claudio /
/in VeXP, structure vo_frame_s is different from xine /
/there are no member functions proc_frame & proc_slice
and there is no member proc_called(there is a member function (*copy) just like proc_slice)
i add proc_frame & proc_slice to VeXP vo_frame_s set them to NULL
df_xine can load mpeg2 file i got the audio outpot but the video output is nothing/
This patch ports video_out_dfb to VeXP (not tested, but should work). Let me know.
Best regards, Claudio
Sorry, this is the right patch.
Best regards, Claudio
================================================================
diff -uraN DirectFB-extra/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb.c DirectFB-extra2/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb.c
--- DirectFB-extra/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb.c 2004-05-18 11:24:09.000000000 +0200
+++ DirectFB-extra2/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb.c 2004-05-18 12:09:52.000000000 +0200
@@ -284,7 +284,7 @@
uint8_t* v_off;
uint32_t line = frame->width >> 2;
uint32_t n = (frame->width * frame->height) >> 3;
- uint32_t l = frame->vo_frame.pitches[0];
+ uint32_t l = frame->width << 1;
int32_t bright = this->brightness.l_val;
int32_t ctr = this->contrast.l_val;
@@ -1468,7 +1468,7 @@
static void -dfb_proc_frame(vo_frame_t* vo_frame) +dfb_frame_copy(vo_frame_t* vo_frame) { dfb_frame_t* frame = (dfb_frame_t*) vo_frame; #ifdef DFB_DEBUG @@ -1478,8 +1478,6 @@ TEST(vo_frame != NULL); TEST(frame->surface != NULL);
- vo_frame->proc_called = 1;
-
if(frame->proc_needed)
{
uint8_t* data;
@@ -1488,8 +1486,7 @@
data = (uint8_t*) frame->surface->back_buffer->system.addr;
pitch = (uint32_t) frame->surface->back_buffer->system.pitch;- SPEED(frame->realize((dfb_driver_t*) vo_frame->driver,
- frame, data, pitch));
+ SPEED(frame->realize(frame->driver, frame, data, pitch));
}FAILURE: @@ -1525,14 +1522,13 @@
pthread_mutex_init(&(frame->vo_frame.mutex), NULL);
- frame->vo_frame.proc_slice = NULL; - frame->vo_frame.proc_frame = dfb_proc_frame; - frame->vo_frame.field = NULL; - frame->vo_frame.dispose = dfb_frame_dispose; - frame->vo_frame.driver = vo_driver; - frame->state.src_blend = DSBF_SRCALPHA; - frame->state.dst_blend = DSBF_INVSRCALPHA; - frame->state.modified = SMF_ALL; + frame->vo_frame.copy = dfb_frame_copy; + frame->vo_frame.field = NULL; + frame->vo_frame.dispose = dfb_frame_dispose; + frame->driver = (dfb_driver_t*) vo_driver; + frame->state.src_blend = DSBF_SRCALPHA; + frame->state.dst_blend = DSBF_INVSRCALPHA; + frame->state.modified = SMF_ALL;
D_MAGIC_SET(&(frame->state), CardState);
@@ -1584,16 +1580,32 @@
frame->state.source = frame->surface;
frame->state.modified |= SMF_SOURCE;- release(frame->chunks[0]);
- release(frame->chunks[1]);
- release(frame->chunks[2]);
+ if(frame->vo_frame.base[0])
+ {
+ xine_free_aligned(frame->vo_frame.base[0]);
+ frame->vo_frame.base[0] = NULL;
+ }
+
+ if(frame->vo_frame.base[1])
+ {
+ xine_free_aligned(frame->vo_frame.base[1]);
+ frame->vo_frame.base[1] = NULL;
+ }
+
+ if(frame->vo_frame.base[2])
+ {
+ xine_free_aligned(frame->vo_frame.base[2]);
+ frame->vo_frame.base[2] = NULL;
+ } if(format == XINE_IMGFMT_YUY2)
{
+ int pitch;
+
ONESHOT("video frame format is YUY2");yuv_cc = &yuy2_cc; - vo_frame->pitches[0] = frame->width << 1; + pitch = frame->width << 1;
if(frame->surface->format == DSPF_YUY2 &&
!this->brightness.l_val && this->contrast.l_val == 0x4000)
@@ -1604,20 +1616,19 @@
} else
{
vo_frame->base[0] = (uint8_t*) xine_xmalloc_aligned(16,
- vo_frame->pitches[0] *
- frame->height,
- &(frame->chunks[0]));
+ pitch * frame->height);
TEST(vo_frame->base[0] != NULL);
} } else /* assume XINE_IMGFMT_YV12 */
{
+ int pitches[2];
+
ONESHOT("video frame format is YV12");yuv_cc = &yv12_cc; - vo_frame->pitches[0] = frame->width; - vo_frame->pitches[1] = frame->width >> 1; - vo_frame->pitches[2] = frame->width >> 1; + pitches[0] = frame->width; + pitches[1] = frame->width >> 1;
if((frame->surface->format == DSPF_YV12 ||
frame->surface->format == DSPF_I420) &&
@@ -1642,17 +1653,11 @@
} else
{
vo_frame->base[0] = (uint8_t*) xine_xmalloc_aligned(16,
- vo_frame->pitches[0] *
- frame->height,
- &(frame->chunks[0]));
+ pitches[0] * frame->height);
vo_frame->base[1] = (uint8_t*) xine_xmalloc_aligned(16,
- vo_frame->pitches[1] *
- (frame->height >> 1) + 2,
- &(frame->chunks[1]));
+ (pitches[1] * (frame->height >> 1)) + 2);
vo_frame->base[2] = (uint8_t*) xine_xmalloc_aligned(16,
- vo_frame->pitches[2] *
- (frame->height >> 1) + 2,
- &(frame->chunks[2]));
+ (pitches[1] * (frame->height >> 1)) + 2);
TEST(vo_frame->base[0] != NULL);
TEST(vo_frame->base[1] != NULL);
TEST(vo_frame->base[2] != NULL);
@@ -2062,15 +2067,8 @@
}
-static int -dfb_redraw_needed(vo_driver_t* vo_driver) -{ - return(0); -} - - static void -dfb_dispose(vo_driver_t* vo_driver) +dfb_exit(vo_driver_t* vo_driver) { dfb_driver_t* this = (dfb_driver_t*) vo_driver;
@@ -2083,8 +2081,25 @@ }
-static vo_driver_t* -open_plugin(video_driver_class_t* vo_class, const void *vo_visual) +static vo_info_t vo_info_dfb = +{ + VIDEO_OUT_IFACE_VERSION, + "DFB", + "Unofficial DirectFB video driver for VeXP", + XINE_VISUAL_TYPE_DFB, + 8 +}; + + +vo_info_t* +get_video_out_plugin_info(void) +{ + return(&vo_info_dfb); +} + + +vo_driver_t* +init_video_out_plugin(config_values_t *config, void *vo_visual) { dfb_driver_class_t* class = (dfb_driver_class_t*) vo_class; dfb_visual_t* visual = (dfb_visual_t*) vo_visual; @@ -2094,26 +2109,23 @@ TEST(vo_visual != NULL); TEST(visual->output_cb != NULL);
- if(class->xine->verbosity) - fprintf(stderr, "DFB [Unofficial DirectFB video driver]\n"); + fprintf(stderr, "DFB [Unofficial DirectFB video driver for VeXP]\n");
TEST(this = (dfb_driver_t*) calloc(1, sizeof(dfb_driver_t)));
this->vo_driver.get_capabilities = dfb_get_capabilities;
this->vo_driver.alloc_frame = dfb_alloc_frame;
this->vo_driver.update_frame_format = dfb_update_frame_format;
- this->vo_driver.overlay_begin = NULL;
this->vo_driver.overlay_blend = dfb_overlay_blend;
- this->vo_driver.overlay_end = NULL;
this->vo_driver.display_frame = dfb_display_frame;
this->vo_driver.get_property = dfb_get_property;
this->vo_driver.set_property = dfb_set_property;
this->vo_driver.get_property_min_max = dfb_get_property_min_max;
this->vo_driver.gui_data_exchange = dfb_gui_data_exchange;
- this->vo_driver.redraw_needed = dfb_redraw_needed;
- this->vo_driver.dispose = dfb_dispose;
+ this->vo_driver.exit = dfb_exit;
+ this->vo_driver.get_info = get_video_out_plugin_info;- this->verbosity = class->xine->verbosity; + this->verbosity = 1;
#ifdef ARCH_X86
{
@@ -2143,21 +2155,17 @@
}
#endif+ if(config)
{
- config_values_t* config = class->xine->config;
-
- if(config)
- {
- this->max_num_frames = config->register_num(config,
- "video.dfb.max_num_frames", 15,
- "Maximum number of allocated frames (at least 5)",
- NULL, 10, NULL, NULL);
-
- this->correction.defined = config->register_range(config,
- "video.dfb.gamma_correction", -16,
- -128, 127, "RGB gamma correction",
- NULL, 10, NULL, NULL);
- }
+ this->max_num_frames = config->register_num(config,
+ "video.dfb.max_num_frames", 15,
+ "Maximum number of allocated frames (at least 5)",
+ NULL, 10, NULL, NULL);
+
+ this->correction.defined = config->register_range(config,
+ "video.dfb.gamma_correction", -16,
+ -128, 127, "RGB gamma correction",
+ NULL, 10, NULL, NULL);
}
@@ -2234,63 +2242,3 @@ return(NULL); }
-
-static char*
-get_identifier(video_driver_class_t* vo_class)
-{
- return("DFB");
-}
-
-
-static char*
-get_description(video_driver_class_t* vo_class)
-{
- return("Unofficial DirectFB video driver.");
-}
-
-
-static void
-dispose_class(video_driver_class_t* vo_class)
-{
- release(vo_class);
-}
-
-
-static void*
-init_class(xine_t* xine, void* vo_visual)
-{
- dfb_driver_class_t* class = NULL;
-
- TEST(xine != NULL);
-
- TEST(class = (dfb_driver_class_t*) calloc(1, sizeof(dfb_driver_class_t)));
-
- class->vo_class.open_plugin = open_plugin;
- class->vo_class.get_identifier = get_identifier;
- class->vo_class.get_description = get_description;
- class->vo_class.dispose = dispose_class;
- class->xine = xine;
-
- return(class);
-
-FAILURE:
- return(NULL);
-}
-
-
-
-static vo_info_t vo_info_dfb =
-{
- 8,
- XINE_VISUAL_TYPE_DFB
-};
-
-
-plugin_info_t xine_plugin_info[] =
-{
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, VIDEO_OUT_DRIVER_IFACE_VERSION, "DFB",
- XINE_VERSION_CODE, &vo_info_dfb, init_class},
- { PLUGIN_NONE, 0, "", 0, NULL, NULL}
-};
-
diff -uraN DirectFB-extra/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb.h DirectFB-extra2/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb.h
--- DirectFB-extra/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb.h 2004-05-18 11:24:09.000000000 +0200
+++ DirectFB-extra2/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb.h 2004-05-18 12:00:11.000000000 +0200
@@ -35,6 +35,8 @@
{
vo_frame_t vo_frame;
+ dfb_driver_t* driver;
+
int width;
int height;
double ratio;
@@ -44,8 +46,6 @@
CardState state;
CoreSurface* surface;- void* chunks[3];
-
void (*realize) (dfb_driver_t* this, dfb_frame_t* frame,
uint8_t* data, uint32_t pitch);@@ -128,15 +128,6 @@
typedef struct
{
- video_driver_class_t vo_class;
-
- xine_t* xine;
-
-} dfb_driver_class_t;
-
-
-typedef struct
-{
IDirectFBSurface* surface;DVOutputCallback output_cb;
diff -uraN DirectFB-extra/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb_mmx.h DirectFB-extra2/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb_mmx.h
--- DirectFB-extra/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb_mmx.h 2004-05-18 11:24:09.000000000 +0200
+++ DirectFB-extra2/interfaces/IDirectFBVideoProvider/video_out_dfb/video_out_dfb_mmx.h 2004-05-18 12:04:24.000000000 +0200
@@ -214,7 +214,7 @@
"emms\n\t"
:: "r" (yuv_data), "r" (y_off), "r" (u_off), "r" (v_off),
- "r" (frame->vo_frame.pitches[0]), "r" (pitch),
+ "r" (frame->width << 1), "r" (pitch),
"m" (line), "m" (n)
: "memory");
}
-- Info: To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe directfb-dev" as subject.
