xref: /haiku/src/add-ons/media/media-add-ons/usb_webcam/AddOn.h (revision 02af02f93ae67777d65cce1eda1c5f21aaed3446)
1a1830cbdSFrançois Revol /*
2a1830cbdSFrançois Revol  * Copyright 2004-2008, François Revol, <revol@free.fr>.
3a1830cbdSFrançois Revol  * Distributed under the terms of the MIT License.
4a1830cbdSFrançois Revol  */
52c9bd703SFrançois Revol #ifndef _VIDEO_ADDON_H
62c9bd703SFrançois Revol #define _VIDEO_ADDON_H
72c9bd703SFrançois Revol 
82c9bd703SFrançois Revol #include <media/MediaAddOn.h>
92c9bd703SFrançois Revol 
102c9bd703SFrançois Revol #define TOUCH(x) ((void)(x))
112c9bd703SFrançois Revol 
122c9bd703SFrançois Revol extern "C" _EXPORT BMediaAddOn *make_media_addon(image_id you);
132c9bd703SFrançois Revol 
142c9bd703SFrançois Revol class CamRoster;
152c9bd703SFrançois Revol class CamDevice;
162c9bd703SFrançois Revol 
17*02af02f9SJérôme Duval class WebCamMediaAddOn : public BMediaAddOn {
182c9bd703SFrançois Revol public:
192c9bd703SFrançois Revol 						WebCamMediaAddOn(image_id imid);
202c9bd703SFrançois Revol 	virtual 			~WebCamMediaAddOn();
212c9bd703SFrançois Revol 
222c9bd703SFrançois Revol 	virtual	status_t	InitCheck(const char **out_failure_text);
232c9bd703SFrançois Revol 
242c9bd703SFrançois Revol 	virtual	int32		CountFlavors();
252c9bd703SFrançois Revol 	virtual	status_t	GetFlavorAt(int32 n, const flavor_info ** out_info);
262c9bd703SFrançois Revol 	virtual	BMediaNode	*InstantiateNodeFor(
272c9bd703SFrançois Revol 							const flavor_info * info,
282c9bd703SFrançois Revol 							BMessage * config,
292c9bd703SFrançois Revol 							status_t * out_error);
302c9bd703SFrançois Revol 
GetConfigurationFor(BMediaNode * node,BMessage * message)312c9bd703SFrançois Revol 	virtual	status_t	GetConfigurationFor(BMediaNode *node, BMessage *message)
322c9bd703SFrançois Revol 								{ TOUCH(node); TOUCH(message); return B_OK; }
SaveConfigInfo(BMediaNode * node,BMessage * message)332c9bd703SFrançois Revol 	virtual	status_t	SaveConfigInfo(BMediaNode *node, BMessage *message)
342c9bd703SFrançois Revol 								{ TOUCH(node); TOUCH(message); return B_OK; }
352c9bd703SFrançois Revol 
WantsAutoStart()362c9bd703SFrançois Revol 	virtual	bool		WantsAutoStart() { return false; }
AutoStart(int in_count,BMediaNode ** out_node,int32 * out_internal_id,bool * out_has_more)372c9bd703SFrançois Revol 	virtual	status_t	AutoStart(int in_count, BMediaNode **out_node,
382c9bd703SFrançois Revol 								int32 *out_internal_id, bool *out_has_more)
392c9bd703SFrançois Revol 								{	TOUCH(in_count); TOUCH(out_node);
402c9bd703SFrançois Revol 									TOUCH(out_internal_id); TOUCH(out_has_more);
412c9bd703SFrançois Revol 									return B_ERROR; }
422c9bd703SFrançois Revol 		// those are for use by CamDevices
432c9bd703SFrançois Revol 		status_t		CameraAdded(CamDevice* device);
442c9bd703SFrançois Revol 		status_t		CameraRemoved(CamDevice* device);
452c9bd703SFrançois Revol 		void			FillDefaultFlavorInfo(flavor_info* info);
462c9bd703SFrançois Revol 
472c9bd703SFrançois Revol private:
482c9bd703SFrançois Revol 	uint32				fInternalIDCounter;
492c9bd703SFrançois Revol 	status_t			fInitStatus;
502c9bd703SFrançois Revol 	flavor_info			fDefaultFlavorInfo;
512c9bd703SFrançois Revol 	media_format		fMediaFormat;
522c9bd703SFrançois Revol 	CamRoster*			fRoster;
532c9bd703SFrançois Revol };
542c9bd703SFrançois Revol 
552c9bd703SFrançois Revol #endif
56