Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Something
Monday, March 26th, 2007 at 12:58:37am UTC 

  1. Index: apps/plugins/mpegplayer/mpegplayer.c
  2. ===================================================================
  3. --- apps/plugins/mpegplayer/mpegplayer.c        (revision 12911)
  4. +++ apps/plugins/mpegplayer/mpegplayer.c        (working copy)
  5. @@ -103,6 +103,7 @@
  6.  #include "mpeg2dec_config.h"
  7.  
  8.  #include "plugin.h"
  9. +#include "gray.h"
  10.  
  11.  #include "mpeg2.h"
  12.  #include "mpeg_settings.h"
  13. @@ -270,8 +271,16 @@
  14.                  /* Wait for video thread to stop */
  15.                  while (videostatus == PLEASE_PAUSE) { rb->sleep(HZ/25); }
  16.              }
  17. +
  18. +#ifndef HAVE_LCD_COLOR
  19. +            gray_show(false);
  20. +#endif
  21.              result = mpeg_menu();
  22.  
  23. +#ifndef HAVE_LCD_COLOR
  24. +            gray_show(true);
  25. +#endif
  26. +
  27.              /* The menu can change the font, so restore */
  28.              rb->lcd_setfont(FONT_SYSFIXED);
  29.  
  30. @@ -911,6 +920,10 @@
  31.      size_t file_remaining;
  32.      size_t n;
  33.      size_t disk_buf_len;
  34. +#ifndef HAVE_LCD_COLOR
  35. +    long graysize;
  36. +    int grayscales;
  37. +#endif
  38.  
  39.      /* We define this here so it is on the main stack (in IRAM) */
  40.      mad_fixed_t mad_frame_overlap[2][32][18];       /* 4608 bytes */
  41. @@ -940,13 +953,27 @@
  42.      buffer_size = audiosize - (PCMBUFFER_SIZE+AUDIOBUFFER_SIZE+LIBMPEG2BUFFER_SIZE);
  43.  
  44.      DEBUGF("audiosize=%d, buffer_size=%ld\n",audiosize,buffer_size);
  45. -    buffer_size &= ~(0x7ff);  /* Round buffer down to nearest 2KB */
  46. -    DEBUGF("audiosize=%d, buffer_size=%ld\n",audiosize,buffer_size);
  47.      buffer = mpeg2_malloc(buffer_size,-1);
  48.  
  49.      if (buffer == NULL)
  50.          return PLUGIN_ERROR;
  51.  
  52. +#ifndef HAVE_LCD_COLOR
  53. +    /* initialize the grayscale buffer: 32 bitplanes for 33 shades of gray. */
  54. +    grayscales = gray_init(rb, buffer, buffer_size, false, LCD_WIDTH, LCD_HEIGHT,
  55. +                           32, 2<<8, &graysize) + 1;
  56. +    buffer += graysize;
  57. +    buffer_size -= graysize;
  58. +    if (grayscales < 33 || buffer_size <= 0)
  59. +    {
  60. +        rb->splash(HZ, "gray buf error");
  61. +        return PLUGIN_ERROR;
  62. +    }
  63. +#endif
  64. +
  65. +    buffer_size &= ~(0x7ff);  /* Round buffer down to nearest 2KB */
  66. +    DEBUGF("audiosize=%d, buffer_size=%ld\n",audiosize,buffer_size);
  67. +
  68.      mpa_buffer_size = AUDIOBUFFER_SIZE;
  69.      mpa_buffer = mpeg2_malloc(mpa_buffer_size,-2);
  70.  
  71. @@ -1026,6 +1053,10 @@
  72.      audiostatus = STREAM_BUFFERING;
  73.      videostatus = STREAM_PLAYING;
  74.  
  75. +#ifndef HAVE_LCD_COLOR
  76. +    gray_show(true);
  77. +#endif
  78. +
  79.      /* We put the video thread on the second processor for multi-core targets. */
  80.      if ((videothread_id = rb->create_thread(video_thread,
  81.          (uint8_t*)video_stack,VIDEO_STACKSIZE,"mpgvideo" IF_PRIO(,PRIORITY_PLAYBACK)
  82. @@ -1074,6 +1105,10 @@
  83.          rb->sleep(HZ/10);
  84.      }
  85.  
  86. +#ifndef HAVE_LCD_COLOR
  87. +    gray_show(false);
  88. +#endif
  89. +
  90.      rb->remove_thread(audiothread_id);
  91.      rb->yield(); /* Is this needed? */
  92.  
  93. Index: apps/plugins/mpegplayer/video_out_rockbox.c
  94. ===================================================================
  95. --- apps/plugins/mpegplayer/video_out_rockbox.c (revision 12900)
  96. +++ apps/plugins/mpegplayer/video_out_rockbox.c (working copy)
  97. @@ -24,6 +24,7 @@
  98.  #include "mpeg2dec_config.h"
  99.  
  100.  #include "plugin.h"
  101. +#include "gray.h"
  102.  
  103.  extern struct plugin_api* rb;
  104.  
  105. @@ -188,6 +189,7 @@
  106.  
  107.  void vo_draw_frame (uint8_t * const * buf)
  108.  {
  109. +#ifdef HAVE_LCD_COLOR
  110.  #ifdef SIMULATOR
  111.      yuv_bitmap_part(buf,0,0,image_width,
  112.                      output_x,output_y,output_width,output_height);
  113. @@ -197,6 +199,10 @@
  114.                      0,0,image_width,
  115.                      output_x,output_y,output_width,output_height);
  116.  #endif
  117. +#else
  118. +    gray_ub_gray_bitmap_part(buf[0],0,0,image_width,
  119. +                             output_x,output_y,output_width,output_height);
  120. +#endif
  121.  }
  122.  
  123.  #if LCD_WIDTH >= LCD_HEIGHT
  124. Index: apps/plugins/mpegplayer/Makefile
  125. ===================================================================
  126. --- apps/plugins/mpegplayer/Makefile    (revision 12900)
  127. +++ apps/plugins/mpegplayer/Makefile    (working copy)
  128. @@ -8,7 +8,7 @@
  129.  #
  130.  
  131.  INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
  132. - -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
  133. + -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(APPSDIR)/plugins/lib -I$(OUTDIR) -I$(BUILDDIR)
  134.  CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
  135.   -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
  136.  
  137. Index: apps/plugins/SUBDIRS
  138. ===================================================================
  139. --- apps/plugins/SUBDIRS        (revision 12900)
  140. +++ apps/plugins/SUBDIRS        (working copy)
  141. @@ -32,9 +32,7 @@
  142.  #endif
  143.  
  144.  /* For all the colour targets */
  145. -#if defined(HAVE_LCD_COLOR)
  146.  mpegplayer
  147. -#endif
  148.  
  149.  
  150.  #endif /* IRIVER_IFP7XX_SERIES */

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right