• Post Reply Bookmark Topic Watch Topic
  • New Topic

Invalid ArgumentList error  RSS feed

 
Jessica Gaudette
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all. I've been working on this for a while and know I'm missing something silly (or at least that is what I think) and need some help. Could someone please review this code and tell me what I've done wrong? Thanks in advance!


package src.Ispeek.impl.media.configuration;

import java.util.*;
import javax.media.*;

public class VFWAuto {

public VFWAuto() {
Vector devices = (Vector) CaptureDeviceManager.getDeviceList(null).clone();
Enumeration enumeration = devices.elements();

while (enumeration.hasMoreElements()) {
CaptureDeviceInfo cdi = (CaptureDeviceInfo) enumeration.nextElement();
String name = cdi.getName();
if (name.startsWith("vfw:"))
CaptureDeviceManager.removeDevice(cdi);
}

int nDevices = 0;
for (int i = 0; i < 10; i++)
{
String name = VFWCapture.capDriverDescriptionName(int); //this is where I am getting the error- syntax error on token int Invalid ArgumentList// if (name != null && name.length() > 1) {
System.err.println("Found device " + name);
System.err.println("Querying device. Please wait...");
com.sun.media.protocol.vfw.VFWSourceStream.autoDetect(i); nDevices++; }
}
}

public static void main(String [] args) {
VFWAuto a = new VFWAuto();
System.exit(0);
}
}
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jessica Gaudette:
...String name = VFWCapture.capDriverDescriptionName(int);...

When calling this method, you need to provide the correct argument(s). I don't know what this method is expecting, but "int" is a type -- not a value.
 
Jessica Gaudette
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for pointing that out...This is what I changed- but am now getting a different error: I changed the int to name, as below, and am now getting "the local variable name may not have been intialized. What am I doing wrong? Name is a string- which is a value isn't it?

{
String name = VFWCapture.capDriverDescriptionName(name);
if (name != null && name.length() > 1)
System.err.println("Found device " + name);
System.err.println("Querying device. Please wait...");
com.sun.media.protocol.vfw.VFWSourceStream.autoDetect(i); nDevices++; }
}
 
David McCombs
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String name = VFWCapture.capDriverDescriptionName(name);

name has to be initialized to something before you can use it, and you seem to be trying to use it right before it gets initialized. Do you have an int named name, that you are trying to pass in this method? Or is that a String, the same string you are trying to initialize? From your original post it looks like an int value needs to be passed.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you're using the class com.sun.media.vfw.VFWCapture (documented here), in which case the method capGetDriverDescriptionName is looking for an int value as an argument. Unfortunately, this documentation falls a bit short, so I don't know what that value is supposed to mean.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!