1 /* 2 * FireWire DV media addon for Haiku 3 * 4 * Copyright (c) 2008, JiSheng Zhang (jszhang3@mail.ustc.edu.cn) 5 * Distributed under the terms of the MIT License. 6 * 7 */ 8 #ifndef __FIREWIRE_CARD_H 9 #define __FIREWIRE_CARD_H 10 11 12 #include <SupportDefs.h> 13 14 15 class FireWireCard { 16 public: 17 enum fmt_type { 18 FMT_MPEGTS = 0, 19 FMT_DV = 1, 20 }; 21 FireWireCard(const char* path); 22 ~FireWireCard(); 23 24 status_t InitCheck(); 25 26 status_t DetectRecvFn(); 27 ssize_t Read(void** buffer); 28 status_t Extract(void* dest, void** src, ssize_t* sizeUsed); 29 30 void GetBufInfo(size_t* rbufsize, int* rcount); 31 32 private: 33 ssize_t DvRead(void** buffer); 34 status_t DvExtract(void* dest, void** src, ssize_t* sizeUsed); 35 ssize_t MpegtsRead(void** buffer); 36 status_t MpegtsExtract(void* dest, void** src, 37 ssize_t* sizeUsed); 38 39 status_t fInitStatus; 40 int fDev; 41 void* fBuf; 42 void* fPad; 43 size_t fRbufSize; 44 int fRcount; 45 fmt_type fFormat; 46 47 }; 48 49 #endif 50