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