int rate; /**< Samplerate */
int depth; /**< Depth */
bool little_endian; /**< Endianness */
- guint64 channel_mask; /**< channel_mask */
+ guint64 channel_mask; /**< channel_mask */
} player_audio_raw_data_s;
/**
_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK,
_PLAYER_EVENT_TYPE_AUDIO_STREAM_CHANGED,
_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED,
+ _PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED,
_PLAYER_EVENT_TYPE_NUM
}_player_event_e;
int __player_convert_error_code(int code, char* func_name);
bool __player_state_validate(player_s * handle, player_state_e threshold);
+/**
+ * @brief Called when the video sink bin is crated.
+ * @since_tizen 3.0
+ * @param[out] caps video sink current caps
+ * @param[out ] user_data The user data passed from the callback registration function
+ * @see player_set_vidoe_bin_created_cb()
+ * @see player_unset_vidoe_bin_created_cb()
+ */
+typedef void (*player_video_bin_created_cb)(const char *caps, void *user_data);
+
+/**
+ * @brief Registers a callback function to be invoked when video sink bin is created.
+ * @since_tizen 3.0
+ * @param[in] player The handle to the media player
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #PLAYER_ERROR_NONE Successful
+ * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @post player_video_bin_created_cb() will be invoked.
+ * @see player_unset_vidoe_bin_created_cb()
+ */
+int player_set_video_bin_created_cb(player_h player, player_video_bin_created_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters a callback function to be invoked when video sink bin is created.
+ * @since_tizen 3.0
+ * @param[in] player The handle to the media player
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #PLAYER_ERROR_NONE Successful
+ * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @post player_video_bin_created_cb() will be invoked.
+ * @see player_unset_vidoe_bin_created_cb()
+ */
+int player_unset_video_bin_created_cb(player_h player);
+
+
#ifdef __cplusplus
}
#endif
int rate; /**< Samplerate */
int depth; /**< Depth */
bool little_endian; /**< Endianness */
- guint64 channel_mask; /**< channel_mask */
+ guint64 channel_mask; /**< channel_mask */
} player_audio_raw_data_s;
/**
#endif
}
break;
+ case MM_MESSAGE_VIDEO_BIN_CREATED:
+ if( handle->user_cb[_PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED])
+ {
+ char *caps = (char *)msg->data;
+ if(caps)
+ ((player_video_bin_created_cb)
+ handle->user_cb[_PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED])(
+ caps, handle->user_data[_PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED]);
+ g_free(caps);
+ }
+ break;
case MM_MESSAGE_UNKNOWN: //0x00
case MM_MESSAGE_WARNING: //0x02
case MM_MESSAGE_CONNECTING: //0x100
return PLAYER_ERROR_NONE;
}
+
+int player_set_video_bin_created_cb(player_h player, player_video_bin_created_cb callback, void *user_data)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(callback);
+ int type = _PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED;
+
+ player_s * handle = (player_s *) player;
+ handle->user_cb[type] = callback;
+ handle->user_data[type] = user_data;
+ LOGI("[%s] Event type : %d ",__FUNCTION__, type);
+ return PLAYER_ERROR_NONE;
+}
+
+int player_unset_video_bin_created_cb(player_h player)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ player_s * handle = (player_s *) player;
+ int type = _PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED;
+
+ handle->user_cb[type] = NULL;
+ handle->user_data[type] = NULL;
+ LOGI("[%s] Event type : %d ",__FUNCTION__, type);
+ return PLAYER_ERROR_NONE;
+}
#include <appcore-efl.h>
#define KEY_END "XF86Stop"
-#define MEDIA_FILE_PATH "/opt/usr/media/Color.mp4"
+#define MEDIA_FILE_PATH "/home/owner/content/Color.mp4"
#ifdef PACKAGE
#undef PACKAGE
#endif
#define PACKAGE "player_test"
#define MAX_STRING_LEN 2048
#define MMTS_SAMPLELIST_INI_DEFAULT_PATH "/opt/etc/mmts_filelist.ini"
-#define PLAYER_TEST_DUMP_PATH_PREFIX "/opt/usr/media/dump_pcm_"
+#define PLAYER_TEST_DUMP_PATH_PREFIX "/home/owner/content/dump_pcm_"
#define INI_SAMPLE_LIST_MAX 9
#define DEFAULT_HTTP_TIMEOUT -1
static void _player_set_progressive_download()
{
- player_set_progressive_download_path(g_player[0], "/opt/test.pd");
+ player_set_progressive_download_path(g_player[0], "/home/owner/test.pd");
player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void*)g_player[0]);
}