... Custom GstMessage name that will be sent to GstBus when autofocusing is complete */ #define GST_PHOTOGRAPHY_AUTOFOCUS_DONE "autofocus-done" ...
gboolean CameraN900::initialize_pipeline(int *argc, char ***argv) { ... pipeline = gst_pipeline_new("test-camera"); bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); gst_bus_add_watch(bus, (GstBusFunc)bus_callback, camera_src); ... } gboolean CameraN900::bus_callback (GstMessage * message) { const gchar *message_str; message_str = gst_message_type_get_name(GST_MESSAGE_TYPE (message)); printf("Message: %s\n",message_str); GType focusStatus= gst_focus_status_get_type(); switch(GstFocusStatus (focusStatus)){ case GST_PHOTOGRAPHY_FOCUS_STATUS_NONE: printf("NONE\n"); case GST_PHOTOGRAPHY_FOCUS_STATUS_RUNNING: printf("RUNNINF\n"); case GST_PHOTOGRAPHY_FOCUS_STATUS_FAIL: printf("FAILE\n"); case GST_PHOTOGRAPHY_FOCUS_STATUS_SUCCESS: printf("SUCCESS\n"); break; } return TRUE; }