Name: libmm-player
Summary: Multimedia Framework Player Library
-Version: 0.2.10
+Version: 0.2.11
Release: 0
Group: System/Libraries
License: Apache License, Version 2.0
typedef bool (*mm_player_video_capture_callback) (void *stream, int stream_size, void *user_param);
/**
+ * Video frame render error callback function type.
+ *
+ * @param error_id [in] cause of error
+ * @param user_param [in] User defined parameter which is passed when set
+ * video frame render error callback
+ *
+ * @return This callback function have to return MM_ERROR_NONE.
+ */
+typedef bool (*mm_player_video_frame_render_error_callback) (void *error_id, void *user_param);
+
+/**
* This function is to set play speed for playback.
*
* @param player [in] Handle of player.
int mm_player_set_video_stream_callback(MMHandleType player, mm_player_video_stream_callback callback, void *user_param);
/**
+ * This function set callback function for rendering error information of video render plug-in.
+ *
+ * @param player [in] Handle of player.
+ * @param callback [in] Frame render error callback function.
+ * @param user_param [in] User parameter which is passed to callback function.
+ *
+ * @return This function returns zero on success, or negative value with error code.
+ * @see
+ * @remark None
+ * @par Example
+ * @code
+ * @endcode
+ */
+int mm_player_set_video_frame_render_error_callback(MMHandleType player, mm_player_video_frame_render_error_callback callback, void *user_param);
+
+/**
* This function set callback function for receiving audio stream from player.
*
* @param player [in] Handle of player.
MMPlayerGstPipelineInfo *pipeline;
gboolean pipeline_is_constructed;
- /* Buffering support cbs*/
+ /* buffering support cbs*/
mm_player_buffer_need_data_callback need_data_cb;
mm_player_buffer_enough_data_callback enough_data_cb;
mm_player_buffer_seek_data_callback seek_data_cb;
void* buffer_cb_user_param;
- /* for video stream callback */
+ /* video stream callback */
mm_player_video_stream_callback video_stream_cb;
void* video_stream_cb_user_param;
int use_video_stream;
/* video capture callback*/
gulong video_capture_cb_probe_id;
+ /* video frame render error callback */
+ mm_player_video_frame_render_error_callback video_frame_render_error_cb;
+ void* video_frame_render_error_cb_user_param;
+
/* sound info */
MMPlayerSoundInfo sound;
int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
int _mmplayer_set_videostream_cb(MMHandleType hplayer,mm_player_video_stream_callback callback, void *user_param);
int _mmplayer_set_audiostream_cb(MMHandleType hplayer,mm_player_audio_stream_callback callback, void *user_param);
+int _mmplayer_set_videoframe_render_error_cb(MMHandleType hplayer, mm_player_video_frame_render_error_callback callback, void *user_param);
int _mmplayer_set_subtitle_silent (MMHandleType hplayer, int silent);
int _mmplayer_get_subtitle_silent (MMHandleType hplayer, int* silent);
int _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long* start_pos, unsigned long* stop_pos);
return result;
}
+int mm_player_set_video_frame_render_error_callback(MMHandleType player, mm_player_video_frame_render_error_callback callback, void *user_param)
+{
+ int result = MM_ERROR_NONE;
+
+ debug_log("\n");
+
+ return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+
+ MMPLAYER_CMD_LOCK( player );
+
+ result = _mmplayer_set_videoframe_render_error_cb(player, callback, user_param);
+
+ MMPLAYER_CMD_UNLOCK( player );
+
+ return result;
+}
+
int mm_player_do_video_capture(MMHandleType player)
{
int result = MM_ERROR_NONE;
debug_fleave();
}
+static void
+__mmplayer_videoframe_render_error_cb(GstElement *element, void *error_id, gpointer data)
+{
+ mm_player_t* player = (mm_player_t*)data;
+
+ return_if_fail ( player );
+
+ debug_fenter();
+
+ if (player->video_frame_render_error_cb )
+ {
+ if (player->attrs)
+ {
+ int surface_type = 0;
+ mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &surface_type);
+ switch (surface_type)
+ {
+ case MM_DISPLAY_SURFACE_X_EXT:
+ player->video_frame_render_error_cb((unsigned int*)error_id, player->video_frame_render_error_cb_user_param);
+ debug_log("display surface type(X_EXT) : render error callback(%p) is finished", player->video_frame_render_error_cb);
+ break;
+ default:
+ debug_error("video_frame_render_error_cb was set, but this surface type(%d) is not supported", surface_type);
+ break;
+ }
+ }
+ else
+ {
+ debug_error("could not get surface type");
+ }
+ }
+ else
+ {
+ debug_warning("video_frame_render_error_cb was not set");
+ }
+
+ debug_fleave();
+}
+
gboolean
_mmplayer_update_content_attrs(mm_player_t* player) // @
{
}
}
break;
- case MM_DISPLAY_SURFACE_X_EXT: /* NOTE : this surface type is for the video texture(canvas texture) */
+ case MM_DISPLAY_SURFACE_X_EXT: /* NOTE : this surface type is used for the videoTexture(canvasTexture) overlay */
{
void *pixmap_id_cb = NULL;
void *pixmap_id_cb_user_data = NULL;
{
void *pixmap_id_cb = NULL;
mm_attrs_get_data_by_name(attrs, "display_overlay", &pixmap_id_cb);
- if (pixmap_id_cb) /* this is for the video textue(canvas texture) */
+ if (pixmap_id_cb) /* this is used for the videoTextue(canvasTexture) overlay */
{
videosink_element = PLAYER_INI()->videosink_element_x;
- debug_warning("video texture usage");
}
else
{
MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_SINK, videosink_element, videosink_element, TRUE);
debug_log("selected videosink name: %s", videosink_element);
+
+ /* connect signal handlers for sink plug-in */
+ switch (surface_type) {
+ case MM_DISPLAY_SURFACE_X_EXT:
+ MMPLAYER_SIGNAL_CONNECT( player,
+ player->pipeline->videobin[MMPLAYER_V_SINK].gst,
+ "frame-render-error",
+ G_CALLBACK(__mmplayer_videoframe_render_error_cb),
+ player );
+ debug_log("videoTexture usage, connect a signal handler for pixmap rendering error");
+ break;
+ default:
+ break;
+ }
}
if ( _mmplayer_update_video_param(player) != MM_ERROR_NONE)
return MM_ERROR_NONE;
}
-int __mmplayer_start_streaming_ext(mm_player_t *player)
+int
+_mmplayer_set_videoframe_render_error_cb(MMHandleType hplayer, mm_player_video_frame_render_error_callback callback, void *user_param) // @
+{
+ mm_player_t* player = (mm_player_t*) hplayer;
+
+ debug_fenter();
+
+ return_val_if_fail ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+ return_val_if_fail ( callback, MM_ERROR_INVALID_ARGUMENT );
+
+ player->video_frame_render_error_cb = callback;
+ player->video_frame_render_error_cb_user_param = user_param;
+
+ debug_log("Video frame render error cb Handle value is %p : %p\n", player, player->video_frame_render_error_cb);
+
+ debug_fleave();
+
+ return MM_ERROR_NONE;
+}
+
+int
+__mmplayer_start_streaming_ext(mm_player_t *player)
{
gint ret = MM_ERROR_NONE;