* fixed a couple of regressions of r37670 concerning optional build targets
(bluetooth, ac3_decoder, netfs) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37672 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
0041b38214
commit
0ea1aab28a
@ -31,9 +31,9 @@
|
||||
int32 api_version = B_CUR_DRIVER_API_VERSION;
|
||||
|
||||
// Modules
|
||||
static char* usb_name = B_USB_MODULE_NAME;
|
||||
static char* hci_name = BT_HCI_MODULE_NAME;
|
||||
static char* btDevices_name = BT_HCI_MODULE_NAME;
|
||||
static const char* usb_name = B_USB_MODULE_NAME;
|
||||
static const char* hci_name = BT_HCI_MODULE_NAME;
|
||||
static const char* btDevices_name = BT_HCI_MODULE_NAME;
|
||||
|
||||
|
||||
usb_module_info* usb = NULL;
|
||||
|
@ -21,9 +21,9 @@ extern "C" {
|
||||
static int netfs_mount(nspace_id nsid, const char *device, ulong flags,
|
||||
void *parameters, size_t len, void **data, vnode_id *rootID);
|
||||
static int netfs_unmount(void *ns);
|
||||
static int netfs_sync(void *ns);
|
||||
//static int netfs_sync(void *ns);
|
||||
static int netfs_read_fs_stat(void *ns, struct fs_info *info);
|
||||
static int netfs_write_fs_stat(void *ns, struct fs_info *info, long mask);
|
||||
//static int netfs_write_fs_stat(void *ns, struct fs_info *info, long mask);
|
||||
|
||||
// vnodes
|
||||
static int netfs_read_vnode(void *ns, vnode_id vnid, char reenter,
|
||||
@ -32,7 +32,7 @@ static int netfs_write_vnode(void *ns, void *node, char reenter);
|
||||
static int netfs_remove_vnode(void *ns, void *node, char reenter);
|
||||
|
||||
// nodes
|
||||
static int netfs_fsync(void *ns, void *node);
|
||||
//static int netfs_fsync(void *ns, void *node);
|
||||
static int netfs_read_stat(void *ns, void *node, struct stat *st);
|
||||
static int netfs_write_stat(void *ns, void *node, struct stat *st,
|
||||
long mask);
|
||||
@ -50,7 +50,7 @@ static int netfs_write(void *ns, void *node, void *cookie, off_t pos,
|
||||
const void *buffer, size_t *bufferSize);
|
||||
static int netfs_ioctl(void *ns, void *node, void *cookie, int cmd,
|
||||
void *buffer, size_t bufferSize);
|
||||
static int netfs_setflags(void *ns, void *node, void *cookie, int flags);
|
||||
//static int netfs_setflags(void *ns, void *node, void *cookie, int flags);
|
||||
|
||||
// hard links / symlinks
|
||||
static int netfs_link(void *ns, void *dir, const char *name, void *node);
|
||||
@ -239,6 +239,8 @@ netfs_unmount(void *ns)
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
#if 0 // not used
|
||||
|
||||
// netfs_sync
|
||||
static
|
||||
int
|
||||
@ -259,6 +261,8 @@ netfs_sync(void *ns)
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// netfs_read_fs_stat
|
||||
static
|
||||
int
|
||||
@ -279,6 +283,8 @@ netfs_read_fs_stat(void *ns, struct fs_info *info)
|
||||
return error;
|
||||
}
|
||||
|
||||
#if 0 // not used
|
||||
|
||||
// netfs_write_fs_stat
|
||||
static
|
||||
int
|
||||
@ -299,6 +305,8 @@ netfs_write_fs_stat(void *ns, struct fs_info *info, long mask)
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark ----- vnodes -----
|
||||
|
||||
@ -355,6 +363,8 @@ netfs_remove_vnode(void *ns, void *_node, char reenter)
|
||||
// #pragma mark -
|
||||
// #pragma mark ----- nodes -----
|
||||
|
||||
#if 0 // not used
|
||||
|
||||
// netfs_fsync
|
||||
static
|
||||
int
|
||||
@ -367,6 +377,8 @@ netfs_fsync(void *ns, void *_node)
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// netfs_read_stat
|
||||
static
|
||||
int
|
||||
|
@ -43,7 +43,7 @@ AC3Decoder::AC3Decoder()
|
||||
{
|
||||
fInputBuffer = malloc(INPUT_BUFFER_MAX_SIZE);
|
||||
strcpy(fChannelInfo,"Unknown");
|
||||
|
||||
|
||||
fState = a52_init(0);
|
||||
if (fState) {
|
||||
fSamples = a52_samples(fState);
|
||||
@ -84,7 +84,7 @@ AC3Decoder::Setup(media_format *ioEncodedFormat,
|
||||
TRACE("AC3Decoder::Setup: couldn't get stream info\n");
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
// Sample offsets of the output buffer are stored in fInterleaveOffset
|
||||
// When a channel is not present, it is skipped, the rest is shifted left
|
||||
// The block of samples order presented by liba52 is
|
||||
@ -253,7 +253,7 @@ AC3Decoder::NegotiateOutputFormat(media_format *ioDecodedFormat)
|
||||
|
||||
ioDecodedFormat->u.raw_audio.buffer_size = 6 * 256 * fFrameSize;
|
||||
ioDecodedFormat->u.raw_audio.channel_mask = fChannelMask;
|
||||
|
||||
|
||||
TRACE("AC3Decoder::NegotiateOutputFormat: fFlags 0x%x, fFrameRate %d, fBitRate %d, fChannelCount %d, fFrameSize %d\n", fFlags, fFrameRate, fBitRate, fChannelCount, fFrameSize);
|
||||
|
||||
return B_OK;
|
||||
@ -267,7 +267,7 @@ AC3Decoder::Seek(uint32 seekTo,
|
||||
{
|
||||
fInputChunkSize = 0;
|
||||
fInputBufferSize = 0;
|
||||
|
||||
|
||||
TRACE("AC3Decoder::Seek called\n");
|
||||
|
||||
if (seekTo == B_MEDIA_SEEK_TO_TIME) {
|
||||
@ -297,7 +297,7 @@ AC3Decoder::Decode(void *buffer, int64 *frameCount,
|
||||
TRACE("AC3Decoder::Decode: DecodeNext failed\n");
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Every A/52 frame is composed of 6 blocks, each with an output of 256
|
||||
samples for each channel. The a52_block() function decodes the next
|
||||
@ -305,10 +305,10 @@ AC3Decoder::Decode(void *buffer, int64 *frameCount,
|
||||
audio in the frame. After each call, you should extract the audio data
|
||||
from the sample buffer.
|
||||
*/
|
||||
|
||||
|
||||
// fInterleaveOffset[] is used to provide a correct interleave of
|
||||
// multi channel audio
|
||||
|
||||
|
||||
for (int i = 0; i < 6; i++) {
|
||||
a52_block(fState);
|
||||
for (int j = 0; j < fChannelCount; j++) {
|
||||
@ -320,7 +320,7 @@ AC3Decoder::Decode(void *buffer, int64 *frameCount,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mediaHeader->start_time = fStartTime;
|
||||
mediaHeader->type = B_MEDIA_RAW_AUDIO;
|
||||
mediaHeader->size_used = 6 * 256 * fFrameSize;
|
||||
@ -344,7 +344,8 @@ AC3Decoder::InputGetData(void **buffer, int size)
|
||||
return true;
|
||||
}
|
||||
if (fInputChunkSize > 0) {
|
||||
int bytes = min_c(size - fInputBufferSize, fInputChunkSize);
|
||||
int bytes
|
||||
= min_c((size_t)(size - fInputBufferSize), fInputChunkSize);
|
||||
memcpy((char *)fInputBuffer + fInputBufferSize, (char *)fInputChunk + fInputChunkOffset, bytes);
|
||||
fInputChunkOffset += bytes;
|
||||
fInputChunkSize -= bytes;
|
||||
@ -368,7 +369,7 @@ void
|
||||
AC3Decoder::InputRemoveData(int size)
|
||||
{
|
||||
fInputBufferSize -= size;
|
||||
|
||||
|
||||
if (fInputBufferSize)
|
||||
memmove(fInputBuffer, (char *)fInputBuffer + size, fInputBufferSize);
|
||||
}
|
||||
@ -398,9 +399,9 @@ AC3Decoder::DecodeNext()
|
||||
TRACE("AC3Decoder::DecodeNext: can't get 7 bytes\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int flags, sample_rate, bit_rate;
|
||||
|
||||
|
||||
int bytes = a52_syncinfo((uint8_t *)input, &flags, &sample_rate, &bit_rate);
|
||||
if (bytes == 0) {
|
||||
TRACE("AC3Decoder::DecodeNext: syncinfo failed\n");
|
||||
@ -414,23 +415,23 @@ AC3Decoder::DecodeNext()
|
||||
TRACE("AC3Decoder::DecodeNext: can't get %d data bytes\n", bytes);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// printf("fFlags 0x%x, flags 0x%x\n", fFlags, flags);
|
||||
|
||||
|
||||
flags = fFlags | A52_ADJUST_LEVEL;
|
||||
sample_t level = 1.0;
|
||||
if (0 != a52_frame(fState, (uint8_t *)input, &flags, &level, 0)) {
|
||||
TRACE("AC3Decoder::DecodeNext: a52_frame failed\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
TRACE("decoded %d bytes, flags 0x%x\n", bytes, fFlags);
|
||||
|
||||
InputRemoveData(bytes);
|
||||
|
||||
|
||||
if (fDisableDynamicCompression)
|
||||
a52_dynrng(fState, NULL, 0);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -35,16 +35,16 @@ DeviceManager::MessageReceived(BMessage* msg)
|
||||
entry_ref ref;
|
||||
const char *name;
|
||||
BDirectory dir;
|
||||
|
||||
|
||||
Output::Instance()->Post("Something new in the bus ... ", BLACKBOARD_DEVICEMANAGER);
|
||||
|
||||
|
||||
if ((msg->FindInt32("device", &ref.device)!=B_OK)
|
||||
|| (msg->FindInt64("directory", &ref.directory)!=B_OK)
|
||||
|| (msg->FindString("name", &name) != B_OK))
|
||||
return;
|
||||
|
||||
|
||||
Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER, " -> %s\n", name);
|
||||
|
||||
|
||||
ref.set_name(name);
|
||||
|
||||
// Check if the entry is a File or a directory
|
||||
@ -53,7 +53,7 @@ DeviceManager::MessageReceived(BMessage* msg)
|
||||
node_ref nref;
|
||||
dir.GetNodeRef(&nref);
|
||||
AddDirectory(&nref);
|
||||
|
||||
|
||||
} else {
|
||||
printf("%s: Entry %s is taken as a file\n", __FUNCTION__, name);
|
||||
AddDevice(&ref);
|
||||
@ -64,8 +64,8 @@ DeviceManager::MessageReceived(BMessage* msg)
|
||||
{
|
||||
Output::Instance()->Post("Something removed from the bus ...\n",
|
||||
BLACKBOARD_DEVICEMANAGER);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case B_STAT_CHANGED:
|
||||
case B_ATTR_CHANGED:
|
||||
@ -95,13 +95,13 @@ DeviceManager::AddDirectory(node_ref *nref)
|
||||
Output::Instance()->Post("AddDirectory::watch_node Failed\n", BLACKBOARD_DEVICEMANAGER);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
// BPath path(*nref);
|
||||
// BString str(path.Path());
|
||||
//
|
||||
// Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER,
|
||||
//
|
||||
// Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER,
|
||||
// "Exploring entries in %s\n", str.String());
|
||||
|
||||
|
||||
entry_ref ref;
|
||||
status_t error;
|
||||
while ((error = directory.GetNextRef(&ref)) == B_OK) {
|
||||
@ -109,7 +109,7 @@ DeviceManager::AddDirectory(node_ref *nref)
|
||||
AddDevice(&ref);
|
||||
}
|
||||
|
||||
Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER,
|
||||
Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER,
|
||||
"Finished exploring entries(%s)\n", strerror(error));
|
||||
|
||||
return (error == B_OK || error == B_ENTRY_NOT_FOUND)?B_OK:error;
|
||||
@ -285,8 +285,8 @@ DeviceManager::StopMonitoringDevice(const char *device)
|
||||
return err;
|
||||
|
||||
// test if still monitored
|
||||
bool stillMonitored = false;
|
||||
/*
|
||||
bool stillMonitored = false;
|
||||
int32 i = 0;
|
||||
while ((tmpaddon = (_BDeviceAddOn_ *)fDeviceAddons.ItemAt(i++)) !=NULL) {
|
||||
if (addon == tmpaddon)
|
||||
|
Loading…
x
Reference in New Issue
Block a user