1*b3d94504SStephan Aßmus /* 2*b3d94504SStephan Aßmus * This file is a part of BeOS USBVision driver project. 3*b3d94504SStephan Aßmus * Copyright (c) 2003 by Siarzuk Zharski <imker@gmx.li> 4*b3d94504SStephan Aßmus * 5*b3d94504SStephan Aßmus * This file may be used under the terms of the BSD License 6*b3d94504SStephan Aßmus * 7*b3d94504SStephan Aßmus * Skeletal part of this code was inherired from original BeOS sample code, 8*b3d94504SStephan Aßmus * that is distributed under the terms of the Be Sample Code License. 9*b3d94504SStephan Aßmus * 10*b3d94504SStephan Aßmus */ 11*b3d94504SStephan Aßmus 12*b3d94504SStephan Aßmus #ifndef _USBVISION_ADDON_H 13*b3d94504SStephan Aßmus #define _USBVISION_ADDON_H 14*b3d94504SStephan Aßmus 15*b3d94504SStephan Aßmus #include <media/MediaAddOn.h> 16*b3d94504SStephan Aßmus 17*b3d94504SStephan Aßmus #define TOUCH(x) ((void)(x)) 18*b3d94504SStephan Aßmus 19*b3d94504SStephan Aßmus extern "C" _EXPORT BMediaAddOn *make_media_addon(image_id you); 20*b3d94504SStephan Aßmus 21*b3d94504SStephan Aßmus class MediaAddOn : public BMediaAddOn 22*b3d94504SStephan Aßmus { 23*b3d94504SStephan Aßmus public: 24*b3d94504SStephan Aßmus MediaAddOn(image_id imid); 25*b3d94504SStephan Aßmus virtual ~MediaAddOn(); 26*b3d94504SStephan Aßmus 27*b3d94504SStephan Aßmus virtual status_t InitCheck(const char **out_failure_text); 28*b3d94504SStephan Aßmus 29*b3d94504SStephan Aßmus virtual int32 CountFlavors(); 30*b3d94504SStephan Aßmus virtual status_t GetFlavorAt(int32 n, const flavor_info ** out_info); 31*b3d94504SStephan Aßmus virtual BMediaNode *InstantiateNodeFor( 32*b3d94504SStephan Aßmus const flavor_info * info, 33*b3d94504SStephan Aßmus BMessage * config, 34*b3d94504SStephan Aßmus status_t * out_error); 35*b3d94504SStephan Aßmus GetConfigurationFor(BMediaNode * node,BMessage * message)36*b3d94504SStephan Aßmus virtual status_t GetConfigurationFor(BMediaNode *node, BMessage *message) 37*b3d94504SStephan Aßmus { TOUCH(node); TOUCH(message); return B_OK; } SaveConfigInfo(BMediaNode * node,BMessage * message)38*b3d94504SStephan Aßmus virtual status_t SaveConfigInfo(BMediaNode *node, BMessage *message) 39*b3d94504SStephan Aßmus { TOUCH(node); TOUCH(message); return B_OK; } 40*b3d94504SStephan Aßmus WantsAutoStart()41*b3d94504SStephan Aßmus virtual bool WantsAutoStart() { return false; } AutoStart(int in_count,BMediaNode ** out_node,int32 * out_internal_id,bool * out_has_more)42*b3d94504SStephan Aßmus virtual status_t AutoStart(int in_count, BMediaNode **out_node, 43*b3d94504SStephan Aßmus int32 *out_internal_id, bool *out_has_more) 44*b3d94504SStephan Aßmus { TOUCH(in_count); TOUCH(out_node); 45*b3d94504SStephan Aßmus TOUCH(out_internal_id); TOUCH(out_has_more); 46*b3d94504SStephan Aßmus return B_ERROR; } 47*b3d94504SStephan Aßmus bool USBVisionInit(); 48*b3d94504SStephan Aßmus void USBVisionUninit(); 49*b3d94504SStephan Aßmus status_t USBVisionWriteRegister(uint8 reg, uint8 *data, uint8 len = sizeof(uint8)); 50*b3d94504SStephan Aßmus status_t USBVisionReadRegister(uint8 reg, uint8 *data, uint8 len = sizeof(uint8)); 51*b3d94504SStephan Aßmus 52*b3d94504SStephan Aßmus private: 53*b3d94504SStephan Aßmus status_t fInitStatus; 54*b3d94504SStephan Aßmus flavor_info fFlavorInfo; 55*b3d94504SStephan Aßmus media_format fMediaFormat; 56*b3d94504SStephan Aßmus int fDriverFD; 57*b3d94504SStephan Aßmus }; 58*b3d94504SStephan Aßmus 59*b3d94504SStephan Aßmus #endif /*_USBVISION_ADDON_H*/ 60