xref: /haiku/src/add-ons/media/media-add-ons/AbstractFileInterfaceAddOn.h (revision 232527b28241d16ac7e74f43984ce45fe1682039)
1242094dbSshatty // AbstractFileInterfaceAddOn.h
2242094dbSshatty //
3242094dbSshatty // Andrew Bachmann, 2002
4242094dbSshatty //
5242094dbSshatty // AbstractFileInterfaceAddOn is an add-on
6242094dbSshatty // that can make instances of AbstractFileInterfaceNode
7242094dbSshatty //
8242094dbSshatty // AbstractFileInterfaceNode handles a file and a multistream
9242094dbSshatty 
10242094dbSshatty #if !defined(_ABSTRACT_FILE_INTERFACE_ADD_ON_H)
11242094dbSshatty #define _ABSTRACT_FILE_INTERFACE_ADD_ON_H
12242094dbSshatty 
13242094dbSshatty #include <MediaDefs.h>
14242094dbSshatty #include <MediaAddOn.h>
15242094dbSshatty 
16242094dbSshatty class AbstractFileInterfaceAddOn :
17242094dbSshatty     public BMediaAddOn
18242094dbSshatty {
19242094dbSshatty public:
20242094dbSshatty 	virtual ~AbstractFileInterfaceAddOn(void);
21242094dbSshatty 	explicit AbstractFileInterfaceAddOn(image_id image);
22242094dbSshatty 
23242094dbSshatty /**************************/
24242094dbSshatty /* begin from BMediaAddOn */
25242094dbSshatty public:
26242094dbSshatty virtual	status_t InitCheck(
27242094dbSshatty 				const char ** out_failure_text);
28242094dbSshatty virtual	int32 CountFlavors(void);
29242094dbSshatty virtual	status_t GetFlavorAt(
30242094dbSshatty 				int32 n,
31242094dbSshatty 				const flavor_info ** out_info);
32242094dbSshatty virtual	BMediaNode * InstantiateNodeFor(
33242094dbSshatty 				const flavor_info * info,
34242094dbSshatty 				BMessage * config,
35242094dbSshatty 				status_t * out_error) = 0;
36242094dbSshatty virtual	status_t GetConfigurationFor(
37242094dbSshatty 				BMediaNode * your_node,
38242094dbSshatty 				BMessage * into_message);
39242094dbSshatty virtual	bool WantsAutoStart(void);
40242094dbSshatty virtual	status_t AutoStart(
41242094dbSshatty 				int in_count,
42242094dbSshatty 				BMediaNode ** out_node,
43242094dbSshatty 				int32 * out_internal_id,
44242094dbSshatty 				bool * out_has_more);
45242094dbSshatty 
46242094dbSshatty /* only implement if you have a B_FILE_INTERFACE node */
47242094dbSshatty virtual	status_t SniffRef(
48242094dbSshatty 				const entry_ref & file,
49242094dbSshatty 				BMimeType * io_mime_type,
50242094dbSshatty 				float * out_quality,
51242094dbSshatty 				int32 * out_internal_id);
52242094dbSshatty virtual	status_t SniffType(					//	This is broken if you deal with producers
53242094dbSshatty 				const BMimeType & type,		//	and consumers both. Use SniffTypeKind instead.
54242094dbSshatty 				float * out_quality,		//	If you implement SniffTypeKind, this doesn't
55242094dbSshatty 				int32 * out_internal_id);	//	get called.
56242094dbSshatty virtual	status_t GetFileFormatList(
57242094dbSshatty 				int32 flavor_id,			//	for this node flavor (if it matters)
58242094dbSshatty 				media_file_format * out_writable_formats, 	//	don't write here if NULL
59242094dbSshatty 				int32 in_write_items,		//	this many slots in out_writable_formats
60242094dbSshatty 				int32 * out_write_items,	//	set this to actual # available, even if bigger than in count
61242094dbSshatty 				media_file_format * out_readable_formats, 	//	don't write here if NULL
62242094dbSshatty 				int32 in_read_items,		//	this many slots in out_readable_formats
63242094dbSshatty 				int32 * out_read_items,		//	set this to actual # available, even if bigger than in count
64242094dbSshatty 				void * _reserved);			//	ignore until further notice
65242094dbSshatty virtual	status_t SniffTypeKind(				//	Like SniffType, but for the specific kind(s)
66242094dbSshatty 				const BMimeType & type,
67242094dbSshatty 				uint64 in_kinds,
68242094dbSshatty 				float * out_quality,
69242094dbSshatty 				int32 * out_internal_id,
70242094dbSshatty 				void * _reserved) = 0;
71242094dbSshatty virtual	status_t SniffTypeKind(				//	Like SniffType, but for the specific kind(s)
72242094dbSshatty 				const BMimeType & type,
73242094dbSshatty 				uint64 in_kinds,
74242094dbSshatty 				uint64 io_kind,
75242094dbSshatty 				float * out_quality,
76242094dbSshatty 				int32 * out_internal_id,
77242094dbSshatty 				void * _reserved);
78242094dbSshatty 
79242094dbSshatty 
80242094dbSshatty /* end from BMediaAddOn */
81242094dbSshatty /************************/
82242094dbSshatty 
83242094dbSshatty private:
84242094dbSshatty 
85242094dbSshatty 		AbstractFileInterfaceAddOn(	/* private unimplemented */
86242094dbSshatty 				const AbstractFileInterfaceAddOn & clone);
87242094dbSshatty 		AbstractFileInterfaceAddOn & operator=(
88242094dbSshatty 				const AbstractFileInterfaceAddOn & clone);
89242094dbSshatty 
90242094dbSshatty 		int32 refCount;
91242094dbSshatty 
92242094dbSshatty 		/* Mmmh, stuffing! */
93242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_0(void *);
94242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_1(void *);
95242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_2(void *);
96242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_3(void *);
97242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_4(void *);
98242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_5(void *);
99242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_6(void *);
100242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_7(void *);
101242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_8(void *);
102242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_9(void *);
103242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_10(void *);
104242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_11(void *);
105242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_12(void *);
106242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_13(void *);
107242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_14(void *);
108242094dbSshatty virtual		status_t _Reserved_AbstractFileInterfaceAddOn_15(void *);
109242094dbSshatty 
110*232527b2Sshatty 		uint32 _reserved_abstract_file_interface_add_on_[16];
111242094dbSshatty 
112242094dbSshatty };
113242094dbSshatty 
114242094dbSshatty #if BUILDING_ABSTRACT_FILE_INTERFACE__ADD_ON
115242094dbSshatty extern "C" _EXPORT BMediaAddOn * make_abstract_file_interface_add_on(image_id you);
116242094dbSshatty #endif
117242094dbSshatty 
118242094dbSshatty #endif /* _ABSTRACT_FILE_INTERFACE_ADD_ON_H */
119