xref: /haiku/src/add-ons/media/media-add-ons/video_producer_demo/AddOn.h (revision d6f3c208b19065c815ade9636c1a9137addb577c)
1*d6f3c208Sbeveloper #ifndef _VIDEO_ADDON_H
2*d6f3c208Sbeveloper #define _VIDEO_ADDON_H
3*d6f3c208Sbeveloper 
4*d6f3c208Sbeveloper #include <media/MediaAddOn.h>
5*d6f3c208Sbeveloper 
6*d6f3c208Sbeveloper #define TOUCH(x) ((void)(x))
7*d6f3c208Sbeveloper 
8*d6f3c208Sbeveloper extern "C" _EXPORT BMediaAddOn *make_media_addon(image_id you);
9*d6f3c208Sbeveloper 
10*d6f3c208Sbeveloper class MediaAddOn : public BMediaAddOn
11*d6f3c208Sbeveloper {
12*d6f3c208Sbeveloper public:
13*d6f3c208Sbeveloper 						MediaAddOn(image_id imid);
14*d6f3c208Sbeveloper 	virtual 			~MediaAddOn();
15*d6f3c208Sbeveloper 
16*d6f3c208Sbeveloper 	virtual	status_t	InitCheck(const char **out_failure_text);
17*d6f3c208Sbeveloper 
18*d6f3c208Sbeveloper 	virtual	int32		CountFlavors();
19*d6f3c208Sbeveloper 	virtual	status_t	GetFlavorAt(int32 n, const flavor_info ** out_info);
20*d6f3c208Sbeveloper 	virtual	BMediaNode	*InstantiateNodeFor(
21*d6f3c208Sbeveloper 							const flavor_info * info,
22*d6f3c208Sbeveloper 							BMessage * config,
23*d6f3c208Sbeveloper 							status_t * out_error);
24*d6f3c208Sbeveloper 
GetConfigurationFor(BMediaNode * node,BMessage * message)25*d6f3c208Sbeveloper 	virtual	status_t	GetConfigurationFor(BMediaNode *node, BMessage *message)
26*d6f3c208Sbeveloper 								{ TOUCH(node); TOUCH(message); return B_OK; }
SaveConfigInfo(BMediaNode * node,BMessage * message)27*d6f3c208Sbeveloper 	virtual	status_t	SaveConfigInfo(BMediaNode *node, BMessage *message)
28*d6f3c208Sbeveloper 								{ TOUCH(node); TOUCH(message); return B_OK; }
29*d6f3c208Sbeveloper 
WantsAutoStart()30*d6f3c208Sbeveloper 	virtual	bool		WantsAutoStart() { return false; }
AutoStart(int in_count,BMediaNode ** out_node,int32 * out_internal_id,bool * out_has_more)31*d6f3c208Sbeveloper 	virtual	status_t	AutoStart(int in_count, BMediaNode **out_node,
32*d6f3c208Sbeveloper 								int32 *out_internal_id, bool *out_has_more)
33*d6f3c208Sbeveloper 								{	TOUCH(in_count); TOUCH(out_node);
34*d6f3c208Sbeveloper 									TOUCH(out_internal_id); TOUCH(out_has_more);
35*d6f3c208Sbeveloper 									return B_ERROR; }
36*d6f3c208Sbeveloper 
37*d6f3c208Sbeveloper private:
38*d6f3c208Sbeveloper 	status_t			fInitStatus;
39*d6f3c208Sbeveloper 	flavor_info			fFlavorInfo;
40*d6f3c208Sbeveloper 	media_format		fMediaFormat;
41*d6f3c208Sbeveloper };
42*d6f3c208Sbeveloper 
43*d6f3c208Sbeveloper #endif
44