static GstPadProbeReturn
__mmplayer_subtitle_adjust_position_probe(GstPad *pad, GstPadProbeInfo *info, gpointer u_data)
-
{
mm_player_t *player = (mm_player_t *) u_data;
GstClockTime cur_timestamp = 0;
__gst_appsrc_feed_data_mem(GstElement *element, guint size, gpointer user_data)
{
GstElement *appsrc = element;
- tBuffer *buf = (tBuffer *)user_data;
+ MMPlayerInputBuffer *buf = (MMPlayerInputBuffer *)user_data;
GstBuffer *buffer = NULL;
GstFlowReturn ret = GST_FLOW_OK;
gint len = size;
static gboolean
__gst_appsrc_seek_data_mem(GstElement *element, guint64 size, gpointer user_data)
{
- tBuffer *buf = (tBuffer *)user_data;
+ MMPlayerInputBuffer *buf = (MMPlayerInputBuffer *)user_data;
MMPLAYER_RETURN_VAL_IF_FAIL(buf, FALSE);
}
g_object_set(element, "stream-type", stream_type, NULL);
- g_object_set(element, "size", player->mem_buf.len, NULL);
+ g_object_set(element, "size", player->profile.input_mem.len, NULL);
g_object_set(element, "blocksize", (guint64)20480, NULL);
MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
- G_CALLBACK(__gst_appsrc_seek_data_mem), &player->mem_buf);
+ G_CALLBACK(__gst_appsrc_seek_data_mem), &player->profile.input_mem);
MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
- G_CALLBACK(__gst_appsrc_feed_data_mem), &player->mem_buf);
+ G_CALLBACK(__gst_appsrc_feed_data_mem), &player->profile.input_mem);
}
break;
case MM_PLAYER_URI_TYPE_URL:
LOGD("ext: %s, mem_size: %d, mmap(param): %p\n", ext, mem_size, param);
if (mem_size && param) {
- if (data->mem)
- free(data->mem);
-
- data->mem = malloc(mem_size);
-
- if (data->mem) {
- memcpy(data->mem, param, mem_size);
- data->mem_size = mem_size;
+ if (data->input_mem.buf)
+ free(data->input_mem.buf);
+ data->input_mem.buf = malloc(mem_size);
+
+ if (data->input_mem.buf) {
+ memcpy(data->input_mem.buf, param, mem_size);
+ data->input_mem.len = mem_size;
+ ret = MM_ERROR_NONE;
} else {
LOGE("failed to alloc mem %d", mem_size);
+ ret = MM_ERROR_PLAYER_INTERNAL;
}
+ data->input_mem.offset = 0;
data->uri_type = MM_PLAYER_URI_TYPE_MEM;
- ret = MM_ERROR_NONE;
}
}
} else {
/* dump parse result */
SECURE_LOGW("incomming uri : %s\n", uri);
LOGD("uri_type : %d, mem : %p, mem_size : %d, urgent : %s\n",
- data->uri_type, data->mem, data->mem_size, data->urgent);
+ data->uri_type, data->input_mem.buf, data->input_mem.len, data->urgent);
MMPLAYER_FLEAVE();
}
}
- /* profile.mem or mem_buf.buf have to be free when player is destroyed */
- if (player->profile.uri_type == MM_PLAYER_URI_TYPE_MEM) {
- player->mem_buf.buf = (char *)player->profile.mem;
- player->mem_buf.len = player->profile.mem_size;
- player->mem_buf.offset = 0;
- }
-
if (uri && (strstr(uri, "es_buff://"))) {
if (strstr(uri, "es_buff://push_mode"))
player->es_player_push_mode = TRUE;
__mmplayer_video_stream_destroy_bo_list(player);
__mmplayer_initialize_storage_info(player, MMPLAYER_PATH_MAX);
- if (player->profile.mem) {
- free(player->profile.mem);
- player->profile.mem = NULL;
- player->mem_buf.buf = NULL;
+ if (player->profile.input_mem.buf) {
+ free(player->profile.input_mem.buf);
+ player->profile.input_mem.buf = NULL;
}
+ player->profile.input_mem.len = 0;
+ player->profile.input_mem.offset = 0;
+
player->uri_info.uri_idx = 0;
MMPLAYER_FLEAVE();
}