java - Get caps from pipeline -


i new gstreamer , try caps property pipeline in java. if try in command line pipeline

gst-launch-0.10 -v --gst-debug-level=2 filesrc location="c:/dokumenty/eclipse/rtsp_test/trailer.mp4" ! decodebin2 ! queue ! jpegenc ! rtpjpegpay ! udpsink host=::1 port=5000 sync=true

it works fine , return caps, needed

/gstpipeline:pipeline0/gstudpsink:udpsink0.gstpad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)jpeg, payload=(int)96, ssrc=(uint)3175930633, clock-base=(uint)3850186239, seqnum-base=(uint)8531

but dont know, how caps in java pipeline

pipe = pipeline.launch("filesrc location="c:/dokumenty/eclipse/rtsp_test/trailer.mp4" ! decodebin2 ! queue ! jpegenc ! rtpjpegpay ! udpsink host=::1 port=5000 sync=true"); 

are there methods how udpsink0 pipeline?

thank you

if @ documentation bin (the parent class of pipeline), you'll see there few ways individual elements. simple way use: bin.getelementbyname("udpsink0").

a more generic way call bin.getsinks() , grab first result list. way code still work if use different type of sink.

once have element object can pad using element.getstaticpad("sink") , can caps object pad.getnegotiatedcaps().

for more information check out javadocs, can found at: https://code.google.com/p/gstreamer-java/downloads/list

in short:

element sink = pipe.getelementbyname("udpsink0"); pad pad = sink.getstaticpad("sink"); caps caps = pad.getnegotiatedcaps(); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -