Plays MJPEG Video using the RGA. THe RGA allows resize of the JPEG file.

Dependencies:   GR-PEACH_video GraphicsFramework LCD_shield_config R_BSP SDBlockDevice_GR_PEACH TLV320_RBSP USBHost_custom

Fork of RGA_HelloWorld by Renesas

Overview

This demo shows how play a MJPEG and WAV file video using the RZA1 hardware RGA, JCU and SSIF. The JCU decodes each MJPEG frame. The SSIF plays the raw WAV file, and the RGA supplies the GUI and resize of the JPEG image.

MJPEG Creation

Requirements

Python Script

SD Card

  • Rename the jpg file to Renesas.jpg and audio file Renesas.wav
  • Download this image file and rename is Background.jpg /media/uploads/zkimike/background.jpg
Revision:
12:9a413bec6673
Parent:
3:841987280a7f
--- a/rga_func.cpp	Mon Apr 24 16:40:18 2017 +0900
+++ b/rga_func.cpp	Fri Jan 05 22:41:01 2018 +0000
@@ -22,11 +22,15 @@
 #include "rga_func.h"
 #include "Images/BinaryImage_RZ_A1H.h"
 
+
 #define ZOOM_SRC_CENTER_X                   (IMAGE_WIDTH_ZOOM_FUNC / 2)
 #define ZOOM_SRC_CENTER_Y                   (IMAGE_HEIGHT_ZOOM_FUNC / 2)
 
 #define CRYSTAL_DIAMETER                    (93)
 
+#define VIDEO_WIDTH                        (480u)
+#define VIDEO_HEIGHT                       (272u)
+
 Canvas2D_ContextClass canvas2d;
 
 static animation_timing_function_t* accelerator;
@@ -107,6 +111,22 @@
     R_GRAPHICS_Finish(canvas2d.c_LanguageContext);
 }
 
+void RGA_Func_VideoPlayer(frame_buffer_t* frmbuf_info, uint8_t *jpeg_buffer1, uint8_t *jpeg_buffer2) {
+    
+    /* Clear */
+    canvas2d.clearRect(0, 0, frmbuf_info->width, frmbuf_info->height);
+    
+    /* Draw Backgound */
+    canvas2d.drawImage((graphics_image_t*)jpeg_buffer1, 0, 0);
+
+    /* Draw video */
+    canvas2d.drawImage((graphics_image_t*)jpeg_buffer2, 30, 120, VIDEO_WIDTH, VIDEO_HEIGHT);
+    //canvas2d.drawImage((graphics_image_t*)jpeg_buffer2, 30, 120 );
+
+    
+    /* Complete drawing */
+    R_GRAPHICS_Finish(canvas2d.c_LanguageContext);
+}
 void RGA_Func_Dissolve(frame_buffer_t* frmbuf_info, float32_t global_alpha) {
     /* Dissolve = Fade Out + Fade In */
     /* Clear */