author | mickeyl <mickeyl> | 2004-09-20 20:56:14 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-09-20 20:56:14 (UTC) |
commit | 5c96d26bccfeeb34a639054bf8abe41af687d3c5 (patch) (unidiff) | |
tree | e048d68785ef9f33eff56700f9f631ffc19af53f | |
parent | a99238645ef9d50fb79c6fb7c7185d0dce013e13 (diff) | |
download | opie-5c96d26bccfeeb34a639054bf8abe41af687d3c5.zip opie-5c96d26bccfeeb34a639054bf8abe41af687d3c5.tar.gz opie-5c96d26bccfeeb34a639054bf8abe41af687d3c5.tar.bz2 |
catch up with recent libxine API changes
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index f28fba3..90f62f2 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -95,49 +95,49 @@ struct opie_frame_s { | |||
95 | 95 | ||
96 | vo_scale_t sc; | 96 | vo_scale_t sc; |
97 | 97 | ||
98 | uint8_t *chunk[3]; | 98 | uint8_t *chunk[3]; |
99 | 99 | ||
100 | uint8_t *data; /* rgb */ | 100 | uint8_t *data; /* rgb */ |
101 | int bytes_per_line; | 101 | int bytes_per_line; |
102 | 102 | ||
103 | yuv2rgb_t *yuv2rgb; | 103 | yuv2rgb_t *yuv2rgb; |
104 | uint8_t *rgb_dst; | 104 | uint8_t *rgb_dst; |
105 | int yuv_stride; | 105 | int yuv_stride; |
106 | int stripe_height, stripe_inc; | 106 | int stripe_height, stripe_inc; |
107 | 107 | ||
108 | null_driver_t *output; | 108 | null_driver_t *output; |
109 | }; | 109 | }; |
110 | 110 | ||
111 | static uint32_t null_get_capabilities( vo_driver_t *self ){ | 111 | static uint32_t null_get_capabilities( vo_driver_t *self ){ |
112 | null_driver_t* this = (null_driver_t*)self; | 112 | null_driver_t* this = (null_driver_t*)self; |
113 | return this->m_capabilities; | 113 | return this->m_capabilities; |
114 | } | 114 | } |
115 | 115 | ||
116 | static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { | 116 | static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { |
117 | opie_frame_t *frame = (opie_frame_t *) vo_img ; | 117 | opie_frame_t *frame = (opie_frame_t *) vo_img ; |
118 | 118 | ||
119 | vo_img->copy_called = 1; | 119 | vo_img->proc_called = 1; |
120 | 120 | ||
121 | if (!frame->output->m_show_video) { | 121 | if (!frame->output->m_show_video) { |
122 | /* printf("nullvideo: no video\n"); */ | 122 | /* printf("nullvideo: no video\n"); */ |
123 | return; | 123 | return; |
124 | } | 124 | } |
125 | 125 | ||
126 | if (frame->format == XINE_IMGFMT_YV12) { | 126 | if (frame->format == XINE_IMGFMT_YV12) { |
127 | frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, | 127 | frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, |
128 | src[0], src[1], src[2]); | 128 | src[0], src[1], src[2]); |
129 | } else { | 129 | } else { |
130 | 130 | ||
131 | frame->yuv2rgb->yuy22rgb_fun (frame->yuv2rgb, frame->rgb_dst, | 131 | frame->yuv2rgb->yuy22rgb_fun (frame->yuv2rgb, frame->rgb_dst, |
132 | src[0]); | 132 | src[0]); |
133 | } | 133 | } |
134 | 134 | ||
135 | frame->rgb_dst += frame->stripe_inc; | 135 | frame->rgb_dst += frame->stripe_inc; |
136 | } | 136 | } |
137 | 137 | ||
138 | static void null_frame_field (vo_frame_t *vo_img, int which_field) { | 138 | static void null_frame_field (vo_frame_t *vo_img, int which_field) { |
139 | 139 | ||
140 | opie_frame_t *frame = (opie_frame_t *) vo_img ; | 140 | opie_frame_t *frame = (opie_frame_t *) vo_img ; |
141 | 141 | ||
142 | switch (which_field) { | 142 | switch (which_field) { |
143 | case VO_TOP_FIELD: | 143 | case VO_TOP_FIELD: |
@@ -165,87 +165,87 @@ static void null_frame_dispose( vo_frame_t* vo_img){ | |||
165 | } | 165 | } |
166 | 166 | ||
167 | /* end take care of frames*/ | 167 | /* end take care of frames*/ |
168 | 168 | ||
169 | static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | 169 | static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ |
170 | 170 | ||
171 | null_driver_t* this = (null_driver_t*)self; | 171 | null_driver_t* this = (null_driver_t*)self; |
172 | opie_frame_t* frame; | 172 | opie_frame_t* frame; |
173 | 173 | ||
174 | #ifdef LOG | 174 | #ifdef LOG |
175 | fprintf (stderr, "nullvideo: alloc_frame\n"); | 175 | fprintf (stderr, "nullvideo: alloc_frame\n"); |
176 | #endif | 176 | #endif |
177 | 177 | ||
178 | frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); | 178 | frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); |
179 | 179 | ||
180 | memset( frame, 0, sizeof( opie_frame_t) ); | 180 | memset( frame, 0, sizeof( opie_frame_t) ); |
181 | memcpy (&frame->sc, &this->sc, sizeof(vo_scale_t)); | 181 | memcpy (&frame->sc, &this->sc, sizeof(vo_scale_t)); |
182 | 182 | ||
183 | pthread_mutex_init (&frame->frame.mutex, NULL); | 183 | pthread_mutex_init (&frame->frame.mutex, NULL); |
184 | 184 | ||
185 | frame->output = this; | 185 | frame->output = this; |
186 | 186 | ||
187 | /* initialize the frame*/ | 187 | /* initialize the frame*/ |
188 | frame->frame.driver = self; | 188 | frame->frame.driver = self; |
189 | frame->frame.copy = null_frame_copy; | 189 | frame->frame.proc_slice = null_frame_copy; |
190 | frame->frame.field = null_frame_field; | 190 | frame->frame.field = null_frame_field; |
191 | frame->frame.dispose = null_frame_dispose; | 191 | frame->frame.dispose = null_frame_dispose; |
192 | 192 | ||
193 | /* | 193 | /* |
194 | * colorspace converter for this frame | 194 | * colorspace converter for this frame |
195 | */ | 195 | */ |
196 | frame->yuv2rgb = this->yuv2rgb_factory->create_converter (this->yuv2rgb_factory); | 196 | frame->yuv2rgb = this->yuv2rgb_factory->create_converter (this->yuv2rgb_factory); |
197 | 197 | ||
198 | return (vo_frame_t*) frame; | 198 | return (vo_frame_t*) frame; |
199 | } | 199 | } |
200 | 200 | ||
201 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | 201 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, |
202 | uint32_t width, uint32_t height, | 202 | uint32_t width, uint32_t height, |
203 | int ratio_code, int format, int flags ){ | 203 | double ratio_code, int format, int flags ){ |
204 | null_driver_t* this = (null_driver_t*) self; | 204 | null_driver_t* this = (null_driver_t*) self; |
205 | opie_frame_t* frame = (opie_frame_t*)img; | 205 | opie_frame_t* frame = (opie_frame_t*)img; |
206 | /* not needed now */ | 206 | /* not needed now */ |
207 | 207 | ||
208 | #ifdef LOG | 208 | #ifdef LOG |
209 | fprintf (stderr, "nullvideo: update_frame_format\n"); | 209 | fprintf (stderr, "nullvideo: update_frame_format\n"); |
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | flags &= VO_BOTH_FIELDS; | 212 | flags &= VO_BOTH_FIELDS; |
213 | 213 | ||
214 | /* find out if we need to adapt this frame */ | 214 | /* find out if we need to adapt this frame */ |
215 | 215 | ||
216 | if ((width != frame->sc.delivered_width) | 216 | if ((width != frame->sc.delivered_width) |
217 | || (height != frame->sc.delivered_height) | 217 | || (height != frame->sc.delivered_height) |
218 | || (ratio_code != frame->sc.delivered_ratio_code) | 218 | || (ratio_code != frame->sc.delivered_ratio) |
219 | || (flags != frame->flags) | 219 | || (flags != frame->flags) |
220 | || (format != frame->format) | 220 | || (format != frame->format) |
221 | || (this->sc.user_ratio != frame->sc.user_ratio) | 221 | || (this->sc.user_ratio != frame->sc.user_ratio) |
222 | || (this->gui_width != frame->sc.gui_width) | 222 | || (this->gui_width != frame->sc.gui_width) |
223 | || (this->gui_height != frame->sc.gui_height)) { | 223 | || (this->gui_height != frame->sc.gui_height)) { |
224 | 224 | ||
225 | frame->sc.delivered_width = width; | 225 | frame->sc.delivered_width = width; |
226 | frame->sc.delivered_height = height; | 226 | frame->sc.delivered_height = height; |
227 | frame->sc.delivered_ratio_code = ratio_code; | 227 | frame->sc.delivered_ratio = ratio_code; |
228 | frame->flags = flags; | 228 | frame->flags = flags; |
229 | frame->format = format; | 229 | frame->format = format; |
230 | frame->sc.user_ratio = this->sc.user_ratio; | 230 | frame->sc.user_ratio = this->sc.user_ratio; |
231 | frame->sc.gui_width = this->gui_width; | 231 | frame->sc.gui_width = this->gui_width; |
232 | frame->sc.gui_height = this->gui_height; | 232 | frame->sc.gui_height = this->gui_height; |
233 | frame->sc.gui_pixel_aspect = 1.0; | 233 | frame->sc.gui_pixel_aspect = 1.0; |
234 | 234 | ||
235 | vo_scale_compute_ideal_size ( &frame->sc ); | 235 | vo_scale_compute_ideal_size ( &frame->sc ); |
236 | vo_scale_compute_output_size( &frame->sc ); | 236 | vo_scale_compute_output_size( &frame->sc ); |
237 | 237 | ||
238 | #ifdef LOG | 238 | #ifdef LOG |
239 | fprintf (stderr, "nullvideo: gui %dx%d delivered %dx%d output %dx%d\n", | 239 | fprintf (stderr, "nullvideo: gui %dx%d delivered %dx%d output %dx%d\n", |
240 | frame->sc.gui_width, frame->sc.gui_height, | 240 | frame->sc.gui_width, frame->sc.gui_height, |
241 | frame->sc.delivered_width, frame->sc.delivered_height, | 241 | frame->sc.delivered_width, frame->sc.delivered_height, |
242 | frame->sc.output_width, frame->sc.output_height); | 242 | frame->sc.output_width, frame->sc.output_height); |
243 | #endif | 243 | #endif |
244 | 244 | ||
245 | /* | 245 | /* |
246 | * (re-) allocate | 246 | * (re-) allocate |
247 | */ | 247 | */ |
248 | if( frame->data ) { | 248 | if( frame->data ) { |
249 | if( frame->chunk[0] ){ | 249 | if( frame->chunk[0] ){ |
250 | free( frame->chunk[0] ); | 250 | free( frame->chunk[0] ); |
251 | frame->chunk[0] = NULL; | 251 | frame->chunk[0] = NULL; |
@@ -334,49 +334,49 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
334 | frame->stripe_inc = 2 * frame->stripe_height * frame->bytes_per_line; | 334 | frame->stripe_inc = 2 * frame->stripe_height * frame->bytes_per_line; |
335 | break; | 335 | break; |
336 | case VO_BOTH_FIELDS: | 336 | case VO_BOTH_FIELDS: |
337 | frame->rgb_dst = (uint8_t *)frame->data; | 337 | frame->rgb_dst = (uint8_t *)frame->data; |
338 | frame->stripe_inc = frame->stripe_height * frame->bytes_per_line; | 338 | frame->stripe_inc = frame->stripe_height * frame->bytes_per_line; |
339 | break; | 339 | break; |
340 | } | 340 | } |
341 | } | 341 | } |
342 | } | 342 | } |
343 | 343 | ||
344 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | 344 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ |
345 | null_driver_t* this = (null_driver_t*) self; | 345 | null_driver_t* this = (null_driver_t*) self; |
346 | opie_frame_t* frame = (opie_frame_t*)frame_gen; | 346 | opie_frame_t* frame = (opie_frame_t*)frame_gen; |
347 | display_xine_frame_t display = this->frameDis; | 347 | display_xine_frame_t display = this->frameDis; |
348 | 348 | ||
349 | if (!this->m_show_video) | 349 | if (!this->m_show_video) |
350 | return; | 350 | return; |
351 | 351 | ||
352 | if( display != NULL ) { | 352 | if( display != NULL ) { |
353 | (*display)(this->caller, frame->data, | 353 | (*display)(this->caller, frame->data, |
354 | frame->sc.output_width, frame->sc.output_height, | 354 | frame->sc.output_width, frame->sc.output_height, |
355 | frame->bytes_per_line ); | 355 | frame->bytes_per_line ); |
356 | } | 356 | } |
357 | 357 | ||
358 | frame->frame.displayed (&frame->frame); | 358 | frame->frame.free(&frame->frame); |
359 | } | 359 | } |
360 | 360 | ||
361 | 361 | ||
362 | /* blending related */ | 362 | /* blending related */ |
363 | static void null_overlay_clut_yuv2rgb (null_driver_t *this, | 363 | static void null_overlay_clut_yuv2rgb (null_driver_t *this, |
364 | vo_overlay_t *overlay, | 364 | vo_overlay_t *overlay, |
365 | opie_frame_t *frame) { | 365 | opie_frame_t *frame) { |
366 | int i; | 366 | int i; |
367 | clut_t* clut = (clut_t*) overlay->color; | 367 | clut_t* clut = (clut_t*) overlay->color; |
368 | if (!overlay->rgb_clut) { | 368 | if (!overlay->rgb_clut) { |
369 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { | 369 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { |
370 | *((uint32_t *)&clut[i]) = | 370 | *((uint32_t *)&clut[i]) = |
371 | frame->yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, | 371 | frame->yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, |
372 | clut[i].y, clut[i].cb, clut[i].cr); | 372 | clut[i].y, clut[i].cb, clut[i].cr); |
373 | } | 373 | } |
374 | overlay->rgb_clut++; | 374 | overlay->rgb_clut++; |
375 | } | 375 | } |
376 | if (!overlay->clip_rgb_clut) { | 376 | if (!overlay->clip_rgb_clut) { |
377 | clut = (clut_t*) overlay->clip_color; | 377 | clut = (clut_t*) overlay->clip_color; |
378 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { | 378 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { |
379 | *((uint32_t *)&clut[i]) = | 379 | *((uint32_t *)&clut[i]) = |
380 | frame->yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb, | 380 | frame->yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb, |
381 | clut[i].y, clut[i].cb, clut[i].cr); | 381 | clut[i].y, clut[i].cb, clut[i].cr); |
382 | } | 382 | } |
@@ -465,49 +465,49 @@ xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | |||
465 | 465 | ||
466 | vo->m_show_video = 0; // false | 466 | vo->m_show_video = 0; // false |
467 | vo->m_video_fullscreen = 0; | 467 | vo->m_video_fullscreen = 0; |
468 | vo->m_is_scaling = 0; | 468 | vo->m_is_scaling = 0; |
469 | vo->display_ratio = 1.0; | 469 | vo->display_ratio = 1.0; |
470 | vo->gui_width = 16; | 470 | vo->gui_width = 16; |
471 | vo->gui_height = 8; | 471 | vo->gui_height = 8; |
472 | vo->frameDis = NULL; | 472 | vo->frameDis = NULL; |
473 | 473 | ||
474 | /* install callback handlers*/ | 474 | /* install callback handlers*/ |
475 | vo->vo_driver.get_capabilities = null_get_capabilities; | 475 | vo->vo_driver.get_capabilities = null_get_capabilities; |
476 | vo->vo_driver.alloc_frame = null_alloc_frame; | 476 | vo->vo_driver.alloc_frame = null_alloc_frame; |
477 | vo->vo_driver.update_frame_format = null_update_frame_format; | 477 | vo->vo_driver.update_frame_format = null_update_frame_format; |
478 | vo->vo_driver.display_frame = null_display_frame; | 478 | vo->vo_driver.display_frame = null_display_frame; |
479 | vo->vo_driver.overlay_blend = null_overlay_blend; | 479 | vo->vo_driver.overlay_blend = null_overlay_blend; |
480 | vo->vo_driver.get_property = null_get_property; | 480 | vo->vo_driver.get_property = null_get_property; |
481 | vo->vo_driver.set_property = null_set_property; | 481 | vo->vo_driver.set_property = null_set_property; |
482 | vo->vo_driver.get_property_min_max = null_get_property_min_max; | 482 | vo->vo_driver.get_property_min_max = null_get_property_min_max; |
483 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; | 483 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; |
484 | vo->vo_driver.dispose = null_dispose; | 484 | vo->vo_driver.dispose = null_dispose; |
485 | vo->vo_driver.redraw_needed = null_redraw_needed; | 485 | vo->vo_driver.redraw_needed = null_redraw_needed; |
486 | 486 | ||
487 | 487 | ||
488 | /* capabilities */ | 488 | /* capabilities */ |
489 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; | 489 | vo->m_capabilities = /* VO_CAP_COPIES_IMAGE | */ VO_CAP_YUY2 | VO_CAP_YV12; |
490 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, | 490 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, |
491 | vo->yuv2rgb_cmap); | 491 | vo->yuv2rgb_cmap); |
492 | 492 | ||
493 | vo->caller = userData; | 493 | vo->caller = userData; |
494 | vo->frameDis = frameDisplayFunc; | 494 | vo->frameDis = frameDisplayFunc; |
495 | 495 | ||
496 | /* return ( vo_driver_t*) vo; */ | 496 | /* return ( vo_driver_t*) vo; */ |
497 | return vo_new_port( xine, ( vo_driver_t* )vo, 0 ); | 497 | return vo_new_port( xine, ( vo_driver_t* )vo, 0 ); |
498 | } | 498 | } |
499 | 499 | ||
500 | #if 0 | 500 | #if 0 |
501 | static vo_info_t vo_info_null = { | 501 | static vo_info_t vo_info_null = { |
502 | 5, | 502 | 5, |
503 | XINE_VISUAL_TYPE_FB | 503 | XINE_VISUAL_TYPE_FB |
504 | }; | 504 | }; |
505 | 505 | ||
506 | vo_info_t *get_video_out_plugin_info(){ | 506 | vo_info_t *get_video_out_plugin_info(){ |
507 | vo_info_null.description = ("xine video output plugin using null device"); | 507 | vo_info_null.description = ("xine video output plugin using null device"); |
508 | return &vo_info_null; | 508 | return &vo_info_null; |
509 | } | 509 | } |
510 | 510 | ||
511 | #endif | 511 | #endif |
512 | 512 | ||
513 | /* this is special for this device */ | 513 | /* this is special for this device */ |