]> git.pld-linux.org Git - packages/xine-lib.git/blob - xine-lib-vdr.patch
- release 8
[packages/xine-lib.git] / xine-lib-vdr.patch
1 Index: xine-lib/configure.ac
2 ===================================================================
3 RCS file: /cvsroot/xine/xine-lib/configure.ac,v
4 retrieving revision 1.356
5 diff -u -r1.356 configure.ac
6 --- xine-lib/configure.ac       5 Feb 2006 13:59:45 -0000       1.356
7 +++ xine-lib/configure.ac       20 Mar 2006 21:11:58 -0000
8 @@ -2351,6 +2351,7 @@
9  src/video_out/vidix/drivers/Makefile
10  src/xine-utils/Makefile
11  src/xine-engine/Makefile
12 +src/vdr/Makefile
13  win32/Makefile
14  win32/include/Makefile])
15  AC_CONFIG_COMMANDS([default],[[chmod +x ./misc/SlackBuild ./misc/build_rpms.sh ./misc/relchk.sh]],[[]])
16 @@ -2406,7 +2407,7 @@
17  echo "   - stdin_fifo    - rtp"
18  echo "   - http          - mms"
19  echo "   - pnm           - rtsp"
20 -echo "   - dvb"
21 +echo "   - dvb           - vdr"
22  if test x"$external_dvdnav" = "xyes"; then
23    echo "   - dvd (external libs)"
24  else
25 @@ -2589,6 +2590,7 @@
26  echo "   - eq              - eq2"
27  echo "   - boxblur         - denoise3d"
28  echo "   - unsharp         - tvtime"
29 +echo "   - vdr"
30  echo "  * SFX:"
31  echo "   - goom            - oscope"
32  echo "   - fftscope        - mosaico"
33 Index: xine-lib/src/Makefile.am
34 ===================================================================
35 RCS file: /cvsroot/xine/xine-lib/src/Makefile.am,v
36 retrieving revision 1.54
37 diff -u -r1.54 Makefile.am
38 --- xine-lib/src/Makefile.am    14 Jan 2005 15:24:08 -0000      1.54
39 +++ xine-lib/src/Makefile.am    20 Mar 2006 21:11:59 -0000
40 @@ -30,4 +30,5 @@
41         libfaad \
42         libflac \
43          libmusepack \
44 -       post
45 +       post \
46 +       vdr
47 Index: xine-lib/src/libmpeg2/decode.c
48 ===================================================================
49 RCS file: /cvsroot/xine/xine-lib/src/libmpeg2/decode.c,v
50 retrieving revision 1.130
51 diff -u -r1.130 decode.c
52 --- xine-lib/src/libmpeg2/decode.c      19 Feb 2006 15:05:07 -0000      1.130
53 +++ xine-lib/src/libmpeg2/decode.c      20 Mar 2006 21:12:02 -0000
54 @@ -251,7 +251,7 @@
55  }
56  
57  static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
58 -                              uint8_t * buffer)
59 +                              uint8_t * buffer, int next_code)
60  {
61      picture_t * picture;
62      int is_frame_done;
63 @@ -408,6 +408,11 @@
64             /* abort(); */
65             break;
66         }
67 +
68 +        /* according to ISO/IEC 13818-2, an extension start code will follow.
69 +         * Otherwise the stream follows ISO/IEC 11172-2 which means MPEG1 */ 
70 +        picture->mpeg1 = (next_code != 0xb5);
71 +
72         if (mpeg2dec->force_aspect) picture->aspect_ratio_information = mpeg2dec->force_aspect;
73  
74         if (mpeg2dec->is_sequence_needed ) {
75 @@ -589,45 +594,135 @@
76      return is_frame_done;
77  }
78  
79 +static inline int find_start_code (mpeg2dec_t * mpeg2dec,
80 +                                   uint8_t ** current, uint8_t * limit)
81 +{
82 +    uint8_t * p;
83 +
84 +    if (*current >= limit)
85 +       return 0;
86 +    if (mpeg2dec->shift == 0x00000100)
87 +       return 1;
88 +
89 +    mpeg2dec->shift = (mpeg2dec->shift | *(*current)++) << 8;
90 +
91 +    if (*current >= limit)
92 +       return 0;
93 +    if (mpeg2dec->shift == 0x00000100)
94 +       return 1;
95 +
96 +    mpeg2dec->shift = (mpeg2dec->shift | *(*current)++) << 8;
97 +
98 +    if (*current >= limit)
99 +       return 0;
100 +    if (mpeg2dec->shift == 0x00000100)
101 +       return 1;
102 +
103 +    limit--;
104 +
105 +    if (*current >= limit) {
106 +       mpeg2dec->shift = (mpeg2dec->shift | *(*current)++) << 8;
107 +       return 0;
108 +    }
109 +
110 +    p = *current;
111 +
112 +    while (p < limit && (p = (uint8_t *)memchr(p, 0x01, limit - p))) {
113 +       if (p[-2] || p[-1])
114 +           p += 3;
115 +       else {
116 +           *current = ++p;
117 +           return 1;
118 +       }
119 +    }
120 +
121 +    *current = ++limit;
122 +    p = limit - 3;
123 +    mpeg2dec->shift = (mpeg2dec->shift | *p++) << 8;
124 +    mpeg2dec->shift = (mpeg2dec->shift | *p++) << 8;
125 +    mpeg2dec->shift = (mpeg2dec->shift | *p++) << 8;
126 +
127 +    return 0;
128 +}
129 +
130  static inline uint8_t * copy_chunk (mpeg2dec_t * mpeg2dec,
131                                     uint8_t * current, uint8_t * end)
132  {
133 -    uint32_t shift;
134 -    uint8_t * chunk_ptr;
135      uint8_t * limit;
136 -    uint8_t byte;
137  
138 -    shift = mpeg2dec->shift;
139 -    chunk_ptr = mpeg2dec->chunk_ptr;
140 -    limit = current + (mpeg2dec->chunk_buffer + BUFFER_SIZE - chunk_ptr);
141 +    /* sequence end code 0xb7 doesn't have any data and there might be the case
142 +     * that no start code will follow this code for quite some time (e. g. in case
143 +     * of a still image.
144 +     * Therefore, return immediately with a chunk_size of 0. Setting code to 0xb4
145 +     * will eat up any trailing garbage next time.
146 +     */
147 +    if (mpeg2dec->code == 0xb7) {
148 +       mpeg2dec->code = 0xb4;
149 +       mpeg2dec->chunk_size = 0;
150 +       return current;
151 +    }
152 +
153 +    limit = current + (mpeg2dec->chunk_buffer + BUFFER_SIZE - mpeg2dec->chunk_ptr);
154      if (limit > end)
155         limit = end;
156 +#if 0
157 +    {
158 +       uint32_t shift = mpeg2dec->shift;
159 +       uint8_t * chunk_ptr = mpeg2dec->chunk_ptr;
160  
161 -    while (1) {
162 +       while (1) {
163  
164 -       byte = *current++;
165 -       if (shift != 0x00000100) {
166 -           shift = (shift | byte) << 8;
167 -           *chunk_ptr++ = byte;
168 -           if (current < limit)
169 -               continue;
170 -           if (current == end) {
171 -               mpeg2dec->chunk_ptr = chunk_ptr;
172 -               mpeg2dec->shift = shift;
173 -               return NULL;
174 -           } else {
175 -               /* we filled the chunk buffer without finding a start code */
176 -               mpeg2dec->code = 0xb4;  /* sequence_error_code */
177 -               mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
178 -               return current;
179 +           uint8_t byte = *current++;
180 +           if (shift != 0x00000100) {
181 +               shift = (shift | byte) << 8;
182 +               *chunk_ptr++ = byte;
183 +               if (current < limit)
184 +                   continue;
185 +               if (current == end) {
186 +                   mpeg2dec->chunk_ptr = chunk_ptr;
187 +                   mpeg2dec->shift = shift;
188 +                   return NULL;
189 +               } else {
190 +                   /* we filled the chunk buffer without finding a start code */
191 +                   mpeg2dec->code = 0xb4;      /* sequence_error_code */
192 +                   mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
193 +                   return current;
194 +               }
195             }
196 +           mpeg2dec->code = byte;
197 +           mpeg2dec->chunk_size = chunk_ptr - mpeg2dec->chunk_buffer - 3;
198 +           mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
199 +           mpeg2dec->shift = 0xffffff00;
200 +           return current;
201         }
202 -       mpeg2dec->code = byte;
203 -       mpeg2dec->chunk_size = chunk_ptr - mpeg2dec->chunk_buffer - 3;
204 +    }
205 +#else
206 +    {
207 +       uint8_t * data = current;
208 +       int found = find_start_code(mpeg2dec, &current, limit);
209 +       int bite = current - data;
210 +        if (bite) {
211 +           xine_fast_memcpy(mpeg2dec->chunk_ptr, data, bite);
212 +           mpeg2dec->chunk_ptr += bite;
213 +       }
214 +
215 +       if (found) {
216 +           mpeg2dec->code = *current++;
217 +           mpeg2dec->chunk_size = mpeg2dec->chunk_ptr - mpeg2dec->chunk_buffer - 3;
218 +           mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
219 +           mpeg2dec->shift = 0xffffff00;
220 +           return current;
221 +       }
222 +    
223 +       if (current == end)
224 +           return NULL;
225 +
226 +       /* we filled the chunk buffer without finding a start code */
227 +       mpeg2dec->code = 0xb4;  /* sequence_error_code */
228         mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
229 -       mpeg2dec->shift = 0xffffff00;
230         return current;
231      }
232 +#endif
233  }
234  
235  int mpeg2_decode_data (mpeg2dec_t * mpeg2dec, uint8_t * current, uint8_t * end,
236 @@ -648,12 +743,12 @@
237      if (pts)
238        mpeg2dec->pts = pts;
239  
240 -    while (current != end) {
241 +    while (current != end || mpeg2dec->code == 0xb7) {
242         code = mpeg2dec->code;
243         current = copy_chunk (mpeg2dec, current, end);
244         if (current == NULL) 
245             break;
246 -       ret += parse_chunk (mpeg2dec, code, mpeg2dec->chunk_buffer);
247 +       ret += parse_chunk (mpeg2dec, code, mpeg2dec->chunk_buffer, mpeg2dec->code);
248      }
249  
250      libmpeg2_accel_frame_completion(&mpeg2dec->accel, mpeg2dec->frame_format, 
251 @@ -820,7 +915,7 @@
252  void mpeg2_find_sequence_header (mpeg2dec_t * mpeg2dec,
253                                  uint8_t * current, uint8_t * end){
254  
255 -  uint8_t code;
256 +  uint8_t code, next_code;
257    picture_t *picture = mpeg2dec->picture;
258  
259    mpeg2dec->seek_mode = 1;
260 @@ -830,6 +925,7 @@
261      current = copy_chunk (mpeg2dec, current, end);
262      if (current == NULL)
263        return ;
264 +    next_code = mpeg2dec->code;
265  
266      /* printf ("looking for sequence header... %02x\n", code);  */
267  
268 @@ -840,6 +936,11 @@
269         printf ("libmpeg2: bad sequence header\n");
270         continue;
271        }
272 +
273 +      /* according to ISO/IEC 13818-2, an extension start code will follow.
274 +       * Otherwise the stream follows ISO/IEC 11172-2 which means MPEG1 */ 
275 +      picture->mpeg1 = (next_code != 0xb5);
276 +
277        if (mpeg2dec->force_aspect) picture->aspect_ratio_information = mpeg2dec->force_aspect;
278           
279        if (mpeg2dec->is_sequence_needed) {
280 Index: xine-lib/src/post/planar/expand.c
281 ===================================================================
282 RCS file: /cvsroot/xine/xine-lib/src/post/planar/expand.c,v
283 retrieving revision 1.15
284 diff -u -r1.15 expand.c
285 --- xine-lib/src/post/planar/expand.c   27 Jan 2006 07:46:14 -0000      1.15
286 +++ xine-lib/src/post/planar/expand.c   20 Mar 2006 21:12:04 -0000
287 @@ -21,7 +21,8 @@
288   *
289   * expand video filter by James Stembridge 24/05/2003
290   *            improved by Michael Roitzsch
291 - * 
292 + *            centre_crop_out_mode by Reinhard Nissl
293 + *
294   * based on invert.c
295   *
296   */
297 @@ -52,6 +53,11 @@
298   * This way, the decoder (or any other post plugin up the tree) will only
299   * see the frame area between the black bars and by that modify the
300   * enlarged version directly. No need for later copying.
301 + *
302 + * When centre_crop_out_mode is enabled, the plugin will detect the black
303 + * bars to the left and right of the image and will then set up cropping
304 + * to efficiently remove the black border around the 4:3 image, which the
305 + * plugin would produce otherwise for this case.
306   */ 
307  
308  
309 @@ -63,6 +69,7 @@
310    int enable_automatic_shift;
311    int overlay_y_offset;
312    double aspect;
313 +  int centre_cut_out_mode;
314  } expand_parameters_t;
315  
316  START_PARAM_DESCR(expand_parameters_t)
317 @@ -72,6 +79,8 @@
318    "manually shift the overlay vertically")
319  PARAM_ITEM(POST_PARAM_TYPE_DOUBLE, aspect, NULL, 1.0, 3.5, 0,
320    "target aspect ratio")
321 +PARAM_ITEM(POST_PARAM_TYPE_BOOL, centre_cut_out_mode, NULL, 0, 1, 0,
322 +  "cut out centered 4:3 image contained in 16:9 frame")
323  END_PARAM_DESCR(expand_param_descr)
324  
325  typedef struct post_expand_s {
326 @@ -83,6 +92,8 @@
327    int                      overlay_y_offset;
328    double                   aspect;
329    int                      top_bar_height;
330 +  int                      centre_cut_out_mode;
331 +  int                      cropping_active;
332  } post_expand_t;
333  
334  /* plugin class functions */
335 @@ -107,6 +118,9 @@
336                                        uint32_t height, double ratio, 
337                                        int format, int flags);
338  
339 +/* replaced vo_frame functions */
340 +static int            expand_draw(vo_frame_t *frame, xine_stream_t *stream);
341 +
342  /* overlay manager intercept check */
343  static int            expand_intercept_ovl(post_video_port_t *port);
344  
345 @@ -152,11 +166,14 @@
346    this->enable_automatic_shift = 0;
347    this->overlay_y_offset       = 0;
348    this->aspect                 = 4.0 / 3.0;
349 +  this->centre_cut_out_mode    = 0;
350 +  this->cropping_active        = 0;
351    
352    port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
353    port->new_port.get_frame     = expand_get_frame;
354    port->intercept_ovl          = expand_intercept_ovl;
355    port->new_manager->add_event = expand_overlay_add_event;
356 +  port->new_frame->draw        = expand_draw;
357    
358    input_param       = &this->parameter_input;
359    input_param->name = "parameters";
360 @@ -164,8 +181,8 @@
361    input_param->data = &post_api;
362    xine_list_push_back(this->post.input, input_param);
363    
364 -  input->xine_in.name     = "video";
365 -  output->xine_out.name   = "expanded video";
366 +  input->xine_in.name   = "video";
367 +  output->xine_out.name = "expanded video";
368    
369    this->post.xine_post.video_input[0] = &port->new_port;
370    
371 @@ -212,6 +229,8 @@
372    this->enable_automatic_shift = param->enable_automatic_shift;
373    this->overlay_y_offset       = param->overlay_y_offset;
374    this->aspect                 = param->aspect;
375 +  this->centre_cut_out_mode    = param->centre_cut_out_mode;
376 +
377    return 1;
378  }
379  
380 @@ -223,6 +242,8 @@
381    param->enable_automatic_shift = this->enable_automatic_shift;
382    param->overlay_y_offset       = this->overlay_y_offset;
383    param->aspect                 = this->aspect;
384 +  param->centre_cut_out_mode    = this->centre_cut_out_mode;
385 +  
386    return 1;
387  }
388  
389 @@ -236,6 +257,7 @@
390             "  Enable_automatic_shift: Enable automatic overlay shifting\n"
391             "  Overlay_y_offset: Manually shift the overlay vertically\n"
392             "  aspect: The target aspect ratio (default 4:3)\n"
393 +           "  Centre_cut_out_mode: extracts 4:3 image contained in 16:9 frame\n"
394             "\n"
395           );
396  }
397 @@ -322,6 +344,10 @@
398  
399  static int expand_intercept_ovl(post_video_port_t *port)
400  {
401 +  post_expand_t         *this = (post_expand_t *)port->post;
402 +
403 +  if (this->centre_cut_out_mode && this->cropping_active) return 0;
404 +  
405    /* we always intercept overlay manager */
406    return 1;
407  }
408 @@ -350,3 +376,79 @@
409    
410    return port->original_manager->add_event(port->original_manager, event_gen);
411  }
412 +
413 +
414 +static int is_pixel_black(vo_frame_t *frame, int x, int y)
415 +{
416 +  int Y = 0x00, Cr = 0x00, Cb = 0x00;
417 +
418 +  if (x < 0)              x = 0;
419 +  if (x >= frame->width)  x = frame->width - 1;
420 +  if (y < 0)              y = 0;
421 +  if (y >= frame->height) y = frame->height - 1;
422 +  
423 +  switch (frame->format)
424 +  {
425 +  case XINE_IMGFMT_YV12:
426 +    Y  = *(frame->base[ 0 ] + frame->pitches[ 0 ] * y     + x);
427 +    Cr = *(frame->base[ 1 ] + frame->pitches[ 1 ] * y / 2 + x / 2);
428 +    Cb = *(frame->base[ 2 ] + frame->pitches[ 2 ] * y / 2 + x / 2);
429 +    break;
430 +    
431 +  case XINE_IMGFMT_YUY2:
432 +    Y  = *(frame->base[ 0 ] + frame->pitches[ 0 ] * y + x * 2 + 0);
433 +    x &= ~1;
434 +    Cr = *(frame->base[ 0 ] + frame->pitches[ 0 ] * y + x * 2 + 1);
435 +    Cb = *(frame->base[ 0 ] + frame->pitches[ 0 ] * y + x * 2 + 3);
436 +    break;
437 +  }
438 +
439 +  return (Y == 0x10 && Cr == 0x80 && Cb == 0x80);
440 +}
441 +
442 +
443 +static int expand_draw(vo_frame_t *frame, xine_stream_t *stream)
444 +{
445 +  post_video_port_t *port = (post_video_port_t *)frame->port;
446 +  post_expand_t     *this = (post_expand_t *)port->post;
447 +  int                skip;
448 +
449 +  if (this->centre_cut_out_mode && !frame->bad_frame)
450 +  {
451 +    /* expected area of inner 4:3 image */
452 +    int centre_width = frame->width * (9 * 4) / (16 * 3);
453 +    int centre_left  = (frame->width - centre_width ) / 2;
454 +
455 +    /* centre point for detecting a black frame */
456 +    int centre_x = frame->width  / 2;
457 +    int centre_y = frame->height / 2;
458 +
459 +    /* ignore a black frame as it could lead to wrong results */
460 +    if (!is_pixel_black(frame, centre_x, centre_y))
461 +    {
462 +      /* coordinates for testing black border near the centre area */
463 +      int test_left  = centre_left - 16;
464 +      int test_right = centre_left + 16 + centre_width;
465 +
466 +      /* enable cropping when these pixels are black */
467 +      this->cropping_active = is_pixel_black(frame, test_left, centre_y)
468 +        && is_pixel_black(frame, test_right, centre_y);
469 +    }
470 +
471 +    /* crop frame */
472 +    if (this->centre_cut_out_mode && this->cropping_active) {
473 +      frame->crop_left  += centre_left;
474 +      frame->crop_right += centre_left;
475 +
476 +      /* get_frame() allocated an extra high frame */
477 +      frame->crop_top    += (frame->next->height - frame->height) / 2;
478 +      frame->crop_bottom += (frame->next->height - frame->height) / 2;
479 +    }
480 +  }
481 +
482 +  _x_post_frame_copy_down(frame, frame->next);
483 +  skip = frame->next->draw(frame->next, stream);
484 +  _x_post_frame_copy_up(frame, frame->next);
485 +
486 +  return skip;
487 +}
488 Index: xine-lib/src/xine-engine/audio_out.c
489 ===================================================================
490 RCS file: /cvsroot/xine/xine-lib/src/xine-engine/audio_out.c,v
491 retrieving revision 1.198
492 diff -u -r1.198 audio_out.c
493 --- xine-lib/src/xine-engine/audio_out.c        7 Mar 2006 08:03:22 -0000       1.198
494 +++ xine-lib/src/xine-engine/audio_out.c        20 Mar 2006 21:12:07 -0000
495 @@ -1034,6 +1034,10 @@
496         }
497        }
498  
499 +      if ((in_buf->vpts - cur_time) > 2*90000 )
500 +        xprintf(this->xine, XINE_VERBOSITY_DEBUG,
501 +                "audio_out: vpts/clock error, in_buf->vpts=%" PRId64 " cur_time=%" PRId64 "\n", in_buf->vpts, cur_time);
502 +
503        lprintf ("loop:pause: I feel sleepy (%d buffers).\n", this->out_fifo->num_buffers);
504        xine_usec_sleep (10000);
505        lprintf ("loop:pause: I wake up.\n");
506 Index: xine-lib/src/xine-engine/demux.c
507 ===================================================================
508 RCS file: /cvsroot/xine/xine-lib/src/xine-engine/demux.c,v
509 retrieving revision 1.61
510 diff -u -r1.61 demux.c
511 --- xine-lib/src/xine-engine/demux.c    24 Jan 2006 22:25:34 -0000      1.61
512 +++ xine-lib/src/xine-engine/demux.c    20 Mar 2006 21:12:08 -0000
513 @@ -85,6 +85,8 @@
514    stream->video_fifo->clear(stream->video_fifo);
515    stream->audio_fifo->clear(stream->audio_fifo);
516    
517 +  pthread_mutex_lock(&stream->demux_mutex);  
518 +
519    buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo);
520    buf->type = BUF_CONTROL_RESET_DECODER;
521    stream->video_fifo->put (stream->video_fifo, buf);
522 @@ -93,6 +95,8 @@
523    buf->type = BUF_CONTROL_RESET_DECODER;
524    stream->audio_fifo->put (stream->audio_fifo, buf);
525    
526 +  pthread_mutex_unlock(&stream->demux_mutex);  
527 +
528    /* on seeking we must wait decoder fifos to process before doing flush. 
529     * otherwise we flush too early (before the old data has left decoders)
530     */
531 @@ -124,6 +128,8 @@
532  
533    buf_element_t *buf;
534        
535 +  pthread_mutex_lock(&stream->demux_mutex);  
536 +
537    buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo);
538    buf->type = BUF_CONTROL_NEWPTS;
539    buf->decoder_flags = flags;
540 @@ -135,6 +141,8 @@
541    buf->decoder_flags = flags;
542    buf->disc_off = pts;
543    stream->audio_fifo->put (stream->audio_fifo, buf);
544 +
545 +  pthread_mutex_unlock(&stream->demux_mutex);  
546  }
547  
548  /* sync with decoder fifos, making sure everything gets processed */
549 @@ -165,12 +173,16 @@
550      header_count_audio = 0;
551    }
552    
553 +  pthread_mutex_lock(&stream->demux_mutex);  
554 +
555    buf_video->type = BUF_CONTROL_HEADERS_DONE;
556    stream->video_fifo->put (stream->video_fifo, buf_video);
557  
558    buf_audio->type = BUF_CONTROL_HEADERS_DONE;
559    stream->audio_fifo->put (stream->audio_fifo, buf_audio);
560  
561 +  pthread_mutex_unlock(&stream->demux_mutex);  
562 +
563    while ((stream->header_count_audio < header_count_audio) || 
564           (stream->header_count_video < header_count_video)) {
565      struct timeval tv;
566 @@ -198,6 +210,8 @@
567  
568    buf_element_t *buf;
569  
570 +  pthread_mutex_lock(&stream->demux_mutex);  
571 +
572    buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo);
573    buf->type = BUF_CONTROL_START;
574    stream->video_fifo->put (stream->video_fifo, buf);
575 @@ -205,12 +219,16 @@
576    buf = stream->audio_fifo->buffer_pool_alloc (stream->audio_fifo);
577    buf->type = BUF_CONTROL_START;
578    stream->audio_fifo->put (stream->audio_fifo, buf);
579 +
580 +  pthread_mutex_unlock(&stream->demux_mutex);  
581  }
582  
583  void _x_demux_control_end( xine_stream_t *stream, uint32_t flags ) {
584  
585    buf_element_t *buf;
586  
587 +  pthread_mutex_lock(&stream->demux_mutex);  
588 +
589    buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo);
590    buf->type = BUF_CONTROL_END;
591    buf->decoder_flags = flags;
592 @@ -220,12 +238,16 @@
593    buf->type = BUF_CONTROL_END;
594    buf->decoder_flags = flags;
595    stream->audio_fifo->put (stream->audio_fifo, buf);
596 +
597 +  pthread_mutex_unlock(&stream->demux_mutex);  
598  }
599  
600  void _x_demux_control_nop( xine_stream_t *stream, uint32_t flags ) {
601  
602    buf_element_t *buf;
603  
604 +  pthread_mutex_lock(&stream->demux_mutex);  
605 +
606    buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo);
607    buf->type = BUF_CONTROL_NOP;
608    buf->decoder_flags = flags;
609 @@ -235,6 +257,8 @@
610    buf->type = BUF_CONTROL_NOP;
611    buf->decoder_flags = flags;
612    stream->audio_fifo->put (stream->audio_fifo, buf);
613 +
614 +  pthread_mutex_unlock(&stream->demux_mutex);  
615  }
616  
617  static void *demux_loop (void *stream_gen) {
618 Index: xine-lib/src/xine-engine/post.c
619 ===================================================================
620 RCS file: /cvsroot/xine/xine-lib/src/xine-engine/post.c,v
621 retrieving revision 1.32
622 diff -u -r1.32 post.c
623 --- xine-lib/src/xine-engine/post.c     27 Jan 2006 07:46:15 -0000      1.32
624 +++ xine-lib/src/xine-engine/post.c     20 Mar 2006 21:12:09 -0000
625 @@ -149,6 +149,14 @@
626    if (port->port_lock) pthread_mutex_unlock(port->port_lock);
627  }
628  
629 +static void post_video_trigger_drawing(xine_video_port_t *port_gen) {
630 +  post_video_port_t *port = (post_video_port_t *)port_gen;
631 +  
632 +  if (port->port_lock) pthread_mutex_lock(port->port_lock);
633 +  port->original_port->trigger_drawing(port->original_port);
634 +  if (port->port_lock) pthread_mutex_unlock(port->port_lock);
635 +}
636 +
637  static int post_video_status(xine_video_port_t *port_gen, xine_stream_t *stream,
638                               int *width, int *height, int64_t *img_duration) {
639    post_video_port_t *port = (post_video_port_t *)port_gen;
640 @@ -223,6 +231,7 @@
641    port->new_port.exit                = post_video_exit;
642    port->new_port.get_overlay_manager = post_video_get_overlay_manager;
643    port->new_port.flush               = post_video_flush;
644 +  port->new_port.trigger_drawing     = post_video_trigger_drawing;
645    port->new_port.status              = post_video_status;
646    port->new_port.get_property        = post_video_get_property;
647    port->new_port.set_property        = post_video_set_property;
648 Index: xine-lib/src/xine-engine/video_out.c
649 ===================================================================
650 RCS file: /cvsroot/xine/xine-lib/src/xine-engine/video_out.c,v
651 retrieving revision 1.223
652 diff -u -r1.223 video_out.c
653 --- xine-lib/src/xine-engine/video_out.c        27 Jan 2006 07:46:15 -0000      1.223
654 +++ xine-lib/src/xine-engine/video_out.c        20 Mar 2006 21:12:10 -0000
655 @@ -127,6 +127,9 @@
656    int                       frame_drop_limit;
657    int                       frame_drop_cpt;
658    int                       crop_left, crop_right, crop_top, crop_bottom;
659 +
660 +  pthread_mutex_t           trigger_drawing_mutex;
661 +  pthread_cond_t            trigger_drawing;
662  } vos_t;
663  
664  
665 @@ -568,6 +571,7 @@
666      vo_append_to_img_buf_queue (this->display_img_buf_queue, img);
667      
668    } else {
669 +    fprintf (stderr, "bad_frame\n");
670      lprintf ("bad_frame\n");
671  
672      if (stream) {
673 @@ -1039,6 +1043,24 @@
674      this->redraw_needed = 1;
675  }
676  
677 +static int interruptable_sleep(vos_t *this, int usec_to_sleep)
678 +{
679 +  struct timespec abstime;
680 +
681 +  struct timeval now;
682 +  gettimeofday(&now, 0);
683 +
684 +  abstime.tv_sec  = now.tv_sec + usec_to_sleep / 1000000;
685 +  abstime.tv_nsec = now.tv_usec * 1000 + (usec_to_sleep % 1000000) * 1000;
686 +
687 +  if (abstime.tv_nsec > 1000000000) {
688 +    abstime.tv_nsec -= 1000000000;
689 +    abstime.tv_sec++;
690 +  }
691 +
692 +  return pthread_cond_timedwait(&this->trigger_drawing, &this->trigger_drawing_mutex, &abstime);
693 +}
694 +
695  /* special loop for paused mode
696   * needed to update screen due overlay changes, resize, window
697   * movement, brightness adjusting etc.
698 @@ -1084,7 +1106,7 @@
699      }
700      
701      pthread_mutex_unlock( &this->free_img_buf_queue->mutex );
702 -    xine_usec_sleep (20000);
703 +    interruptable_sleep(this, 20000);
704      pthread_mutex_lock( &this->free_img_buf_queue->mutex );
705    }
706    
707 @@ -1112,6 +1134,8 @@
708    nice(-2);
709  #endif /* WIN32 */
710  
711 +  pthread_mutex_lock(&this->trigger_drawing_mutex);
712 +
713    /*
714     * here it is - the heart of xine (or rather: one of the hearts
715     * of xine) : the video output loop
716 @@ -1214,7 +1238,10 @@
717                 "video_out: vpts/clock error, next_vpts=%" PRId64 " cur_vpts=%" PRId64 "\n", next_frame_vpts,vpts);
718                 
719        if (usec_to_sleep > 0)
720 -        xine_usec_sleep (usec_to_sleep);
721 +      {
722 +        if (0 == interruptable_sleep(this, usec_to_sleep))
723 +          break;
724 +      }
725  
726        if (this->discard_frames)
727          break;
728 @@ -1222,6 +1249,8 @@
729      } while ( (usec_to_sleep > 0) && this->video_loop_running);
730    }
731  
732 +  pthread_mutex_unlock(&this->trigger_drawing_mutex);
733 +
734    /*
735     * throw away undisplayed frames
736     */
737 @@ -1597,6 +1626,9 @@
738    free (this->free_img_buf_queue);
739    free (this->display_img_buf_queue);
740  
741 +  pthread_cond_destroy(&this->trigger_drawing);
742 +  pthread_mutex_destroy(&this->trigger_drawing_mutex);
743 +
744    free (this);
745  }
746  
747 @@ -1666,6 +1698,14 @@
748    }
749  }
750  
751 +static void vo_trigger_drawing (xine_video_port_t *this_gen) {
752 +  vos_t      *this = (vos_t *) this_gen;
753 +
754 +  pthread_mutex_lock (&this->trigger_drawing_mutex);
755 +  pthread_cond_signal (&this->trigger_drawing);
756 +  pthread_mutex_unlock (&this->trigger_drawing_mutex);
757 +}
758 +
759  /* crop_frame() will allocate a new frame to copy in the given image
760   * while cropping. maybe someday this will be an automatic post plugin.
761   */
762 @@ -1761,6 +1801,7 @@
763    this->vo.enable_ovl            = vo_enable_overlay;
764    this->vo.get_overlay_manager   = vo_get_overlay_manager;
765    this->vo.flush                 = vo_flush;
766 +  this->vo.trigger_drawing       = vo_trigger_drawing;
767    this->vo.get_property          = vo_get_property;
768    this->vo.set_property          = vo_set_property;
769    this->vo.status                = vo_status;
770 @@ -1780,6 +1821,9 @@
771    this->overlay_source->init (this->overlay_source);
772    this->overlay_enabled       = 1;
773  
774 +  pthread_mutex_init(&this->trigger_drawing_mutex, NULL);
775 +  pthread_cond_init(&this->trigger_drawing, NULL);
776 +
777    this->frame_drop_limit      = 3;
778    this->frame_drop_cpt        = 0;
779  
780 Index: xine-lib/src/xine-engine/video_out.h
781 ===================================================================
782 RCS file: /cvsroot/xine/xine-lib/src/xine-engine/video_out.h,v
783 retrieving revision 1.113
784 diff -u -r1.113 video_out.h
785 --- xine-lib/src/xine-engine/video_out.h        24 Sep 2005 19:08:26 -0000      1.113
786 +++ xine-lib/src/xine-engine/video_out.h        20 Mar 2006 21:12:11 -0000
787 @@ -205,6 +205,9 @@
788    /* flush video_out fifo */
789    void (*flush) (xine_video_port_t *self);
790  
791 +  /* trigger immediate drawing */
792 +  void (*trigger_drawing) (xine_video_port_t *self);
793 +
794    /* Get/Set video property
795     *
796     * See VO_PROP_* bellow
797 Index: xine-lib/src/xine-engine/video_overlay.h
798 ===================================================================
799 RCS file: /cvsroot/xine/xine-lib/src/xine-engine/video_overlay.h,v
800 retrieving revision 1.20
801 diff -u -r1.20 video_overlay.h
802 --- xine-lib/src/xine-engine/video_overlay.h    24 Sep 2005 19:08:26 -0000      1.20
803 +++ xine-lib/src/xine-engine/video_overlay.h    20 Mar 2006 21:12:12 -0000
804 @@ -38,7 +38,7 @@
805  
806  #define MAX_OBJECTS   50
807  #define MAX_EVENTS    50
808 -#define MAX_SHOWING   16
809 +#define MAX_SHOWING   (5 + 16)
810  
811  #define OVERLAY_EVENT_NULL             0
812  #define OVERLAY_EVENT_SHOW             1
813 Index: xine-lib/src/xine-engine/xine.c
814 ===================================================================
815 RCS file: /cvsroot/xine/xine-lib/src/xine-engine/xine.c,v
816 retrieving revision 1.322
817 diff -u -r1.322 xine.c
818 --- xine-lib/src/xine-engine/xine.c     17 Mar 2006 18:52:04 -0000      1.322
819 +++ xine-lib/src/xine-engine/xine.c     20 Mar 2006 21:12:14 -0000
820 @@ -532,6 +532,7 @@
821    pthread_mutex_init (&stream->info_mutex, NULL);
822    pthread_mutex_init (&stream->meta_mutex, NULL);
823    pthread_mutex_init (&stream->demux_lock, NULL);
824 +  pthread_mutex_init (&stream->demux_mutex, NULL);
825    pthread_mutex_init (&stream->event_queues_lock, NULL);
826    pthread_mutex_init (&stream->counter_lock, NULL);
827    pthread_cond_init  (&stream->counter_changed, NULL);
828 @@ -1269,6 +1270,7 @@
829    pthread_mutex_destroy (&stream->event_queues_lock);
830    pthread_mutex_destroy (&stream->current_extra_info_lock);
831    pthread_cond_destroy  (&stream->counter_changed);
832 +  pthread_mutex_destroy (&stream->demux_mutex);
833    pthread_mutex_destroy (&stream->demux_lock);
834    pthread_mutex_destroy (&stream->first_frame_lock);
835    pthread_cond_destroy  (&stream->first_frame_reached);
836 @@ -1948,3 +1950,89 @@
837    slave->master = master->master;
838    return 1;
839  }
840 +
841 +int _x_continue_stream_processing(xine_stream_t *stream)
842 +{
843 +  return stream->status != XINE_STATUS_STOP
844 +    && stream->status != XINE_STATUS_QUIT;
845 +}
846 +
847 +void _x_trigger_relaxed_frame_drop_mode(xine_stream_t *stream)
848 +{
849 +  stream->first_frame_flag = 2;
850 +}
851 +
852 +void _x_reset_relaxed_frame_drop_mode(xine_stream_t *stream)
853 +{
854 +  stream->first_frame_flag = 1;
855 +}
856 +
857 +void _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, int *num_audio_buffers, int *num_video_frames, int *num_audio_frames)
858 +{
859 +  stream->xine->port_ticket->acquire(stream->xine->port_ticket, 0);
860 +
861 +  if (num_video_buffers)
862 +    *num_video_buffers = (stream->video_fifo ? stream->video_fifo->size(stream->video_fifo) : 0);
863 +    
864 +  if (num_audio_buffers)
865 +    *num_audio_buffers = (stream->audio_fifo ? stream->audio_fifo->size(stream->audio_fifo) : 0);
866 +    
867 +  if (num_video_frames)
868 +    *num_video_frames = (stream->video_out ? stream->video_out->get_property(stream->video_out, VO_PROP_BUFS_IN_FIFO) : 0);
869 +
870 +  if (num_audio_frames)
871 +    *num_audio_frames = (stream->audio_out ? stream->audio_out->get_property(stream->audio_out, AO_PROP_BUFS_IN_FIFO) : 0);
872 +
873 +  stream->xine->port_ticket->release(stream->xine->port_ticket, 0);
874 +}
875 +
876 +int _x_query_unprocessed_osd_events(xine_stream_t *stream)
877 +{
878 +  video_overlay_manager_t *ovl;
879 +  int redraw_needed;
880 +  
881 +  stream->xine->port_ticket->acquire(stream->xine->port_ticket, 0);
882 +
883 +  ovl = stream->video_out->get_overlay_manager(stream->video_out);
884 +  redraw_needed = ovl->redraw_needed(ovl, 0);
885
886 +  if (redraw_needed) 
887 +    stream->video_out->trigger_drawing(stream->video_out);
888 +
889 +  stream->xine->port_ticket->release(stream->xine->port_ticket, 0);
890 +
891 +  return redraw_needed;
892 +}
893 +
894 +int _x_demux_seek(xine_stream_t *stream, off_t start_pos, int start_time, int playing)
895 +{
896 +  return stream->demux_plugin->seek(stream->demux_plugin, start_pos, start_time, playing);
897 +}
898 +
899 +int _x_lock_frontend(xine_stream_t *stream, int ms_to_time_out)
900 +{
901 +  if (ms_to_time_out >= 0) {
902 +    struct timespec abstime;
903 +
904 +    struct timeval now;
905 +    gettimeofday(&now, 0);
906 +
907 +    abstime.tv_sec = now.tv_sec + ms_to_time_out / 1000;
908 +    abstime.tv_nsec = now.tv_usec * 1000 + (ms_to_time_out % 1000) * 1e6;
909 +
910 +    if (abstime.tv_nsec > 1e9) {
911 +      abstime.tv_nsec -= 1e9;
912 +      abstime.tv_sec++;
913 +    }
914 +
915 +    return (0 == pthread_mutex_timedlock(&stream->frontend_lock, &abstime));
916 +  }
917 +
918 +  pthread_mutex_lock(&stream->frontend_lock);
919 +  return 1;
920 +}
921 +
922 +void _x_unlock_frontend(xine_stream_t *stream)
923 +{
924 +  pthread_mutex_unlock(&stream->frontend_lock);
925 +}
926 Index: xine-lib/src/xine-engine/xine_internal.h
927 ===================================================================
928 RCS file: /cvsroot/xine/xine-lib/src/xine-engine/xine_internal.h,v
929 retrieving revision 1.171
930 diff -u -r1.171 xine_internal.h
931 --- xine-lib/src/xine-engine/xine_internal.h    27 Jan 2006 07:46:16 -0000      1.171
932 +++ xine-lib/src/xine-engine/xine_internal.h    20 Mar 2006 21:12:14 -0000
933 @@ -320,6 +320,7 @@
934    int                        demux_thread_running;
935    pthread_mutex_t            demux_lock;
936    int                        demux_action_pending;
937 +  pthread_mutex_t            demux_mutex; /* used in _x_demux_... functions to synchronize order of pairwise A/V buffer operations */
938  
939    extra_info_t              *current_extra_info;
940    pthread_mutex_t            current_extra_info_lock;
941 @@ -354,6 +355,15 @@
942   * private function prototypes:
943   */
944  
945 +int _x_continue_stream_processing(xine_stream_t *stream);
946 +void _x_trigger_relaxed_frame_drop_mode(xine_stream_t *stream);
947 +void _x_reset_relaxed_frame_drop_mode(xine_stream_t *stream);
948 +void _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, int *num_audio_buffers, int *num_video_frames, int *num_audio_frames);
949 +int _x_query_unprocessed_osd_events(xine_stream_t *stream);
950 +int _x_demux_seek(xine_stream_t *stream, off_t start_pos, int start_time, int playing);
951 +int _x_lock_frontend(xine_stream_t *stream, int ms_to_time_out);
952 +void _x_unlock_frontend(xine_stream_t *stream);
953 +
954  void _x_handle_stream_end      (xine_stream_t *stream, int non_user);
955  
956  /* report message to UI. usually these are async errors */
957 diff -Nurp ../xine-cvs/xine-lib/src/vdr/Makefile.am xine-lib/src/vdr/Makefile.am
958 --- ../xine-cvs/xine-lib/src/vdr/Makefile.am    1970-01-01 01:00:00.000000000 +0100
959 +++ xine-lib/src/vdr/Makefile.am        2005-06-29 22:58:03.000000000 +0200
960 @@ -0,0 +1,30 @@
961 +include $(top_srcdir)/misc/Makefile.common
962 +
963 +
964 +
965 +libdir = $(XINE_PLUGINDIR)
966 +
967 +AM_CFLAGS = -D_LARGEFILE64_SOURCE
968 +
969 +lib_LTLIBRARIES = \
970 +       xineplug_inp_vdr.la
971 +
972 +xineplug_inp_vdr_la_SOURCES = input_vdr.c
973 +xineplug_inp_vdr_la_LIBADD = $(XINE_LIB)
974 +xineplug_inp_vdr_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
975 +
976 +include_HEADERS = input_vdr.h
977 +
978 +
979 +
980 +postlibdir = $(XINE_PLUGINDIR)/post
981 +
982 +postlib_LTLIBRARIES = \
983 +       xineplug_post_vdr.la
984 +
985 +xineplug_post_vdr_la_SOURCES = post_vdr.c post_vdr_video.c post_vdr_audio.c
986 +xineplug_post_vdr_la_LIBADD = $(XINE_LIB)
987 +xineplug_post_vdr_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
988 +
989 +noinst_HEADERS = post_vdr.h
990 +
991 diff -Nurp ../xine-cvs/xine-lib/src/vdr/input_vdr.c xine-lib/src/vdr/input_vdr.c
992 --- ../xine-cvs/xine-lib/src/vdr/input_vdr.c    1970-01-01 01:00:00.000000000 +0100
993 +++ xine-lib/src/vdr/input_vdr.c        2006-03-19 21:37:33.000000000 +0100
994 @@ -0,0 +1,2480 @@
995 +/*
996 + * Copyright (C) 2003-2004 the xine project
997 + *
998 + * This file is part of xine, a free video player.
999 + * 
1000 + * xine is free software; you can redistribute it and/or modify
1001 + * it under the terms of the GNU General Public License as published by
1002 + * the Free Software Foundation; either version 2 of the License, or
1003 + * (at your option) any later version.
1004 + * 
1005 + * xine is distributed in the hope that it will be useful,
1006 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1007 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1008 + * GNU General Public License for more details.
1009 + * 
1010 + * You should have received a copy of the GNU General Public License
1011 + * along with this program; if not, write to the Free Software
1012 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
1013 + *
1014 + * $Id$
1015 + */
1016 +
1017 +#ifdef HAVE_CONFIG_H
1018 +#include "config.h"
1019 +#endif
1020 +
1021 +#include <stdio.h>
1022 +#include <stdlib.h>
1023 +#include <string.h>
1024 +#include <fcntl.h>
1025 +#include <unistd.h>
1026 +#include <sys/stat.h>
1027 +#include <sys/poll.h>
1028 +#include <errno.h>
1029 +#include <pthread.h>
1030 +
1031 +#define LOG_MODULE "input_vdr"
1032 +#define LOG_VERBOSE
1033 +/*
1034 +#define LOG
1035 +*/
1036 +#include "xine_internal.h"
1037 +#include "xineutils.h"
1038 +#include "input_plugin.h"
1039 +
1040 +#include "input_vdr.h"
1041 +#include "post_vdr.h"
1042 +
1043 +
1044 +
1045 +#define VDR_MAX_NUM_WINDOWS 16
1046 +#define VDR_ABS_FIFO_DIR "/tmp/vdr-xine"
1047 +
1048 +
1049 +
1050 +#define BUF_SIZE 1024
1051 +
1052 +#define LOG_OSD(x)
1053 +/*
1054 +#define LOG_OSD(x) x
1055 +*/
1056 +
1057 +
1058 +typedef struct
1059 +{
1060 +  input_plugin_t      input_plugin;
1061 +   
1062 +  xine_stream_t      *stream;
1063 +  xine_stream_t      *stream_external;
1064 +
1065 +  int                 fh;
1066 +  int                 fh_control;
1067 +  int                 fh_result;
1068 +  int                 fh_event;
1069 +  
1070 +  char               *mrl;
1071 +
1072 +  off_t               curpos;
1073 +  char                seek_buf[ BUF_SIZE ];
1074 +   
1075 +  char               *preview;
1076 +  off_t               preview_size;
1077 +   
1078 +  enum funcs          cur_func;
1079 +  off_t               cur_size;
1080 +  off_t               cur_done;
1081 +
1082 +  xine_osd_t         *osd_window[ VDR_MAX_NUM_WINDOWS ];
1083 +  uint8_t            *osd_buffer;
1084 +  uint32_t            osd_buffer_size;
1085 +  uint8_t             osd_unscaled_blending;
1086 +
1087 +  uint8_t             audio_channels;
1088 +  uint8_t             trick_speed_mode;
1089 +  uint8_t             mute_mode;
1090 +  uint8_t             dont_change_xine_volume;
1091 +  int                 last_volume;
1092 +  vdr_frame_size_changed_data_t frame_size;
1093 +  
1094 +  pthread_t           rpc_thread;
1095 +  int                 rpc_thread_shutdown;
1096 +  pthread_mutex_t     rpc_thread_shutdown_lock;
1097 +  pthread_cond_t      rpc_thread_shutdown_cond;
1098 +
1099 +  xine_event_queue_t *event_queue;
1100 +  xine_event_queue_t *event_queue_external;
1101 +
1102 +}
1103 +vdr_input_plugin_t;
1104 +
1105 +
1106 +
1107 +typedef struct
1108 +{
1109 +  input_class_t       input_class;
1110 +  xine_t             *xine;
1111 +  char               *mrls[ 2 ];
1112 +}
1113 +vdr_input_class_t;
1114 +
1115 +
1116 +
1117 +static int vdr_write(int f, void *b, int n)
1118 +{
1119 +  int t = 0, r;
1120 +  
1121 +  while (t < n)
1122 +  {
1123 +    /*
1124 +     * System calls are not a thread cancellation point in Linux
1125 +     * pthreads.  However, the RT signal sent to cancel the thread
1126 +     * will cause recv() to return with EINTR, and we can manually
1127 +     * check cancellation.
1128 +     */
1129 +    pthread_testcancel();
1130 +    r = write(f, ((char *)b) + t, n - t);
1131 +    pthread_testcancel();
1132 +
1133 +    if (r < 0
1134 +        && (errno == EINTR
1135 +          || errno == EAGAIN))
1136 +    {
1137 +      continue;
1138 +    }
1139 +    
1140 +    if (r < 0)
1141 +      return r;
1142 +    
1143 +    t += r;
1144 +  }
1145 +  
1146 +  return t;
1147 +}
1148 +
1149 +
1150 +
1151 +static int internal_write_event_play_external(vdr_input_plugin_t *this, uint32_t key);
1152 +
1153 +static void event_handler_external(void *user_data, const xine_event_t *event)
1154 +{
1155 +  vdr_input_plugin_t *this = (vdr_input_plugin_t *)user_data;
1156 +  uint32_t key = key_none;
1157 +/*  
1158 +  printf("event_handler_external(): event->type: %d\n", event->type);
1159 +*/
1160 +  switch (event->type)
1161 +  {
1162 +  case XINE_EVENT_UI_PLAYBACK_FINISHED:
1163 +    break;
1164 +
1165 +  default:
1166 +    return;
1167 +  }    
1168 +  
1169 +  if (0 != internal_write_event_play_external(this, key))
1170 +    xprintf(this->stream->xine, XINE_VERBOSITY_LOG, 
1171 +            _(LOG_MODULE ": input event write: %s.\n"), strerror(errno));
1172 +}
1173 +
1174 +static void external_stream_stop(vdr_input_plugin_t *this)
1175 +{
1176 +  if (this->stream_external)
1177 +  {    
1178 +    xine_stop(this->stream_external);
1179 +    xine_close(this->stream_external);
1180 +
1181 +    if (this->event_queue_external)
1182 +    {
1183 +      xine_event_dispose_queue(this->event_queue_external);
1184 +      this->event_queue_external = 0;
1185 +    }
1186 +
1187 +    _x_demux_flush_engine(this->stream_external);
1188 +    
1189 +    xine_dispose(this->stream_external);    
1190 +    this->stream_external = 0;
1191 +  }
1192 +}
1193 +
1194 +static void external_stream_play(vdr_input_plugin_t *this, char *file_name)
1195 +{
1196 +  external_stream_stop(this);
1197 +
1198 +  this->stream_external = xine_stream_new(this->stream->xine, this->stream->audio_out, this->stream->video_out);
1199 +  
1200 +  this->event_queue_external = xine_event_new_queue(this->stream_external);
1201 +
1202 +  xine_event_create_listener_thread(this->event_queue_external, event_handler_external, this);
1203 +
1204 +  if (!xine_open(this->stream_external, file_name)
1205 +      || !xine_play(this->stream_external, 0, 0))
1206 +  {
1207 +    uint32_t key = key_none;
1208 +    
1209 +    if ( 0 != internal_write_event_play_external(this, key))
1210 +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, 
1211 +              _(LOG_MODULE ": input event write: %s.\n"), strerror(errno));
1212 +  }
1213 +}
1214 +
1215 +static off_t vdr_read_abort(xine_stream_t *stream, int fd, char *buf, off_t todo)
1216 +{  
1217 +  off_t ret;
1218 +  
1219 +  while (1)
1220 +  {
1221 +    /*
1222 +     * System calls are not a thread cancellation point in Linux
1223 +     * pthreads.  However, the RT signal sent to cancel the thread
1224 +     * will cause recv() to return with EINTR, and we can manually
1225 +     * check cancellation.
1226 +     */
1227 +    pthread_testcancel();
1228 +    ret = _x_read_abort(stream, fd, buf, todo);
1229 +    pthread_testcancel();
1230 +    
1231 +    if (ret < 0
1232 +        && (errno == EINTR
1233 +          || errno == EAGAIN))
1234 +    {
1235 +      continue;
1236 +    }
1237 +    
1238 +    break;
1239 +  }
1240 +
1241 +  return ret;
1242 +}
1243 +
1244 +#define READ_DATA_OR_FAIL(kind, log) \
1245 +  data_##kind##_t *data = &data_union.kind; \
1246 +  { \
1247 +    log; \
1248 +    n = vdr_read_abort(this->stream, this->fh_control, (char *)data + sizeof (data->header), sizeof (*data) - sizeof (data->header)); \
1249 +    if (n != sizeof (*data) - sizeof (data->header)) \
1250 +      return -1; \
1251 +    \
1252 +    this->cur_size -= n; \
1253 +  } 
1254 +
1255 +static double _now()
1256 +{
1257 +  struct timeval tv;
1258 +  
1259 +  gettimeofday(&tv, 0);
1260 +
1261 +  return (tv.tv_sec * 1000000.0 + tv.tv_usec) / 1000.0;
1262 +}
1263 +
1264 +static off_t vdr_execute_rpc_command(vdr_input_plugin_t *this)
1265 +{
1266 +  data_union_t data_union;
1267 +  off_t n;
1268 +   
1269 +  n = vdr_read_abort(this->stream, this->fh_control, (char *)&data_union, sizeof (data_union.header));
1270 +  if (n != sizeof (data_union.header))
1271 +    return -1;
1272 +  
1273 +  this->cur_func = data_union.header.func;
1274 +  this->cur_size = data_union.header.len - sizeof (data_union.header);
1275 +  this->cur_done = 0;
1276 +
1277 +  switch (this->cur_func)
1278 +  {
1279 +  case func_nop:
1280 +    {
1281 +      READ_DATA_OR_FAIL(nop, lprintf("got NOP\n"));
1282 +    }
1283 +    break;
1284 +
1285 +  case func_osd_new:
1286 +    {
1287 +      READ_DATA_OR_FAIL(osd_new, LOG_OSD(lprintf("got OSDNEW\n")));
1288 +/*
1289 +      LOG_OSD(lprintf("... (%d,%d)-(%d,%d)\n", data->x, data->y, data->width, data->height));
1290 +
1291 +      fprintf(stderr, "vdr: osdnew %d\n", data->window);
1292 +*/    
1293 +      if (data->window >= VDR_MAX_NUM_WINDOWS)
1294 +        return -1;
1295 +      
1296 +      if (0 != this->osd_window[ data->window ])
1297 +        return -1;
1298 +      
1299 +      this->osd_window[ data->window ] = xine_osd_new(this->stream
1300 +                                                     , data->x
1301 +                                                     , data->y
1302 +                                                     , data->width
1303 +                                                     , data->height);
1304 +      
1305 +      if (0 == this->osd_window[ data->window ])
1306 +        return -1;
1307 +    }
1308 +    break;
1309 +
1310 +  case func_osd_free:
1311 +    {
1312 +      READ_DATA_OR_FAIL(osd_free, LOG_OSD(lprintf("got OSDFREE\n")));
1313 +/*      
1314 +      fprintf(stderr, "vdr: osdfree %d\n", data->window);
1315 +*/      
1316 +      if (data->window >= VDR_MAX_NUM_WINDOWS)
1317 +        return -1;
1318 +      
1319 +      if (0 != this->osd_window[ data->window ])
1320 +        xine_osd_free(this->osd_window[ data->window ]);
1321 +      
1322 +      this->osd_window[ data->window ] = 0;
1323 +    }
1324 +    break;
1325 +    
1326 +  case func_osd_show:
1327 +    {
1328 +      READ_DATA_OR_FAIL(osd_show, LOG_OSD(lprintf("got OSDSHOW\n")));
1329 +/*      
1330 +      fprintf(stderr, "vdr: osdshow %d\n", data->window);
1331 +*/      
1332 +      if (data->window >= VDR_MAX_NUM_WINDOWS)
1333 +        return -1;
1334 +      
1335 +      if (0 != this->osd_window[ data->window ])
1336 +      {
1337 +        if (this->osd_unscaled_blending)
1338 +          xine_osd_show_unscaled(this->osd_window[ data->window ], 0);
1339 +        else
1340 +          xine_osd_show(this->osd_window[ data->window ], 0);
1341 +      }
1342 +    }
1343 +    break;
1344 +    
1345 +  case func_osd_hide:
1346 +    {
1347 +      READ_DATA_OR_FAIL(osd_hide, LOG_OSD(lprintf("got OSDHIDE\n")));
1348 +/*      
1349 +      fprintf(stderr, "vdr: osdhide %d\n", data->window);
1350 +*/      
1351 +      if (data->window >= VDR_MAX_NUM_WINDOWS)
1352 +        return -1;
1353 +      
1354 +      if (0 != this->osd_window[ data->window ])
1355 +      {
1356 +        if (this->osd_unscaled_blending)
1357 +          xine_osd_show_unscaled(this->osd_window[ data->window ], 0);
1358 +        else
1359 +          xine_osd_show(this->osd_window[ data->window ], 0);
1360 +      }
1361 +    }
1362 +    break;
1363 +    
1364 +  case func_osd_flush:
1365 +    {
1366 +      double _t1, _t2;
1367 +      int _n = 0;
1368 +      int _to = 0;
1369 +      int r = 0;
1370 +      
1371 +      READ_DATA_OR_FAIL(osd_flush, LOG_OSD(lprintf("got OSDFLUSH\n")));
1372 +/*      
1373 +      fprintf(stderr, "vdr: osdflush +\n");
1374 +*/
1375 +      _t1 = _now();
1376 +      
1377 +      while ((r = _x_query_unprocessed_osd_events(this->stream)))
1378 +      {
1379 +        if ((_now() - _t1) > 200)
1380 +        {
1381 +          _to = 1;
1382 +          break;
1383 +        }
1384 +/*        
1385 +        fprintf(stderr, "redraw_needed: 1\n");
1386 +*/        
1387 +/*        sched_yield(); */
1388 +        xine_usec_sleep(5000);
1389 +        _n++;
1390 +      }
1391 +
1392 +      _t2 = _now();
1393 +      fprintf(stderr, "vdr: osdflush: n: %d, %.1lf, timeout: %d, result: %d\n", _n, _t2 - _t1, _to, r);
1394 +/*      
1395 +      fprintf(stderr, "redraw_needed: 0\n");        
1396 +      
1397 +      fprintf(stderr, "vdr: osdflush -\n");
1398 +*/
1399 +    }
1400 +    break;
1401 +    
1402 +  case func_osd_set_position:
1403 +    {
1404 +      READ_DATA_OR_FAIL(osd_set_position, LOG_OSD(lprintf("got OSDSETPOSITION\n")));
1405 +/*
1406 +      fprintf(stderr, "vdr: osdsetposition %d\n", data->window);    
1407 +*/      
1408 +      if (data->window >= VDR_MAX_NUM_WINDOWS)
1409 +        return -1;
1410 +      
1411 +      if (0 != this->osd_window[ data->window ])
1412 +        xine_osd_set_position(this->osd_window[ data->window ], data->x, data->y);
1413 +    }
1414 +    break;
1415 +  
1416 +  case func_osd_draw_bitmap:
1417 +    {
1418 +      READ_DATA_OR_FAIL(osd_draw_bitmap, LOG_OSD(lprintf("got OSDDRAWBITMAP\n")));
1419 +/*
1420 +      fprintf(stderr, "vdr: osddrawbitmap %d\n", data->window);    
1421 +*/      
1422 +      if (this->osd_buffer_size < this->cur_size)
1423 +      {
1424 +        if (this->osd_buffer)
1425 +          free(this->osd_buffer);
1426 +        
1427 +        this->osd_buffer_size = 0;
1428 +        
1429 +        this->osd_buffer = xine_xmalloc(this->cur_size);
1430 +        if (!this->osd_buffer)
1431 +          return -1;
1432 +        
1433 +        this->osd_buffer_size = this->cur_size;
1434 +      }
1435 +      
1436 +      n = vdr_read_abort (this->stream, this->fh_control, (char *)this->osd_buffer, this->cur_size);
1437 +      if (n != this->cur_size)
1438 +        return -1;
1439 +      
1440 +      this->cur_size -= n;
1441 +      
1442 +      if (data->window >= VDR_MAX_NUM_WINDOWS)
1443 +        return -1;
1444 +      
1445 +      if (0 != this->osd_window[ data->window ])
1446 +        xine_osd_draw_bitmap(this->osd_window[ data->window ], this->osd_buffer, data->x, data->y, data->width, data->height, 0);
1447 +    }
1448 +    break;
1449 +    
1450 +  case func_set_color:
1451 +    {
1452 +      uint32_t vdr_color[ 256 ];
1453 +      
1454 +      READ_DATA_OR_FAIL(set_color, lprintf("got SETCOLOR\n"));
1455 +      
1456 +      if (((data->num + 1) * sizeof (uint32_t)) != this->cur_size)
1457 +        return -1;
1458 +      
1459 +      n = vdr_read_abort (this->stream, this->fh_control, (char *)&vdr_color[ data->index ], this->cur_size);
1460 +      if (n != this->cur_size)
1461 +        return -1;
1462 +      
1463 +      this->cur_size -= n;
1464 +      
1465 +      if (data->window >= VDR_MAX_NUM_WINDOWS)
1466 +        return -1;
1467 +      
1468 +      if (0 != this->osd_window[ data->window ])
1469 +      {
1470 +        uint32_t color[ 256 ];
1471 +        uint8_t trans[ 256 ];
1472 +        
1473 +        xine_osd_get_palette(this->osd_window[ data->window ], color, trans);
1474 +        
1475 +        {
1476 +          int i;
1477 +          
1478 +          for (i = data->index; i <= (data->index + data->num); i++)
1479 +          {
1480 +            int a = (vdr_color[ i ] & 0xff000000) >> 0x18;
1481 +            int r = (vdr_color[ i ] & 0x00ff0000) >> 0x10;
1482 +            int g = (vdr_color[ i ] & 0x0000ff00) >> 0x08;
1483 +            int b = (vdr_color[ i ] & 0x000000ff) >> 0x00;
1484 +            
1485 +            int y  = (( 66 * r + 129 * g +  25 * b + 128) >> 8) +  16;
1486 +            int cr = ((112 * r -  94 * g -  18 * b + 128) >> 8) + 128;
1487 +            int cb = ((-38 * r -  74 * g + 112 * b + 128) >> 8) + 128;
1488 +
1489 +            uint8_t *dst = (uint8_t *)&color[ i ];
1490 +            *dst++ = cb;
1491 +            *dst++ = cr;
1492 +            *dst++ = y;
1493 +            *dst++ = 0;
1494 +
1495 +            trans[ i ] = a >> 4;
1496 +          }
1497 +        }
1498 +        
1499 +        xine_osd_set_palette(this->osd_window[ data->window ], color, trans);
1500 +      }
1501 +    }
1502 +    break;
1503 +
1504 +  case func_play_external:
1505 +    {
1506 +      char file_name[ 1024 ];
1507 +      int file_name_len = 0;
1508 +      
1509 +      READ_DATA_OR_FAIL(play_external, lprintf("got PLAYEXTERNAL\n"));
1510 +
1511 +      file_name_len = this->cur_size;
1512 +
1513 +      if (0 != file_name_len)
1514 +      {
1515 +        if (file_name_len <= 1
1516 +            || file_name_len > sizeof (file_name))
1517 +        {
1518 +          return -1;
1519 +        }
1520 +      
1521 +        n = vdr_read_abort (this->stream, this->fh_control, file_name, file_name_len);
1522 +        if (n != file_name_len)
1523 +          return -1;
1524 +      
1525 +        if (file_name[ file_name_len - 1 ] != '\0')
1526 +          return -1;
1527 +      
1528 +        this->cur_size -= n;
1529 +      }
1530 +
1531 +      lprintf((file_name_len > 0) ? "----------- play external: %s\n" : "---------- stop external\n", file_name);
1532 +      
1533 +      if (file_name_len > 0)
1534 +        external_stream_play(this, file_name);
1535 +      else
1536 +        external_stream_stop(this);
1537 +    }
1538 +    break;
1539 +
1540 +  case func_clear:
1541 +    {
1542 +      READ_DATA_OR_FAIL(clear, lprintf("got CLEAR\n"));
1543 +
1544 +      {
1545 +        int orig_speed = xine_get_param(this->stream, XINE_PARAM_FINE_SPEED);
1546 +        if (orig_speed <= 0)
1547 +          xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, XINE_FINE_SPEED_NORMAL);
1548 +fprintf(stderr, "+++ CLEAR(%d%c)\n", data->n, data->s ? 'b' : 'a');
1549 +/*        
1550 +        if (!this->dont_change_xine_volume)
1551 +          xine_set_param(this->stream, XINE_PARAM_AUDIO_VOLUME, 0);
1552 +*/      
1553 +        _x_demux_flush_engine(this->stream);
1554 +fprintf(stderr, "=== CLEAR(%d.1)\n", data->n);
1555 +        _x_demux_control_start(this->stream);
1556 +fprintf(stderr, "=== CLEAR(%d.2)\n", data->n);
1557 +        _x_demux_seek(this->stream, 0, 0, 0);
1558 +fprintf(stderr, "=== CLEAR(%d.3)\n", data->n);
1559 +
1560 +        _x_stream_info_reset(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE);
1561 +fprintf(stderr, "=== CLEAR(%d.4)\n", data->n);
1562 +       _x_meta_info_reset(this->stream, XINE_META_INFO_AUDIOCODEC);
1563 +fprintf(stderr, "=== CLEAR(%d.5)\n", data->n);
1564 +
1565 +        _x_trigger_relaxed_frame_drop_mode(this->stream);
1566 +/*        _x_reset_relaxed_frame_drop_mode(this->stream); */
1567 +/*      
1568 +        if (!this->dont_change_xine_volume)
1569 +          xine_set_param(this->stream, XINE_PARAM_AUDIO_VOLUME, this->last_volume);
1570 +*/
1571 +fprintf(stderr, "--- CLEAR(%d%c)\n", data->n, data->s ? 'b' : 'a');
1572 +        if (orig_speed <= 0)
1573 +          xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, orig_speed);
1574 +      }
1575 +    }
1576 +    break;
1577 +
1578 +  case func_first_frame:
1579 +    {
1580 +      READ_DATA_OR_FAIL(first_frame, lprintf("got FIRST FRAME\n"));
1581 +
1582 +      _x_trigger_relaxed_frame_drop_mode(this->stream);
1583 +/*      _x_reset_relaxed_frame_drop_mode(this->stream); */
1584 +    }
1585 +    break;
1586 +
1587 +  case func_still_frame:
1588 +    {
1589 +      READ_DATA_OR_FAIL(still_frame, lprintf("got STILL FRAME\n"));
1590 +
1591 +      _x_reset_relaxed_frame_drop_mode(this->stream);
1592 +    }
1593 +    break;
1594 +
1595 +  case func_set_video_window:
1596 +    {
1597 +      READ_DATA_OR_FAIL(set_video_window, lprintf("got SET VIDEO WINDOW\n"));
1598 +/*
1599 +      fprintf(stderr, "svw: (%d, %d)x(%d, %d), (%d, %d)\n", data->x, data->y, data->w, data->h, data->wRef, data->hRef);
1600 +*/    
1601 +      {
1602 +        xine_event_t event;
1603 +        vdr_set_video_window_data_t event_data;
1604 +        
1605 +        event_data.x = data->x;
1606 +        event_data.y = data->y;
1607 +        event_data.w = data->w;
1608 +        event_data.h = data->h;
1609 +        event_data.w_ref = data->w_ref;
1610 +        event_data.h_ref = data->h_ref;
1611 +        
1612 +        event.type = XINE_EVENT_VDR_SETVIDEOWINDOW;
1613 +        event.data = &event_data;
1614 +        event.data_length = sizeof (event_data);
1615 +        
1616 +        xine_event_send(this->stream, &event);
1617 +      }
1618 +    }
1619 +    break;
1620 +    
1621 +  case func_select_audio:
1622 +    {
1623 +      READ_DATA_OR_FAIL(select_audio, lprintf("got SELECT AUDIO\n"));
1624 +
1625 +      this->audio_channels = data->channels;
1626 +      
1627 +      {
1628 +        xine_event_t event;
1629 +        vdr_select_audio_data_t event_data;
1630 +        
1631 +        event_data.channels = this->audio_channels;
1632 +        
1633 +        event.type = XINE_EVENT_VDR_SELECTAUDIO;
1634 +        event.data = &event_data;
1635 +        event.data_length = sizeof (event_data);
1636 +        
1637 +        xine_event_send(this->stream, &event);
1638 +      }
1639 +    }
1640 +    break;
1641 +    
1642 +  case func_trick_speed_mode:
1643 +    {
1644 +      READ_DATA_OR_FAIL(trick_speed_mode, lprintf("got TRICK SPEED MODE\n"));
1645 +
1646 +      this->trick_speed_mode = data->on;
1647 +      
1648 +      _x_demux_seek(this->stream, 0, 0, 0);
1649 +
1650 +      {
1651 +        xine_event_t event;
1652 +        
1653 +        event.type = XINE_EVENT_VDR_TRICKSPEEDMODE;
1654 +        event.data = 0;
1655 +        event.data_length = this->trick_speed_mode;
1656 +/*        fprintf(stderr, "************************: %p, %d\n", event.data, event.data_length); */
1657 +        xine_event_send(this->stream, &event);
1658 +      }
1659 +    }
1660 +    break;
1661 +    
1662 +  case func_flush:
1663 +    {
1664 +      READ_DATA_OR_FAIL(flush, lprintf("got FLUSH\n"));
1665 +
1666 +      if (!data->just_wait)
1667 +      {
1668 +        if (this->stream->video_fifo)
1669 +        {
1670 +          buf_element_t *buf = this->stream->video_fifo->buffer_pool_alloc(this->stream->video_fifo);
1671 +          if (!buf)
1672 +          {
1673 +            xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _(LOG_MODULE ": buffer_pool_alloc() failed!\n"));
1674 +            return -1;
1675 +          }
1676 +          
1677 +          buf->type = BUF_CONTROL_FLUSH_DECODER;
1678 +          
1679 +          this->stream->video_fifo->put(this->stream->video_fifo, buf);
1680 +        }
1681 +      }
1682 +      
1683 +      {
1684 +        double _t1, _t2;
1685 +        int _n = 0;
1686 +        
1687 +        int vb = -1, ab = -1, vf = -1, af = -1;
1688 +        
1689 +        uint8_t timed_out = 0;
1690 +        
1691 +        struct timeval now, then;
1692 +        
1693 +        if (data->ms_timeout >= 0)
1694 +        {
1695 +          gettimeofday(&now, 0);
1696 +          
1697 +          then = now;
1698 +          then.tv_usec += (data->ms_timeout % 1000) * 1000;
1699 +          then.tv_sec  += (data->ms_timeout / 1000);
1700 +          
1701 +          if (then.tv_usec >= 1000000)
1702 +          {
1703 +            then.tv_usec -= 1000000;
1704 +            then.tv_sec  += 1;
1705 +          }
1706 +        }
1707 +        else
1708 +        {
1709 +          then.tv_usec = 0;
1710 +          then.tv_sec  = 0;
1711 +        }
1712 +
1713 +        _t1 = _now();
1714 +        
1715 +        while (1)
1716 +        {
1717 +          _x_query_buffer_usage(this->stream, &vb, &ab, &vf, &af);
1718 +          
1719 +          if (vb <= 0 && ab <= 0 && vf <= 0 && af <= 0)
1720 +            break;
1721 +          
1722 +          if (data->ms_timeout >= 0
1723 +              && timercmp(&now, &then, >=))
1724 +          {
1725 +            timed_out++;
1726 +            break;
1727 +          }
1728 +          
1729 +/*          sched_yield(); */
1730 +          xine_usec_sleep(5000);
1731 +          _n++;
1732 +          
1733 +          if (data->ms_timeout >= 0)
1734 +            gettimeofday(&now, 0);          
1735 +        }
1736 +
1737 +        _t2 = _now();
1738 +        fprintf(stderr, "vdr: flush: n: %d, %.1lf\n", _n, _t2 - _t1);
1739 +        
1740 +        xprintf(this->stream->xine
1741 +                , XINE_VERBOSITY_LOG
1742 +                , _(LOG_MODULE ": flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n")
1743 +                , vb, ab, vf, af
1744 +                , (timed_out ? "timed out" : "done"));
1745 +        
1746 +        {
1747 +          result_flush_t result_flush;
1748 +          result_flush.header.func = data->header.func;
1749 +          result_flush.header.len = sizeof (result_flush);
1750 +          
1751 +          result_flush.timed_out = timed_out;
1752 +          
1753 +          if (sizeof (result_flush) != vdr_write(this->fh_result, &result_flush, sizeof (result_flush)))
1754 +            return -1;
1755 +        }
1756 +      }
1757 +    }
1758 +    break;
1759 +
1760 +  case func_mute:
1761 +    {
1762 +      READ_DATA_OR_FAIL(mute, lprintf("got MUTE\n"));
1763 +      
1764 +      xine_set_param(this->stream, XINE_PARAM_AUDIO_MUTE, data->mute);
1765 +    }
1766 +    break;
1767 +
1768 +  case func_set_volume:
1769 +    {
1770 +      READ_DATA_OR_FAIL(set_volume, lprintf("got SETVOLUME\n"));
1771 +
1772 +      {
1773 +        int change_volume = !this->dont_change_xine_volume;
1774 +        int do_mute   = (0 != this->last_volume && 0 == data->volume);
1775 +        int do_unmute = (0 == this->last_volume && 0 != data->volume);
1776 +        int report_change = 0;
1777 +        
1778 +        this->last_volume = data->volume;
1779 +
1780 +        if (do_mute || do_unmute)
1781 +        {
1782 +          switch (this->mute_mode)
1783 +          {
1784 +          case INPUT_VDR_MUTE_EXECUTE:
1785 +            report_change = 1;
1786 +            xine_set_param(this->stream, XINE_PARAM_AUDIO_MUTE, do_mute);
1787 +            
1788 +          case INPUT_VDR_MUTE_IGNORE:
1789 +            if (do_mute)
1790 +              change_volume = 0;
1791 +            break;
1792 +
1793 +          case INPUT_VDR_MUTE_SIMULATE:
1794 +            change_volume = 1;
1795 +            break;
1796 +
1797 +          default:
1798 +            return -1;
1799 +          };
1800 +        }
1801 +        
1802 +        if (change_volume)
1803 +        {
1804 +          report_change = 1;
1805 +          xine_set_param(this->stream, XINE_PARAM_AUDIO_VOLUME, this->last_volume);
1806 +        }
1807 +
1808 +        if (report_change)
1809 +        {
1810 +          xine_event_t            event;
1811 +          xine_audio_level_data_t data;
1812 +          
1813 +          data.left
1814 +            = data.right
1815 +            = xine_get_param(this->stream, XINE_PARAM_AUDIO_VOLUME);
1816 +          data.mute
1817 +            = xine_get_param(this->stream, XINE_PARAM_AUDIO_MUTE);
1818 +          
1819 +          event.type        = XINE_EVENT_AUDIO_LEVEL;
1820 +          event.data        = &data;
1821 +          event.data_length = sizeof (data);
1822 +          
1823 +          xine_event_send(this->stream, &event);
1824 +        }
1825 +      }
1826 +    }
1827 +    break;
1828 +
1829 +  case func_set_speed:
1830 +    {
1831 +      READ_DATA_OR_FAIL(set_speed, lprintf("got SETSPEED\n"));
1832 +      
1833 +      lprintf("... got SETSPEED %d\n", data->speed);
1834 +      
1835 +      if (data->speed != xine_get_param(this->stream, XINE_PARAM_FINE_SPEED))
1836 +        xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, data->speed);
1837 +    }
1838 +    break;
1839 +
1840 +  case func_set_prebuffer:
1841 +    {
1842 +      READ_DATA_OR_FAIL(set_prebuffer, lprintf("got SETPREBUFFER\n"));
1843 +
1844 +      xine_set_param(this->stream, XINE_PARAM_METRONOM_PREBUFFER, data->prebuffer);
1845 +    }
1846 +    break;
1847 +
1848 +  case func_metronom:
1849 +    {
1850 +      READ_DATA_OR_FAIL(metronom, lprintf("got METRONOM\n"));
1851 +
1852 +      _x_demux_control_newpts(this->stream, data->pts, data->flags);
1853 +    }
1854 +    break;
1855 +    
1856 +  case func_start:
1857 +    {
1858 +      READ_DATA_OR_FAIL(start, lprintf("got START\n"));
1859 +
1860 +      _x_demux_control_start(this->stream);
1861 +      _x_demux_seek(this->stream, 0, 0, 0);
1862 +    }
1863 +    break;
1864 +
1865 +  case func_wait:
1866 +    {
1867 +      READ_DATA_OR_FAIL(wait, lprintf("got WAIT\n"));
1868 +
1869 +      {
1870 +        result_wait_t result_wait;
1871 +        result_wait.header.func = data->header.func;
1872 +        result_wait.header.len = sizeof (result_wait);
1873 +          
1874 +        if (sizeof (result_wait) != vdr_write(this->fh_result, &result_wait, sizeof (result_wait)))
1875 +          return -1;
1876 +      }
1877 +    }
1878 +    break;
1879 +
1880 +  case func_setup:
1881 +    {
1882 +      READ_DATA_OR_FAIL(setup, lprintf("got SETUP\n"));
1883 +
1884 +      this->osd_unscaled_blending   = data->osd_unscaled_blending;
1885 +      this->dont_change_xine_volume = data->dont_change_xine_volume;
1886 +      this->mute_mode               = data->mute_mode;
1887 +    }
1888 +    break;
1889 +
1890 +  case func_grab_image:
1891 +    {
1892 +      READ_DATA_OR_FAIL(grab_image, lprintf("got GRABIMAGE\n"));
1893 +
1894 +      {
1895 +        off_t ret_val = -1;
1896 +        
1897 +        uint8_t *img   = 0;
1898 +        int frame_size = 0;
1899 +        int width      = 0;
1900 +        int height     = 0;       
1901 +        int ratio_code = 0;
1902 +        int format     = 0;
1903 +        
1904 +        int orig_speed = xine_get_param(this->stream, XINE_PARAM_FINE_SPEED);
1905 +        if (XINE_SPEED_PAUSE != orig_speed)
1906 +          xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, XINE_SPEED_PAUSE);
1907 +        
1908 +        if (xine_get_current_frame(this->stream, &width, &height, &ratio_code, &format, 0))
1909 +        {
1910 +          switch (format)
1911 +          {
1912 +          case XINE_IMGFMT_YV12:
1913 +            frame_size = width * height
1914 +              + ((width + 1) / 2) * ((height + 1) / 2)
1915 +              + ((width + 1) / 2) * ((height + 1) / 2);
1916 +            break;
1917 +            
1918 +          case XINE_IMGFMT_YUY2:
1919 +            frame_size = width * height
1920 +              + ((width + 1) / 2) * height
1921 +              + ((width + 1) / 2) * height;
1922 +            break;
1923 +          }
1924 +          
1925 +          img = xine_xmalloc(frame_size);
1926 +          
1927 +          if (!xine_get_current_frame(this->stream, &width, &height, &ratio_code, &format, img))
1928 +            frame_size = 0;
1929 +          
1930 +          if (ratio_code == XINE_VO_ASPECT_SQUARE)
1931 +            ratio_code = 10000;
1932 +          else if (ratio_code == XINE_VO_ASPECT_4_3)
1933 +            ratio_code = 13333;
1934 +          else if (ratio_code == XINE_VO_ASPECT_ANAMORPHIC)
1935 +            ratio_code = 17778;
1936 +          else if (ratio_code == XINE_VO_ASPECT_DVB)
1937 +            ratio_code = 21100;
1938 +          
1939 +          if (0 == frame_size)
1940 +          {
1941 +            width      = 0;
1942 +            height     = 0;
1943 +            ratio_code = 0;
1944 +          }          
1945 +        }
1946 +        
1947 +        if (XINE_SPEED_PAUSE != orig_speed)
1948 +          xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, orig_speed);
1949 +        
1950 +        {
1951 +          result_grab_image_t result_grab_image;
1952 +          result_grab_image.header.func = data->header.func;
1953 +          result_grab_image.header.len = sizeof (result_grab_image) + frame_size;
1954 +          
1955 +          result_grab_image.width  = width;
1956 +          result_grab_image.height = height;
1957 +          result_grab_image.ratio  = ratio_code;
1958 +          result_grab_image.format = format;
1959 +          
1960 +          if (sizeof (result_grab_image) == vdr_write(this->fh_result, &result_grab_image, sizeof (result_grab_image)))
1961 +          {
1962 +            if (frame_size == vdr_write(this->fh_result, img, frame_size))
1963 +              ret_val = 0;
1964 +          }
1965 +        }
1966 +        
1967 +        if (img)
1968 +          free(img);
1969 +        
1970 +        if (ret_val != 0)
1971 +          return ret_val;
1972 +      }
1973 +    }
1974 +    break;
1975 +    
1976 +  case func_get_pts:
1977 +    {
1978 +      READ_DATA_OR_FAIL(get_pts, lprintf("got GETPTS\n"));
1979 +      
1980 +      {
1981 +        result_get_pts_t result_get_pts;
1982 +        result_get_pts.header.func = data->header.func;
1983 +        result_get_pts.header.len = sizeof (result_get_pts);
1984 +        
1985 +        result_get_pts.pts = xine_get_current_vpts(this->stream) - this->stream->metronom->get_option(this->stream->metronom, METRONOM_VPTS_OFFSET);
1986 +        
1987 +        if (sizeof (result_get_pts) != vdr_write(this->fh_result, &result_get_pts, sizeof (result_get_pts)))
1988 +          return -1;
1989 +      }
1990 +    }
1991 +    break;
1992 +
1993 +  case func_get_version:
1994 +    {
1995 +      READ_DATA_OR_FAIL(get_version, lprintf("got GETVERSION\n"));
1996 +      
1997 +      {
1998 +        result_get_version_t result_get_version;
1999 +        result_get_version.header.func = data->header.func;
2000 +        result_get_version.header.len = sizeof (result_get_version);
2001 +        
2002 +        result_get_version.version = XINE_INPUT_VDR_VERSION;
2003 +        
2004 +        if (sizeof (result_get_version) != vdr_write(this->fh_result, &result_get_version, sizeof (result_get_version)))
2005 +          return -1;
2006 +      }
2007 +    }
2008 +    break;
2009 +
2010 +  case func_video_size:
2011 +    {
2012 +      READ_DATA_OR_FAIL(video_size, lprintf("got VIDEO SIZE\n"));
2013 +
2014 +      {
2015 +        int format;
2016 +        
2017 +        result_video_size_t result_video_size;
2018 +        result_video_size.header.func = data->header.func;
2019 +        result_video_size.header.len = sizeof (result_video_size);
2020 +        
2021 +        result_video_size.top    = -1;
2022 +        result_video_size.left   = -1;
2023 +        result_video_size.width  = -1;
2024 +        result_video_size.height = -1;
2025 +        result_video_size.ratio  = 0;
2026 +        
2027 +        xine_get_current_frame(this->stream, &result_video_size.width, &result_video_size.height, &result_video_size.ratio, &format, 0);
2028 +        
2029 +        if (result_video_size.ratio == XINE_VO_ASPECT_SQUARE)
2030 +          result_video_size.ratio = 10000;
2031 +        else if (result_video_size.ratio == XINE_VO_ASPECT_4_3)
2032 +          result_video_size.ratio = 13333;
2033 +        else if (result_video_size.ratio == XINE_VO_ASPECT_ANAMORPHIC)
2034 +          result_video_size.ratio = 17778;
2035 +        else if (result_video_size.ratio == XINE_VO_ASPECT_DVB)
2036 +          result_video_size.ratio = 21100;
2037 +        
2038 +        if (0 != this->frame_size.x
2039 +            || 0 != this->frame_size.y
2040 +            || 0 != this->frame_size.w
2041 +            || 0 != this->frame_size.h)
2042 +        {
2043 +          result_video_size.left   = this->frame_size.x;
2044 +          result_video_size.top    = this->frame_size.y;
2045 +          result_video_size.width  = this->frame_size.w;
2046 +          result_video_size.height = this->frame_size.h;
2047 +        }
2048 +
2049 +        result_video_size.zoom_x = xine_get_param(this->stream, XINE_PARAM_VO_ZOOM_X);
2050 +        result_video_size.zoom_y = xine_get_param(this->stream, XINE_PARAM_VO_ZOOM_Y);
2051 +        
2052 +        if (sizeof (result_video_size) != vdr_write(this->fh_result, &result_video_size, sizeof (result_video_size)))
2053 +          return -1;
2054 +      }
2055 +    }
2056 +    break;
2057 +
2058 +  case func_reset_audio:
2059 +    {
2060 +      double _t1, _t2;
2061 +      int _n = 0;
2062 +      
2063 +      READ_DATA_OR_FAIL(reset_audio, lprintf("got RESET AUDIO\n"));
2064 +
2065 +      if (this->stream->audio_fifo)
2066 +      {
2067 +        xine_set_param(this->stream, XINE_PARAM_IGNORE_AUDIO, 1);
2068 +        xine_set_param(this->stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL, -2);
2069 +
2070 +        _t1 = _now();
2071 +        
2072 +        while (1)
2073 +        {
2074 +          int n = xine_get_stream_info(this->stream, XINE_STREAM_INFO_MAX_AUDIO_CHANNEL);
2075 +          if (n <= 0)
2076 +            break;
2077 +          
2078 +          /* keep the decoder running */
2079 +          if (this->stream->audio_fifo)
2080 +          {
2081 +            buf_element_t *buf = this->stream->audio_fifo->buffer_pool_alloc(this->stream->audio_fifo);
2082 +            if (!buf)
2083 +            {
2084 +              xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _(LOG_MODULE ": buffer_pool_alloc() failed!\n"));
2085 +              return -1;
2086 +            }
2087 +            
2088 +            buf->type = BUF_CONTROL_RESET_TRACK_MAP;
2089 +            
2090 +            this->stream->audio_fifo->put(this->stream->audio_fifo, buf);
2091 +          }
2092 +          
2093 +/*          sched_yield(); */
2094 +          xine_usec_sleep(5000);
2095 +          _n++;
2096 +        }
2097 +
2098 +        _t2 = _now();
2099 +        fprintf(stderr, "vdr: reset_audio: n: %d, %.1lf\n", _n, _t2 - _t1);
2100 +        
2101 +        xine_set_param(this->stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL, -1);
2102 +
2103 +        _x_stream_info_reset(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE);
2104 +        _x_meta_info_reset(this->stream, XINE_META_INFO_AUDIOCODEC);
2105 +
2106 +        xine_set_param(this->stream, XINE_PARAM_IGNORE_AUDIO, 0);
2107 +      }
2108 +    }
2109 +    break;
2110 +    
2111 +  default:
2112 +    lprintf("unknown function: %d\n", this->cur_func);
2113 +  }
2114 +    
2115 +  if (this->cur_size != this->cur_done)
2116 +  {
2117 +    off_t skip = this->cur_size - this->cur_done;
2118 +
2119 +    lprintf("func: %d, skipping: %lld\n", this->cur_func, skip);
2120 +     
2121 +    while (skip > BUF_SIZE)
2122 +    {
2123 +      n = vdr_read_abort(this->stream, this->fh_control, this->seek_buf, BUF_SIZE);
2124 +      if (n != BUF_SIZE)
2125 +        return -1;
2126 +
2127 +      skip -= BUF_SIZE;
2128 +    }
2129 +
2130 +    n = vdr_read_abort(this->stream, this->fh_control, this->seek_buf, skip);
2131 +    if (n != skip)
2132 +      return -1;
2133 +
2134 +    this->cur_done = this->cur_size;
2135 +
2136 +    return -1;
2137 +  }
2138 +
2139 +  return 0;
2140 +}
2141 +
2142 +static void *vdr_rpc_thread_loop(void *arg)
2143 +{
2144 +  vdr_input_plugin_t *this = (vdr_input_plugin_t *)arg;
2145 +  int frontend_lock_failures = 0;
2146 +  int failed = 0;
2147 +  
2148 +  while (!failed
2149 +    && !this->rpc_thread_shutdown)
2150 +  {
2151 +    struct timeval timeout;
2152 +    fd_set rset;
2153 +  
2154 +    FD_ZERO(&rset);
2155 +    FD_SET(this->fh_control, &rset);
2156 +
2157 +    timeout.tv_sec  = 0;
2158 +    timeout.tv_usec = 50000;
2159 +
2160 +    if (select(this->fh_control + 1, &rset, NULL, NULL, &timeout) > 0)
2161 +    {
2162 +      if (!_x_lock_frontend(this->stream, 100))
2163 +      {
2164 +        if (++frontend_lock_failures > 50)
2165 +        {
2166 +          failed = 1;
2167 +          xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
2168 +                  LOG_MODULE ": locking frontend for rpc command execution failed, exiting ...\n");
2169 +        }
2170 +      }
2171 +      else
2172 +      {
2173 +        frontend_lock_failures = 0;
2174 +        
2175 +        if (vdr_execute_rpc_command(this) < 0)
2176 +        {
2177 +          failed = 1;
2178 +          xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
2179 +                  LOG_MODULE ": execution of rpc command %d (%s) failed, exiting ...\n", this->cur_func, "");
2180 +        }
2181 +
2182 +        _x_unlock_frontend(this->stream);
2183 +      }
2184 +    }
2185 +  }
2186 +
2187 +  /* close control and result channel here to have vdr-xine initiate a disconnect for the above error case ... */
2188 +  close(this->fh_control);
2189 +  this->fh_control = -1;
2190 +  
2191 +  close(this->fh_result);
2192 +  this->fh_result = -1;
2193 +  
2194 +  xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
2195 +          LOG_MODULE ": rpc thread done.\n");
2196 +
2197 +  pthread_mutex_lock(&this->rpc_thread_shutdown_lock);
2198 +  this->rpc_thread_shutdown = -1;
2199 +  pthread_cond_broadcast(&this->rpc_thread_shutdown_cond);
2200 +  pthread_mutex_unlock(&this->rpc_thread_shutdown_lock);
2201 +  
2202 +  return 0;
2203 +}
2204 +
2205 +static int internal_write_event_key(vdr_input_plugin_t *this, uint32_t key)
2206 +{
2207 +  event_key_t event;
2208 +  event.header.func = func_key;
2209 +  event.header.len = sizeof (event);
2210 +
2211 +  event.key = key;
2212 +
2213 +  if (sizeof (event) != vdr_write(this->fh_event, &event, sizeof (event)))
2214 +    return -1;
2215 +  
2216 +  return 0;
2217 +}
2218 +
2219 +static int internal_write_event_frame_size(vdr_input_plugin_t *this)
2220 +{
2221 +  event_frame_size_t event;
2222 +  event.header.func = func_frame_size;
2223 +  event.header.len = sizeof (event);
2224 +
2225 +  event.left   = this->frame_size.x;
2226 +  event.top    = this->frame_size.y;
2227 +  event.width  = this->frame_size.w,
2228 +  event.height = this->frame_size.h;
2229 +  event.zoom_x = xine_get_param(this->stream, XINE_PARAM_VO_ZOOM_X);
2230 +  event.zoom_y = xine_get_param(this->stream, XINE_PARAM_VO_ZOOM_Y);
2231 +
2232 +  if (sizeof (event) != vdr_write(this->fh_event, &event, sizeof (event)))
2233 +    return -1;
2234 +  
2235 +  return 0;
2236 +}
2237 +
2238 +static int internal_write_event_play_external(vdr_input_plugin_t *this, uint32_t key)
2239 +{
2240 +  event_play_external_t event;
2241 +  event.header.func = func_play_external;
2242 +  event.header.len = sizeof (event);
2243 +
2244 +  event.key = key;
2245 +
2246 +  if (sizeof (event) != vdr_write(this->fh_event, &event, sizeof (event)))
2247 +    return -1;
2248 +  
2249 +  return 0;
2250 +}
2251 +
2252 +static off_t vdr_plugin_read(input_plugin_t *this_gen, 
2253 +                             char *buf, off_t len)
2254 +{
2255 +  vdr_input_plugin_t  *this = (vdr_input_plugin_t *) this_gen;
2256 +  off_t n, total;
2257 +#ifdef LOG_READ   
2258 +  lprintf ("reading %lld bytes...\n", len);
2259 +#endif   
2260 +  total=0;
2261 +  if (this->curpos < this->preview_size)
2262 +  {
2263 +    n = this->preview_size - this->curpos;
2264 +    if (n > (len - total))
2265 +      n = len - total;
2266 +#ifdef LOG_READ
2267 +    lprintf ("%lld bytes from preview (which has %lld bytes)\n",
2268 +            n, this->preview_size);
2269 +#endif
2270 +    memcpy (&buf[total], &this->preview[this->curpos], n);
2271 +    this->curpos += n;
2272 +    total += n;
2273 +  }
2274 +   
2275 +  if( (len-total) > 0 )
2276 +  {
2277 +    int retries = 0;
2278 +    do
2279 +    {
2280 +      n = vdr_read_abort (this->stream, this->fh, &buf[total], len-total);
2281 +      if (0 == n)
2282 +        lprintf("read 0, retries: %d\n", retries);
2283 +    }
2284 +    while (0 == n
2285 +           && !this->stream_external
2286 +           && _x_continue_stream_processing(this->stream)
2287 +           && 200 > retries++); /* 200 * 50ms */
2288 +#ifdef LOG_READ      
2289 +    lprintf ("got %lld bytes (%lld/%lld bytes read)\n",
2290 +            n,total,len);
2291 +#endif
2292 +    if (n < 0)
2293 +    {
2294 +      _x_message(this->stream, XINE_MSG_READ_ERROR, NULL);
2295 +      return 0;
2296 +    }
2297 +
2298 +    this->curpos += n;
2299 +    total += n;
2300 +  }
2301 +  return total;
2302 +}
2303 +
2304 +static buf_element_t *vdr_plugin_read_block(input_plugin_t *this_gen, fifo_buffer_t *fifo, 
2305 +                                            off_t todo)
2306 +{
2307 +  off_t          total_bytes;
2308 +  buf_element_t *buf = fifo->buffer_pool_alloc(fifo);
2309 +
2310 +  buf->content = buf->mem;
2311 +  buf->type = BUF_DEMUX_BLOCK;
2312 +
2313 +  total_bytes = vdr_plugin_read(this_gen, (char *)buf->content, todo);
2314 +
2315 +  if (total_bytes != todo)
2316 +  {
2317 +    buf->free_buffer(buf);
2318 +    return NULL;
2319 +  }
2320 +
2321 +  buf->size = total_bytes;
2322 +
2323 +  return buf;
2324 +}
2325 +
2326 +/* forward reference */
2327 +static off_t vdr_plugin_get_current_pos(input_plugin_t *this_gen);
2328 +
2329 +static off_t vdr_plugin_seek(input_plugin_t *this_gen, off_t offset, int origin)
2330 +{
2331 +  vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
2332 +
2333 +  lprintf("seek %lld offset, %d origin...\n",
2334 +          offset, origin);
2335 +
2336 +  if ((origin == SEEK_CUR) && (offset >= 0))
2337 +  {
2338 +    for ( ; ((int)offset) - BUF_SIZE > 0; offset -= BUF_SIZE)
2339 +    {
2340 +      if (!this_gen->read(this_gen, this->seek_buf, BUF_SIZE))
2341 +        return this->curpos;
2342 +    }
2343 +
2344 +    this_gen->read (this_gen, this->seek_buf, offset);
2345 +  }
2346 +
2347 +  if (origin == SEEK_SET)
2348 +  {
2349 +    if (offset < this->curpos)
2350 +    {
2351 +      if (this->curpos <= this->preview_size) 
2352 +        this->curpos = offset;
2353 +      else
2354 +        lprintf("cannot seek back! (%lld > %lld)\n", this->curpos, offset);
2355 +    }
2356 +    else
2357 +    {
2358 +      offset -= this->curpos;
2359 +
2360 +      for ( ; ((int)offset) - BUF_SIZE > 0; offset -= BUF_SIZE)
2361 +      {
2362 +        if (!this_gen->read(this_gen, this->seek_buf, BUF_SIZE))
2363 +          return this->curpos;
2364 +      }
2365 +
2366 +      this_gen->read(this_gen, this->seek_buf, offset);
2367 +    }
2368 +  }
2369 +
2370 +  return this->curpos;
2371 +}
2372 +
2373 +static off_t vdr_plugin_get_length(input_plugin_t *this_gen)
2374 +{
2375 +  return 0;
2376 +}
2377 +
2378 +static uint32_t vdr_plugin_get_capabilities(input_plugin_t *this_gen)
2379 +{
2380 +  return INPUT_CAP_NOCAP; /* INPUT_CAP_PREVIEW; */
2381 +}
2382 +
2383 +static uint32_t vdr_plugin_get_blocksize(input_plugin_t *this_gen)
2384 +{
2385 +  return 0;
2386 +}
2387 +
2388 +static off_t vdr_plugin_get_current_pos(input_plugin_t *this_gen)
2389 +{
2390 +  vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
2391 +
2392 +  return this->curpos;
2393 +}
2394 +
2395 +static char* vdr_plugin_get_mrl(input_plugin_t *this_gen)
2396 +{
2397 +  vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
2398 +
2399 +  return this->mrl;
2400 +}
2401 +
2402 +static void vdr_plugin_dispose(input_plugin_t *this_gen)
2403 +{
2404 +  vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
2405 +  int i;
2406 +
2407 +  external_stream_stop(this);
2408 +
2409 +  if (this->event_queue)
2410 +    xine_event_dispose_queue(this->event_queue);
2411 +
2412 +  if (this->rpc_thread)
2413 +  {
2414 +    struct timespec abstime;
2415 +    int ms_to_time_out = 10000;
2416 +
2417 +    xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _(LOG_MODULE ": shutting down rpc thread (timeout: %d ms) ...\n"), ms_to_time_out);
2418 +
2419 +    pthread_mutex_lock(&this->rpc_thread_shutdown_lock);
2420 +
2421 +    if (this->rpc_thread_shutdown > -1)
2422 +    {
2423 +      this->rpc_thread_shutdown = 1;
2424 +      
2425 +      {
2426 +        struct timeval now;
2427 +        gettimeofday(&now, 0);
2428 +        
2429 +        abstime.tv_sec = now.tv_sec + ms_to_time_out / 1000;
2430 +        abstime.tv_nsec = now.tv_usec * 1000 + (ms_to_time_out % 1000) * 1e6;
2431 +        
2432 +        if (abstime.tv_nsec > 1e9)
2433 +        {
2434 +          abstime.tv_nsec -= 1e9;
2435 +          abstime.tv_sec++;
2436 +        }
2437 +      }
2438 +      
2439 +      if (0 != pthread_cond_timedwait(&this->rpc_thread_shutdown_cond, &this->rpc_thread_shutdown_lock, &abstime))
2440 +      {
2441 +        xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _(LOG_MODULE ": cancelling rpc thread in function %d...\n"), this->cur_func);
2442 +        pthread_cancel(this->rpc_thread);
2443 +      }
2444 +    }
2445 +    
2446 +    pthread_mutex_unlock(&this->rpc_thread_shutdown_lock);
2447 +    
2448 +    xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _(LOG_MODULE ": joining rpc thread ...\n"));
2449 +    pthread_join(this->rpc_thread, 0);
2450 +    xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _(LOG_MODULE ": rpc thread joined.\n"));
2451 +  }
2452 +
2453 +  pthread_cond_destroy(&this->rpc_thread_shutdown_cond);
2454 +  pthread_mutex_destroy(&this->rpc_thread_shutdown_lock);
2455 +  
2456 +  if (this->fh_result != -1)
2457 +    close(this->fh_result);
2458 +  
2459 +  if (this->fh_control != -1)
2460 +    close(this->fh_control);
2461 +
2462 +  if (this->fh_event != -1)
2463 +    close(this->fh_event);
2464 +  
2465 +  for (i = 0; i < VDR_MAX_NUM_WINDOWS; i++)
2466 +  {
2467 +    if (0 == this->osd_window[ i ])
2468 +      continue;
2469 +
2470 +    xine_osd_hide(this->osd_window[ i ], 0);
2471 +    xine_osd_free(this->osd_window[ i ]);
2472 +  }
2473 +
2474 +  if (this->osd_buffer)
2475 +    free(this->osd_buffer);
2476 +  
2477 +  if ((this->fh != STDIN_FILENO) && (this->fh != -1))
2478 +    close(this->fh);
2479 +
2480 +  free(this->mrl);
2481 +  free(this);
2482 +}
2483 +
2484 +static int vdr_plugin_get_optional_data(input_plugin_t *this_gen, 
2485 +                                        void *data, int data_type)
2486 +{
2487 +  vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
2488 +  int preview_size = (this->preview_size > MAX_PREVIEW_SIZE) ? MAX_PREVIEW_SIZE : this->preview_size;
2489 +/*
2490 +  switch (data_type)
2491 +  {
2492 +  case INPUT_OPTIONAL_DATA_PREVIEW:
2493 +    memcpy (data, this->preview, preview_size);
2494 +    return preview_size;
2495 +  }
2496 +*/  
2497 +  return INPUT_OPTIONAL_UNSUPPORTED;
2498 +}
2499 +
2500 +static uint8_t preview_mpg_data[] =
2501 +{
2502 +/* 0x0000 */ 0x00, 0x00, 0x01, 0xb3, 0x2d, 0x02, 0x40, 0x23, 0x12, 0x4f, 0xa3, 0x80, 0x00, 0x00, 0x01, 0xb5,
2503 +/* 0x0010 */ 0x14, 0x82, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0xb5, 0x23, 0x05, 0x05, 0x05, 0x0b, 0x42,
2504 +/* 0x0020 */ 0x12, 0x00, 0x00, 0x00, 0x01, 0xb8, 0x00, 0x08, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0f,
2505 +/* 0x0030 */ 0xff, 0xf8, 0x00, 0x00, 0x01, 0xb5, 0x8f, 0xff, 0xf7, 0xdd, 0x80, 0x00, 0x00, 0x01, 0x01, 0x0b,
2506 +/* 0x0040 */ 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2507 +/* 0x0050 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2508 +/* 0x0060 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2509 +/* 0x0070 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2510 +/* 0x0080 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2511 +/* 0x0090 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2512 +/* 0x00a0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2513 +/* 0x00b0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2514 +/* 0x00c0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2515 +/* 0x00d0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2516 +/* 0x00e0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2517 +/* 0x00f0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2518 +/* 0x0100 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2519 +/* 0x0110 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2520 +/* 0x0120 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00,
2521 +/* 0x0130 */ 0x01, 0x02, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2522 +/* 0x0140 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2523 +/* 0x0150 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2524 +/* 0x0160 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2525 +/* 0x0170 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2526 +/* 0x0180 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2527 +/* 0x0190 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2528 +/* 0x01a0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2529 +/* 0x01b0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2530 +/* 0x01c0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2531 +/* 0x01d0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2532 +/* 0x01e0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2533 +/* 0x01f0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2534 +/* 0x0200 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2535 +/* 0x0210 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2536 +/* 0x0220 */ 0x60, 0x00, 0x00, 0x01, 0x03, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2537 +/* 0x0230 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2538 +/* 0x0240 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2539 +/* 0x0250 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2540 +/* 0x0260 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2541 +/* 0x0270 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2542 +/* 0x0280 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2543 +/* 0x0290 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2544 +/* 0x02a0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2545 +/* 0x02b0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2546 +/* 0x02c0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2547 +/* 0x02d0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2548 +/* 0x02e0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2549 +/* 0x02f0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2550 +/* 0x0300 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2551 +/* 0x0310 */ 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x04, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2552 +/* 0x0320 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2553 +/* 0x0330 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2554 +/* 0x0340 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2555 +/* 0x0350 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2556 +/* 0x0360 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2557 +/* 0x0370 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2558 +/* 0x0380 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2559 +/* 0x0390 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2560 +/* 0x03a0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2561 +/* 0x03b0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2562 +/* 0x03c0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2563 +/* 0x03d0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2564 +/* 0x03e0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2565 +/* 0x03f0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2566 +/* 0x0400 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x05, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3,
2567 +/* 0x0410 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2568 +/* 0x0420 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2569 +/* 0x0430 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2570 +/* 0x0440 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2571 +/* 0x0450 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2572 +/* 0x0460 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2573 +/* 0x0470 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2574 +/* 0x0480 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2575 +/* 0x0490 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2576 +/* 0x04a0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2577 +/* 0x04b0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2578 +/* 0x04c0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2579 +/* 0x04d0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2580 +/* 0x04e0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2581 +/* 0x04f0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x06, 0x0b, 0xfc,
2582 +/* 0x0500 */ 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2583 +/* 0x0510 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2584 +/* 0x0520 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2585 +/* 0x0530 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2586 +/* 0x0540 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2587 +/* 0x0550 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2588 +/* 0x0560 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2589 +/* 0x0570 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2590 +/* 0x0580 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2591 +/* 0x0590 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2592 +/* 0x05a0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2593 +/* 0x05b0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2594 +/* 0x05c0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2595 +/* 0x05d0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2596 +/* 0x05e0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01,
2597 +/* 0x05f0 */ 0x07, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2598 +/* 0x0600 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2599 +/* 0x0610 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2600 +/* 0x0620 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2601 +/* 0x0630 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2602 +/* 0x0640 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2603 +/* 0x0650 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2604 +/* 0x0660 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2605 +/* 0x0670 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2606 +/* 0x0680 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2607 +/* 0x0690 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2608 +/* 0x06a0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2609 +/* 0x06b0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2610 +/* 0x06c0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2611 +/* 0x06d0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60,
2612 +/* 0x06e0 */ 0x00, 0x00, 0x01, 0x08, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2613 +/* 0x06f0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2614 +/* 0x0700 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2615 +/* 0x0710 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2616 +/* 0x0720 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2617 +/* 0x0730 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2618 +/* 0x0740 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2619 +/* 0x0750 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2620 +/* 0x0760 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2621 +/* 0x0770 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2622 +/* 0x0780 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2623 +/* 0x0790 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2624 +/* 0x07a0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2625 +/* 0x07b0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2626 +/* 0x07c0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2627 +/* 0x07d0 */ 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x09, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2628 +/* 0x07e0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2629 +/* 0x07f0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2630 +/* 0x0800 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2631 +/* 0x0810 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2632 +/* 0x0820 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2633 +/* 0x0830 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2634 +/* 0x0840 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2635 +/* 0x0850 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2636 +/* 0x0860 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2637 +/* 0x0870 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2638 +/* 0x0880 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2639 +/* 0x0890 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2640 +/* 0x08a0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2641 +/* 0x08b0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2642 +/* 0x08c0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x0a, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46,
2643 +/* 0x08d0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2644 +/* 0x08e0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2645 +/* 0x08f0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2646 +/* 0x0900 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2647 +/* 0x0910 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2648 +/* 0x0920 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2649 +/* 0x0930 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2650 +/* 0x0940 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2651 +/* 0x0950 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2652 +/* 0x0960 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2653 +/* 0x0970 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2654 +/* 0x0980 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2655 +/* 0x0990 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2656 +/* 0x09a0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2657 +/* 0x09b0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x0b, 0x0b, 0xfc, 0x3e,
2658 +/* 0x09c0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2659 +/* 0x09d0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2660 +/* 0x09e0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2661 +/* 0x09f0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2662 +/* 0x0a00 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2663 +/* 0x0a10 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2664 +/* 0x0a20 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2665 +/* 0x0a30 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2666 +/* 0x0a40 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2667 +/* 0x0a50 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2668 +/* 0x0a60 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2669 +/* 0x0a70 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2670 +/* 0x0a80 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2671 +/* 0x0a90 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2672 +/* 0x0aa0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x0c,
2673 +/* 0x0ab0 */ 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2674 +/* 0x0ac0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2675 +/* 0x0ad0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2676 +/* 0x0ae0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2677 +/* 0x0af0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2678 +/* 0x0b00 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2679 +/* 0x0b10 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2680 +/* 0x0b20 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2681 +/* 0x0b30 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2682 +/* 0x0b40 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2683 +/* 0x0b50 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2684 +/* 0x0b60 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2685 +/* 0x0b70 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2686 +/* 0x0b80 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2687 +/* 0x0b90 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00,
2688 +/* 0x0ba0 */ 0x00, 0x01, 0x0d, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2689 +/* 0x0bb0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2690 +/* 0x0bc0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2691 +/* 0x0bd0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2692 +/* 0x0be0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2693 +/* 0x0bf0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2694 +/* 0x0c00 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2695 +/* 0x0c10 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2696 +/* 0x0c20 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2697 +/* 0x0c30 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2698 +/* 0x0c40 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2699 +/* 0x0c50 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2700 +/* 0x0c60 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2701 +/* 0x0c70 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2702 +/* 0x0c80 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2703 +/* 0x0c90 */ 0x18, 0x60, 0x00, 0x00, 0x01, 0x0e, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2704 +/* 0x0ca0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2705 +/* 0x0cb0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2706 +/* 0x0cc0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2707 +/* 0x0cd0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2708 +/* 0x0ce0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2709 +/* 0x0cf0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2710 +/* 0x0d00 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2711 +/* 0x0d10 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2712 +/* 0x0d20 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2713 +/* 0x0d30 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2714 +/* 0x0d40 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2715 +/* 0x0d50 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2716 +/* 0x0d60 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2717 +/* 0x0d70 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2718 +/* 0x0d80 */ 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x0f, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18,
2719 +/* 0x0d90 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2720 +/* 0x0da0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2721 +/* 0x0db0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2722 +/* 0x0dc0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2723 +/* 0x0dd0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2724 +/* 0x0de0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2725 +/* 0x0df0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2726 +/* 0x0e00 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2727 +/* 0x0e10 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2728 +/* 0x0e20 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2729 +/* 0x0e30 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2730 +/* 0x0e40 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2731 +/* 0x0e50 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2732 +/* 0x0e60 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2733 +/* 0x0e70 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x10, 0x0b, 0xfc, 0x3e, 0xd1,
2734 +/* 0x0e80 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2735 +/* 0x0e90 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2736 +/* 0x0ea0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2737 +/* 0x0eb0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2738 +/* 0x0ec0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2739 +/* 0x0ed0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2740 +/* 0x0ee0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2741 +/* 0x0ef0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2742 +/* 0x0f00 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2743 +/* 0x0f10 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2744 +/* 0x0f20 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2745 +/* 0x0f30 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2746 +/* 0x0f40 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2747 +/* 0x0f50 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2748 +/* 0x0f60 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x11, 0x0b,
2749 +/* 0x0f70 */ 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2750 +/* 0x0f80 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2751 +/* 0x0f90 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2752 +/* 0x0fa0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2753 +/* 0x0fb0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2754 +/* 0x0fc0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2755 +/* 0x0fd0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2756 +/* 0x0fe0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2757 +/* 0x0ff0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2758 +/* 0x1000 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2759 +/* 0x1010 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2760 +/* 0x1020 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2761 +/* 0x1030 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2762 +/* 0x1040 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2763 +/* 0x1050 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00,
2764 +/* 0x1060 */ 0x01, 0x12, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2765 +/* 0x1070 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2766 +/* 0x1080 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2767 +/* 0x1090 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2768 +/* 0x10a0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2769 +/* 0x10b0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2770 +/* 0x10c0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2771 +/* 0x10d0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2772 +/* 0x10e0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2773 +/* 0x10f0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2774 +/* 0x1100 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2775 +/* 0x1110 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2776 +/* 0x1120 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2777 +/* 0x1130 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2778 +/* 0x1140 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2779 +/* 0x1150 */ 0x60, 0x00, 0x00, 0x01, 0x13, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2780 +/* 0x1160 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2781 +/* 0x1170 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2782 +/* 0x1180 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2783 +/* 0x1190 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2784 +/* 0x11a0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2785 +/* 0x11b0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2786 +/* 0x11c0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2787 +/* 0x11d0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2788 +/* 0x11e0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2789 +/* 0x11f0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2790 +/* 0x1200 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2791 +/* 0x1210 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2792 +/* 0x1220 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2793 +/* 0x1230 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2794 +/* 0x1240 */ 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x14, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2795 +/* 0x1250 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2796 +/* 0x1260 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2797 +/* 0x1270 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2798 +/* 0x1280 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2799 +/* 0x1290 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2800 +/* 0x12a0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2801 +/* 0x12b0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2802 +/* 0x12c0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2803 +/* 0x12d0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2804 +/* 0x12e0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2805 +/* 0x12f0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2806 +/* 0x1300 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2807 +/* 0x1310 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2808 +/* 0x1320 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2809 +/* 0x1330 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x15, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3,
2810 +/* 0x1340 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2811 +/* 0x1350 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2812 +/* 0x1360 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2813 +/* 0x1370 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2814 +/* 0x1380 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2815 +/* 0x1390 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2816 +/* 0x13a0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2817 +/* 0x13b0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2818 +/* 0x13c0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2819 +/* 0x13d0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2820 +/* 0x13e0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2821 +/* 0x13f0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2822 +/* 0x1400 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2823 +/* 0x1410 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2824 +/* 0x1420 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x16, 0x0b, 0xfc,
2825 +/* 0x1430 */ 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2826 +/* 0x1440 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2827 +/* 0x1450 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2828 +/* 0x1460 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2829 +/* 0x1470 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2830 +/* 0x1480 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2831 +/* 0x1490 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2832 +/* 0x14a0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2833 +/* 0x14b0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2834 +/* 0x14c0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2835 +/* 0x14d0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2836 +/* 0x14e0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2837 +/* 0x14f0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2838 +/* 0x1500 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2839 +/* 0x1510 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01,
2840 +/* 0x1520 */ 0x17, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2841 +/* 0x1530 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2842 +/* 0x1540 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2843 +/* 0x1550 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2844 +/* 0x1560 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2845 +/* 0x1570 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2846 +/* 0x1580 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2847 +/* 0x1590 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2848 +/* 0x15a0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2849 +/* 0x15b0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2850 +/* 0x15c0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2851 +/* 0x15d0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2852 +/* 0x15e0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2853 +/* 0x15f0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2854 +/* 0x1600 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60,
2855 +/* 0x1610 */ 0x00, 0x00, 0x01, 0x18, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2856 +/* 0x1620 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2857 +/* 0x1630 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2858 +/* 0x1640 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2859 +/* 0x1650 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2860 +/* 0x1660 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2861 +/* 0x1670 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2862 +/* 0x1680 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2863 +/* 0x1690 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2864 +/* 0x16a0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2865 +/* 0x16b0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2866 +/* 0x16c0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2867 +/* 0x16d0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2868 +/* 0x16e0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2869 +/* 0x16f0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2870 +/* 0x1700 */ 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x19, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2871 +/* 0x1710 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2872 +/* 0x1720 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2873 +/* 0x1730 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2874 +/* 0x1740 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2875 +/* 0x1750 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2876 +/* 0x1760 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2877 +/* 0x1770 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2878 +/* 0x1780 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2879 +/* 0x1790 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2880 +/* 0x17a0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2881 +/* 0x17b0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2882 +/* 0x17c0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2883 +/* 0x17d0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2884 +/* 0x17e0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2885 +/* 0x17f0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x1a, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46,
2886 +/* 0x1800 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2887 +/* 0x1810 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2888 +/* 0x1820 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2889 +/* 0x1830 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2890 +/* 0x1840 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2891 +/* 0x1850 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2892 +/* 0x1860 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2893 +/* 0x1870 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2894 +/* 0x1880 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2895 +/* 0x1890 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2896 +/* 0x18a0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2897 +/* 0x18b0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2898 +/* 0x18c0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2899 +/* 0x18d0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2900 +/* 0x18e0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x1b, 0x0b, 0xfc, 0x3e,
2901 +/* 0x18f0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2902 +/* 0x1900 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2903 +/* 0x1910 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2904 +/* 0x1920 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2905 +/* 0x1930 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2906 +/* 0x1940 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2907 +/* 0x1950 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2908 +/* 0x1960 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2909 +/* 0x1970 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2910 +/* 0x1980 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2911 +/* 0x1990 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2912 +/* 0x19a0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2913 +/* 0x19b0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2914 +/* 0x19c0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2915 +/* 0x19d0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x1c,
2916 +/* 0x19e0 */ 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2917 +/* 0x19f0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2918 +/* 0x1a00 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2919 +/* 0x1a10 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2920 +/* 0x1a20 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2921 +/* 0x1a30 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2922 +/* 0x1a40 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2923 +/* 0x1a50 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2924 +/* 0x1a60 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2925 +/* 0x1a70 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2926 +/* 0x1a80 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2927 +/* 0x1a90 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2928 +/* 0x1aa0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2929 +/* 0x1ab0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2930 +/* 0x1ac0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00,
2931 +/* 0x1ad0 */ 0x00, 0x01, 0x1d, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2932 +/* 0x1ae0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2933 +/* 0x1af0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2934 +/* 0x1b00 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2935 +/* 0x1b10 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2936 +/* 0x1b20 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2937 +/* 0x1b30 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2938 +/* 0x1b40 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2939 +/* 0x1b50 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2940 +/* 0x1b60 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2941 +/* 0x1b70 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2942 +/* 0x1b80 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2943 +/* 0x1b90 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2944 +/* 0x1ba0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2945 +/* 0x1bb0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2946 +/* 0x1bc0 */ 0x18, 0x60, 0x00, 0x00, 0x01, 0x1e, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2947 +/* 0x1bd0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2948 +/* 0x1be0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2949 +/* 0x1bf0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2950 +/* 0x1c00 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2951 +/* 0x1c10 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2952 +/* 0x1c20 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2953 +/* 0x1c30 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2954 +/* 0x1c40 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2955 +/* 0x1c50 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2956 +/* 0x1c60 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2957 +/* 0x1c70 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2958 +/* 0x1c80 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2959 +/* 0x1c90 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2960 +/* 0x1ca0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2961 +/* 0x1cb0 */ 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x1f, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18,
2962 +/* 0x1cc0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2963 +/* 0x1cd0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2964 +/* 0x1ce0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2965 +/* 0x1cf0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2966 +/* 0x1d00 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
2967 +/* 0x1d10 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
2968 +/* 0x1d20 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
2969 +/* 0x1d30 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
2970 +/* 0x1d40 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
2971 +/* 0x1d50 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2972 +/* 0x1d60 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2973 +/* 0x1d70 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2974 +/* 0x1d80 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2975 +/* 0x1d90 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2976 +/* 0x1da0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x20, 0x0b, 0xfc, 0x3e, 0xd1,
2977 +/* 0x1db0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
2978 +/* 0x1dc0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
2979 +/* 0x1dd0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
2980 +/* 0x1de0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
2981 +/* 0x1df0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
2982 +/* 0x1e00 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
2983 +/* 0x1e10 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
2984 +/* 0x1e20 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
2985 +/* 0x1e30 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
2986 +/* 0x1e40 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2987 +/* 0x1e50 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2988 +/* 0x1e60 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2989 +/* 0x1e70 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2990 +/* 0x1e80 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2991 +/* 0x1e90 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x21, 0x0b,
2992 +/* 0x1ea0 */ 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
2993 +/* 0x1eb0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
2994 +/* 0x1ec0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
2995 +/* 0x1ed0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
2996 +/* 0x1ee0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
2997 +/* 0x1ef0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
2998 +/* 0x1f00 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
2999 +/* 0x1f10 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
3000 +/* 0x1f20 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
3001 +/* 0x1f30 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
3002 +/* 0x1f40 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
3003 +/* 0x1f50 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
3004 +/* 0x1f60 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
3005 +/* 0x1f70 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
3006 +/* 0x1f80 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00,
3007 +/* 0x1f90 */ 0x01, 0x22, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
3008 +/* 0x1fa0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
3009 +/* 0x1fb0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
3010 +/* 0x1fc0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
3011 +/* 0x1fd0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
3012 +/* 0x1fe0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
3013 +/* 0x1ff0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
3014 +/* 0x2000 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
3015 +/* 0x2010 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
3016 +/* 0x2020 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
3017 +/* 0x2030 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
3018 +/* 0x2040 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
3019 +/* 0x2050 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
3020 +/* 0x2060 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
3021 +/* 0x2070 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
3022 +/* 0x2080 */ 0x60, 0x00, 0x00, 0x01, 0x23, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
3023 +/* 0x2090 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
3024 +/* 0x20a0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
3025 +/* 0x20b0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
3026 +/* 0x20c0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
3027 +/* 0x20d0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
3028 +/* 0x20e0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
3029 +/* 0x20f0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
3030 +/* 0x2100 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
3031 +/* 0x2110 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
3032 +/* 0x2120 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
3033 +/* 0x2130 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
3034 +/* 0x2140 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
3035 +/* 0x2150 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
3036 +/* 0x2160 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
3037 +/* 0x2170 */ 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x24, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
3038 +/* 0x2180 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
3039 +/* 0x2190 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
3040 +/* 0x21a0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
3041 +/* 0x21b0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
3042 +/* 0x21c0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
3043 +/* 0x21d0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
3044 +/* 0x21e0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
3045 +/* 0x21f0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
3046 +/* 0x2200 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
3047 +/* 0x2210 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
3048 +/* 0x2220 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
3049 +/* 0x2230 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
3050 +/* 0x2240 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
3051 +/* 0x2250 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
3052 +/* 0x2260 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0xb7
3053 +/* 0x226b */
3054 +};
3055 +
3056 +static uint8_t preview_data[ sizeof (preview_mpg_data) + ((sizeof (preview_mpg_data) - 1) / (2048 - 6 - 3) + 1) * (6 + 3) ];
3057 +
3058 +static int vdr_plugin_open(input_plugin_t *this_gen)
3059 +{
3060 +  vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
3061 +
3062 +  lprintf("trying to open '%s'...\n", this->mrl);
3063 +
3064 +  if (this->fh == -1)
3065 +  {
3066 +    char *filename;
3067 +    int err = 0;
3068 +
3069 +    filename = (char *)&this->mrl[ 4 ];
3070 +    this->fh = open(filename, O_RDONLY | O_NONBLOCK);
3071 +
3072 +    lprintf("filename '%s'\n", filename);
3073 +
3074 +    if (this->fh == -1)
3075 +    {
3076 +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
3077 +              _(LOG_MODULE ": failed to open '%s' (%s)\n"),
3078 +              filename,
3079 +              strerror(errno));
3080 +      
3081 +      return 0;
3082 +    }
3083 +
3084 +    {
3085 +      struct pollfd poll_fh = { this->fh, POLLIN, 0 };
3086 +      
3087 +      int r = poll(&poll_fh, 1, 300);      
3088 +      if (1 != r)
3089 +      {
3090 +        xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
3091 +                _(LOG_MODULE ": failed to open '%s' (%s)\n"),
3092 +                filename,
3093 +                _("timeout expired during setup phase"));
3094 +        
3095 +        return 0;
3096 +      }
3097 +    }
3098 +    
3099 +    fcntl(this->fh, F_SETFL, ~O_NONBLOCK & fcntl(this->fh, F_GETFL, 0));
3100 +    
3101 +    {
3102 +      char *filename_control = 0;
3103 +      asprintf(&filename_control, "%s.control", filename);
3104 +
3105 +      this->fh_control = open(filename_control, O_RDONLY);
3106 +
3107 +      if (this->fh_control == -1) {
3108 +        xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
3109 +                _(LOG_MODULE ": failed to open '%s' (%s)\n"),
3110 +                filename_control,
3111 +                strerror(errno));
3112 +
3113 +        free(filename_control);
3114 +        return 0;
3115 +      }
3116 +
3117 +      free(filename_control);      
3118 +    }
3119 +
3120 +    {
3121 +      char *filename_result = 0;
3122 +      asprintf(&filename_result, "%s.result", filename);
3123 +
3124 +      this->fh_result = open(filename_result, O_WRONLY);
3125 +
3126 +      if (this->fh_result == -1) {
3127 +        perror("failed");
3128 +        
3129 +        xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
3130 +                _(LOG_MODULE ": failed to open '%s' (%s)\n"),
3131 +                filename_result,
3132 +                strerror(errno));
3133 +        
3134 +        free(filename_result);
3135 +        return 0;
3136 +      }
3137 +
3138 +      free(filename_result);
3139 +    }
3140 +
3141 +    {
3142 +      char *filename_event = 0;
3143 +      asprintf(&filename_event, "%s.event", filename);
3144 +
3145 +      this->fh_event = open(filename_event, O_WRONLY);
3146 +
3147 +      if (this->fh_event == -1) {
3148 +        perror("failed");
3149 +
3150 +        xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
3151 +                _(LOG_MODULE ": failed to open '%s' (%s)\n"),
3152 +                filename_event,
3153 +                strerror(errno));
3154 +        
3155 +        free(filename_event);
3156 +        return 0;
3157 +      }
3158 +
3159 +      free(filename_event);
3160 +    }
3161 +
3162 +    this->rpc_thread_shutdown = 0;
3163 +    if ((err = pthread_create(&this->rpc_thread, NULL,
3164 +                              vdr_rpc_thread_loop, (void *)this)) != 0)
3165 +    {
3166 +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, 
3167 +              _(LOG_MODULE ": can't create new thread (%s)\n"),
3168 +              strerror(err));
3169 +      
3170 +      return 0;
3171 +    }
3172 +  }
3173 +
3174 +
3175 +  /*
3176 +   * mrl accepted and opened successfully at this point
3177 +   *
3178 +   * => create plugin instance
3179 +   */
3180 +
3181 +  /*
3182 +   * fill preview buffer
3183 +   */
3184 +
3185 +  if (!preview_data[ 2 ])
3186 +  {
3187 +    uint8_t *src = preview_mpg_data;
3188 +    uint8_t *dst = preview_data;
3189 +    int todo = sizeof (preview_mpg_data);
3190 +    int bite = 2048 - 6 - 3;
3191 +
3192 +    while (todo > 0)
3193 +    {
3194 +      if (bite > todo)
3195 +        bite = todo;
3196 +
3197 +      *dst++ = 0x00;
3198 +      *dst++ = 0x00;
3199 +      *dst++ = 0x01;
3200 +      *dst++ = 0xe0;
3201 +
3202 +      *dst++ = (bite + 3) >> 8;
3203 +      *dst++ = (bite + 3) & 0xff;
3204 +
3205 +      *dst++ = 0x80;
3206 +      *dst++ = 0x00;
3207 +      *dst++ = 0x00;
3208 +
3209 +      memcpy(dst, src, bite);
3210 +      dst += bite;
3211 +      src += bite;
3212 +
3213 +      todo -= bite;
3214 +    }
3215 +  }
3216 +
3217 +  this->preview      = (char *)&preview_data;
3218 +  this->preview_size = 0; /* sizeof (preview_data); */
3219 +  this->curpos       = 0;
3220 +
3221 +  return 1;
3222 +}
3223 +
3224 +static void event_handler(void *user_data, const xine_event_t *event)
3225 +{
3226 +  vdr_input_plugin_t *this = (vdr_input_plugin_t *)user_data;
3227 +  uint32_t key = key_none;
3228 +
3229 +  lprintf("eventHandler(): event->type: %d\n", event->type);
3230 +
3231 +  if (XINE_EVENT_VDR_FRAMESIZECHANGED == event->type)
3232 +  {
3233 +    memcpy(&this->frame_size, event->data, event->data_length);
3234 +
3235 +    if (0 != internal_write_event_frame_size(this))
3236 +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, 
3237 +              _(LOG_MODULE ": input event write: %s.\n"), strerror(errno));
3238 +
3239 +    return;
3240 +  }
3241 +  else if (XINE_EVENT_VDR_PLUGINSTARTED == event->type)
3242 +  {
3243 +    if (0 == event->data_length) /* vdr_video */
3244 +    {
3245 +      xine_event_t event;
3246 +        
3247 +      event.type = XINE_EVENT_VDR_TRICKSPEEDMODE;
3248 +      event.data = 0;
3249 +      event.data_length = this->trick_speed_mode;
3250 +
3251 +      xine_event_send(this->stream, &event);
3252 +    }
3253 +    else if (1 == event->data_length) /* vdr_audio */
3254 +    {
3255 +      xine_event_t event;
3256 +      vdr_select_audio_data_t event_data;
3257 +        
3258 +      event_data.channels = this->audio_channels;
3259 +        
3260 +      event.type = XINE_EVENT_VDR_SELECTAUDIO;
3261 +      event.data = &event_data;
3262 +      event.data_length = sizeof (event_data);
3263 +        
3264 +      xine_event_send(this->stream, &event);
3265 +    }
3266 +    else
3267 +    {
3268 +      fprintf(stderr, "input_vdr: illegal XINE_EVENT_VDR_PLUGINSTARTED: %d\n", event->data_length);
3269 +    }
3270 +  }
3271 +
3272 +  switch (event->type)
3273 +  {
3274 +  case XINE_EVENT_INPUT_UP:            key = key_up;               break;
3275 +  case XINE_EVENT_INPUT_DOWN:          key = key_down;             break;
3276 +  case XINE_EVENT_INPUT_LEFT:          key = key_left;             break;
3277 +  case XINE_EVENT_INPUT_RIGHT:         key = key_right;            break;
3278 +  case XINE_EVENT_INPUT_SELECT:        key = key_ok;               break;
3279 +  case XINE_EVENT_VDR_BACK:            key = key_back;             break;
3280 +  case XINE_EVENT_VDR_CHANNELPLUS:     key = key_channel_plus;     break;
3281 +  case XINE_EVENT_VDR_CHANNELMINUS:    key = key_channel_minus;    break;
3282 +  case XINE_EVENT_VDR_RED:             key = key_red;              break;
3283 +  case XINE_EVENT_VDR_GREEN:           key = key_green;            break;
3284 +  case XINE_EVENT_VDR_YELLOW:          key = key_yellow;           break;
3285 +  case XINE_EVENT_VDR_BLUE:            key = key_blue;             break;
3286 +  case XINE_EVENT_VDR_PLAY:            key = key_play;             break;
3287 +  case XINE_EVENT_VDR_PAUSE:           key = key_pause;            break;
3288 +  case XINE_EVENT_VDR_STOP:            key = key_stop;             break;
3289 +  case XINE_EVENT_VDR_RECORD:          key = key_record;           break;
3290 +  case XINE_EVENT_VDR_FASTFWD:         key = key_fast_fwd;         break;
3291 +  case XINE_EVENT_VDR_FASTREW:         key = key_fast_rew;         break;
3292 +  case XINE_EVENT_VDR_POWER:           key = key_power;            break;
3293 +  case XINE_EVENT_VDR_SCHEDULE:        key = key_schedule;         break;
3294 +  case XINE_EVENT_VDR_CHANNELS:        key = key_channels;         break;
3295 +  case XINE_EVENT_VDR_TIMERS:          key = key_timers;           break;
3296 +  case XINE_EVENT_VDR_RECORDINGS:      key = key_recordings;       break;
3297 +  case XINE_EVENT_INPUT_MENU1:         key = key_menu;             break;
3298 +  case XINE_EVENT_VDR_SETUP:           key = key_setup;            break;
3299 +  case XINE_EVENT_VDR_COMMANDS:        key = key_commands;         break;
3300 +  case XINE_EVENT_INPUT_NUMBER_0:      key = key_0;                break;
3301 +  case XINE_EVENT_INPUT_NUMBER_1:      key = key_1;                break;
3302 +  case XINE_EVENT_INPUT_NUMBER_2:      key = key_2;                break;
3303 +  case XINE_EVENT_INPUT_NUMBER_3:      key = key_3;                break;
3304 +  case XINE_EVENT_INPUT_NUMBER_4:      key = key_4;                break;
3305 +  case XINE_EVENT_INPUT_NUMBER_5:      key = key_5;                break;
3306 +  case XINE_EVENT_INPUT_NUMBER_6:      key = key_6;                break;
3307 +  case XINE_EVENT_INPUT_NUMBER_7:      key = key_7;                break;
3308 +  case XINE_EVENT_INPUT_NUMBER_8:      key = key_8;                break;
3309 +  case XINE_EVENT_INPUT_NUMBER_9:      key = key_9;                break;
3310 +  case XINE_EVENT_VDR_USER1:           key = key_user1;            break;
3311 +  case XINE_EVENT_VDR_USER2:           key = key_user2;            break;
3312 +  case XINE_EVENT_VDR_USER3:           key = key_user3;            break;
3313 +  case XINE_EVENT_VDR_USER4:           key = key_user4;            break;
3314 +  case XINE_EVENT_VDR_USER5:           key = key_user5;            break;
3315 +  case XINE_EVENT_VDR_USER6:           key = key_user6;            break;
3316 +  case XINE_EVENT_VDR_USER7:           key = key_user7;            break;
3317 +  case XINE_EVENT_VDR_USER8:           key = key_user8;            break;
3318 +  case XINE_EVENT_VDR_USER9:           key = key_user9;            break;
3319 +  case XINE_EVENT_VDR_VOLPLUS:         key = key_volume_plus;      break;
3320 +  case XINE_EVENT_VDR_VOLMINUS:        key = key_volume_minus;     break;
3321 +  case XINE_EVENT_VDR_MUTE:            key = key_mute;             break;
3322 +  case XINE_EVENT_VDR_AUDIO:           key = key_audio;            break;
3323 +  case XINE_EVENT_VDR_INFO:            key = key_info;             break;
3324 +  default:
3325 +    return;
3326 +  }
3327 +
3328 +  if (0 != internal_write_event_key(this, key))
3329 +    xprintf(this->stream->xine, XINE_VERBOSITY_LOG, 
3330 +            _(LOG_MODULE ": input event write: %s.\n"), strerror(errno));
3331 +}
3332 +
3333 +static input_plugin_t *vdr_class_get_instance(input_class_t *cls_gen, xine_stream_t *stream,
3334 +                                               const char *data)
3335 +{
3336 +  vdr_input_plugin_t *this;
3337 +  char               *mrl = strdup(data);
3338 +
3339 +  if (!strncasecmp(mrl, "vdr:/", 5))
3340 +  {
3341 +    lprintf("filename '%s'\n", (char *)&mrl[ 4 ]);
3342 +  }
3343 +  else
3344 +  {
3345 +    free(mrl);
3346 +    return NULL;
3347 +  }
3348 +
3349 +  /*
3350 +   * mrl accepted and opened successfully at this point
3351 +   *
3352 +   * => create plugin instance
3353 +   */
3354 +
3355 +  this = (vdr_input_plugin_t *)xine_xmalloc(sizeof (vdr_input_plugin_t));
3356 +
3357 +  this->stream     = stream;
3358 +  this->curpos     = 0;
3359 +  this->mrl        = mrl;
3360 +  this->fh         = -1;
3361 +  this->fh_control = -1;
3362 +  this->fh_result  = -1;
3363 +  this->fh_event   = -1;
3364 +
3365 +  this->input_plugin.open              = vdr_plugin_open;
3366 +  this->input_plugin.get_capabilities  = vdr_plugin_get_capabilities;
3367 +  this->input_plugin.read              = vdr_plugin_read;
3368 +  this->input_plugin.read_block        = vdr_plugin_read_block;
3369 +  this->input_plugin.seek              = vdr_plugin_seek;
3370 +  this->input_plugin.get_current_pos   = vdr_plugin_get_current_pos;
3371 +  this->input_plugin.get_length        = vdr_plugin_get_length;
3372 +  this->input_plugin.get_blocksize     = vdr_plugin_get_blocksize;
3373 +  this->input_plugin.get_mrl           = vdr_plugin_get_mrl;
3374 +  this->input_plugin.dispose           = vdr_plugin_dispose;
3375 +  this->input_plugin.get_optional_data = vdr_plugin_get_optional_data;
3376 +  this->input_plugin.input_class       = cls_gen;
3377 +
3378 +  this->cur_func = func_unknown;
3379 +  this->cur_size = 0;
3380 +  this->cur_done = 0;
3381 +
3382 +  memset(this->osd_window, 0, sizeof (this->osd_window));
3383 +
3384 +  this->osd_buffer              = 0;
3385 +  this->osd_buffer_size         = 0;
3386 +  this->osd_unscaled_blending   = 0;
3387 +  this->trick_speed_mode        = 0;
3388 +  this->audio_channels          = 0;
3389 +  this->mute_mode               = INPUT_VDR_MUTE_SIMULATE;
3390 +  this->dont_change_xine_volume = 0;
3391 +  this->last_volume             = 0;
3392 +  this->frame_size.x            = 0;
3393 +  this->frame_size.y            = 0;
3394 +  this->frame_size.w            = 0;
3395 +  this->frame_size.h            = 0;
3396 +  
3397 +  this->stream_external      = 0;
3398 +  this->event_queue_external = 0;
3399 +
3400 +  pthread_mutex_init(&this->rpc_thread_shutdown_lock, 0);
3401 +  pthread_cond_init(&this->rpc_thread_shutdown_cond, 0);  
3402 +  
3403 +  this->event_queue = xine_event_new_queue(this->stream);
3404 +  if (this->event_queue)
3405 +    xine_event_create_listener_thread(this->event_queue, event_handler, this);
3406 +
3407 +  return &this->input_plugin;
3408 +}
3409 +
3410 +/*
3411 + * vdr input plugin class stuff
3412 + */
3413 +
3414 +static char *vdr_class_get_description(input_class_t *this_gen)
3415 +{
3416 +  return _("VDR display device plugin");
3417 +}
3418 +
3419 +static const char *vdr_class_get_identifier (input_class_t *this_gen)
3420 +{
3421 +  return "VDR";
3422 +}
3423 +
3424 +static void vdr_class_dispose (input_class_t *this_gen)
3425 +{
3426 +  vdr_input_class_t *this = (vdr_input_class_t *)this_gen;
3427 +
3428 +  free(this);
3429 +}
3430 +
3431 +static char **vdr_class_get_autoplay_list(input_class_t *this_gen,
3432 +                                          int *num_files)
3433 +{
3434 +  vdr_input_class_t *class = (vdr_input_class_t *)this_gen;
3435 +
3436 +  *num_files = 1;
3437 +  return class->mrls;
3438 +}
3439 +
3440 +static void *init_class(xine_t *xine, void *data)
3441 +{
3442 +  vdr_input_class_t *this;
3443 +  
3444 +  lprintf("init_class\n");
3445 +  
3446 +  this = (vdr_input_class_t *)xine_xmalloc(sizeof (vdr_input_class_t));
3447 +  
3448 +  this->xine = xine;
3449 +
3450 +  this->mrls[ 0 ] = "vdr:" VDR_ABS_FIFO_DIR "/stream#demux:mpeg_pes";
3451 +  this->mrls[ 1 ] = 0;
3452 +
3453 +  this->input_class.get_instance      = vdr_class_get_instance;
3454 +  this->input_class.get_identifier    = vdr_class_get_identifier;
3455 +  this->input_class.get_description   = vdr_class_get_description;
3456 +  this->input_class.get_dir           = NULL;
3457 +  this->input_class.get_autoplay_list = vdr_class_get_autoplay_list;
3458 +  this->input_class.dispose           = vdr_class_dispose;
3459 +  this->input_class.eject_media       = NULL;
3460 +
3461 +  return this;
3462 +}
3463 +
3464 +/*
3465 + * exported plugin catalog entry
3466 + */
3467 +
3468 +plugin_info_t xine_plugin_info[] =
3469 +{
3470 +  /* type, API, "name", version, special_info, init_function */
3471 +  { PLUGIN_INPUT, 17, "VDR", XINE_VERSION_CODE, NULL, init_class },
3472 +  { PLUGIN_NONE, 0, "", 0, NULL, NULL }
3473 +};
3474 +
3475 diff -Nurp ../xine-cvs/xine-lib/src/vdr/input_vdr.h xine-lib/src/vdr/input_vdr.h
3476 --- ../xine-cvs/xine-lib/src/vdr/input_vdr.h    1970-01-01 01:00:00.000000000 +0100
3477 +++ xine-lib/src/vdr/input_vdr.h        2006-03-15 23:06:39.000000000 +0100
3478 @@ -0,0 +1,585 @@
3479 +
3480 +#ifndef __INPUT_VDR_H
3481 +#define __INPUT_VDR_H
3482 +
3483 +
3484 +#define XINE_INPUT_VDR_VERSION 708
3485 +
3486 +
3487 +enum funcs
3488 +{
3489 +  func_unknown = -1
3490 +  , func_nop
3491 +  , func_osd_new
3492 +  , func_osd_free
3493 +  , func_osd_show
3494 +  , func_osd_hide
3495 +  , func_osd_set_position
3496 +  , func_osd_draw_bitmap
3497 +  , func_set_color
3498 +  , func_clear
3499 +  , func_mute
3500 +  , func_set_volume
3501 +  , func_set_speed
3502 +  , func_set_prebuffer
3503 +  , func_metronom
3504 +  , func_start
3505 +  , func_wait
3506 +  , func_setup
3507 +  , func_grab_image
3508 +  , func_get_pts
3509 +  , func_flush
3510 +  , func_first_frame
3511 +  , func_still_frame
3512 +  , func_video_size
3513 +  , func_set_video_window
3514 +  , func_osd_flush
3515 +  , func_play_external
3516 +  , func_key
3517 +  , func_frame_size
3518 +  , func_reset_audio
3519 +  , func_select_audio
3520 +  , func_trick_speed_mode
3521 +  , func_get_version
3522 +};
3523 +
3524 +enum keys
3525 +{
3526 +  key_none,
3527 +  key_up,
3528 +  key_down,
3529 +  key_menu,
3530 +  key_ok,
3531 +  key_back,
3532 +  key_left,
3533 +  key_right,
3534 +  key_red,
3535 +  key_green,
3536 +  key_yellow,
3537 +  key_blue,
3538 +  key_0,
3539 +  key_1,
3540 +  key_2,
3541 +  key_3,
3542 +  key_4,
3543 +  key_5,
3544 +  key_6,
3545 +  key_7,
3546 +  key_8,
3547 +  key_9,
3548 +  key_play,
3549 +  key_pause,
3550 +  key_stop,
3551 +  key_record,
3552 +  key_fast_fwd,
3553 +  key_fast_rew,
3554 +  key_power,
3555 +  key_channel_plus,
3556 +  key_channel_minus,
3557 +  key_volume_plus,
3558 +  key_volume_minus,
3559 +  key_mute,
3560 +  key_schedule,
3561 +  key_channels,
3562 +  key_timers,
3563 +  key_recordings,
3564 +  key_setup,
3565 +  key_commands,
3566 +  key_user1,
3567 +  key_user2,
3568 +  key_user3,
3569 +  key_user4,
3570 +  key_user5,
3571 +  key_user6,
3572 +  key_user7,
3573 +  key_user8,
3574 +  key_user9,
3575 +  key_audio,
3576 +  key_info,
3577 +};
3578 +
3579 +
3580 +
3581 +typedef struct __attribute__((packed)) data_header_s
3582 +{
3583 +  uint32_t func:8;
3584 +  uint32_t len:24;
3585 +} 
3586 +data_header_t;
3587 +
3588 +
3589 +
3590 +typedef data_header_t result_header_t;
3591 +typedef data_header_t event_header_t;
3592 +
3593 +
3594 +
3595 +typedef struct __attribute__((packed)) data_nop_s
3596 +{
3597 +  data_header_t header;
3598 +}
3599 +data_nop_t;
3600 +
3601 +
3602 +
3603 +typedef struct __attribute__((packed)) data_osd_new_s
3604 +{
3605 +  data_header_t header;
3606 +  
3607 +  uint8_t  window;
3608 +  int16_t  x;
3609 +  int16_t  y;
3610 +  uint16_t width;
3611 +  uint16_t height;
3612 +}
3613 +data_osd_new_t;
3614 +
3615 +
3616 +
3617 +typedef struct __attribute__((packed)) data_osd_free_s
3618 +{
3619 +  data_header_t header;
3620 +  
3621 +  uint8_t window;
3622 +}
3623 +data_osd_free_t;
3624 +
3625 +
3626 +
3627 +typedef struct __attribute__((packed)) data_osd_show_s
3628 +{
3629 +  data_header_t header;
3630 +  
3631 +  uint8_t window;
3632 +}
3633 +data_osd_show_t;
3634 +
3635 +
3636 +
3637 +typedef struct __attribute__((packed)) data_osd_hide_s
3638 +{
3639 +  data_header_t header;
3640 +  
3641 +  uint8_t window;
3642 +}
3643 +data_osd_hide_t;
3644 +
3645 +
3646 +
3647 +typedef struct __attribute__((packed)) data_osd_flush_s
3648 +{
3649 +  data_header_t header;
3650 +}
3651 +data_osd_flush_t;
3652 +
3653 +
3654 +
3655 +typedef struct __attribute__((packed)) data_play_external_s
3656 +{
3657 +  data_header_t header;
3658 +}
3659 +data_play_external_t;
3660 +
3661 +
3662 +
3663 +typedef struct __attribute__((packed)) data_osd_set_position_s
3664 +{
3665 +  data_header_t header;
3666 +  
3667 +  uint8_t window;
3668 +  int16_t x;
3669 +  int16_t y;
3670 +}
3671 +data_osd_set_position_t;
3672 +
3673 +
3674 +
3675 +typedef struct __attribute__((packed)) data_osd_draw_bitmap_s
3676 +{
3677 +  data_header_t header;
3678 +  
3679 +  uint8_t  window;
3680 +  int16_t  x;
3681 +  int16_t  y;
3682 +  uint16_t width;
3683 +  uint16_t height;
3684 +}
3685 +data_osd_draw_bitmap_t;
3686 +
3687 +
3688 +
3689 +typedef struct __attribute__((packed)) data_set_color_s
3690 +{
3691 +  data_header_t header;
3692 +  
3693 +  uint8_t window;
3694 +  uint8_t index;
3695 +  uint8_t num;
3696 +}
3697 +data_set_color_t;
3698 +
3699 +
3700 +
3701 +typedef struct __attribute__((packed)) data_flush_s
3702 +{
3703 +  data_header_t header;
3704 +
3705 +  int32_t ms_timeout;
3706 +  uint8_t just_wait;
3707 +}
3708 +data_flush_t;
3709 +
3710 +
3711 +
3712 +typedef struct __attribute__((packed)) result_flush_s
3713 +{
3714 +  result_header_t header;
3715 +  
3716 +  uint8_t timed_out;
3717 +}
3718 +result_flush_t;
3719 +
3720 +
3721 +
3722 +typedef struct __attribute__((packed)) data_clear_s
3723 +{
3724 +  data_header_t header;
3725 +
3726 +  int32_t n;
3727 +  int8_t s;
3728 +}
3729 +data_clear_t;
3730 +
3731 +
3732 +
3733 +typedef struct __attribute__((packed)) data_mute_s
3734 +{
3735 +  data_header_t header;
3736 +
3737 +  uint8_t mute;
3738 +}
3739 +data_mute_t;
3740 +
3741 +
3742 +
3743 +typedef struct __attribute__((packed)) data_set_volume_s
3744 +{
3745 +  data_header_t header;
3746 +
3747 +  uint8_t volume;
3748 +}
3749 +data_set_volume_t;
3750 +
3751 +
3752 +
3753 +typedef struct __attribute__((packed)) data_set_speed_s
3754 +{
3755 +  data_header_t header;
3756 +
3757 +  int32_t speed;
3758 +}
3759 +data_set_speed_t;
3760 +
3761 +
3762 +
3763 +typedef struct __attribute__((packed)) data_set_prebuffer_s
3764 +{
3765 +  data_header_t header;
3766 +
3767 +  uint32_t prebuffer;
3768 +}
3769 +data_set_prebuffer_t;
3770 +
3771 +
3772 +
3773 +typedef struct __attribute__((packed)) data_metronom_s
3774 +{
3775 +  data_header_t header;
3776 +
3777 +  int64_t  pts;
3778 +  uint32_t flags;
3779 +}
3780 +data_metronom_t;
3781 +
3782 +
3783 +
3784 +typedef struct __attribute__((packed)) data_start_s
3785 +{
3786 +  data_header_t header;
3787 +}
3788 +data_start_t;
3789 +
3790 +
3791 +
3792 +typedef struct __attribute__((packed)) data_wait_s
3793 +{
3794 +  data_header_t header;
3795 +}
3796 +data_wait_t;
3797 +
3798 +
3799 +
3800 +typedef struct __attribute__((packed)) result_wait_s
3801 +{
3802 +  result_header_t header;
3803 +}
3804 +result_wait_t;
3805 +
3806 +
3807 +
3808 +#define INPUT_VDR_MUTE_IGNORE   0
3809 +#define INPUT_VDR_MUTE_EXECUTE  1
3810 +#define INPUT_VDR_MUTE_SIMULATE 2
3811 +
3812 +typedef struct __attribute__((packed)) data_setup_s
3813 +{
3814 +  data_header_t header;
3815 +
3816 +  uint8_t osd_unscaled_blending;
3817 +  uint8_t dont_change_xine_volume;
3818 +  uint8_t mute_mode;
3819 +}
3820 +data_setup_t;
3821 +
3822 +
3823 +
3824 +typedef struct __attribute__((packed)) data_first_frame_s
3825 +{
3826 +  data_header_t header;
3827 +}
3828 +data_first_frame_t;
3829 +
3830 +
3831 +
3832 +typedef struct __attribute__((packed)) data_still_frame_s
3833 +{
3834 +  data_header_t header;
3835 +}
3836 +data_still_frame_t;
3837 +
3838 +
3839 +
3840 +typedef struct __attribute__((packed)) data_set_video_window_s
3841 +{
3842 +  data_header_t header;
3843 +
3844 +  uint32_t x;
3845 +  uint32_t y;
3846 +  uint32_t w;
3847 +  uint32_t h;
3848 +  uint32_t w_ref;
3849 +  uint32_t h_ref;
3850 +}
3851 +data_set_video_window_t;
3852 +
3853 +
3854 +
3855 +typedef struct __attribute__((packed)) data_grab_image_s
3856 +{
3857 +  data_header_t header;
3858 +}
3859 +data_grab_image_t;
3860 +
3861 +
3862 +
3863 +typedef struct __attribute__((packed)) result_grab_image_s
3864 +{
3865 +  result_header_t header;
3866 +
3867 +  int32_t width;
3868 +  int32_t height;
3869 +  int32_t ratio;
3870 +  int32_t format;
3871 +}
3872 +result_grab_image_t;
3873 +
3874 +
3875 +
3876 +typedef struct __attribute__((packed)) data_get_pts_s
3877 +{
3878 +  data_header_t header;
3879 +}
3880 +data_get_pts_t;
3881 +
3882 +
3883 +
3884 +typedef struct __attribute__((packed)) result_get_pts_s
3885 +{
3886 +  result_header_t header;
3887 +
3888 +  int64_t pts;
3889 +}
3890 +result_get_pts_t;
3891 +
3892 +
3893 +
3894 +typedef struct __attribute__((packed)) data_get_version_s
3895 +{
3896 +  data_header_t header;
3897 +}
3898 +data_get_version_t;
3899 +
3900 +
3901 +
3902 +typedef struct __attribute__((packed)) result_get_version_s
3903 +{
3904 +  result_header_t header;
3905 +
3906 +  int32_t version;
3907 +}
3908 +result_get_version_t;
3909 +
3910 +
3911 +
3912 +typedef struct __attribute__((packed)) data_video_size_s
3913 +{
3914 +  data_header_t header;
3915 +}
3916 +data_video_size_t;
3917 +
3918 +
3919 +
3920 +typedef struct __attribute__((packed)) result_video_size_s
3921 +{
3922 +  result_header_t header;
3923 +
3924 +  int32_t left;
3925 +  int32_t top;
3926 +  int32_t width;
3927 +  int32_t height;
3928 +  int32_t ratio;
3929 +  int32_t zoom_x;
3930 +  int32_t zoom_y;
3931 +}
3932 +result_video_size_t;
3933 +
3934 +
3935 +
3936 +typedef struct __attribute__((packed)) data_reset_audio_s
3937 +{
3938 +  data_header_t header;
3939 +}
3940 +data_reset_audio_t;
3941 +
3942 +
3943 +
3944 +typedef struct __attribute__((packed)) event_key_s
3945 +{
3946 +  event_header_t header;
3947 +  
3948 +  uint32_t key;
3949 +}
3950 +event_key_t;
3951 +
3952 +
3953 +
3954 +typedef struct __attribute__((packed)) event_frame_size_s
3955 +{
3956 +  event_header_t header;
3957 +  
3958 +  int32_t left;
3959 +  int32_t top;
3960 +  int32_t width;
3961 +  int32_t height;
3962 +  int32_t zoom_x;
3963 +  int32_t zoom_y;
3964 +}
3965 +event_frame_size_t;
3966 +
3967 +
3968 +
3969 +typedef struct __attribute__((packed)) event_play_external_s
3970 +{
3971 +  event_header_t header;
3972 +  
3973 +  uint32_t key;
3974 +}
3975 +event_play_external_t;
3976 +
3977 +
3978 +
3979 +typedef struct __attribute__((packed)) data_select_audio_s
3980 +{
3981 +  data_header_t header;
3982 +  
3983 +  uint8_t channels;
3984 +}
3985 +data_select_audio_t;
3986 +
3987 +
3988 +
3989 +typedef struct __attribute__((packed)) data_trick_speed_mode_s
3990 +{
3991 +  data_header_t header;
3992 +
3993 +  uint8_t on;
3994 +}
3995 +data_trick_speed_mode_t;
3996 +
3997 +
3998 +
3999 +typedef union __attribute__((packed)) data_union_u
4000 +{
4001 +  data_header_t           header;
4002 +  data_nop_t              nop;
4003 +  data_osd_new_t          osd_new;
4004 +  data_osd_free_t         osd_free;
4005 +  data_osd_show_t         osd_show;
4006 +  data_osd_hide_t         osd_hide;
4007 +  data_osd_set_position_t osd_set_position;
4008 +  data_osd_draw_bitmap_t  osd_draw_bitmap;
4009 +  data_set_color_t        set_color;
4010 +  data_flush_t            flush;
4011 +  data_clear_t            clear;
4012 +  data_mute_t             mute;
4013 +  data_set_volume_t       set_volume;
4014 +  data_set_speed_t        set_speed;
4015 +  data_set_prebuffer_t    set_prebuffer;
4016 +  data_metronom_t         metronom;
4017 +  data_start_t            start;
4018 +  data_wait_t             wait;
4019 +  data_setup_t            setup;
4020 +  data_grab_image_t       grab_image;
4021 +  data_get_pts_t          get_pts;
4022 +  data_first_frame_t      first_frame;
4023 +  data_still_frame_t      still_frame;
4024 +  data_video_size_t       video_size;
4025 +  data_set_video_window_t set_video_window;
4026 +  data_osd_flush_t        osd_flush;
4027 +  data_play_external_t    play_external;
4028 +  data_reset_audio_t      reset_audio;
4029 +  data_select_audio_t     select_audio;
4030 +  data_trick_speed_mode_t trick_speed_mode;
4031 +  data_get_version_t      get_version;
4032 +}
4033 +data_union_t;
4034 +
4035 +
4036 +
4037 +typedef union __attribute__((packed)) result_union_u
4038 +{
4039 +  result_header_t         header;
4040 +  result_grab_image_t     grab_image;
4041 +  result_get_pts_t        get_pts;
4042 +  result_flush_t          flush;
4043 +  result_video_size_t     video_size;
4044 +  result_get_version_t    get_version;
4045 +  result_wait_t           wait;
4046 +}
4047 +result_union_t;
4048 +
4049 +
4050 +
4051 +typedef union __attribute__((packed)) event_union_u
4052 +{
4053 +  event_header_t          header;
4054 +  event_key_t             key;
4055 +  event_frame_size_t      frame_size;
4056 +  event_play_external_t   play_external;
4057 +}
4058 +event_union_t;
4059 +
4060 +
4061 +
4062 +#endif /* __INPUT_VDR_H */
4063 +
4064 diff -Nurp ../xine-cvs/xine-lib/src/vdr/post_vdr.c xine-lib/src/vdr/post_vdr.c
4065 --- ../xine-cvs/xine-lib/src/vdr/post_vdr.c     1970-01-01 01:00:00.000000000 +0100
4066 +++ xine-lib/src/vdr/post_vdr.c 2005-06-29 22:39:12.000000000 +0200
4067 @@ -0,0 +1,44 @@
4068 +/*
4069 + * Copyright (C) 2000-2004 the xine project
4070 + * 
4071 + * This file is part of xine, a free video player.
4072 + * 
4073 + * xine is free software; you can redistribute it and/or modify
4074 + * it under the terms of the GNU General Public License as published by
4075 + * the Free Software Foundation; either version 2 of the License, or
4076 + * (at your option) any later version.
4077 + * 
4078 + * xine is distributed in the hope that it will be useful,
4079 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4080 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4081 + * GNU General Public License for more details.
4082 + * 
4083 + * You should have received a copy of the GNU General Public License
4084 + * along with this program; if not, write to the Free Software
4085 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
4086 + *
4087 + * $Id$
4088 + */
4089
4090 +/*
4091 + * plugins for VDR
4092 + */
4093 +
4094 +#include "xine_internal.h"
4095 +#include "post.h"
4096 +#include "post_vdr.h"
4097 +
4098 +
4099 +
4100 +static post_info_t vdr_video_special_info = { XINE_POST_TYPE_VIDEO_FILTER };
4101 +static post_info_t vdr_audio_special_info = { XINE_POST_TYPE_AUDIO_FILTER };
4102 +
4103 +plugin_info_t xine_plugin_info[] =
4104 +{
4105 +  /* type, API, "name", version, special_info, init_function */  
4106 +  { PLUGIN_POST, 9, "vdr"      , XINE_VERSION_CODE, &vdr_video_special_info, &vdr_video_init_plugin },
4107 +  { PLUGIN_POST, 9, "vdr_video", XINE_VERSION_CODE, &vdr_video_special_info, &vdr_video_init_plugin },
4108 +  { PLUGIN_POST, 9, "vdr_audio", XINE_VERSION_CODE, &vdr_audio_special_info, &vdr_audio_init_plugin },
4109 +  { PLUGIN_NONE, 0, "", 0, NULL, NULL }
4110 +};
4111 +
4112 diff -Nurp ../xine-cvs/xine-lib/src/vdr/post_vdr.h xine-lib/src/vdr/post_vdr.h
4113 --- ../xine-cvs/xine-lib/src/vdr/post_vdr.h     1970-01-01 01:00:00.000000000 +0100
4114 +++ xine-lib/src/vdr/post_vdr.h 2005-08-14 13:56:05.000000000 +0200
4115 @@ -0,0 +1,71 @@
4116 +
4117 +#ifndef __POST_VDR_H
4118 +#define __POST_VDR_H
4119 +
4120 +
4121 +
4122 +typedef struct vdr_set_video_window_data_s {
4123 +  int32_t x;
4124 +  int32_t y;
4125 +  int32_t w;
4126 +  int32_t h;
4127 +  int32_t w_ref;
4128 +  int32_t h_ref;
4129 +
4130 +} vdr_set_video_window_data_t;
4131 +
4132 +
4133 +
4134 +typedef struct vdr_frame_size_changed_data_s {
4135 +  int32_t x;
4136 +  int32_t y;
4137 +  int32_t w;
4138 +  int32_t h;
4139 +
4140 +} vdr_frame_size_changed_data_t;
4141 +
4142 +
4143 +
4144 +typedef struct vdr_select_audio_data_s {
4145 +  uint8_t channels;
4146 +
4147 +} vdr_select_audio_data_t;
4148 +
4149 +
4150 +
4151 +inline static int vdr_is_vdr_stream(xine_stream_t *stream)
4152 +{
4153 +  if (!stream
4154 +      || !stream->input_plugin
4155 +      || !stream->input_plugin->input_class)
4156 +  {
4157 +    return 0;
4158 +  }
4159 +
4160 +  {
4161 +    input_class_t *input_class = stream->input_plugin->input_class;
4162 +
4163 +    if (input_class->get_identifier)
4164 +    {
4165 +      const char *identifier = input_class->get_identifier(input_class);
4166 +      if (identifier
4167 +          && 0 == strcmp(identifier, "VDR"))
4168 +      {
4169 +        return 1;
4170 +      }
4171 +    }
4172 +  }
4173 +
4174 +  return 0;
4175 +}
4176 +
4177 +
4178 +
4179 +/* plugin class initialization function */
4180 +void *vdr_video_init_plugin(xine_t *xine, void *);
4181 +void *vdr_audio_init_plugin(xine_t *xine, void *);
4182 +
4183 +
4184 +
4185 +#endif /* __POST_VDR_H */
4186 +
4187 diff -Nurp ../xine-cvs/xine-lib/src/vdr/post_vdr_audio.c xine-lib/src/vdr/post_vdr_audio.c
4188 --- ../xine-cvs/xine-lib/src/vdr/post_vdr_audio.c       1970-01-01 01:00:00.000000000 +0100
4189 +++ xine-lib/src/vdr/post_vdr_audio.c   2005-08-14 13:46:41.000000000 +0200
4190 @@ -0,0 +1,287 @@
4191 +/*
4192 + * Copyright (C) 2000-2004 the xine project
4193 + * 
4194 + * This file is part of xine, a free video player.
4195 + * 
4196 + * xine is free software; you can redistribute it and/or modify
4197 + * it under the terms of the GNU General Public License as published by
4198 + * the Free Software Foundation; either version 2 of the License, or
4199 + * (at your option) any later version.
4200 + * 
4201 + * xine is distributed in the hope that it will be useful,
4202 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4203 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4204 + * GNU General Public License for more details.
4205 + * 
4206 + * You should have received a copy of the GNU General Public License
4207 + * along with this program; if not, write to the Free Software
4208 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
4209 + *
4210 + * $Id$
4211 + */
4212
4213 +/*
4214 + * select audio channel plugin for VDR
4215 + */
4216 +
4217 +#define LOG_MODULE "vdr_audio"
4218 +#define LOG_VERBOSE
4219 +/*
4220 +#define LOG
4221 +*/
4222 +
4223 +#include "xine_internal.h"
4224 +#include "post.h"
4225 +#include "post_vdr.h"
4226 +
4227 +
4228 +
4229 +typedef struct vdr_audio_post_plugin_s
4230 +{
4231 +  post_plugin_t post_plugin;
4232 +
4233 +  xine_event_queue_t *event_queue;
4234 +  xine_stream_t      *vdr_stream;
4235 +  
4236 +  uint8_t audio_channels;
4237 +  int num_channels;
4238 +  
4239 +}
4240 +vdr_audio_post_plugin_t;
4241 +
4242 +
4243 +static void vdr_audio_select_audio(vdr_audio_post_plugin_t *this, uint8_t channels)
4244 +{
4245 +  this->audio_channels = channels;
4246 +}
4247 +
4248
4249 +/* plugin class functions */
4250 +static post_plugin_t *vdr_audio_open_plugin(post_class_t *class_gen, int inputs,
4251 +                                            xine_audio_port_t **audio_target,
4252 +                                            xine_video_port_t **video_target);
4253 +static char          *vdr_audio_get_identifier(post_class_t *class_gen);
4254 +static char          *vdr_audio_get_description(post_class_t *class_gen);
4255 +static void           vdr_audio_class_dispose(post_class_t *class_gen);
4256 +
4257 +/* plugin instance functions */
4258 +static void           vdr_audio_dispose(post_plugin_t *this_gen);
4259 +
4260 +/* replaced ao_port functions */
4261 +static int            vdr_audio_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
4262 +                                          uint32_t bits, uint32_t rate, int mode);
4263 +static void           vdr_audio_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream);
4264 +
4265 +
4266 +
4267 +void *vdr_audio_init_plugin(xine_t *xine, void *data)
4268 +{
4269 +  post_class_t *class = (post_class_t *)malloc(sizeof (post_class_t));
4270 +  
4271 +  if (!class)
4272 +    return NULL;
4273 +  
4274 +  class->open_plugin     = vdr_audio_open_plugin;
4275 +  class->get_identifier  = vdr_audio_get_identifier;
4276 +  class->get_description = vdr_audio_get_description;
4277 +  class->dispose         = vdr_audio_class_dispose;
4278 +  
4279 +  return class;
4280 +}
4281 +
4282 +static post_plugin_t *vdr_audio_open_plugin(post_class_t *class_gen, int inputs,
4283 +                                     xine_audio_port_t **audio_target,
4284 +                                     xine_video_port_t **video_target)
4285 +{
4286 +  vdr_audio_post_plugin_t *this = (vdr_audio_post_plugin_t *)xine_xmalloc(sizeof (vdr_audio_post_plugin_t));
4287 +  post_in_t               *input;
4288 +  post_out_t              *output;
4289 +  post_audio_port_t       *port;
4290 +/*  
4291 +fprintf(stderr, "~~~~~~~~~~ vdr open plugin\n");
4292 +*/
4293 +  if (!this || !audio_target || !audio_target[ 0 ])
4294 +  {
4295 +    free(this);
4296 +    return NULL;
4297 +  }
4298 +
4299 +  _x_post_init(&this->post_plugin, 1, 0);
4300 +  this->post_plugin.dispose = vdr_audio_dispose;
4301 +
4302 +  port = _x_post_intercept_audio_port(&this->post_plugin, audio_target[ 0 ], &input, &output);
4303 +  port->new_port.open       = vdr_audio_port_open;
4304 +  port->new_port.put_buffer = vdr_audio_port_put_buffer;
4305 +
4306 +  this->post_plugin.xine_post.audio_input[ 0 ] = &port->new_port;
4307 +
4308 +  
4309 +
4310 +  this->audio_channels = 0;
4311 +  
4312 +  return &this->post_plugin;
4313 +}
4314 +
4315 +static char *vdr_audio_get_identifier(post_class_t *class_gen)
4316 +{
4317 +  return "vdr_audio";
4318 +}
4319 +
4320 +static char *vdr_audio_get_description(post_class_t *class_gen)
4321 +{
4322 +  return "modifies every audio frame as requested by VDR";
4323 +}
4324 +
4325 +static void vdr_audio_class_dispose(post_class_t *class_gen)
4326 +{
4327 +  free(class_gen);
4328 +}
4329 +
4330 +
4331 +static void vdr_audio_dispose(post_plugin_t *this_gen)
4332 +{
4333 +/*
4334 +fprintf(stderr, "~~~~~~~~~~ vdr dispose\n");
4335 +*/
4336 +  if (_x_post_dispose(this_gen))
4337 +  {
4338 +    vdr_audio_post_plugin_t *this = (vdr_audio_post_plugin_t *)this_gen;
4339 +    
4340 +    if (this->vdr_stream)
4341 +      xine_event_dispose_queue(this->event_queue);
4342 +    
4343 +    free(this_gen);
4344 +  }
4345 +}
4346 +
4347 +static int vdr_audio_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
4348 +                               uint32_t bits, uint32_t rate, int mode) {
4349 +
4350 +  post_audio_port_t       *port = (post_audio_port_t *)port_gen;
4351 +  vdr_audio_post_plugin_t *this = (vdr_audio_post_plugin_t *)port->post;
4352 +
4353 +  _x_post_rewire(&this->post_plugin);
4354 +  _x_post_inc_usage(port);
4355 +/*
4356 +fprintf(stderr, "~~~~~~~~~~ vdr port open\n");
4357 +*/
4358 +  port->stream = stream;
4359 +  port->bits = bits;
4360 +  port->rate = rate;
4361 +  port->mode = mode;
4362 +
4363 +  this->num_channels = _x_ao_mode2channels(mode);
4364 +
4365 +  return port->original_port->open(port->original_port, stream, bits, rate, mode );
4366 +}
4367 +
4368 +
4369 +static void vdr_audio_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream)
4370 +{
4371 +  post_audio_port_t       *port = (post_audio_port_t *)port_gen;
4372 +  vdr_audio_post_plugin_t *this = (vdr_audio_post_plugin_t *)port->post;
4373 +  xine_event_t *event;
4374 +/*
4375 +fprintf(stderr, "~~~~~~ vdr_audio\n");
4376 +*/
4377 +  if (this->vdr_stream
4378 +      && !_x_continue_stream_processing(this->vdr_stream))
4379 +  {
4380 +    this->vdr_stream = 0;
4381 +    
4382 +    xine_event_dispose_queue(this->event_queue);
4383 +    this->event_queue = 0;
4384 +    
4385 +    this->audio_channels = 0;
4386 +  }
4387 +  
4388 +  if (!this->vdr_stream
4389 +      && vdr_is_vdr_stream(stream))
4390 +  {
4391 +    this->event_queue = xine_event_new_queue(stream);
4392 +    if (this->event_queue)
4393 +    {
4394 +      this->vdr_stream = stream;
4395 +      
4396 +      {
4397 +        xine_event_t event;
4398 +        
4399 +        event.type = XINE_EVENT_VDR_PLUGINSTARTED;
4400 +        event.data = 0;
4401 +        event.data_length = 1; /* vdr_audio */
4402 +        
4403 +        xine_event_send(this->vdr_stream, &event);
4404 +      }
4405 +    }
4406 +  }
4407 +  
4408 +  if (this->event_queue)
4409 +  {
4410 +    while ((event = xine_event_get(this->event_queue)))
4411 +    {
4412 +      if (event->type == XINE_EVENT_VDR_SELECTAUDIO)
4413 +      {
4414 +        vdr_select_audio_data_t *data = (vdr_select_audio_data_t *)event->data;
4415 +        
4416 +        vdr_audio_select_audio(this, data->channels);
4417 +      }
4418 +
4419 +      xine_event_free(event);
4420 +    }
4421 +  }
4422
4423 +  if (this->num_channels == 2
4424 +      && this->audio_channels != 0
4425 +      && this->audio_channels != 3)
4426 +  {
4427 +    audio_buffer_t *vdr_buf = port->original_port->get_buffer(port->original_port);
4428 +    vdr_buf->num_frames = buf->num_frames;
4429 +    vdr_buf->vpts = buf->vpts;
4430 +    vdr_buf->frame_header_count = buf->frame_header_count;
4431 +    vdr_buf->first_access_unit = buf->first_access_unit;
4432 +    /* FIXME: The audio buffer should contain this info.
4433 +     *        We should not have to get it from the open call.
4434 +     */
4435 +    vdr_buf->format.bits = buf->format.bits;
4436 +    vdr_buf->format.rate = buf->format.rate;
4437 +    vdr_buf->format.mode = buf->format.mode;
4438 +    _x_extra_info_merge(vdr_buf->extra_info, buf->extra_info);
4439 +
4440 +    {
4441 +      int step = buf->format.bits / 8;
4442 +      uint8_t *src = (uint8_t *)buf->mem;
4443 +      uint8_t *dst = (uint8_t *)vdr_buf->mem;
4444 +
4445 +      if (this->audio_channels == 2)
4446 +        src += step;
4447 +/*      
4448 +      fprintf(stderr, "~~~~~~~~~~ vdr port put buffer: channels: %d, %d\n"
4449 +              , this->audio_channels
4450 +              , buf->format.bits);
4451 +*/      
4452 +      int i, k;
4453 +      for (i = 0; i < buf->num_frames; i++)
4454 +      {
4455 +        for (k = 0; k < step; k++)
4456 +          *dst++ = *src++;
4457 +
4458 +        src -= step;
4459 +        
4460 +        for (k = 0; k < step; k++)
4461 +          *dst++ = *src++;
4462 +
4463 +        src += step;
4464 +      }
4465 +    }
4466 +    
4467 +    /* pass data to original port */
4468 +    port->original_port->put_buffer(port->original_port, vdr_buf, stream);
4469 +
4470 +    /* free data from origial buffer */
4471 +    buf->num_frames = 0; /* UNDOCUMENTED, but hey, it works! Force old audio_out buffer free. */
4472 +  }
4473
4474 +  port->original_port->put_buffer(port->original_port, buf, stream);
4475 +
4476 +  return;
4477 +}
4478 diff -Nurp ../xine-cvs/xine-lib/src/vdr/post_vdr_video.c xine-lib/src/vdr/post_vdr_video.c
4479 --- ../xine-cvs/xine-lib/src/vdr/post_vdr_video.c       1970-01-01 01:00:00.000000000 +0100
4480 +++ xine-lib/src/vdr/post_vdr_video.c   2005-08-14 13:46:29.000000000 +0200
4481 @@ -0,0 +1,485 @@
4482 +/*
4483 + * Copyright (C) 2000-2004 the xine project
4484 + * 
4485 + * This file is part of xine, a free video player.
4486 + * 
4487 + * xine is free software; you can redistribute it and/or modify
4488 + * it under the terms of the GNU General Public License as published by
4489 + * the Free Software Foundation; either version 2 of the License, or
4490 + * (at your option) any later version.
4491 + * 
4492 + * xine is distributed in the hope that it will be useful,
4493 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4494 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4495 + * GNU General Public License for more details.
4496 + * 
4497 + * You should have received a copy of the GNU General Public License
4498 + * along with this program; if not, write to the Free Software
4499 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
4500 + *
4501 + * $Id$
4502 + */
4503
4504 +/*
4505 + * frame scaler plugin for VDR
4506 + */
4507 +
4508 +#define LOG_MODULE "vdr_video"
4509 +#define LOG_VERBOSE
4510 +/*
4511 +#define LOG
4512 +*/
4513 +
4514 +#include "xine_internal.h"
4515 +#include "post.h"
4516 +#include "post_vdr.h"
4517 +
4518 +
4519 +
4520 +typedef struct vdr_video_post_plugin_s
4521 +{
4522 +  post_plugin_t post_plugin;
4523 +
4524 +  xine_event_queue_t *event_queue;
4525 +  xine_stream_t      *vdr_stream;
4526 +  
4527 +  int8_t trick_speed_mode;
4528 +  int8_t enabled;
4529 +  
4530 +  int32_t x;
4531 +  int32_t y;
4532 +  int32_t w;
4533 +  int32_t h;
4534 +  int32_t w_ref;
4535 +  int32_t h_ref;
4536 +
4537 +  int32_t old_frame_left;
4538 +  int32_t old_frame_top;
4539 +  int32_t old_frame_width;
4540 +  int32_t old_frame_height;
4541 +  
4542 +}
4543 +vdr_video_post_plugin_t;
4544 +
4545 +
4546 +static void vdr_video_set_video_window(vdr_video_post_plugin_t *this, int32_t x, int32_t y, int32_t w, int32_t h, int32_t w_ref, int32_t h_ref)
4547 +{
4548 +  this->enabled = 0;
4549 +  
4550 +  this->x     = x;
4551 +  this->y     = y;
4552 +  this->w     = w;
4553 +  this->h     = h;
4554 +  this->w_ref = w_ref;
4555 +  this->h_ref = h_ref;
4556 +
4557 +  if (w != w_ref || h != h_ref)
4558 +    this->enabled = 1;
4559 +}
4560 +
4561
4562 +/* plugin class functions */
4563 +static post_plugin_t *vdr_video_open_plugin(post_class_t *class_gen, int inputs,
4564 +                                            xine_audio_port_t **audio_target,
4565 +                                            xine_video_port_t **video_target);
4566 +static char          *vdr_video_get_identifier(post_class_t *class_gen);
4567 +static char          *vdr_video_get_description(post_class_t *class_gen);
4568 +static void           vdr_video_class_dispose(post_class_t *class_gen);
4569 +
4570 +/* plugin instance functions */
4571 +static void           vdr_video_dispose(post_plugin_t *this_gen);
4572 +
4573 +/* frame intercept check */
4574 +static int            vdr_video_intercept_frame(post_video_port_t *port, vo_frame_t *frame);
4575 +
4576 +/* replaced vo_frame functions */
4577 +static int            vdr_video_draw(vo_frame_t *frame, xine_stream_t *stream);
4578 +
4579 +
4580 +void *vdr_video_init_plugin(xine_t *xine, void *data)
4581 +{
4582 +  post_class_t *class = (post_class_t *)malloc(sizeof (post_class_t));
4583 +  
4584 +  if (!class)
4585 +    return NULL;
4586 +  
4587 +  class->open_plugin     = vdr_video_open_plugin;
4588 +  class->get_identifier  = vdr_video_get_identifier;
4589 +  class->get_description = vdr_video_get_description;
4590 +  class->dispose         = vdr_video_class_dispose;
4591 +  
4592 +  return class;
4593 +}
4594 +
4595 +static post_plugin_t *vdr_video_open_plugin(post_class_t *class_gen, int inputs,
4596 +                                            xine_audio_port_t **audio_target,
4597 +                                            xine_video_port_t **video_target)
4598 +{
4599 +  vdr_video_post_plugin_t *this = (vdr_video_post_plugin_t *)xine_xmalloc(sizeof (vdr_video_post_plugin_t));
4600 +  post_in_t               *input;
4601 +  post_out_t              *output;
4602 +  post_video_port_t       *port;
4603 +  
4604 +  if (!this || !video_target || !video_target[ 0 ])
4605 +  {
4606 +    free(this);
4607 +    return NULL;
4608 +  }
4609 +
4610 +  _x_post_init(&this->post_plugin, 0, 1);
4611 +  this->post_plugin.dispose = vdr_video_dispose;
4612 +
4613 +  port = _x_post_intercept_video_port(&this->post_plugin, video_target[ 0 ], &input, &output);
4614 +  port->intercept_frame = vdr_video_intercept_frame;
4615 +  port->new_frame->draw = vdr_video_draw;
4616 +  this->post_plugin.xine_post.video_input[ 0 ] = &port->new_port;
4617 +  
4618 +  
4619 +  
4620 +  this->enabled          = 0;
4621 +  this->vdr_stream       = 0;
4622 +  this->event_queue      = 0;
4623 +  this->old_frame_left   = 0;
4624 +  this->old_frame_top    = 0;
4625 +  this->old_frame_width  = 0;
4626 +  this->old_frame_height = 0;
4627 +  this->trick_speed_mode = 0;
4628 +  
4629 +  return &this->post_plugin;
4630 +}
4631 +
4632 +static char *vdr_video_get_identifier(post_class_t *class_gen)
4633 +{
4634 +  return "vdr";
4635 +}
4636 +
4637 +static char *vdr_video_get_description(post_class_t *class_gen)
4638 +{
4639 +  return "modifies every video frame as requested by VDR";
4640 +}
4641 +
4642 +static void vdr_video_class_dispose(post_class_t *class_gen)
4643 +{
4644 +  free(class_gen);
4645 +}
4646 +
4647 +
4648 +static void vdr_video_dispose(post_plugin_t *this_gen)
4649 +{
4650 +  if (_x_post_dispose(this_gen))
4651 +  {
4652 +    vdr_video_post_plugin_t *this = (vdr_video_post_plugin_t *)this_gen;
4653 +    
4654 +    if (this->vdr_stream)
4655 +    {
4656 +      xine_event_t event;
4657 +      vdr_frame_size_changed_data_t event_data;
4658 +
4659 +      event_data.x = 0;
4660 +      event_data.y = 0;
4661 +      event_data.w = 0;
4662 +      event_data.h = 0;
4663 +      
4664 +      event.type        = XINE_EVENT_VDR_FRAMESIZECHANGED;
4665 +      event.data        = &event_data;
4666 +      event.data_length = sizeof (event_data);
4667 +      
4668 +      xine_event_send(this->vdr_stream, &event);
4669 +
4670 +      xine_event_dispose_queue(this->event_queue);
4671 +    }
4672 +    
4673 +    free(this_gen);
4674 +  }
4675 +}
4676 +
4677 +
4678 +static int vdr_video_intercept_frame(post_video_port_t *port, vo_frame_t *frame)
4679 +{
4680 +  return (frame->format == XINE_IMGFMT_YUY2
4681 +          || frame->format == XINE_IMGFMT_YV12);
4682 +}
4683 +
4684 +
4685 +static inline void vdr_video_scale(uint8_t *src, uint8_t *dst, int y_inc, int x_inc, int w_dst, int h_dst, int x, int y, int w, int h, int w_ref, int h_ref, int init)
4686 +{
4687 +  int x0 = x * w_dst / w_ref;
4688 +  int y0 = y * h_dst / h_ref;
4689 +
4690 +  int x1 = ((x + w) * w_dst - 1 + w_ref) / w_ref;
4691 +  int y1 = ((y + h) * h_dst - 1 + h_ref) / h_ref;
4692 +
4693 +  int dx = x1 - x0;
4694 +  int dy = y1 - y0;
4695 +
4696 +  int yy, xx;
4697 +
4698 +  int dy2    = dy + dy;
4699 +  int h_dst2 = h_dst + h_dst;
4700 +  int y_eps  = h_dst - dy2;
4701 +
4702 +  int dx2    = dx + dx;
4703 +  int w_dst2 = w_dst + w_dst;
4704 +  int x_eps0 = w_dst - dx2;
4705 +    
4706 +  for (yy = 0; yy < y0; yy++)
4707 +  {
4708 +    uint8_t *dst0 = dst;
4709 +    
4710 +    for (xx = 0; xx < w_dst; xx++)
4711 +    {
4712 +      *dst0 = init;
4713 +      dst0 += x_inc;
4714 +    }
4715 +
4716 +    dst += y_inc;
4717 +  }
4718 +
4719 +  for (yy = y0; yy < y1; yy++)
4720 +  {
4721 +    uint8_t *dst0 = dst;
4722 +    uint8_t *src0 = src;
4723 +
4724 +    int x_eps = x_eps0;
4725 +    
4726 +    for (xx = 0; xx < x0; xx++)
4727 +    {
4728 +      *dst0 = init;
4729 +      dst0 += x_inc;
4730 +    }
4731 +    
4732 +    for (xx = x0; xx < x1; xx++)
4733 +    {
4734 +      *dst0 = *src0;
4735 +      dst0 += x_inc;
4736 +      
4737 +      x_eps += w_dst2;
4738 +      while (x_eps >= 0)
4739 +      {
4740 +        src0  += x_inc;
4741 +        x_eps -= dx2;
4742 +      }
4743 +    }
4744 +    
4745 +    for (xx = x1; xx < w_dst; xx++)
4746 +    {
4747 +      *dst0 = init;
4748 +      dst0 += x_inc;
4749 +    }
4750 +
4751 +    dst += y_inc;
4752 +
4753 +    y_eps += h_dst2;
4754 +    while (y_eps >= 0)
4755 +    {
4756 +      src   += y_inc;
4757 +      y_eps -= dy2;
4758 +    }
4759 +  }
4760 +  
4761 +  for (yy = y1; yy < h_dst; yy++)
4762 +  {
4763 +    uint8_t *dst0 = dst;
4764 +    
4765 +    for (xx = 0; xx < w_dst; xx++)
4766 +    {
4767 +      *dst0 = init;
4768 +      dst0 += x_inc;
4769 +    }
4770 +
4771 +    dst += y_inc;
4772 +  }  
4773 +}
4774 +
4775 +static void vdr_video_scale_YUY2(vdr_video_post_plugin_t *this, vo_frame_t *src, vo_frame_t *dst)
4776 +{
4777 +  int w = dst->width  - dst->crop_left - dst->crop_right;
4778 +  int h = dst->height - dst->crop_top  - dst->crop_bottom;
4779 +  int offset;
4780 +  
4781 +  if (w < 0)
4782 +    w = 0;
4783 +  
4784 +  if (h < 0)
4785 +    h = 0;
4786 +
4787 +  offset = dst->pitches[ 0 ] * dst->crop_top + 2 *   dst->crop_left;
4788 +  vdr_video_scale(&src->base[ 0 ][ 0 ] + offset, &dst->base[ 0 ][ 0 ] + offset, dst->pitches[ 0 ], 2,  w         , h, this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x00);
4789 +  offset = dst->pitches[ 0 ] * dst->crop_top + 4 * ((dst->crop_left + 1) / 2);
4790 +  vdr_video_scale(&src->base[ 0 ][ 1 ] + offset, &dst->base[ 0 ][ 1 ] + offset, dst->pitches[ 0 ], 4, (w + 1) / 2, h, this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x80);
4791 +  offset = dst->pitches[ 0 ] * dst->crop_top + 4 * ((dst->crop_left + 1) / 2);
4792 +  vdr_video_scale(&src->base[ 0 ][ 3 ] + offset, &dst->base[ 0 ][ 3 ] + offset, dst->pitches[ 0 ], 4, (w + 1) / 2, h, this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x80);
4793 +}
4794 +
4795 +static void vdr_video_scale_YV12(vdr_video_post_plugin_t *this, vo_frame_t *src, vo_frame_t *dst)
4796 +{
4797 +  int w = dst->width  - dst->crop_left - dst->crop_right;
4798 +  int h = dst->height - dst->crop_top  - dst->crop_bottom;
4799 +  int offset;
4800 +  
4801 +  if (w < 0)
4802 +    w = 0;
4803 +  
4804 +  if (h < 0)
4805 +    h = 0;
4806 +
4807 +  offset = dst->pitches[ 0 ] *   dst->crop_top           + 1 *   dst->crop_left;
4808 +  vdr_video_scale(&src->base[ 0 ][ 0 ] + offset, &dst->base[ 0 ][ 0 ] + offset, dst->pitches[ 0 ], 1,  w         ,  h         , this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x00);
4809 +  offset = dst->pitches[ 1 ] * ((dst->crop_top + 1) / 2) + 1 * ((dst->crop_left + 1) / 2);
4810 +  vdr_video_scale(&src->base[ 1 ][ 0 ] + offset, &dst->base[ 1 ][ 0 ] + offset, dst->pitches[ 1 ], 1, (w + 1) / 2, (h + 1) / 2, this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x80);
4811 +  offset = dst->pitches[ 2 ] * ((dst->crop_top + 1) / 2) + 1 * ((dst->crop_left + 1) / 2);
4812 +  vdr_video_scale(&src->base[ 2 ][ 0 ] + offset, &dst->base[ 2 ][ 0 ] + offset, dst->pitches[ 2 ], 1, (w + 1) / 2, (h + 1) / 2, this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x80);
4813 +}
4814 +
4815 +
4816 +static int vdr_video_draw(vo_frame_t *frame, xine_stream_t *stream)
4817 +{
4818 +  post_video_port_t       *port = (post_video_port_t *)frame->port;
4819 +  vdr_video_post_plugin_t *this = (vdr_video_post_plugin_t *)port->post;
4820 +  vo_frame_t *vdr_frame;
4821 +  xine_event_t *event;
4822 +  int skip;
4823 +
4824 +  if (this->vdr_stream
4825 +      && !_x_continue_stream_processing(this->vdr_stream))
4826 +  {
4827 +    this->vdr_stream = 0;
4828 +    
4829 +    xine_event_dispose_queue(this->event_queue);
4830 +    this->event_queue = 0;
4831 +    
4832 +    this->old_frame_left   = 0;
4833 +    this->old_frame_top    = 0;
4834 +    this->old_frame_width  = 0;
4835 +    this->old_frame_height = 0;
4836 +  }
4837 +  
4838 +  if (!this->vdr_stream
4839 +      && vdr_is_vdr_stream(stream))
4840 +  {
4841 +    this->event_queue = xine_event_new_queue(stream);
4842 +    if (this->event_queue)
4843 +    {
4844 +      this->vdr_stream = stream;
4845 +      
4846 +      {
4847 +        xine_event_t event;
4848 +        
4849 +        event.type = XINE_EVENT_VDR_PLUGINSTARTED;
4850 +        event.data = 0;
4851 +        event.data_length = 0; /* vdr_video */
4852 +        
4853 +        xine_event_send(this->vdr_stream, &event);
4854 +      }
4855 +    }
4856 +  }
4857 +  
4858 +  if (this->event_queue)
4859 +  {
4860 +    while ((event = xine_event_get(this->event_queue)))
4861 +    {
4862 +      if (event->type == XINE_EVENT_VDR_SETVIDEOWINDOW)
4863 +      {
4864 +        vdr_set_video_window_data_t *data = (vdr_set_video_window_data_t *)event->data;
4865 +        
4866 +        vdr_video_set_video_window(this, data->x, data->y, data->w, data->h, data->w_ref, data->h_ref);
4867 +      }
4868 +      else if (event->type == XINE_EVENT_VDR_TRICKSPEEDMODE)
4869 +      {
4870 +/*
4871 +        fprintf(stderr, "###############################: %p, %d\n", event->data, event->data_length);
4872 +        this->trick_speed_mode = (0 != event->data_length);
4873 +*/
4874 +      }
4875 +
4876 +      xine_event_free(event);
4877 +    }
4878 +  }
4879 +
4880 +  {
4881 +    int frame_left   = frame->crop_left;
4882 +    int frame_width  = frame->width - frame->crop_left - frame->crop_right;
4883 +    int frame_top    = frame->crop_top;
4884 +    int frame_height = frame->height - frame->crop_top - frame->crop_bottom;
4885 +
4886 +    if (frame_left < 0)
4887 +      frame_left = 0;
4888 +    if (frame_width > frame->width)
4889 +      frame_width = frame->width;
4890 +    if (frame_top < 0)
4891 +      frame_top = 0;
4892 +    if (frame_height > frame->height)
4893 +      frame_height = frame->height;
4894 +    
4895 +    if (this->vdr_stream
4896 +        && (this->old_frame_left != frame_left
4897 +          || this->old_frame_top != frame_top
4898 +          || this->old_frame_width != frame_width
4899 +          || this->old_frame_height != frame_height))
4900 +    {
4901 +      xine_event_t event;
4902 +      vdr_frame_size_changed_data_t event_data;
4903 +
4904 +      event_data.x = frame_left;
4905 +      event_data.y = frame_top;
4906 +      event_data.w = frame_width;
4907 +      event_data.h = frame_height;
4908 +      
4909 +      xprintf(this->vdr_stream->xine, XINE_VERBOSITY_LOG,
4910 +            _(LOG_MODULE ": osd: (%d, %d)-(%d, %d)\n"), frame_left, frame_top, frame_width, frame_height);
4911 +      
4912 +      event.type        = XINE_EVENT_VDR_FRAMESIZECHANGED;
4913 +      event.data        = &event_data;
4914 +      event.data_length = sizeof (event_data);
4915 +      
4916 +      xine_event_send(this->vdr_stream, &event);
4917 +    
4918 +      this->old_frame_left   = frame_left;
4919 +      this->old_frame_top    = frame_top;
4920 +      this->old_frame_width  = frame_width;
4921 +      this->old_frame_height = frame_height;
4922 +    }
4923 +  }
4924 +/*
4925 +  fprintf(stderr, "~~~~~~~~~~~~ trickspeedmode: %d\n", this->trick_speed_mode);  
4926 +  
4927 +  if (this->vdr_stream
4928 +      && this->trick_speed_mode)
4929 +  {
4930 +    frame->pts = 0;
4931 +    frame->next->pts = 0;
4932 +  }
4933 +*/  
4934 +  if (!this->enabled 
4935 +      || frame->bad_frame
4936 +      || (frame->format != XINE_IMGFMT_YUY2
4937 +          && frame->format != XINE_IMGFMT_YV12))
4938 +  {
4939 +    _x_post_frame_copy_down(frame, frame->next);
4940 +    skip = frame->next->draw(frame->next, stream);
4941 +    _x_post_frame_copy_up(frame, frame->next);
4942 +    return skip;
4943 +  }
4944 +
4945 +  vdr_frame = port->original_port->get_frame(port->original_port,
4946 +    frame->width, frame->height, frame->ratio, frame->format, frame->flags | VO_BOTH_FIELDS);
4947 +
4948 +  _x_post_frame_copy_down(frame, vdr_frame);
4949 +    
4950 +  switch (vdr_frame->format)
4951 +  {
4952 +  case XINE_IMGFMT_YUY2:
4953 +    vdr_video_scale_YUY2(this, frame, vdr_frame);
4954 +    break;
4955 +    
4956 +  case XINE_IMGFMT_YV12:
4957 +    vdr_video_scale_YV12(this, frame, vdr_frame);    
4958 +    break;
4959 +  }
4960 +  
4961 +  skip = vdr_frame->draw(vdr_frame, stream);
4962 +  _x_post_frame_copy_up(frame, vdr_frame);
4963 +  vdr_frame->free(vdr_frame);
4964 +  
4965 +  return skip;
4966 +}
This page took 0.540862 seconds and 3 git commands to generate.