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