TftRgbFromSdRaw(wX_Pos As Word, wY_Pos As Word, wRgbWidth As Word, wRgbHeight As Word, dwStartSector As Dword, dwStopSector As Dword, wFrameDelayUs As Word), Byte
wRgbWidth = Movie width
wRgbHeight = Movie height
dwStartSector = File start sector on the SD card
dwStopSector = File end sector on the SD card
wFrameDelayUs = Delay in microseconds between frames to adjust the frame rate
Result Byte:
255 = No errors detected
Else = Errors detected
This procedure plays an RGB movie file directly from an SD card, where the movie is stored sequentially without a file system.
Example:
TftRgbFromSdRaw(80,40,320,240, 3243300,4153799,10)
Playing a movie in RAW pixel mode (sequences of pixel values) is computationally demanding. Only small video formats with high-speed dsPICs can display the video smoothly. A dsPIC running at 140 MHz will struggle with a video size of 320x240. Note that there is no VSYNC option available.
The wFrameDelayUs parameter allows for frame rate adjustment by introducing a delay between frames. For smaller video formats on faster microcontrollers where playback may appear too fast, start with 0 for no delay, and add delay if the video is playing too quickly.
Video conversion and upload to SD cards is handled by the included SdCardWriteRGB565 tool.
Note: If wonder, what would be the fastest display hardware set-up? SPI1-to-SPI2 is a bit faster than SPI1-to-PARALLEL when it comes to video display from RAW SD card.
$define TestSignal 8 '0,230,190,8,178,TS.jpg $define TvFrame 179 '1,320,240,179,479,TV.jpg $define Bugs 230,190,480,1090248 '2,230,190,480,1090248,Bugs.mp4 $define CountDown 230,190,1090249,1156993 '3,230,190,1090249,1156993,Old Film Countdown.mp4 Main: TftSetUp(0) 'Set screen TftBmpFromSdRaw(0,0,TvFrame) 'Load TV Frame picture as background TftBmpFromSdRaw(15,25,TestSignal) 'Fill screen with test signal picture DelayMS 1500 TftRgbFromSdRaw(15,25,CountDown,0) 'Play countdown animation TftBmpFromSdRaw(15,25,TestSignal) 'Fill screen with test signal picture DelayMS 1500 TftRgbFromSdRaw(15,25,Bugs,0) 'Play bugs animation TftBmpFromSdRaw(15,25,TestSignal) 'Fill screen with test signal picture |
|
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator