#ifdef TIZEN_FEATURE_STREAMING
int remote_streaming = 0;
#endif
+ GstState element_state = GST_STATE_VOID_PENDING;
+ GstState element_pending_state = GST_STATE_VOID_PENDING;
+
/* Initialize GStreamer */
/* Note: Replace the arguments of gst_init to pass the command line args to GStreamer. */
gst_init(NULL, NULL);
/* set pipeline state to PAUSED */
MEDIADEMUXER_SET_STATE(gst_handle->pipeline, GST_STATE_PAUSED, ERROR);
- int count = 0;
- while (gst_handle->is_prepared != true) {
- count++;
- usleep(POLLING_INTERVAL);
- MD_I("Inside while loop\n");
- if (count > POLLING_INTERVAL) {
- MD_E("Error occure\n");
- ret = MD_ERROR;
- break;
- }
+ if (gst_element_get_state(gst_handle->pipeline, &element_state, &element_pending_state, 1 * GST_SECOND)
+ == GST_STATE_CHANGE_FAILURE) {
+ MD_E(" [%s] state : %s pending : %s \n",
+ GST_ELEMENT_NAME(gst_handle->pipeline),
+ gst_element_state_get_name(element_state),
+ gst_element_state_get_name(element_pending_state));
+ ret = MD_ERROR;
+ goto ERROR;
+ }
+
+ if (gst_handle->is_prepared != true) {
+ MD_E("Error occure");
+ ret = MD_ERROR;
+ goto ERROR;
}
MEDIADEMUXER_FLEAVE();