xref: /haiku/docs/develop/media/MediaFileProducerAddOn.h (revision 4bd0c1066b227cec4b79883bdef697c7a27f2e90)
1 // A MediaFileProducerAddOn is an add-on
2 // that can make MediaFileProducer nodes
3 
4 #if !defined(_MEDIA_FILE_PRODUCER_ADD_ON_H)
5 #define _MEDIA_FILE_PRODUCER_ADD_ON_H
6 
7 #include <MediaDefs.h>
8 #include <MediaAddOn.h>
9 
10 class MediaFileProducerAddOn :
11     public BMediaAddOn
12 {
13 public:
14 MediaFileProducerAddOn();
15 virtual ~MediaFileProducerAddOn();
16 
17 /**************************/
18 /* begin from BMediaAddOn */
19 public:
20 virtual	~BMediaAddOn();
21 
22 virtual	status_t InitCheck(
23 				const char ** out_failure_text);
24 virtual	int32 CountFlavors();
25 virtual	status_t GetFlavorAt(
26 				int32 n,
27 				const flavor_info ** out_info);
28 virtual	BMediaNode * InstantiateNodeFor(
29 				const flavor_info * info,
30 				BMessage * config,
31 				status_t * out_error);
32 virtual	status_t GetConfigurationFor(
33 				BMediaNode * your_node,
34 				BMessage * into_message);
35 virtual	bool WantsAutoStart();
36 virtual	status_t AutoStart(
37 				int in_count,
38 				BMediaNode ** out_node,
39 				int32 * out_internal_id,
40 				bool * out_has_more);
41 /* only implement if you have a B_FILE_INTERFACE node */
42 virtual	status_t SniffRef(
43 				const entry_ref & file,
44 				BMimeType * io_mime_type,
45 				float * out_quality,
46 				int32 * out_internal_id);
47 virtual	status_t SniffType(					//	This is broken if you deal with producers
48 				const BMimeType & type,		//	and consumers both. Use SniffTypeKind instead.
49 				float * out_quality,		//	If you implement SniffTypeKind, this doesn't
50 				int32 * out_internal_id);	//	get called.
51 virtual	status_t GetFileFormatList(
52 				int32 flavor_id,			//	for this node flavor (if it matters)
53 				media_file_format * out_writable_formats, 	//	don't write here if NULL
54 				int32 in_write_items,		//	this many slots in out_writable_formats
55 				int32 * out_write_items,	//	set this to actual # available, even if bigger than in count
56 				media_file_format * out_readable_formats, 	//	don't write here if NULL
57 				int32 in_read_items,		//	this many slots in out_readable_formats
58 				int32 * out_read_items,		//	set this to actual # available, even if bigger than in count
59 				void * _reserved);			//	ignore until further notice
60 virtual	status_t SniffTypeKind(				//	Like SniffType, but for the specific kind(s)
61 				const BMimeType & type,
62 				uint64 in_kinds,
63 				float * out_quality,
64 				int32 * out_internal_id,
65 				void * _reserved);
66 
67 
68 /* end from BMediaAddOn */
69 /************************/
70 
71 private:
72 
73 		MediaFileProducerAddOn(	/* private unimplemented */
74 				const MediaFileProducerAddOn & clone);
75 		MediaFileProducerAddOn & operator=(
76 				const MediaFileProducerAddOn & clone);
77 
78 		/* Mmmh, stuffing! */
79 virtual		status_t _Reserved_MediaFileProducerAddOn_0(void *);
80 virtual		status_t _Reserved_MediaFileProducerAddOn_1(void *);
81 virtual		status_t _Reserved_MediaFileProducerAddOn_2(void *);
82 virtual		status_t _Reserved_MediaFileProducerAddOn_3(void *);
83 virtual		status_t _Reserved_MediaFileProducerAddOn_4(void *);
84 virtual		status_t _Reserved_MediaFileProducerAddOn_5(void *);
85 virtual		status_t _Reserved_MediaFileProducerAddOn_6(void *);
86 virtual		status_t _Reserved_MediaFileProducerAddOn_7(void *);
87 virtual		status_t _Reserved_MediaFileProducerAddOn_8(void *);
88 virtual		status_t _Reserved_MediaFileProducerAddOn_9(void *);
89 virtual		status_t _Reserved_MediaFileProducerAddOn_10(void *);
90 virtual		status_t _Reserved_MediaFileProducerAddOn_11(void *);
91 virtual		status_t _Reserved_MediaFileProducerAddOn_12(void *);
92 virtual		status_t _Reserved_MediaFileProducerAddOn_13(void *);
93 virtual		status_t _Reserved_MediaFileProducerAddOn_14(void *);
94 virtual		status_t _Reserved_MediaFileProducerAddOn_15(void *);
95 
96 		uint32 _reserved_media_file_node_[16];
97 
98 };
99 
100 #if BUILDING_MEDIA_FILE_PRODUCER__ADD_ON
101 extern "C" _EXPORT BMediaAddOn * make_media_file_producer_add_on(image_id you);
102 #endif
103 
104 #endif /* _MEDIA_FILE_PRODUCER_ADD_ON_H */
105