Port Android tutorials to 1.0
authorSebastian Dröge <sebastian@centricular.com>
Thu, 31 Oct 2013 09:24:52 +0000 (10:24 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 31 Oct 2013 09:25:59 +0000 (10:25 +0100)
gst-sdk/tutorials/android-tutorial-1/jni/Android.mk
gst-sdk/tutorials/android-tutorial-2/jni/Android.mk
gst-sdk/tutorials/android-tutorial-3/jni/Android.mk
gst-sdk/tutorials/android-tutorial-3/jni/tutorial-3.c
gst-sdk/tutorials/android-tutorial-4/jni/Android.mk
gst-sdk/tutorials/android-tutorial-4/jni/tutorial-4.c
gst-sdk/tutorials/android-tutorial-5/jni/Android.mk
gst-sdk/tutorials/android-tutorial-5/jni/tutorial-5.c

index aa52af0..7b28a48 100644 (file)
@@ -8,12 +8,12 @@ LOCAL_SHARED_LIBRARIES := gstreamer_android
 LOCAL_LDLIBS := -llog
 include $(BUILD_SHARED_LIBRARY)
 
-ifndef GSTREAMER_SDK_ROOT
-ifndef GSTREAMER_SDK_ROOT_ANDROID
-$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
+ifndef GSTREAMER_ROOT
+ifndef GSTREAMER_ROOT_ANDROID
+$(error GSTREAMER_ROOT_ANDROID is not defined!)
 endif
-GSTREAMER_SDK_ROOT        := $(GSTREAMER_SDK_ROOT_ANDROID)
+GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)
 endif
-GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
+GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
 GSTREAMER_PLUGINS         := coreelements
-include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
+include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
index 3f40633..f575f42 100644 (file)
@@ -8,13 +8,13 @@ LOCAL_SHARED_LIBRARIES := gstreamer_android
 LOCAL_LDLIBS := -llog
 include $(BUILD_SHARED_LIBRARY)
 
-ifndef GSTREAMER_SDK_ROOT
-ifndef GSTREAMER_SDK_ROOT_ANDROID
-$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
+ifndef GSTREAMER_ROOT
+ifndef GSTREAMER_ROOT_ANDROID
+$(error GSTREAMER_ROOT_ANDROID is not defined!)
 endif
-GSTREAMER_SDK_ROOT        := $(GSTREAMER_SDK_ROOT_ANDROID)
+GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)
 endif
-GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
+GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
 include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
 GSTREAMER_PLUGINS         := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_SYS)
-include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
+include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
index 2e6abc2..549e1e3 100644 (file)
@@ -8,14 +8,14 @@ LOCAL_SHARED_LIBRARIES := gstreamer_android
 LOCAL_LDLIBS := -llog -landroid
 include $(BUILD_SHARED_LIBRARY)
 
-ifndef GSTREAMER_SDK_ROOT
-ifndef GSTREAMER_SDK_ROOT_ANDROID
-$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
+ifndef GSTREAMER_ROOT
+ifndef GSTREAMER_ROOT_ANDROID
+$(error GSTREAMER_ROOT_ANDROID is not defined!)
 endif
-GSTREAMER_SDK_ROOT        := $(GSTREAMER_SDK_ROOT_ANDROID)
+GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)
 endif
-GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
+GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
 include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
 GSTREAMER_PLUGINS         := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_SYS) $(GSTREAMER_PLUGINS_EFFECTS)
-GSTREAMER_EXTRA_DEPS      := gstreamer-interfaces-0.10 gstreamer-video-0.10
-include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
+GSTREAMER_EXTRA_DEPS      := gstreamer-video-1.0
+include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
index f9552bc..10b89b7 100644 (file)
@@ -4,7 +4,6 @@
 #include <android/native_window.h>
 #include <android/native_window_jni.h>
 #include <gst/gst.h>
-#include <gst/interfaces/xoverlay.h>
 #include <gst/video/video.h>
 #include <pthread.h>
 
