1 /******************************************************************************
5 / Description: ATI Radeon Video Capture Media AddOn for BeOS.
7 / Copyright 2001, Carlos Hasan
9 *******************************************************************************/
11 #ifndef __RADEON_ADDON_H__
12 #define __RADEON_ADDON_H__
14 #include <media/MediaAddOn.h>
16 #include "benaphore.h"
18 #define TOUCH(x) ((void)(x))
20 extern "C" _EXPORT BMediaAddOn
*make_media_addon(image_id you
);
24 // descriptor of a possible Radeon node
27 CRadeonPlug( CRadeonAddOn
*addon
, const BPath
&dev_path
, int id
);
30 const char *getName() { return fFlavorInfo
.name
; }
31 const char *getDeviceName() { return dev_path
.Path(); }
32 const char *getDeviceShortName() { return dev_path
.Leaf(); }
33 flavor_info
*getFlavorInfo() { return &fFlavorInfo
; }
34 BMediaNode
*getNode() { return node
; }
35 void setNode( BMediaNode
*anode
) { node
= anode
; }
36 BMessage
*getSettings() { return &settings
; }
38 void writeSettings( BMessage
*new_settings
);
41 CRadeonAddOn
*addon
; // (global) addon (only needed for GetConfiguration())
42 BPath dev_path
; // path of device driver
44 flavor_info fFlavorInfo
; // flavor of plug (contains unique id)
45 BMediaNode
*node
; // active node (or NULL)
46 BMessage settings
; // settings for this node
47 media_format fMediaFormat
[4];
50 BPath
getSettingsPath();
53 class CRadeonAddOn
: public BMediaAddOn
56 CRadeonAddOn(image_id imid
);
57 virtual ~CRadeonAddOn();
59 virtual status_t
InitCheck(const char **out_failure_text
);
61 virtual int32
CountFlavors();
62 virtual status_t
GetFlavorAt(int32 n
, const flavor_info
** out_info
);
63 virtual BMediaNode
*InstantiateNodeFor(
64 const flavor_info
* info
,
66 status_t
* out_error
);
68 virtual status_t
SaveConfigInfo(BMediaNode
*node
, BMessage
*message
)
69 { TOUCH(node
); TOUCH(message
); return B_OK
; }
71 virtual bool WantsAutoStart() { return false; }
72 virtual status_t
AutoStart(int in_count
, BMediaNode
**out_node
,
73 int32
*out_internal_id
, bool *out_has_more
)
74 { TOUCH(in_count
); TOUCH(out_node
);
75 TOUCH(out_internal_id
); TOUCH(out_has_more
);
78 virtual status_t
GetConfigurationFor(
79 BMediaNode
*your_node
,
80 BMessage
*into_message
);
83 void UnregisterNode( BMediaNode
*node
, BMessage
*settings
);
87 BList fDevices
; // list of BPath of found devices
88 thread_id settings_thread
;
89 sem_id settings_thread_sem
;
93 status_t
RecursiveScan( const char* rootPath
, BEntry
*rootEntry
= NULL
);
94 static int32
settings_writer( void *param
);
95 void settingsWriter();