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
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 3.1
- FFMPEG https://ffmpeg.org/download.html
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
Diff: rga_func.h
- Revision:
- 2:c7faef0ef374
- Parent:
- 0:84e4649e7707
- Child:
- 3:841987280a7f
--- a/rga_func.h Wed Jan 20 02:35:42 2016 +0000 +++ b/rga_func.h Thu Jan 21 10:10:19 2016 +0000 @@ -23,32 +23,41 @@ #include "RGA.h" -#define IMG_DRAW_WIDTH 241 -#define IMG_DRAW_HEIGHT 180 -#define IMAGE_WIDTH_SCROLL_FUNC 352 // Image width of Scroll function -#define IMAGE_HEIGHT_SCROLL_FUNC 233 // Image height of Scroll function -#define IMAGE_WIDTH_ZOOM_FUNC 352 // Image width of Zoom function -#define IMAGE_HEIGHT_ZOOM_FUNC 233 // Image height of Zoom function +typedef struct { + char * style; + int x; + int y; + int w; + int h; +} draw_rectangle_pos_t; -#define DISSOLVE_MAX_NUM 256 -#define SCROLL_MAX_NUM IMAGE_WIDTH_SCROLL_FUNC - IMG_DRAW_WIDTH -#define ZOOM_MAX_NUM IMAGE_HEIGHT_ZOOM_FUNC / 2 -#define ROTATION_MAX_NUM 360 -#define ACCELERATE_MAX_NUM 256 +#define IMG_DRAW_WIDTH (241) +#define IMG_DRAW_HEIGHT (180) +#define IMAGE_WIDTH_SCROLL_FUNC (352) // Image width of Scroll function +#define IMAGE_HEIGHT_SCROLL_FUNC (233) // Image height of Scroll function +#define IMAGE_WIDTH_ZOOM_FUNC (352) // Image width of Zoom function +#define IMAGE_HEIGHT_ZOOM_FUNC (233) // Image height of Zoom function +#define DISSOLVE_MAX_NUM (256) +#define SCROLL_MAX_NUM (IMAGE_WIDTH_SCROLL_FUNC - IMG_DRAW_WIDTH) +#define ZOOM_MAX_NUM (IMAGE_HEIGHT_ZOOM_FUNC / 2) +#define ROTATION_MAX_NUM (360) +#define ACCELERATE_MAX_NUM (256) +#define ANIMATION_TIMING_EASE (0) +#define ANIMATION_TIMING_LINEAR (1) +#define ANIMATION_TIMING_EASE_IN (2) +#define ANIMATION_TIMING_EASE_OUT (3) +#define ANIMATION_TIMING_EASE_IN_OUT (4) extern void Set_RGAObject(frame_buffer_t* frmbuf_info); -extern void Get_AnimationTiming(char_t *timing_name); -extern void RGA_Func_ClrScreen(frame_buffer_t* frmbuf_info); extern void RGA_Func_DrawTopScreen(frame_buffer_t* frmbuf_info); -extern void RGA_Func_DrawReturnButton(frame_buffer_t* frmbuf_info); -extern void RGA_Func_DrawRectangle(frame_buffer_t* frmbuf_info); -extern void RGA_Func_DrawImage(frame_buffer_t* frmbuf_info); +extern void RGA_Func_DrawRectangle(frame_buffer_t* frmbuf_info, draw_rectangle_pos_t * pos, int pos_num); +extern void RGA_Func_DrawImage(frame_buffer_t* frmbuf_info, int x, int y); extern void RGA_Func_Dissolve(frame_buffer_t* frmbuf_info, float32_t global_alpha); extern void RGA_Func_Scroll(frame_buffer_t* frmbuf_info, int src_width_pos); extern void RGA_Func_Zoom(frame_buffer_t* frmbuf_info, int src_height_pos); extern void RGA_Func_Rotation(frame_buffer_t* frmbuf_info, graphics_matrix_float_t image_angle); -extern void RGA_Func_Accelerate(frame_buffer_t* frmbuf_info, float32_t relative_pos); +extern void RGA_Func_Accelerate(frame_buffer_t* frmbuf_info, int animation_timing, float32_t relative_pos); #endif