xref: /haiku/src/add-ons/media/media-add-ons/AbstractFileInterfaceAddOn.h (revision 242094db6d5f3885b8cf944882c852029e1055a7)
1*242094dbSshatty // AbstractFileInterfaceAddOn.h
2*242094dbSshatty //
3*242094dbSshatty // Andrew Bachmann, 2002
4*242094dbSshatty //
5*242094dbSshatty // AbstractFileInterfaceAddOn is an add-on
6*242094dbSshatty // that can make instances of AbstractFileInterfaceNode
7*242094dbSshatty //
8*242094dbSshatty // AbstractFileInterfaceNode handles a file and a multistream
9*242094dbSshatty 
10*242094dbSshatty #if !defined(_ABSTRACT_FILE_INTERFACE_ADD_ON_H)
11*242094dbSshatty #define _ABSTRACT_FILE_INTERFACE_ADD_ON_H
12*242094dbSshatty 
13*242094dbSshatty #include <MediaDefs.h>
14*242094dbSshatty #include <MediaAddOn.h>
15*242094dbSshatty 
16*242094dbSshatty class AbstractFileInterfaceAddOn :
17*242094dbSshatty     public BMediaAddOn
18*242094dbSshatty {
19*242094dbSshatty public:
20*242094dbSshatty 	virtual ~AbstractFileInterfaceAddOn(void);
21*242094dbSshatty 	explicit AbstractFileInterfaceAddOn(image_id image);
22*242094dbSshatty 
23*242094dbSshatty /**************************/
24*242094dbSshatty /* begin from BMediaAddOn */
25*242094dbSshatty public:
26*242094dbSshatty virtual	status_t InitCheck(
27*242094dbSshatty 				const char ** out_failure_text);
28*242094dbSshatty virtual	int32 CountFlavors(void);
29*242094dbSshatty virtual	status_t GetFlavorAt(
30*242094dbSshatty 				int32 n,
31*242094dbSshatty 				const flavor_info ** out_info);
32*242094dbSshatty virtual	BMediaNode * InstantiateNodeFor(
33*242094dbSshatty 				const flavor_info * info,
34*242094dbSshatty 				BMessage * config,
35*242094dbSshatty 				status_t * out_error) = 0;
36*242094dbSshatty virtual	status_t GetConfigurationFor(
37*242094dbSshatty 				BMediaNode * your_node,
38*242094dbSshatty 				BMessage * into_message);
39*242094dbSshatty virtual	bool WantsAutoStart(void);
40*242094dbSshatty virtual	status_t AutoStart(
41*242094dbSshatty 				int in_count,
42*242094dbSshatty 				BMediaNode ** out_node,
43*242094dbSshatty 				int32 * out_internal_id,
44*242094dbSshatty 				bool * out_has_more);
45*242094dbSshatty 
46*242094dbSshatty /* only implement if you have a B_FILE_INTERFACE node */
47*242094dbSshatty virtual	status_t SniffRef(
48*242094dbSshatty 				const entry_ref & file,
49*242094dbSshatty 				BMimeType * io_mime_type,
50*242094dbSshatty 				float * out_quality,
51*242094dbSshatty 				int32 * out_internal_id);
52*242094dbSshatty virtual	status_t SniffType(					//	This is broken if you deal with producers
53*242094dbSshatty 				const BMimeType & type,		//	and consumers both. Use SniffTypeKind instead.
54*242094dbSshatty 				float * out_quality,		//	If you implement SniffTypeKind, this doesn't
55*242094dbSshatty 				int32 * out_internal_id);	//	get called.
56*242094dbSshatty virtual	status_t GetFileFormatList(
57*242094dbSshatty 				int32 flavor_id,			//	for this node flavor (if it matters)
58*242094dbSshatty 				media_file_format * out_writable_formats, 	//	don't write here if NULL
59*242094dbSshatty 				int32 in_write_items,		//	this many slots in out_writable_formats
60*242094dbSshatty 				int32 * out_write_items,	//	set this to actual # available, even if bigger than in count
61*242094dbSshatty 				media_file_format * out_readable_formats, 	//	don't write here if NULL
62*242094dbSshatty 				int32 in_read_items,		//	this many slots in out_readable_formats
63*242094dbSshatty 				int32 * out_read_items,		//	set this to actual # available, even if bigger than in count
64*242094dbSshatty 				void * _reserved);			//	ignore until further notice
65*242094dbSshatty virtual	status_t SniffTypeKind(				//	Like SniffType, but for the specific kind(s)
66*242094dbSshatty 				const BMimeType & type,
67*242094dbSshatty 				uint64 in_kinds,
68*242094dbSshatty 				float * out_quality,
69*242094dbSshatty 				int32 * out_internal_id,
70*242094dbSshatty 				void * _reserved) = 0;
71*242094dbSshatty virtual	status_t SniffTypeKind(				//	Like SniffType, but for the specific kind(s)
72*242094dbSshatty 				const BMimeType & type,
73*242094dbSshatty 				uint64 in_kinds,
74*242094dbSshatty 				uint64 io_kind,
75*242094dbSshatty 				float * out_quality,
76*242094dbSshatty 				int32 * out_internal_id,
77*242094dbSshatty 				void * _reserved);
78*242094dbSshatty 
79*242094dbSshatty 
80*242094dbSshatty /* end from BMediaAddOn */
81*242094dbSshatty /************************/
82*242094dbSshatty 
83*242094dbSshatty private:
84*242094dbSshatty 
85*242094dbSshatty 		AbstractFileInterfaceAddOn(	/* private unimplemented */
86*242094dbSshatty 				const AbstractFileInterfaceAddOn & clone);
87*242094dbSshatty 		AbstractFileInterfaceAddOn & operator=(
88*242094dbSshatty 				const AbstractFileInterfaceAddOn & clone);
89*242094dbSshatty 
90*242094dbSshatty 		int32 refCount;
91*242094dbSshatty 
92*242094dbSshatty 		/* Mmmh, stuffing! */
93*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_0(void *);
94*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_1(void *);
95*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_2(void *);
96*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_3(void *);
97*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_4(void *);
98*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_5(void *);
99*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_6(void *);
100*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_7(void *);
101*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_8(void *);
102*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_9(void *);
103*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_10(void *);
104*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_11(void *);
105*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_12(void *);
106*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_13(void *);
107*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_14(void *);
108*242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_15(void *);
109*242094dbSshatty 
110*242094dbSshatty 		uint32 _reserved_media_reader_add_on_[16];
111*242094dbSshatty 
112*242094dbSshatty };
113*242094dbSshatty 
114*242094dbSshatty #if BUILDING_ABSTRACT_FILE_INTERFACE__ADD_ON
115*242094dbSshatty extern "C" _EXPORT BMediaAddOn * make_abstract_file_interface_add_on(image_id you);
116*242094dbSshatty #endif
117*242094dbSshatty 
118*242094dbSshatty #endif /* _ABSTRACT_FILE_INTERFACE_ADD_ON_H */
119