본문 바로가기

GStreamer

Basic tutorial 2: GStreamer concepts Goal

https://gstreamer.freedesktop.org/documentation/tutorials/basic/concepts.html?gi-language=c 

 

Basic tutorial 2: GStreamer concepts

Please port this tutorial to javascript! Basic tutorial 2: GStreamer concepts Goal The previous tutorial showed how to build a pipeline automatically. Now we are going to build a pipeline manually by instantiating each element and linking them all together

gstreamer.freedesktop.org

 

 

 

 

 

source elements : 데이터를 생산하여 source pad로 전달.

filter elements : sink pad로 들어온 데이터들에 대해 특정 작업을 하여 source pad로 데이터를 보낸다.

sink elements : sink pad로 전달 받은 데이터를 소비한다. (디스크에 쓰기, 비대오 재생 등)

 

 

All elements in GStreamer must typically be contained inside a pipeline before they can be used, because it takes care of some clocking and messaging functions.

 

clocking과 messageing 함수를 이용하기 위해서 모든 Gstreamer 엘리먼트는 사용하기 전에 파이프라인에 포함되어야 한다.

 

 

Keep in mind that only elements residing in the same bin can be linked together, so remember to add them to the pipeline before trying to link them!

 

같은 bin에 있는 엘리먼트만 링크되기 때문에 링크를 하기 위해서는 엘리먼트들을 파이프라인에 추가하는 과정이 선행되어야 한다.

 

 

Most GStreamer elements have customizable properties: named attributes that can be modified to change the element's behavior (writable properties) or inquired to find out about the element's internal state (readable properties).

 

엘리먼트 동작이나 상태를 변경시킬 수 있는 properties.

 

아래는 “pattern” property를 변경한다.

/* Modify the source's properties */
g_object_set (source, "pattern", 0, NULL);

 

 

The GStreamer bus

It is the object responsible for delivering to the application the GstMessages generated by the elements, in order and to the application thread. This last point is important, because the actual streaming of media is done in another thread than the application.

 

Gstreamer bus는 엘리먼트에서 생성된 GstMessage들을 애플리케이션 스레드에 전달하는 역할.

 

실제 스트리밍은 애플리케이션 스레드가 아닌 다른 스레드에서 수행되기 때문에 Gstreamer bus의 역할이 중요하다.

'GStreamer' 카테고리의 다른 글

Basic tutorial 3: Dynamic pipelines  (0) 2022.05.08