* @remarks We are not supporting changing display.
* @remarks This function have be called before calling the player_prepare() or player_prepare_async() \n
* to reflect the display type.
+ * @remarks This function must be called in main thread of application.
+ * Otherwise, it will return #PLAYER_ERROR_INVALID_OPERATION by internal restriction.
+ * To avoid #PLAYER_ERROR_INVALID_OPERATION in sub thread, ecore_thread_main_loop_begin() and
+ * ecore_thread_main_loop_end() can be used, but deadlock can be also occurred if main thread is busy.
+ * So, it's not recommended to use them. (since 5.0)
* @param[in] player The handle to the media player
* @param[in] type The display type
* @param[in] display The handle to display
* @see player_set_display_roi_area
* @see player_set_display_visible
* @see player_set_display_rotation
+ * @see ecore_thread_main_loop_begin()
+ * @see ecore_thread_main_loop_end()
*/
int player_set_display(player_h player, player_display_type_e type, player_display_h display);
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/stat.h>
+#include <syscall.h>
#include <unistd.h>
#include <tbm_bufmgr.h>
#include <tbm_surface.h>
void (*p_disp_get_evas_display_geometry_info)(void *, int *, int *, int *, int *) = NULL;
void (*p_disp_media_packet_video_decode_cb)(media_packet_h, void *) = NULL;
#endif
+ pid_t pid = getpid();
+ pid_t tid = syscall(SYS_gettid);
LOGD("ENTER");
+
+ LOGD("Check if API is called in main thread. pid [%d], tid [%d]", pid, tid);
+ if (pid != tid) {
+ LOGE("API isn't called in main thread");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
+
PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
/* init */