Fix warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24319 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a8006c78f0
commit
e53032e55d
src/add-ons/media/media-add-ons/usb_webcam
@ -109,7 +109,7 @@ WebCamMediaAddOn::InstantiateNodeFor(
|
||||
return NULL;
|
||||
|
||||
fRoster->Lock();
|
||||
for (int i = 0; i < fRoster->CountCameras(); i++) {
|
||||
for (uint32 i = 0; i < fRoster->CountCameras(); i++) {
|
||||
CamDevice *c;
|
||||
c = fRoster->CameraAt(i);
|
||||
PRINT((CH ": cam[%d]: %d, %s" CT, i, c->FlavorInfo()->internal_id, c->BrandName()));
|
||||
@ -147,6 +147,7 @@ WebCamMediaAddOn::CameraAdded(CamDevice* device)
|
||||
{
|
||||
PRINT((CH "()" CT));
|
||||
NotifyFlavorChange();
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
status_t
|
||||
@ -154,6 +155,7 @@ WebCamMediaAddOn::CameraRemoved(CamDevice* device)
|
||||
{
|
||||
PRINT((CH "()" CT));
|
||||
NotifyFlavorChange();
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -40,7 +40,7 @@ CamBufferingDeframer::Write(const void *buffer, size_t size)
|
||||
|
||||
PRINT((CH "(%p, %d), IB: %d" CT, buffer, size, IB.BufferLength()));
|
||||
|
||||
if (l < fMinFrameSize + fSkipSOFTags + fSkipEOFTags)
|
||||
if (l < (int)(fMinFrameSize + fSkipSOFTags + fSkipEOFTags))
|
||||
return size; // not enough data anyway
|
||||
|
||||
if (!fCurrentFrame) {
|
||||
@ -53,9 +53,9 @@ CamBufferingDeframer::Write(const void *buffer, size_t size)
|
||||
}
|
||||
}
|
||||
|
||||
for (s = 0; (l - s > fMinFrameSize) && ((i = FindSOF(b + s, l - fMinFrameSize - s, &which)) > -1); s++) {
|
||||
for (s = 0; (l - s > (int)fMinFrameSize) && ((i = FindSOF(b + s, l - fMinFrameSize - s, &which)) > -1); s++) {
|
||||
s += i;
|
||||
if (s + fSkipSOFTags + fMinFrameSize + fSkipEOFTags > l)
|
||||
if ((int)(s + fSkipSOFTags + fMinFrameSize + fSkipEOFTags) > l)
|
||||
break;
|
||||
if (!fDevice->ValidateStartOfFrameTag(b + s, fSkipSOFTags))
|
||||
continue;
|
||||
@ -64,7 +64,7 @@ CamBufferingDeframer::Write(const void *buffer, size_t size)
|
||||
PRINT((CH ": SOF: ... %02x %02x %02x %02x %02x %02x" CT, b[s+6], b[s+7], b[s+8], b[s+9], b[s+10], b[s+11]));
|
||||
|
||||
for (e = s + fSkipSOFTags + fMinFrameSize;
|
||||
((e <= s + fSkipSOFTags + fMaxFrameSize) &&
|
||||
((e <= (int)(s + fSkipSOFTags + fMaxFrameSize)) &&
|
||||
(e < l) && ((i = 0*FindEOF(b + e, l - e, &which)) > -1));
|
||||
e++) {
|
||||
e += i;
|
||||
@ -115,6 +115,6 @@ CamBufferingDeframer::DiscardFromInput(size_t size)
|
||||
IB.Seek(0LL, SEEK_SET);
|
||||
IB.SetSize(0);
|
||||
fInputBuffIndex = next;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,6 @@ CamDeframer::WaitFrame(bigtime_t timeout)
|
||||
status_t
|
||||
CamDeframer::GetFrame(CamFrame **frame, bigtime_t *stamp)
|
||||
{
|
||||
status_t err = EINTR;
|
||||
PRINT((CH "()" CT));
|
||||
BAutolock l(fLocker);
|
||||
CamFrame *f = (CamFrame *)fFrames.RemoveItem((int32)0);
|
||||
@ -115,7 +114,6 @@ CamDeframer::GetFrame(CamFrame **frame, bigtime_t *stamp)
|
||||
status_t
|
||||
CamDeframer::DropFrame()
|
||||
{
|
||||
status_t err = EINTR;
|
||||
PRINT((CH "()" CT));
|
||||
BAutolock l(fLocker);
|
||||
CamFrame *f = (CamFrame *)fFrames.RemoveItem((int32)0);
|
||||
@ -161,7 +159,7 @@ int
|
||||
CamDeframer::FindTags(const uint8 *buf, size_t buflen, const uint8 **tags, int tagcount, size_t taglen, size_t skiplen, int *which)
|
||||
{
|
||||
int i, t;
|
||||
for (i = 0; i < buflen - skiplen + 1; i++) {
|
||||
for (i = 0; i < (int)(buflen - skiplen + 1); i++) {
|
||||
for (t = 0; t < tagcount; t++) {
|
||||
if (!memcmp(buf+i, tags[t], taglen)) {
|
||||
if (which)
|
||||
|
@ -29,12 +29,12 @@ struct { const char *name; SensorInstFunc instfunc; } kSensorTable[] = {
|
||||
// -----------------------------------------------------------------------------
|
||||
CamDevice::CamDevice(CamDeviceAddon &_addon, BUSBDevice* _device)
|
||||
: fInitStatus(B_NO_INIT),
|
||||
fSensor(NULL),
|
||||
fCamDeviceAddon(_addon),
|
||||
fDevice(_device),
|
||||
fSupportedDeviceIndex(-1),
|
||||
fTransferEnabled(false),
|
||||
fLocker("WebcamDeviceLock"),
|
||||
fSensor(NULL)
|
||||
fLocker("WebcamDeviceLock")
|
||||
{
|
||||
// fill in the generic flavor
|
||||
memset(&fFlavorInfo, 0, sizeof(fFlavorInfo));
|
||||
|
@ -61,7 +61,7 @@ void
|
||||
CamRoster::DeviceRemoved(BUSBDevice* _device)
|
||||
{
|
||||
PRINT((CH "()" CT));
|
||||
for(uint32 i = 0; i < fCameras.CountItems(); ++i)
|
||||
for(int32 i = 0; i < fCameras.CountItems(); ++i)
|
||||
{
|
||||
CamDevice* cam = (CamDevice *)fCameras.ItemAt(i);
|
||||
if( cam->Matches(_device) )
|
||||
|
@ -115,7 +115,7 @@ CamStreamingDeframer::Write(const void *buffer, size_t size)
|
||||
}
|
||||
PRINT((CH ": checking for EOF; bufsize=%d i=%d" CT, bufsize, i));
|
||||
|
||||
if (i + fSkipEOFTags > bufsize) { // not enough room to check for EOF, leave it for next time
|
||||
if (i + (int)fSkipEOFTags > bufsize) { // not enough room to check for EOF, leave it for next time
|
||||
end = i;
|
||||
i = -1; // don't detach yet
|
||||
} else {
|
||||
|
@ -762,8 +762,8 @@ VideoProducer::FrameGenerator()
|
||||
|
||||
// This is where we fill the video buffer.
|
||||
|
||||
uint32 *p = (uint32 *)buffer->Data();
|
||||
#if 0
|
||||
uint32 *p = (uint32 *)buffer->Data();
|
||||
/* Fill in a pattern */
|
||||
for (uint32 y=0;y<fConnectedFormat.display.line_count;y++)
|
||||
for (uint32 x=0;x<fConnectedFormat.display.line_width;x++)
|
||||
|
@ -62,7 +62,7 @@ SonixCamDevice::SonixCamDevice(CamDeviceAddon &_addon, BUSBDevice* _device)
|
||||
const BUSBConfiguration *config = GetDevice()->ConfigurationAt(0);
|
||||
if (config) {
|
||||
const BUSBInterface *inter = config->InterfaceAt(0);
|
||||
int i;
|
||||
uint32 i;
|
||||
|
||||
GetDevice()->SetConfiguration(config);
|
||||
|
||||
@ -228,7 +228,6 @@ ssize_t
|
||||
SonixCamDevice::WriteIIC(uint8 address, uint8 *data, size_t count)
|
||||
{
|
||||
status_t err;
|
||||
uint8 status;
|
||||
uint8 buffer[8];
|
||||
if (!Sensor())
|
||||
return B_NO_INIT;
|
||||
@ -265,7 +264,6 @@ ssize_t
|
||||
SonixCamDevice::ReadIIC(uint8 address, uint8 *data)
|
||||
{
|
||||
status_t err, lasterr = B_OK;
|
||||
uint8 status;
|
||||
uint8 buffer[8];
|
||||
if (!Sensor())
|
||||
return B_NO_INIT;
|
||||
@ -431,8 +429,8 @@ SonixCamDevice::GetFrameBitmap(BBitmap **bm, bigtime_t *stamp /* = NULL */)
|
||||
return err;
|
||||
PRINT((CH ": VideoFrame = %fx%f,%fx%f" CT, VideoFrame().left, VideoFrame().top, VideoFrame().right, VideoFrame().bottom));
|
||||
|
||||
long int w = VideoFrame().right - VideoFrame().left + 1;
|
||||
long int h = VideoFrame().bottom - VideoFrame().top + 1;
|
||||
long int w = (long)(VideoFrame().right - VideoFrame().left + 1);
|
||||
long int h = (long)(VideoFrame().bottom - VideoFrame().top + 1);
|
||||
b = new BBitmap(VideoFrame().OffsetToSelf(0,0), 0, B_RGB32, w*4);
|
||||
PRINT((CH ": Frame: %dx%d" CT, w, h));
|
||||
|
||||
@ -462,17 +460,17 @@ SonixCamDevice::FillFrameBuffer(BBuffer *buffer, bigtime_t *stamp)
|
||||
if (err < B_OK)
|
||||
return err;
|
||||
|
||||
long int w = VideoFrame().right - VideoFrame().left + 1;
|
||||
long int h = VideoFrame().bottom - VideoFrame().top + 1;
|
||||
long int w = (long)(VideoFrame().right - VideoFrame().left + 1);
|
||||
long int h = (long)(VideoFrame().bottom - VideoFrame().top + 1);
|
||||
PRINT((CH ": VideoFrame = %fx%f,%fx%f Frame: %dx%d" CT, VideoFrame().left, VideoFrame().top, VideoFrame().right, VideoFrame().bottom, w, h));
|
||||
|
||||
if (buffer->SizeAvailable() >= w*h*4)
|
||||
if (buffer->SizeAvailable() >= (size_t)w*h*4)
|
||||
bayer2rgb32le((unsigned char *)buffer->Data(), (unsigned char *)f->Buffer(), w, h);
|
||||
|
||||
delete f;
|
||||
|
||||
PRINT((CH ": available %d, required %d" CT, buffer->SizeAvailable(), w*h*4));
|
||||
if (buffer->SizeAvailable() < w*h*4)
|
||||
if (buffer->SizeAvailable() < (size_t)w*h*4)
|
||||
return E2BIG;
|
||||
PRINT((CH ": got 1 frame (len %d)" CT, buffer->SizeUsed()));
|
||||
return B_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user