visual studio에서 컴파일하기 위한 준비


1. download 

- https://gstreamer.freedesktop.org/data/pkg/windows/1.14.4/


개발을 위해서 devel 버전과 release 버전 둘 다 설치한다.



2. 환경 변수 설정

path에 

H:\gstreamer\1.0\x86\bin

추가한다.


3. header 파일 디렉토리 추가

H:\gstreamer\1.0\x86\lib\glib-2.0\include;

H:\gstreamer\1.0\x86\include\glib-2.0\glib;

H:\gstreamer\1.0\x86\include\glib-2.0;

H:\gstreamer\1.0\x86\include\gstreamer-1.0;

H:\gstreamer\1.0\x86\include


4. lib 파일 디렉토리 추가

H:\gstreamer\1.0\x86\lib


5. lib 파일 추가

gobject-2.0.lib;

glib-2.0.lib;

gstreamer-1.0.lib


6. code compile


///////

#include <gst/gst.h>


int main(int argc, char *argv[]) {

GstElement *pipeline;

GstBus *bus;

GstMessage *msg;


/* Initialize GStreamer */

gst_init(&argc, &argv);


/* Build the pipeline */

pipeline = gst_parse_launch("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);

//pipeline = gst_parse_launch("playbin uri=file:///gstreamer/vector/1024kbps_720p_football.ts", NULL);

/* Start playing */

gst_element_set_state(pipeline, GST_STATE_PLAYING);


/* Wait until error or EOS */

bus = gst_element_get_bus(pipeline);

msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);


/* Free resources */

if (msg != NULL)

gst_message_unref(msg);

gst_object_unref(bus);

gst_element_set_state(pipeline, GST_STATE_NULL);

gst_object_unref(pipeline);

return 0;

}

////////////

'Programming' 카테고리의 다른 글

GDB 사용법 (ing...)  (0) 2020.04.09
google test vs2015 compiled  (0) 2017.04.01
C++ Unit Testing with Google Test Tutorial [펌]  (0) 2017.03.31
Win32 Batch Script 001..100 increment  (0) 2017.03.24
nmake U1077 error 처리방법  (0) 2017.02.15
Posted by 루나s
,