t k / Mbed 2 deprecated MovPlayer

Dependencies:   AsciiFont GR-PEACH_video GraphicsFramework LCD_shield_config R_BSP TLV320_RBSP mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MovFile.hpp Source File

MovFile.hpp

00001 #ifndef __MovFile__
00002 #define __MovFile__
00003 
00004 #include <stdio.h>
00005 #include <stdint.h>
00006 #include "CppStandardHelper.hpp"
00007 
00008 class MovFile {
00009     union __attribute__((packed)) Buffer {
00010         uint8_t  array[4];
00011         uint32_t value;
00012     };
00013     static constexpr int bufSize = 32;
00014     static uint32_t frameSizes[bufSize];
00015     static uint32_t audioSizes[bufSize];
00016     static MovFile singleton;
00017     MovFile();
00018     FILE *file;
00019     uint32_t numOfFrames;
00020     uint32_t *frameSizesP;
00021     uint32_t *audioSizesP;
00022     uint32_t stszAddress;
00023     uint32_t stcoAddress;
00024     uint32_t lastFrameAddress;
00025     int availableCount;
00026     void search(uint32_t pattern);
00027     void fillCaches();
00028     
00029 public:
00030     static MovFile *sharedFile() {
00031         return &singleton;
00032     }
00033     void start(FILE *f);
00034     bool read(char *videoBuf, char *audioBuf, uint32_t *audioSize);
00035 };
00036 
00037 #endif
00038