@@ -130,7 +129,7 @@ static void check_initialization_complete (CustomData *data) {
     GST_DEBUG ("Initialization complete, notifying application. native_window:%p main_loop:%p", data->native_window, data->main_loop);
 
     /* The main loop is running and we received a native window, inform the sink about it */
-    gst_x_overlay_set_window_handle (GST_X_OVERLAY (data->video_sink), (guintptr)data->native_window);
+    gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (data->video_sink), (guintptr)data->native_window);
 
     (*env)->CallVoidMethod (env, data->app, on_gstreamer_initialized_method_id);
     if ((*env)->ExceptionCheck (env)) {
@@ -156,7 +155,7 @@ static void *app_function (void *userdata) {
   g_main_context_push_thread_default(data->context);
 
   /* Build pipeline */
-  data->pipeline = gst_parse_launch("videotestsrc ! warptv ! ffmpegcolorspace ! autovideosink", &error);
+  data->pipeline = gst_parse_launch("videotestsrc ! warptv ! videoconvert ! autovideosink", &error);
   if (error) {
     gchar *message = g_strdup_printf("Unable to build pipeline: %s", error->message);
     g_clear_error (&error);
@@ -168,7 +167,7 @@ static void *app_function (void *userdata) {
   /* Set the pipeline to READY, so it can already accept a window handle, if we have one */
   gst_element_set_state(data->pipeline, GST_STATE_READY);
 
-  data->video_sink = gst_bin_get_by_interface(GST_BIN(data->pipeline), GST_TYPE_X_OVERLAY);
+  data->video_sink = gst_bin_get_by_interface(GST_BIN(data->pipeline), GST_TYPE_VIDEO_OVERLAY);
   if (!data->video_sink) {
     GST_ERROR ("Could not retrieve video sink");
     return NULL;
@@ -276,10 +275,10 @@ static void gst_native_surface_init (JNIEnv *env, jobject thiz, jobject surface)
   if (data->native_window) {
     ANativeWindow_release (data->native_window);
     if (data->native_window == new_native_window) {
-      GST_DEBUG ("New native window is the same as the previous one", data->native_window);
+      GST_DEBUG ("New native window is the same as the previous one %p", data->native_window);
       if (data->video_sink) {
-        gst_x_overlay_expose(GST_X_OVERLAY (data->video_sink));
-        gst_x_overlay_expose(GST_X_OVERLAY (data->video_sink));
+        gst_video_overlay_expose(GST_VIDEO_OVERLAY (data->video_sink));
+        gst_video_overlay_expose(GST_VIDEO_OVERLAY (data->video_sink));
       }
       return;
     } else {
@@ -298,7 +297,7 @@ static void gst_native_surface_finalize (JNIEnv *env, jobject thiz) {
   GST_DEBUG ("Releasing Native Window %p", data->native_window);
 
   if (data->video_sink) {
-    gst_x_overlay_set_window_handle (GST_X_OVERLAY (data->video_sink), (guintptr)NULL);
+    gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (data->video_sink), (guintptr)NULL);
     gst_element_set_state (data->pipeline, GST_STATE_READY);
   }
 
index c298e74..b4028cb 100644 (file)
@@ -8,14 +8,14 @@ LOCAL_SHARED_LIBRARIES := gstreamer_android
 LOCAL_LDLIBS := -llog -landroid
 include $(BUILD_SHARED_LIBRARY)
 
-ifndef GSTREAMER_SDK_ROOT
-ifndef GSTREAMER_SDK_ROOT_ANDROID
-$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
+ifndef GSTREAMER_ROOT
+ifndef GSTREAMER_ROOT_ANDROID
+$(error GSTREAMER_ROOT_ANDROID is not defined!)
 endif
-GSTREAMER_SDK_ROOT        := $(GSTREAMER_SDK_ROOT_ANDROID)
+GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)
 endif
-GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
+GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
 include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
 GSTREAMER_PLUGINS         := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_PLAYBACK) $(GSTREAMER_PLUGINS_CODECS) $(GSTREAMER_PLUGINS_NET) $(GSTREAMER_PLUGINS_SYS)
-GSTREAMER_EXTRA_DEPS      := gstreamer-interfaces-0.10 gstreamer-video-0.10
-include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
+GSTREAMER_EXTRA_DEPS      := gstreamer-video-1.0
+include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
index a20f654..648030a 100644 (file)
@@ -4,7 +4,6 @@
 #include <android/native_window.h>\r
 #include <android/native_window_jni.h>\r
 #include <gst/gst.h>\r
-#include <gst/interfaces/xoverlay.h>\r
 #include <gst/video/video.h>\r
 #include <pthread.h>\r
 \r
@@ -43,7 +42,7 @@ typedef struct _CustomData {
   gboolean is_live;             /* Live streams do not use buffering */\r
 } CustomData;\r
 \r
-/* playbin2 flags */\r
+/* playbin flags */\r
 typedef enum {\r
   GST_PLAY_FLAG_TEXT = (1 << 2)  /* We want subtitle output */\r
 } GstPlayFlags;\r
@@ -124,7 +123,6 @@ static void set_current_ui_position (gint position, gint duration, CustomData *d
 /* If we have pipeline and it is running, query the current position and clip duration and inform\r
  * the application */\r
 static gboolean refresh_ui (CustomData *data) {\r
-  GstFormat fmt = GST_FORMAT_TIME;\r
   gint64 current = -1;\r
   gint64 position;\r
 \r
@@ -134,12 +132,12 @@ static gboolean refresh_ui (CustomData *data) {
 \r
   /* If we didn't know it yet, query the stream duration */\r
   if (!GST_CLOCK_TIME_IS_VALID (data->duration)) {\r
-    if (!gst_element_query_duration (data->pipeline, &fmt, &data->duration)) {\r
+    if (!gst_element_query_duration (data->pipeline, GST_FORMAT_TIME, &data->duration)) {\r
       GST_WARNING ("Could not query current duration");\r
     }\r
   }\r
 \r
-  if (gst_element_query_position (data->pipeline, &fmt, &position)) {\r
+  if (gst_element_query_position (data->pipeline, GST_FORMAT_TIME, &position)) {\r
     /* Java expects these values in milliseconds, and GStreamer provides nanoseconds */\r
     set_current_ui_position (position / GST_MSECOND, data->duration / GST_MSECOND, data);\r
   }\r
@@ -254,23 +252,18 @@ static void check_media_size (CustomData *data) {
   GstElement *video_sink;\r
   GstPad *video_sink_pad;\r
   GstCaps *caps;\r
-  GstVideoFormat fmt;\r
-  int width;\r
-  int height;\r
+  GstVideoInfo info;\r
 \r
   /* Retrieve the Caps at the entrance of the video sink */\r
   g_object_get (data->pipeline, "video-sink", &video_sink, NULL);\r
   video_sink_pad = gst_element_get_static_pad (video_sink, "sink");\r
-  caps = gst_pad_get_negotiated_caps (video_sink_pad);\r
+  caps = gst_pad_get_current_caps (video_sink_pad);\r
 \r
-  if (gst_video_format_parse_caps(caps, &fmt, &width, &height)) {\r
-    int par_n, par_d;\r
-    if (gst_video_parse_caps_pixel_aspect_ratio (caps, &par_n, &par_d)) {\r
-      width = width * par_n / par_d;\r
-    }\r
-    GST_DEBUG ("Media size is %dx%d, notifying application", width, height);\r
+  if (gst_video_info_from_caps (&info, caps)) {\r
+    info.width = info.width * info.par_n / info.par_d;\r
+    GST_DEBUG ("Media size is %dx%d, notifying application", info.width, info.height);\r
 \r
-    (*env)->CallVoidMethod (env, data->app, on_media_size_changed_method_id, (jint)width, (jint)height);\r
+    (*env)->CallVoidMethod (env, data->app, on_media_size_changed_method_id, (jint)info.width, (jint)info.height);\r
     if ((*env)->ExceptionCheck (env)) {\r
       GST_ERROR ("Failed to call Java method");\r
       (*env)->ExceptionClear (env);\r
@@ -313,7 +306,7 @@ static void check_initialization_complete (CustomData *data) {
     GST_DEBUG ("Initialization complete, notifying application. native_window:%p main_loop:%p", data->native_window, data->main_loop);\r
 \r
     /* The main loop is running and we received a native window, inform the sink about it */\r
-    gst_x_overlay_set_window_handle (GST_X_OVERLAY (data->pipeline), (guintptr)data->native_window);\r
+    gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (data->pipeline), (guintptr)data->native_window);\r
 \r
     (*env)->CallVoidMethod (env, data->app, on_gstreamer_initialized_method_id);\r
     if ((*env)->ExceptionCheck (env)) {\r
@@ -341,7 +334,7 @@ static void *app_function (void *userdata) {
   g_main_context_push_thread_default(data->context);\r
 \r
   /* Build pipeline */\r
-  data->pipeline = gst_parse_launch("playbin2", &error);\r
+  data->pipeline = gst_parse_launch("playbin", &error);\r
   if (error) {\r
     gchar *message = g_strdup_printf("Unable to build pipeline: %s", error->message);\r
     g_clear_error (&error);\r
@@ -432,7 +425,7 @@ static void gst_native_finalize (JNIEnv* env, jobject thiz) {
   GST_DEBUG ("Done finalizing");\r
 }\r
 \r
-/* Set playbin2's URI */\r
+/* Set playbin's URI */\r
 void gst_native_set_uri (JNIEnv* env, jobject thiz, jstring uri) {\r
   CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);\r
   if (!data || !data->pipeline) return;\r
@@ -505,10 +498,10 @@ static void gst_native_surface_init (JNIEnv *env, jobject thiz, jobject surface)
   if (data->native_window) {\r
     ANativeWindow_release (data->native_window);\r
     if (data->native_window == new_native_window) {\r
-      GST_DEBUG ("New native window is the same as the previous one", data->native_window);\r
+      GST_DEBUG ("New native window is the same as the previous one %p", data->native_window);\r
       if (data->pipeline) {\r
-        gst_x_overlay_expose(GST_X_OVERLAY (data->pipeline));\r
-        gst_x_overlay_expose(GST_X_OVERLAY (data->pipeline));\r
+        gst_video_overlay_expose(GST_VIDEO_OVERLAY (data->pipeline));\r
+        gst_video_overlay_expose(GST_VIDEO_OVERLAY (data->pipeline));\r
       }\r
       return;\r
     } else {\r
@@ -527,7 +520,7 @@ static void gst_native_surface_finalize (JNIEnv *env, jobject thiz) {
   GST_DEBUG ("Releasing Native Window %p", data->native_window);\r
 \r
   if (data->pipeline) {\r
-    gst_x_overlay_set_window_handle (GST_X_OVERLAY (data->pipeline), (guintptr)NULL);\r
+    gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (data->pipeline), (guintptr)NULL);\r
     gst_element_set_state (data->pipeline, GST_STATE_READY);\r
   }\r
 \r
index a82f505..1211734 100755 (executable)
@@ -8,15 +8,15 @@ LOCAL_SHARED_LIBRARIES := gstreamer_android
 LOCAL_LDLIBS := -llog -landroid
 include $(BUILD_SHARED_LIBRARY)
 
-ifndef GSTREAMER_SDK_ROOT
-ifndef GSTREAMER_SDK_ROOT_ANDROID
-$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
+ifndef GSTREAMER_ROOT
+ifndef GSTREAMER_ROOT_ANDROID
+$(error GSTREAMER_ROOT_ANDROID is not defined!)
 endif
-GSTREAMER_SDK_ROOT        := $(GSTREAMER_SDK_ROOT_ANDROID)
+GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)
 endif
-GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
+GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
 include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
 GSTREAMER_PLUGINS         := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_PLAYBACK) $(GSTREAMER_PLUGINS_CODECS) $(GSTREAMER_PLUGINS_NET) $(GSTREAMER_PLUGINS_SYS)
 G_IO_MODULES              := gnutls
-GSTREAMER_EXTRA_DEPS      := gstreamer-interfaces-0.10 gstreamer-video-0.10
-include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
+GSTREAMER_EXTRA_DEPS      := gstreamer-video-1.0
+include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
index 33d4bc0..78dea64 100755 (executable)
@@ -4,8 +4,8 @@
 #include <android/native_window.h>
 #include <android/native_window_jni.h>
 #include <gst/gst.h>
-#include <gst/interfaces/xoverlay.h>
 #include <gst/video/video.h>
+#include <gst/video/videooverlay.h>
 #include <pthread.h>
 
 GST_DEBUG_CATEGORY_STATIC (debug_category);
@@ -124,7 +124,6 @@ static void set_current_ui_position (gint position, gint duration, CustomData *d
 /* If we have pipeline and it is running, query the current position and clip duration and inform
  * the application */
 static gboolean refresh_ui (CustomData *data) {
-  GstFormat fmt = GST_FORMAT_TIME;
   gint64 current = -1;
   gint64 position;
 
@@ -134,13 +133,13 @@ static gboolean refresh_ui (CustomData *data) {
 
   /* If we didn't know it yet, query the stream duration */
   if (!GST_CLOCK_TIME_IS_VALID (data->duration)) {
-    if (!gst_element_query_duration (data->pipeline, &fmt, &data->duration)) {
+    if (!gst_element_query_duration (data->pipeline, GST_FORMAT_TIME, &data->duration)) {
       GST_WARNING ("Could not query current duration (normal for still pictures)");
       data->duration = 0;
     }
   }
 
-  if (!gst_element_query_position (data->pipeline, &fmt, &position)) {
+  if (!gst_element_query_position (data->pipeline, GST_FORMAT_TIME, &position)) {
     GST_WARNING ("Could not query current position (normal for still pictures)");
     position = 0;
   }
@@ -258,23 +257,18 @@ static void check_media_size (CustomData *data) {
   GstElement *video_sink;
   GstPad *video_sink_pad;
   GstCaps *caps;
-  GstVideoFormat fmt;
-  int width;
-  int height;
+  GstVideoInfo info;
 
   /* Retrieve the Caps at the entrance of the video sink */
   g_object_get (data->pipeline, "video-sink", &video_sink, NULL);
   video_sink_pad = gst_element_get_static_pad (video_sink, "sink");
-  caps = gst_pad_get_negotiated_caps (video_sink_pad);
+  caps = gst_pad_get_current_caps (video_sink_pad);
 
-  if (gst_video_format_parse_caps(caps, &fmt, &width, &height)) {
-    int par_n, par_d;
-    if (gst_video_parse_caps_pixel_aspect_ratio (caps, &par_n, &par_d)) {
-      width = width * par_n / par_d;
-    }
-    GST_DEBUG ("Media size is %dx%d, notifying application", width, height);
+  if (gst_video_info_from_caps(&info, caps)) {
+    info.width = info.width * info.par_n / info.par_d;
+    GST_DEBUG ("Media size is %dx%d, notifying application", info.width, info.height);
 
-    (*env)->CallVoidMethod (env, data->app, on_media_size_changed_method_id, (jint)width, (jint)height);
+    (*env)->CallVoidMethod (env, data->app, on_media_size_changed_method_id, (jint)info.width, (jint)info.height);
     if ((*env)->ExceptionCheck (env)) {
       GST_ERROR ("Failed to call Java method");
       (*env)->ExceptionClear (env);
@@ -317,7 +311,7 @@ static void check_initialization_complete (CustomData *data) {
     GST_DEBUG ("Initialization complete, notifying application. native_window:%p main_loop:%p", data->native_window, data->main_loop);
 
     /* The main loop is running and we received a native window, inform the sink about it */
-    gst_x_overlay_set_window_handle (GST_X_OVERLAY (data->pipeline), (guintptr)data->native_window);
+    gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (data->pipeline), (guintptr)data->native_window);
 
     (*env)->CallVoidMethod (env, data->app, on_gstreamer_initialized_method_id);
     if ((*env)->ExceptionCheck (env)) {
@@ -345,7 +339,7 @@ static void *app_function (void *userdata) {
   g_main_context_push_thread_default(data->context);
 
   /* Build pipeline */
-  data->pipeline = gst_parse_launch("playbin2", &error);
+  data->pipeline = gst_parse_launch("playbin", &error);
   if (error) {
     gchar *message = g_strdup_printf("Unable to build pipeline: %s", error->message);
     g_clear_error (&error);
@@ -509,10 +503,10 @@ static void gst_native_surface_init (JNIEnv *env, jobject thiz, jobject surface)
   if (data->native_window) {
     ANativeWindow_release (data->native_window);
     if (data->native_window == new_native_window) {
-      GST_DEBUG ("New native window is the same as the previous one", data->native_window);
+      GST_DEBUG ("New native window is the same as the previous one %p", data->native_window);
       if (data->pipeline) {
-        gst_x_overlay_expose(GST_X_OVERLAY (data->pipeline));
-        gst_x_overlay_expose(GST_X_OVERLAY (data->pipeline));
+        gst_video_overlay_expose(GST_VIDEO_OVERLAY (data->pipeline));
+        gst_video_overlay_expose(GST_VIDEO_OVERLAY (data->pipeline));
       }
       return;
     } else {
@@ -531,7 +525,7 @@ static void gst_native_surface_finalize (JNIEnv *env, jobject thiz) {
   GST_DEBUG ("Releasing Native Window %p", data->native_window);
 
   if (data->pipeline) {
-    gst_x_overlay_set_window_handle (GST_X_OVERLAY (data->pipeline), (guintptr)NULL);
+    gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (data->pipeline), (guintptr)NULL);
     gst_element_set_state (data->pipeline, GST_STATE_READY);
   }