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
rga_func.h@12:9a413bec6673, 2018-01-05 (annotated)
- Committer:
- zkimike
- Date:
- Fri Jan 05 22:41:01 2018 +0000
- Revision:
- 12:9a413bec6673
- Parent:
- 3:841987280a7f
Added MJPEG video.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
1050186 | 0:84e4649e7707 | 1 | /* |
1050186 | 0:84e4649e7707 | 2 | Permission is hereby granted, free of charge, to any person obtaining a copy |
1050186 | 0:84e4649e7707 | 3 | of this software and associated documentation files (the "Software"), to deal |
1050186 | 0:84e4649e7707 | 4 | in the Software without restriction, including without limitation the rights |
1050186 | 0:84e4649e7707 | 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
1050186 | 0:84e4649e7707 | 6 | copies of the Software, and to permit persons to whom the Software is |
1050186 | 0:84e4649e7707 | 7 | furnished to do so, subject to the following conditions: |
1050186 | 0:84e4649e7707 | 8 | |
1050186 | 0:84e4649e7707 | 9 | The above copyright notice and this permission notice shall be included in |
1050186 | 0:84e4649e7707 | 10 | all copies or substantial portions of the Software. |
1050186 | 0:84e4649e7707 | 11 | |
1050186 | 0:84e4649e7707 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
1050186 | 0:84e4649e7707 | 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
1050186 | 0:84e4649e7707 | 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
1050186 | 0:84e4649e7707 | 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
1050186 | 0:84e4649e7707 | 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
1050186 | 0:84e4649e7707 | 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
1050186 | 0:84e4649e7707 | 18 | THE SOFTWARE. |
1050186 | 0:84e4649e7707 | 19 | */ |
1050186 | 0:84e4649e7707 | 20 | |
1050186 | 0:84e4649e7707 | 21 | #ifndef RGA_FUNC_H |
1050186 | 0:84e4649e7707 | 22 | #define RGA_FUNC_H |
1050186 | 0:84e4649e7707 | 23 | |
1050186 | 0:84e4649e7707 | 24 | #include "RGA.h" |
1050186 | 0:84e4649e7707 | 25 | |
dkato | 2:c7faef0ef374 | 26 | typedef struct { |
dkato | 2:c7faef0ef374 | 27 | char * style; |
dkato | 2:c7faef0ef374 | 28 | int x; |
dkato | 2:c7faef0ef374 | 29 | int y; |
dkato | 2:c7faef0ef374 | 30 | int w; |
dkato | 2:c7faef0ef374 | 31 | int h; |
dkato | 2:c7faef0ef374 | 32 | } draw_rectangle_pos_t; |
1050186 | 0:84e4649e7707 | 33 | |
dkato | 2:c7faef0ef374 | 34 | #define IMG_DRAW_WIDTH (241) |
dkato | 2:c7faef0ef374 | 35 | #define IMG_DRAW_HEIGHT (180) |
dkato | 2:c7faef0ef374 | 36 | #define IMAGE_WIDTH_SCROLL_FUNC (352) // Image width of Scroll function |
dkato | 2:c7faef0ef374 | 37 | #define IMAGE_HEIGHT_SCROLL_FUNC (233) // Image height of Scroll function |
dkato | 2:c7faef0ef374 | 38 | #define IMAGE_WIDTH_ZOOM_FUNC (352) // Image width of Zoom function |
dkato | 2:c7faef0ef374 | 39 | #define IMAGE_HEIGHT_ZOOM_FUNC (233) // Image height of Zoom function |
1050186 | 0:84e4649e7707 | 40 | |
dkato | 2:c7faef0ef374 | 41 | #define DISSOLVE_MAX_NUM (256) |
1050186 | 1:a07212e32dcb | 42 | #define SCROLL_MAX_NUM (IMAGE_WIDTH_SCROLL_FUNC - IMG_DRAW_WIDTH) |
1050186 | 1:a07212e32dcb | 43 | #define ZOOM_MAX_NUM (IMAGE_HEIGHT_ZOOM_FUNC / 2) |
dkato | 2:c7faef0ef374 | 44 | #define ROTATION_MAX_NUM (360) |
dkato | 2:c7faef0ef374 | 45 | #define ACCELERATE_MAX_NUM (256) |
1050186 | 0:84e4649e7707 | 46 | |
dkato | 2:c7faef0ef374 | 47 | #define ANIMATION_TIMING_EASE (0) |
dkato | 2:c7faef0ef374 | 48 | #define ANIMATION_TIMING_LINEAR (1) |
dkato | 2:c7faef0ef374 | 49 | #define ANIMATION_TIMING_EASE_IN (2) |
dkato | 2:c7faef0ef374 | 50 | #define ANIMATION_TIMING_EASE_OUT (3) |
dkato | 2:c7faef0ef374 | 51 | #define ANIMATION_TIMING_EASE_IN_OUT (4) |
1050186 | 0:84e4649e7707 | 52 | |
1050186 | 0:84e4649e7707 | 53 | extern void Set_RGAObject(frame_buffer_t* frmbuf_info); |
1050186 | 0:84e4649e7707 | 54 | extern void RGA_Func_DrawTopScreen(frame_buffer_t* frmbuf_info); |
dkato | 2:c7faef0ef374 | 55 | extern void RGA_Func_DrawRectangle(frame_buffer_t* frmbuf_info, draw_rectangle_pos_t * pos, int pos_num); |
dkato | 2:c7faef0ef374 | 56 | extern void RGA_Func_DrawImage(frame_buffer_t* frmbuf_info, int x, int y); |
zkimike | 12:9a413bec6673 | 57 | extern void RGA_Func_VideoPlayer(frame_buffer_t* frmbuf_info, uint8_t *jpeg_buffer1, uint8_t *jpeg_buffer2); |
1050186 | 0:84e4649e7707 | 58 | extern void RGA_Func_Dissolve(frame_buffer_t* frmbuf_info, float32_t global_alpha); |
1050186 | 0:84e4649e7707 | 59 | extern void RGA_Func_Scroll(frame_buffer_t* frmbuf_info, int src_width_pos); |
1050186 | 0:84e4649e7707 | 60 | extern void RGA_Func_Zoom(frame_buffer_t* frmbuf_info, int src_height_pos); |
1050186 | 0:84e4649e7707 | 61 | extern void RGA_Func_Rotation(frame_buffer_t* frmbuf_info, graphics_matrix_float_t image_angle); |
dkato | 2:c7faef0ef374 | 62 | extern void RGA_Func_Accelerate(frame_buffer_t* frmbuf_info, int animation_timing, float32_t relative_pos); |
1050186 | 0:84e4649e7707 | 63 | |
1050186 | 0:84e4649e7707 | 64 | #endif |