Gstreamer z Visual C ++ Express 2010 - samouczek 1
Jestem nowym użytkownikiem Gstreamera i mam problemy, gdy kompiluję samouczek 1 Gstreamera. Używam 64-bitowego systemu Windows 7 z Visual C ++ Express 2010 i Gstreamer SDK 2012.11 32 bity (pobrane stąd). Oto kod:
#include "stdafx.h"
#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 ("playbin2 uri=file://E:/test_1.MOV", 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;
}
Pierwszy błąd:
error C2664: 'gst_bus_timed_pop_filtered' : cannot convert parameter 3 from 'int' to 'GstMessageType'
Właśnie usunąłem GST_MESSAGE_ERROR z kodu. Linia jest teraz:
msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_EOS);
Miałem ten sam problem z Ubuntu. Ale potem w Ubuntu mogłem odtworzyć wideo.
Drugi błąd: Ale w systemie Windows kompilacja jest dobra, ale gdy próbuję ją uruchomić, mam błędy:
GStreamer-CRITICAL **: gst_element_set_state: assertion 'GST_IS_ELEMENT <element>' failed
GStreamer-CRITICAL **: gst_element_get_bus: assertion 'GST_IS_ELEMENT <element>' failed
GStreamer-CRITICAL **: gst_bus_timed_pop_filtered: assertion 'GST_IS_BUS <bus>' failed
GStreamer-CRITICAL **: gst_object_unref: assertion 'object=!NULL' failed
GStreamer-CRITICAL **: gst_element_set_state: assertion 'GST_IS_ELEMENT <element>' failed
GStreamer-CRITICAL **: gst_object_unref: assertion 'object=!NULL' failed
Naprawdę nie rozumiem, dlaczego działa z ubuntu, a nie z Windows. I naprawdę nie wiem, jak rozwiązać ten problem. Proszę, mógłbyś mi pomóc ?
Pozdrowienia,