vlcj:: Unable to load library 'libvlc' in 64bit OS - stream

I am using 64 bit OS Windows 7 and i have 32 bit VLC versioned 1.1.8.
I have added these libraries
jna.jar
platform.jar
vlcj-1.1.5.1.jar
I am not able to stream using jVlc
public class HelloVLC {
/**
* #param args
* #throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
System.out.println( WindowsRuntimeUtil.getVlcInstallDir());
NativeLibrary.addSearchPath("libvlc", "C:\\Program Files (x86)\\VideoLAN\\VLC");
String media = "dshow://";
String[] options = {" :dshow-vdev=Integrated Webcam :dshow-adev= :dshow-caching=200", ":sout = #transcode{vcodec=theo,vb=800,scale=0.25,acodec=vorb,ab=128,channels=2,samplerate=44100}:display :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep"};
System.out.println("Streaming '" + media + "' to '" + options + "'");
MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();
final HeadlessMediaPlayer mediaPlayer = mediaPlayerFactory.newMediaPlayer();
mediaPlayer.playMedia(media, options);
}
}
I am getting the error Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libvlc': The specified module could not be found.
Kindly help. Is there any way to get this code work in 64 bit OS????

have you tried running it with a 32-bit JVM?

if you are using windows 7 then search for a file libvlc.dll and libvlccore.dll files in to your vlc installation and add their path to code that you've written in
NativeLibrary.addSearchPath() also add...
this worked me in my case windows 7.
NativeLibrary.addSearchPath(
RuntimeUtil.getLibVlcLibraryName(), ""c:/Program Files/VideoLAN/VLC/");
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
LibXUtil.initialise();

VLCj comes with automagic discovery methods, os-independent, that adds the relevent path to JNA:s search path:
NativeDiscovery nd = new NativeDiscovery();
if (!nd.discover()) {
System.out.println("VLC not found");
System.exit(-1);
}
String vlcLibName = RuntimeUtil.getLibVlcName();
String vlcLibCoreName = RuntimeUtil.getLibVlcCoreName();
Native.loadLibrary(vlcLibName, LibVlc.class);
...etc
for a good tutorial on how to load the VLC natives, see
http://capricasoftware.co.uk/#/projects/vlcj/tutorial/first-steps
(See also the previous steps in that tutorial)!

Related

running ECSTask in IOS

I am new to IOS platform. I have a code snippet written using JAVA API.
AmazonECS amazonECS = new AmazonECSClient(credentials).withRegion(usWest1);
String command="bash /opt/run-task.sh "+"/mnt/s3/inputFile1::/mnt/s3/inputFile2"+" "+ "outputFile";
ContainerOverride containerOverrides = new ContainerOverride().withCommand(command).withName("<<container name>>");
TaskOverride overrides = new TaskOverride().withContainerOverrides(containerOverrides);
RunTaskRequest runTaskRequest = new RunTaskRequest().withCluster("<<cluster name>>").withTaskDefinition("<<task definition arn>>")
.withOverrides(overrides).withGeneralProgressListener(new ProgressListener() {
#Override
public void progressChanged(ProgressEvent progressEvent) {
System.out.println(progressEvent.getBytesTransferred());
System.out.println(progressEvent.getEventType());
}
});
Task task = new Task().withTaskDefinitionArn("<<task definition arn>>")
.withOverrides(overrides);
RunTaskResult runTaskResult = amazonECS.runTask(runTaskRequest).withTasks(task);
List<Failure> failures = runTaskResult.withTasks(task).getFailures();
I am using ffmpeg to merge few video files as single file. I need to know if there is equivalent functionality available in IOS.

Invoking Adapter from Java - Worklight 6.2

Below is the java sample code from worklight to invoke adapter.
public static void testAdapterCall(){
try{
DataAccessService service = WorklightBundles.getInstance().getDataAccessService();
String paramArray = "[5, 3,]";
ProcedureQName procedureQname = new ProcedureQName("CalculatorAdapter", "addTwoIntegers");
InvocationResult result = service.invokeProcedure(procedureQname, paramArray);
}
catch(Exception e)
{
e.printStackTrace();
}
}
I'm getting a Null Pointer exception, when it goes to line
DataAccessService service = WorklightBundles.getInstance().getDataAccessService();
Log is as below:
java.lang.NullPointerException
at com.worklight.customcode.Calculator1.testAdapterCall(Calculator1.java:38)
at com.worklight.customcode.Calculator1.main(Calculator1.java:53)
Versions:
Java 1.7
Worklight 6.2
The Adapter is deployed, and the server is also running locally.
I saw this question in other sites also, but it is not answered.
Any help is highly appreciated.
See the documentation in the following PDF document, starting page #13.
public void callProcedure() {
DataAccessService service = worklightBundles.getInstance().getDataAccessService();
String paramArray = "['param1', 'param2', 'param3']";
ProcedureQName procedureQName = new ProcedureQName("adapterName",
"procedureName");
InvocationResult result = service.invokeProcedure(ProcedureQName,
paramArray);
JSONObject jsonObject = result.toJSON();
String value = (String)jsonObject.get("key");
}
Be sure to add any missing includes once you enter the code into a Java IDE, such as Eclipse.

Vaadin File Uploading using FileFilter

I am Using Vaadin Framework. I need to Upload Files in the format of PDF,JAR & ZIP only. I tried with this code.This code is also I got from STACK OVER FLOW.
public void uploadStarted(StartedEvent event) {
// TODO Auto-generated method stub
System.out.println("***Upload: uploadStarted()");
ArrayList<String> allowedMimeTypes = new ArrayList<String>();
allowedMimeTypes.add("application/java-archive");
allowedMimeTypes.add("application/pdf");
allowedMimeTypes.add("application/zip");
String contentType = event.getMIMEType();
boolean allowed = false;
System.out.println(":::::::::::::contentType::::::"
+ contentType);
for (int i = 0; i < allowedMimeTypes.size(); i++) {
if (contentType.equalsIgnoreCase(allowedMimeTypes.get(i))) {
allowed = true;
break;
}
}
try {
if (allowed) {
System.out.println("boolean value:::::::allowed"
+ allowed);
finalDeedUpload.setReceiver(finalDeedFileUploadHandler);
finalDeedUpload.addListener(finalDeedFileUploadHandler);
} else {
showWarningNotification(
"Error:Please Upload File in Given Format", "");
}
This is working for while uploading PDf files it's working, while uploading Zip OR Jar file and any other file it is showing NULLPOINTER EXCEPTION.
Please help me.
Vaadin has a special upload component which is easy to use. There is a whole chapter in Book of Vaadin related to this component.
https://vaadin.com/book/-/page/components.upload.html
In Vaadin 14 there is a method setAcceptedFileTypes at class Upload:
MemoryBuffer buffer = new MemoryBuffer();
Upload upload = new Upload(buffer);
upload.setAcceptedFileTypes(new String[]{"application/zip", "application/pdf", "application/java-archive"});
The method setAcceptedFileTypes sets the HTML attribute accept at the <input type="file"> element and therefore limits / filters what the application user can upload.

Vaadin 7 and applet

0.7 and I want to Call an Applet for use a Token.
I did various tests:
1) Use of AppletIntegration 1.2.9 but when I call applet there's an Exception "ClassNotFoundException PaintTarget"
2) Download Legacy 1.2.10 by https://github.com/Haulmont/AppletIntegration/releases but when I cal the page I have the Exception ""Widgetset does not contain implementation for org.vaadin.applet.AppletIntegration. Check its #ClientWidget mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions. Unrendered UIDL:
org.vaadin.applet.AppletIntegration(NO CLIENT IMPLEMENTATION FOUND)"
3) I create a class AppletCustom
public class AppletCustom extends CustomComponent {
public AppletCustom(String codebase,
String archive,
String code,
String width,
String height,
Map<String, String> params) {
setCompositionRoot(new Label("<div id='appletDiv'></div>", ContentMode.HTML));
StringBuilder sb = new StringBuilder();
/* create the applet */
sb.append("var obj = document.createElement('object');");
sb.append("obj.setAttribute('type','application/x-java-applet');");
sb.append("obj.setAttribute('width','" + width + "');");
sb.append("obj.setAttribute('height','" + height + "');");
sb.append("var codeParam = document.createElement('param');");
sb.append("codeParam.setAttribute('name', 'code');");
sb.append("codeParam.setAttribute('value', '" + code + "');");
sb.append("obj.appendChild(codeParam);");
sb.append("var archiveParam = document.createElement('param');");
sb.append("archiveParam.setAttribute('name', 'archive');");
sb.append("archiveParam.setAttribute('value','" + archive + "');");
sb.append("obj.appendChild(archiveParam);");
sb.append("var param = document.createElement('param');");
sb.append("param.setAttribute('name', 'codebase');");
sb.append("param.setAttribute('value','" + codebase + "');");
sb.append("obj.appendChild(param);");
/* add params to the applet if you like */
if(params != null && !params.isEmpty()){
Iterator<Entry<String, String>> it =
params.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, String> pairs = (Map.Entry<String, String>) it.next();
sb.append("param = document.createElement('param');");
sb.append("param.setAttribute('name', '" + pairs.getKey() + "');");
sb.append("param.setAttribute('value','" + pairs.getValue() + "');");
sb.append("obj.appendChild(param);");
}
}
sb.append("document.getElementById('appletDiv').appendChild(obj);");
JavaScript.getCurrent().execute(sb.toString());
}
}
and i Call it in the page. The applet is seen correctly but i must to return a value using the method
vaadinUpdateVariable("docName", docName + SIGNED_FILE_SUFFIX, true);
How can i resolve my problem?
you might have have run into one of two Maven GWT plugin bugs: [MGWT-147][1] or [MGWT-148][2] just like [Henri Sara][3] said .
i recommended this blog for you : Vaadin addons and maven and eclipse.
please read this also : Using Vaadin with Maven 2
to help you getting your add-on work . if still n't fixed i refer using [Embedded][6] ui component and avoid the hard coding html tag's.
i wish if i helped you if n't i'm sorry that all i know about Vaadin+applets.
1# jira.codehaus(.)org/browse/MGWT-147
2#jira.codehaus(.)org/browse/MGWT-148
3#vaadin(.)com/c/my_sites/view?groupId=13199&privateLayout=0
4# vaadin(.)com/download/prerelease/7.0/7.0.0/7.0.0.rc2/docs/api/com/vaadin/ui/Embedded.html

