Comments (2)
Can you replicate with the BasicPipeline example at https://github.com/gstreamer-java/gst1-java-examples/tree/master/BasicPipeline ?
What's the relation with com.cisco.jtapi.collabEdgeIvr
?
Unfortunately we don't have CI testing on 1.22 at the moment. It could be that updates are required in the bindings. If this is for a commercial project, please contact me as covered in the readme.
from gst1-java-core.
Can you replicate with the BasicPipeline example at https://github.com/gstreamer-java/gst1-java-examples/tree/master/BasicPipeline ?
What's the relation with
com.cisco.jtapi.collabEdgeIvr
?Unfortunately we don't have CI testing on 1.22 at the moment. It could be that updates are required in the bindings. If this is for a commercial project, please contact me as covered in the readme.
Hi Neil,
Further to our conversation, here is the code I'm using after I removed the additional dependencies that might be an issue.
Thank you for the support.
`package com.cisco.jtapi.collabEdgeIvr;
import java.time.format.DateTimeFormatter;
import java.time.LocalDateTime;
import java.time.DayOfWeek;
import java.time.LocalTime;
import org.freedesktop.gstreamer.Gst;
import org.freedesktop.gstreamer.GstObject;
import org.freedesktop.gstreamer.Pipeline;
import org.freedesktop.gstreamer.State;
import org.freedesktop.gstreamer.Bus;
import org.freedesktop.gstreamer.Element;
import java.util.List;
public class test {
public static Pipeline pipeline;
public static Bus bus;
static String greetingsPath;
static String closedPath;
static String pipeGreetingsDesc;
static String pipeClosedDesc;
static String destHost = "192.168.1.50";
static Integer destPort = 16895;
static Boolean isDoneResetParams;
private static DateTimeFormatter dtf = DateTimeFormatter.ofPattern("HH:mm:ss.SS");
private static void log(String msg) {
System.out.println(dtf.format(LocalDateTime.now()) + " " + msg);
}
public static void main(String[] args) throws
InterruptedException {
// Initialize the gstreamer-java framework Gst object
Utils.configurePaths();
Gst.init();
while (true) {
System.out.println("Running");
isDoneResetParams = false;
pipeGreetingsDesc = String.format(
"filesrc location=" + greetingsPath
+ " ! wavparse ! mulawenc ! rtppcmupay max-ptime=30000000 ! udpsink host=%s port=%s",
destHost, destPort);
pipeClosedDesc = String.format(
"filesrc location=" + closedPath
+ " ! wavparse ! mulawenc ! rtppcmupay max-ptime=30000000 ! udpsink host=%s port=%s",
destHost, destPort);
pipeline = (Pipeline) Gst.parseLaunch(pipeGreetingsDesc);
bus = (Bus) pipeline.getBus();
System.out.println(pipeline);
System.out.println(bus);
bus.connect(new Bus.EOS() {
public void endOfStream(GstObject source) {
Gst.quit();
}
});
pipeline.play();
System.out.println("PLAYING GREETING");
Gst.main();
System.out.println("GREETING ENDED");
Boolean isOpen = false;
if (!isOpen) {
System.out.println("Closed");
// Cleaning resources.
List<Element> elements = pipeline.getElements();
for (Element element : elements) {
element.dispose();
}
pipeline.setState(State.NULL);
bus.clearSyncHandler();
Gst.invokeLater(() -> {
pipeline.dispose();
});
pipeline = (Pipeline) Gst.parseLaunch(pipeClosedDesc);
bus = (Bus) pipeline.getBus();
System.out.println(pipeline);
System.out.println(bus);
bus.connect(new Bus.EOS() {
public void endOfStream(GstObject source) {
Gst.quit();
}
});
pipeline.play();
System.out.println("PLAYING CLOSING");
Gst.main();
System.out.println("CLOSING ENDED");
while (!isDoneResetParams) {
log("waiting for isDoneResetParams: " + isDoneResetParams);
Thread.sleep(1000);
}
}
}
}
public static void resetParams() {
try {
System.out.println("Restarting params");
try {
if (pipeline.getState().toString().equals("PLAYING")) {
System.out.print("pipeline is playing, disposing...");
Gst.quit();
List<Element> elements = pipeline.getElements();
for (Element element : elements) {
element.dispose();
}
pipeline.setState(State.NULL);
bus.clearSyncHandler();
Gst.invokeLater(() -> {
pipeline.dispose();
});
}
} catch (Exception e) {
System.out.print("Failed to clean pipeline " + e);
}
System.out.println("Done cleaning");
isDoneResetParams = true;
} catch (Exception e) {
System.out.println(e);
}
}
}
`
from gst1-java-core.
Related Issues (20)
- Question about multithreading with multiple pipelines. HOT 1
- Possible crash on async explicit dispose in 1.4.0 HOT 3
- How to load subtitles? Solution and example required.
- native memory still exists after Pipeline.close HOT 6
- Is it possible to have a custom thread pool to execute GstCallback (AppSink.connect) ? (question)
- How to receive each frame as its pointer(Long type) or Byte array or etc. HOT 1
- VAAPI invalid chip id or driver is being used. HOT 2
- Using GIO objects
- GType.valueOf(long) is not thead safe HOT 3
- JVM Crashes HOT 3
- What may be the reason why the pipeline cannot be created HOT 2
- How to improve throughput
- WebRTCBin.createAnswer() callback not called sporadically (promise garbage collected) HOT 4
- No such Gstreamer factory: webrtcbin HOT 5
- How to get RTPSession from rtpbin
- Need to know the native pointer of a Buffer object
- Segfault in extractError function HOT 6
- gst_element_get_request_pad HOT 1
- Support for pbutils HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gst1-java-core.