こんにちは、Windows 7 64 ビット (32 ビット gstreamer を使用) で gstreamer-0.10 に問題があります。
チュートリアル 1 (VS2010 用に変更) については、以下のコードを参照してください。
#include <gst/gst.h>
int main(int argc, char *argv[]) {
GstElement *pipeline;
GstBus *bus;
GstMessage *msg;
// Added GError to catch pipeline problems?
// http://stackoverflow.com/questions/14923306/gstreamer-with-visual-c-express-2010-tutorial-1
GError **errorMsg = NULL;
/* Initialize GStreamer */
gst_init (&argc, &argv);
/* Build the pipeline */
pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", errorMsg);
// pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", errorMsg);
// pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
// pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
// pipeline = gst_parse_launch ("videotestsrc ! autovideosink", errorMsg);
/* Start playing */
gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* Wait until error or EOS */
bus = gst_element_get_bus (pipeline);
/* MSVC Compiler is more strict with enum type casting hence the (GstMessageType) cast on the second parameter */
msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, (GstMessageType)(GST_MESSAGE_ERROR | GST_MESSAGE_EOS));
// 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;
}
上記のコードは正常にコンパイルされますが、実行時に以下の出力が表示されます。
(basic-tutorial-1_debug.exe:8700): GStreamer-CRITICAL **: gst_element_set_state:
assertion `GST_IS_ELEMENT (element)' failed
(basic-tutorial-1_debug.exe:8700): GStreamer-CRITICAL **: gst_element_get_bus: a
ssertion `GST_IS_ELEMENT (element)' failed
(basic-tutorial-1_debug.exe:8700): GStreamer-CRITICAL **: gst_bus_timed_pop_filt
ered: assertion `GST_IS_BUS (bus)' failed
(basic-tutorial-1_debug.exe:8700): GStreamer-CRITICAL **: gst_object_unref: asse
rtion `object != NULL' failed
(basic-tutorial-1_debug.exe:8700): GStreamer-CRITICAL **: gst_element_set_state:
assertion `GST_IS_ELEMENT (element)' failed
(basic-tutorial-1_debug.exe:8700): GStreamer-CRITICAL **: gst_object_unref: asse
rtion `object != NULL' failed
--gst-debug-level=4 も使用しました (以下の出力を選択)。
it_check: initialized GStreamer successfully
0:00:00.358921084 8236 004D5000 INFO GST_PIPELINE gstparse.c:334:g
st_parse_launch_full: parsing pipeline description 'playbin2 uri=http://docs.gst
reamer.com/media/sintel_trailer-480p.webm'
0:00:00.368644038 8236 004D5000 DEBUG GST_PIPELINE parse.l:107:priv
_gst_parse_yylex: flex: IDENTIFIER: playbin2
0:00:00.375062362 8236 004D5000 INFO GST_ELEMENT_FACTORY gstelementfactor
y.c:467:gst_element_factory_make: no such element factory "playbin2"!
0:00:00.381743480 8236 004D5000 ERROR GST_PIPELINE ./grammar.y:661:
priv_gst_parse_yyparse: no element "playbin2"
0:00:00.387568465 8236 004D5000 ERROR GST_PIPELINE ./grammar.y:929:
priv_gst_parse_launch: Unrecoverable syntax error while parsing pipeline playbin
2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm
また、'playbin2' の名前を 'playbin' に変更し、さらにいくつかの通常のパイプライン (コマンド ラインで動作) も変更しようとしました。
どんな援助にも感謝します。