2014-11-25 3 views
0

Vala의 응용 프로그램에서 GStreamer를 사용하여 .mp4 비디오를 재생하고 있습니다. 튜토리얼에서 파일 파이프 라인을 만들려고합니다 : filesrc -> decodebin -> 펄스 링크,하지만 항상 내 응용 프로그램이 충돌합니다. 내 코드는 다음과 같습니다.Vala에서 GStreamer 파이프 라인이 충돌 함

this.pipeline = new Pipeline ("mypipeline"); 
this.src = ElementFactory.make ("filesrc", "video"); 
src.set("location", downloadFileName); 
this.decode = ElementFactory.make ("decodebin", "decode"); 
this.sink = ElementFactory.make ("autoaudiosink", "sink"); 
this.pipeline.add_many (this.src, this.decode, this.sink); 

if (this.src == null) 
    error("Gstreamer element init error 1"); 
if (this.decode == null) 
    error("Gstreamer element init error 2"); 
if (this.sink == null) 
    error("Gstreamer element init error 3"); 

if (!this.src.link (this.decode)) 
    error("GStreamer linking problems."); 
if (!this.decode.link (this.sink)) 
    error("GStreamer linking problems 2."); 

this.pipeline.set_state (State.PLAYING); 

내 응용 프로그램은 항상 "GStreamer linking problems 2"와 충돌합니다.

gst-launch-1.0 filesrc location=<filename> ! decodebin ! pulsesink 

정상적으로 작동하므로 Vala 관련 문제 (내 실제 파일명입니다)라고 생각합니다.

내가 잘못하고있는 것을 말해 줄 수 있습니까?

답변

1

디코드 빈과 싱크대 사이에 비디오 콘을 놓아야하며, gst_init을 호출했는지 확인해야합니다 (확인했지만 다쳤을 수는 없습니다).

편집 : 여기서 실제 문제는 내부 요소 체인을 구성한 후 해당 소스 패드를 노출 시키면 READY에서 PAUSED 로의 전환에서 발생한다는 것입니다. 즉, "pad-added"신호에 연결하고 제공하는 콜백에서 연결을 수행해야합니다. 나는 "gstreamer pad-added"로 인터넷 검색이 흥미로운 정보를 얻을 것이라고 확신한다.

관련 문제