how to create database in blackberry mobile

List item
i developed an application , in which uses sq lite database . this is running properly on simulater . but when we application deploy on Blackberry curve 8520 mobile then . tell us database does not exist. anyone know answer please quick response ...
My Code is ->
public static void insertData( String pass , String cpass)
{
boolean fl=false;
String root = null;
MainScreen ms = new MainScreen();
Enumeration e = FileSystemRegistry.listRoots();
while (e.hasMoreElements())
{
root = (String)e.nextElement();
if(root.equalsIgnoreCase("store/"))
{
fl=true;
}
}
if(!fl)
{
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
Dialog.alert("This application requires an SD card to be present." +
"Exiting application...");
System.exit(0);
}
});
}
else
{
String dbLocation = "C:/om12345/sql/res/store/";
// Create URI
// Statement st=null;
try
{
URI myURI = URI.create("file:///store/home/user/databases/database.sqlite");
//URI myURI1=URI.
d = DatabaseFactory.create(myURI);
Statement st = d.createStatement( "insert into Admin (pass, Cpass) values('"+ pass+"','"+cpass+"')");
st.prepare();
st.execute();
st.close();
d.close();
//ms.add(new RichTextField ("tata" + "tata1"));
// UiApplication.getApplication.invokeLater(pushScreeen(ms));
}
catch ( Exception e1 )
{
System.out.println( e1.getMessage() );
e1.printStackTrace();
}
}
You likely can't store a sqlite database on /store for the 8520. See my answer to BlackBerry SQLite database creation: "filesystem not ready" for more information on that.
You will first need to change the line that says " String dbLocation = "C:/om12345/sql/res/store/";" since that refers to a location on your development machine but will not work on a mobile device. You need to point to the 'res' folder in your application itself.
You can not create database into store directory if you are having less than 1gb internal storage & you have saved your data base in C directory , which can be accessible from your system, but not on device. So change its location copied into it res folder.
& check if you are having SD card then save your database using /SDCard.
If SDCard is not available than you will able to access database , if you are having more than 1GB internal storage
have a look on this link
http://docs.blackberry.com/en/developers/deliverables/17952/SQLite_database_files_1219778_11.jsp

Resources