This program plays QuickTime movies on GR-Peach
Dependencies: AsciiFont GR-PEACH_video GraphicsFramework LCD_shield_config R_BSP TLV320_RBSP mbed-rtos mbed
Requirements
- GR-Peach
- GR-Peach Audio Camera Shield or I²S compatible audio DAC
- GR-Peach LCD Shield
- USB memory stick
How to play movie files
- Encode movie files
encode movies with ffmpeg
$ ffmpeg -i <input -ar 44100 -acodec pcm_s16le -s 480x270 -vcodec mjpeg -q:v 3 -movflags faststart -threads 4 -vf fps=30 <output>.mov
- Copy movies to the root directory of USB memory
- Build and upload this program
- Run it
USBHost/FATFileSystem/FATFileHandle.h@0:d0f130e27d32, 2017-03-10 (annotated)
- Committer:
- mtkrtk
- Date:
- Fri Mar 10 11:30:02 2017 +0000
- Revision:
- 0:d0f130e27d32
initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mtkrtk | 0:d0f130e27d32 | 1 | /* mbed Microcontroller Library |
mtkrtk | 0:d0f130e27d32 | 2 | * Copyright (c) 2006-2012 ARM Limited |
mtkrtk | 0:d0f130e27d32 | 3 | * |
mtkrtk | 0:d0f130e27d32 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
mtkrtk | 0:d0f130e27d32 | 5 | * of this software and associated documentation files (the "Software"), to deal |
mtkrtk | 0:d0f130e27d32 | 6 | * in the Software without restriction, including without limitation the rights |
mtkrtk | 0:d0f130e27d32 | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
mtkrtk | 0:d0f130e27d32 | 8 | * copies of the Software, and to permit persons to whom the Software is |
mtkrtk | 0:d0f130e27d32 | 9 | * furnished to do so, subject to the following conditions: |
mtkrtk | 0:d0f130e27d32 | 10 | * |
mtkrtk | 0:d0f130e27d32 | 11 | * The above copyright notice and this permission notice shall be included in |
mtkrtk | 0:d0f130e27d32 | 12 | * all copies or substantial portions of the Software. |
mtkrtk | 0:d0f130e27d32 | 13 | * |
mtkrtk | 0:d0f130e27d32 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
mtkrtk | 0:d0f130e27d32 | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
mtkrtk | 0:d0f130e27d32 | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
mtkrtk | 0:d0f130e27d32 | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
mtkrtk | 0:d0f130e27d32 | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
mtkrtk | 0:d0f130e27d32 | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
mtkrtk | 0:d0f130e27d32 | 20 | * SOFTWARE. |
mtkrtk | 0:d0f130e27d32 | 21 | */ |
mtkrtk | 0:d0f130e27d32 | 22 | #ifndef MBED_FATFILEHANDLE_H |
mtkrtk | 0:d0f130e27d32 | 23 | #define MBED_FATFILEHANDLE_H |
mtkrtk | 0:d0f130e27d32 | 24 | |
mtkrtk | 0:d0f130e27d32 | 25 | #include "drivers/FileHandle.h" |
mtkrtk | 0:d0f130e27d32 | 26 | |
mtkrtk | 0:d0f130e27d32 | 27 | using namespace mbed; |
mtkrtk | 0:d0f130e27d32 | 28 | |
mtkrtk | 0:d0f130e27d32 | 29 | class FATFileHandle : public FileHandle { |
mtkrtk | 0:d0f130e27d32 | 30 | public: |
mtkrtk | 0:d0f130e27d32 | 31 | |
mtkrtk | 0:d0f130e27d32 | 32 | FATFileHandle(FIL fh); |
mtkrtk | 0:d0f130e27d32 | 33 | virtual int close(); |
mtkrtk | 0:d0f130e27d32 | 34 | virtual ssize_t write(const void* buffer, size_t length); |
mtkrtk | 0:d0f130e27d32 | 35 | virtual ssize_t read(void* buffer, size_t length); |
mtkrtk | 0:d0f130e27d32 | 36 | virtual int isatty(); |
mtkrtk | 0:d0f130e27d32 | 37 | virtual off_t lseek(off_t position, int whence); |
mtkrtk | 0:d0f130e27d32 | 38 | virtual int fsync(); |
mtkrtk | 0:d0f130e27d32 | 39 | virtual off_t flen(); |
mtkrtk | 0:d0f130e27d32 | 40 | |
mtkrtk | 0:d0f130e27d32 | 41 | protected: |
mtkrtk | 0:d0f130e27d32 | 42 | |
mtkrtk | 0:d0f130e27d32 | 43 | FIL _fh; |
mtkrtk | 0:d0f130e27d32 | 44 | |
mtkrtk | 0:d0f130e27d32 | 45 | }; |
mtkrtk | 0:d0f130e27d32 | 46 | |
mtkrtk | 0:d0f130e27d32 | 47 | #endif |
mtkrtk | 0:d0f130e27d32 | 48 |