int ret;
_media_pkt_fin_data *fin_data;
intptr_t packet;
+ uint64_t pts = 0;
int i;
player_msg_get(key[0], recvMsg);
player_msg_get(key[3], recvMsg);
player_msg_get_type(packet, recvMsg, POINTER);
player_msg_get(mimetype, recvMsg);
+ player_msg_get(pts, recvMsg);
player_msg_get_array(surface_info, recvMsg);
LOGD("width %d, height %d", sinfo.width, sinfo.height);
}
}
if (pkt) {
+ if (pts != 0) {
+ ret = media_packet_set_pts(pkt, (uint64_t)pts);
+ if (ret != MEDIA_PACKET_ERROR_NONE)
+ LOGE("media_packet_set_pts failed");
+ }
/* call media packet callback */
((player_media_packet_video_decoded_cb)cb_info->user_cb[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME])(pkt, cb_info->user_data[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]);
}
muse_core_msg_json_factory_free(__sndMsg__); \
}while(0)
+/**
+ * @brief Create and send return message.
+ * @remarks Does NOT guarantee thread safe.
+ * @param[in] api The enum of module API.
+ * @param[in] event The event number.
+ * @param[in] module mused module information
+ * @param[in] type The enum of parameter type. Muse be one of thease(INT, INT64, POINTER, DOUBLE, STRING, ARRAY)
+ * @param[in] param# the name of param is key, must be local variable. never be pointer.
+ * @param[in] arr_param the name of param is key, must be local array/pointer variable.
+ * @param[in] length The size of array.
+ * @param[in] datum_size The size of a array's datum.
+ */
+#define player_msg_event7_array(api, event, module, type1, param1, type2, param2, type3, param3, type4, param4, type5, param5, type6, param6, type7, param7, arr_param, length, datum_size) \
+ do{ \
+ char *__sndMsg__; \
+ type1 __value1__ = (type1)param1; \
+ type2 __value2__ = (type2)param2; \
+ type3 __value3__ = (type3)param3; \
+ type4 __value4__ = (type4)param4; \
+ type5 __value5__ = (type5)param5; \
+ type6 __value6__ = (type6)param6; \
+ type7 __value7__ = (type7)param7; \
+ int *__arr_value__ = (int *)arr_param; \
+ __sndMsg__ = muse_core_msg_json_factory_new(api, \
+ MUSE_TYPE_INT, MUSE_PARAM_EVENT, event, \
+ MUSE_TYPE_##type1, #param1, __value1__, \
+ MUSE_TYPE_##type2, #param2, __value2__, \
+ MUSE_TYPE_##type3, #param3, __value3__, \
+ MUSE_TYPE_##type4, #param4, __value4__, \
+ MUSE_TYPE_##type5, #param5, __value5__, \
+ MUSE_TYPE_##type6, #param6, __value6__, \
+ MUSE_TYPE_##type7, #param7, __value7__, \
+ MUSE_TYPE_INT, #length, length, \
+ MUSE_TYPE_ARRAY, #arr_param, \
+ datum_size == sizeof(int)? length : \
+ length / sizeof(int) + (length % sizeof(int)?1:0), \
+ __arr_value__, \
+ 0); \
+ muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+ muse_core_msg_json_factory_free(__sndMsg__); \
+ }while(0)
#ifdef __cplusplus
intptr_t packet = (intptr_t)pkt;
media_format_mimetype_e mimetype = MEDIA_FORMAT_NV12;
media_format_h fmt;
+ uint64_t pts = 0;
memset(&sinfo, 0, sizeof(tbm_surface_info_s));
}
media_packet_get_format(pkt, &fmt);
media_format_get_video_info(fmt, &mimetype, NULL, NULL, NULL, NULL);
- player_msg_event6_array(api, ev, module, INT, key[0], INT, key[1], INT, key[2], INT, key[3], POINTER, packet, INT, mimetype, surface_info, surface_info_size, sizeof(char));
+ media_packet_get_pts(pkt, &pts);
+ player_msg_event7_array(api, ev, module, INT, key[0], INT, key[1], INT, key[2], INT, key[3], POINTER, packet, INT, mimetype, INT64, pts, surface_info, surface_info_size, sizeof(char));
}
static void _audio_frame_decoded_cb(player_audio_raw_data_s * audio_frame, void *user_data)