Diffstat (limited to 'noncore/multimedia/opieplayer2/nullvideo.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index f356e76..63d5752 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -67,39 +67,38 @@ struct opie_frame_s { | |||
67 | yuv2rgb_t *yuv2rgb; | 67 | yuv2rgb_t *yuv2rgb; |
68 | uint8_t *rgb_dst; | 68 | uint8_t *rgb_dst; |
69 | int yuv_stride; | 69 | int yuv_stride; |
70 | int stripe_height, stripe_inc; | 70 | int stripe_height, stripe_inc; |
71 | 71 | ||
72 | int bytes_per_line; | 72 | int bytes_per_line; |
73 | uint8_t *data; | 73 | uint8_t *data; |
74 | 74 | ||
75 | int show_video; | 75 | // int show_video; |
76 | null_driver_t *output; | 76 | null_driver_t *output; |
77 | }; | 77 | }; |
78 | 78 | ||
79 | static uint32_t null_get_capabilities(vo_driver_t *self ){ | 79 | static uint32_t null_get_capabilities(vo_driver_t *self ){ |
80 | null_driver_t* this = (null_driver_t*)self; | 80 | null_driver_t* this = (null_driver_t*)self; |
81 | printf("capabilities\n"); | 81 | printf("capabilities\n"); |
82 | return this->m_capabilities; | 82 | return this->m_capabilities; |
83 | } | 83 | } |
84 | 84 | ||
85 | static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { | 85 | static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { |
86 | opie_frame_t *frame = (opie_frame_t *) vo_img ; | 86 | opie_frame_t *frame = (opie_frame_t *) vo_img ; |
87 | printf("frame copy\n"); | 87 | printf("frame copy\n"); |
88 | if(!frame->show_video ){ printf("no video\n"); return; } // no video | 88 | if(!frame->output->m_show_video ){ printf("no video\n"); return; } // no video |
89 | 89 | ||
90 | if (frame->format == IMGFMT_YV12) { | 90 | if (frame->format == IMGFMT_YV12) { |
91 | frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, | 91 | frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, |
92 | src[0], src[1], src[2]); | 92 | src[0], src[1], src[2]); |
93 | } else { | 93 | } else { |
94 | 94 | ||
95 | frame->yuv2rgb->yuy22rgb_fun (frame->yuv2rgb, frame->rgb_dst, | 95 | frame->yuv2rgb->yuy22rgb_fun (frame->yuv2rgb, frame->rgb_dst, |
96 | src[0]); | 96 | src[0]); |
97 | |||
98 | } | 97 | } |
99 | 98 | ||
100 | frame->rgb_dst += frame->stripe_inc; | 99 | frame->rgb_dst += frame->stripe_inc; |
101 | printf("returning\n"); | 100 | printf("returning\n"); |
102 | } | 101 | } |
103 | 102 | ||
104 | static void null_frame_field (vo_frame_t *vo_img, int which_field) { | 103 | static void null_frame_field (vo_frame_t *vo_img, int which_field) { |
105 | 104 | ||
@@ -140,17 +139,17 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
140 | 139 | ||
141 | memset( frame, 0, sizeof( opie_frame_t) ); | 140 | memset( frame, 0, sizeof( opie_frame_t) ); |
142 | pthread_mutex_init (&frame->frame.mutex, NULL); | 141 | pthread_mutex_init (&frame->frame.mutex, NULL); |
143 | 142 | ||
144 | printf("alloc_frame\n"); | 143 | printf("alloc_frame\n"); |
145 | frame->name = "opie\0"; | 144 | frame->name = "opie\0"; |
146 | frame->version = 1; | 145 | frame->version = 1; |
147 | frame->output = this; | 146 | frame->output = this; |
148 | frame->show_video = this->m_show_video; | 147 | // frame->show_video = this->m_show_video; |
149 | /* initialize the frame*/ | 148 | /* initialize the frame*/ |
150 | frame->frame.driver = self; | 149 | frame->frame.driver = self; |
151 | /*frame.frame.free = null_frame_free;*/ | 150 | /*frame.frame.free = null_frame_free;*/ |
152 | frame->frame.copy = null_frame_copy; | 151 | frame->frame.copy = null_frame_copy; |
153 | frame->frame.field = null_frame_field; | 152 | frame->frame.field = null_frame_field; |
154 | frame->frame.dispose = null_frame_dispose; | 153 | frame->frame.dispose = null_frame_dispose; |
155 | frame->yuv2rgb = 0; | 154 | frame->yuv2rgb = 0; |
156 | /* | 155 | /* |
@@ -160,17 +159,17 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
160 | 159 | ||
161 | 160 | ||
162 | return (vo_frame_t*) frame; | 161 | return (vo_frame_t*) frame; |
163 | } | 162 | } |
164 | 163 | ||
165 | // size specific | 164 | // size specific |
166 | static void null_compute_ideal_size (null_driver_t *this, opie_frame_t *frame) { | 165 | static void null_compute_ideal_size (null_driver_t *this, opie_frame_t *frame) { |
167 | 166 | ||
168 | if (!this->m_is_scaling || !this->m_show_video) { | 167 | if (!this->m_is_scaling /*|| !this->m_show_video*/) { |
169 | printf("Not scaling\n"); | 168 | printf("Not scaling\n"); |
170 | frame->ideal_width = frame->width; | 169 | frame->ideal_width = frame->width; |
171 | frame->ideal_height = frame->height; | 170 | frame->ideal_height = frame->height; |
172 | frame->ratio_factor = 1.0; | 171 | frame->ratio_factor = 1.0; |
173 | 172 | ||
174 | } else { | 173 | } else { |
175 | 174 | ||
176 | double image_ratio, desired_ratio, corr_factor; | 175 | double image_ratio, desired_ratio, corr_factor; |
@@ -296,17 +295,17 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
296 | 295 | ||
297 | frame->width = width; | 296 | frame->width = width; |
298 | frame->height = height; | 297 | frame->height = height; |
299 | frame->ratio_code = ratio_code; | 298 | frame->ratio_code = ratio_code; |
300 | frame->flags = flags; | 299 | frame->flags = flags; |
301 | frame->format = format; | 300 | frame->format = format; |
302 | frame->user_ratio = this->user_ratio; | 301 | frame->user_ratio = this->user_ratio; |
303 | this->gui_changed = 0; | 302 | this->gui_changed = 0; |
304 | frame->show_video = this->m_show_video; | 303 | //frame->show_video = this->m_show_video; |
305 | 304 | ||
306 | 305 | ||
307 | null_compute_ideal_size (this, frame); | 306 | null_compute_ideal_size (this, frame); |
308 | null_compute_rgb_size (this, frame); | 307 | null_compute_rgb_size (this, frame); |
309 | 308 | ||
310 | /* | 309 | /* |
311 | * (re-) allocate | 310 | * (re-) allocate |
312 | */ | 311 | */ |
@@ -350,17 +349,17 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
350 | frame->height = height; | 349 | frame->height = height; |
351 | 350 | ||
352 | frame->stripe_height = 16 * frame->output_height / frame->height; | 351 | frame->stripe_height = 16 * frame->output_height / frame->height; |
353 | frame->bytes_per_line = frame->output_width * this->bytes_per_pixel; | 352 | frame->bytes_per_line = frame->output_width * this->bytes_per_pixel; |
354 | 353 | ||
355 | /* | 354 | /* |
356 | * set up colorspace converter | 355 | * set up colorspace converter |
357 | */ | 356 | */ |
358 | if(this->m_show_video ){ | 357 | if(1 /*this->m_show_video*/ ){ |
359 | printf("showing video\n"); | 358 | printf("showing video\n"); |
360 | 359 | ||
361 | switch (flags) { | 360 | switch (flags) { |
362 | case VO_TOP_FIELD: | 361 | case VO_TOP_FIELD: |
363 | case VO_BOTTOM_FIELD: | 362 | case VO_BOTTOM_FIELD: |
364 | frame->yuv2rgb->configure (frame->yuv2rgb, | 363 | frame->yuv2rgb->configure (frame->yuv2rgb, |
365 | frame->width, | 364 | frame->width, |
366 | 16, | 365 | 16, |
@@ -409,25 +408,25 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
409 | printf("done\n"); | 408 | printf("done\n"); |
410 | } | 409 | } |
411 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | 410 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ |
412 | null_driver_t* this = (null_driver_t*) self; | 411 | null_driver_t* this = (null_driver_t*) self; |
413 | opie_frame_t* frame = (opie_frame_t*)frame_gen; | 412 | opie_frame_t* frame = (opie_frame_t*)frame_gen; |
414 | display_xine_frame_t display = this->frameDis; | 413 | display_xine_frame_t display = this->frameDis; |
415 | 414 | ||
416 | printf("display frame\n"); | 415 | printf("display frame\n"); |
417 | // if( this->m_show_video ) { // return if not displaying | 416 | // if( this->m_show_video ) { // return if not displaying |
418 | printf("calling home aye\n" ); | 417 | printf("calling home aye\n" ); |
419 | if( display != NULL ) { | 418 | if( display != NULL ) { |
420 | (*display)(this->caller, frame->data, | 419 | (*display)(this->caller, frame->data, |
421 | frame->output_width, frame->output_height, | 420 | frame->output_width, frame->output_height, |
422 | frame->bytes_per_line ); | 421 | frame->bytes_per_line ); |
423 | printf("display done hope you enyoyed the frame"); | 422 | printf("display done hope you enyoyed the frame"); |
424 | } | 423 | } |
425 | // } | 424 | // } |
426 | 425 | ||
427 | frame->frame.displayed (&frame->frame); | 426 | frame->frame.displayed (&frame->frame); |
428 | } | 427 | } |
429 | 428 | ||
430 | 429 | ||
431 | // blending related | 430 | // blending related |
432 | 431 | ||
433 | 432 | ||