2017-12-26 33 views
-3

私は例1を実行すると:のGStreamer - 例のエラー1

#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); 

/* 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; 
} 

を、私は2つのエラーを取得:
1)引数タイプの "intは" 型のパラメータと互換性がありません "GstMessageType"

2) 'GstMessage * gst_bus_timed_pop_filtered(GstBus *、GstClockTime、GstMessageType)':? 'GstMessageType'

間違っている私がリンクしたVisual Studioとのgstreamerを 'int型から、このように引数3を変換することはできません。

-propertyマネージャー>プロジェクトを右クリック> [既存のプロパティシートを追加します>私は問題を修正したファイルのgstreamer-1.0小道具(LIBS \ \ 2010 VS共有\ \のgstreamer-1.0.props)

+0

コードにリンクを投稿せず、コード自体を投稿してください – Fureeish

+0

投稿しました。本当に私の質問をd​​ownvoteする必要がありますか? – SMALLname

+0

私は@downvoterではありませんが、あなたの質問はどういうわけか、[MCVE](https://stackoverflow.com/help/mcve)、[ツアー](https ://stackoverflow.com/tour)、[方法](https://stackoverflow.com/help/how-to-ask) – Fureeish

答えて

0

をリンクありがとうございましたto this post(解決策1)、 私は何をしたのか分かりませんが、おそらくbinディレクトリにデバッグをリンクしています(何らかの理由で前にはうまくいきませんでした)。 注意すべき点は、プログラムに.cpp拡張子(.cppではなく)が必要であることです。

関連する問題