} _player_cb_data;
typedef struct {
- intptr_t remote_pkt;
+ intptr_t remote_v_data;
gint fd;
gint fd_id;
bool use_tsurf_pool;
int _player_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data)
{
int ret = MEDIA_PACKET_FINALIZE;
- muse_player_api_e api = MUSE_PLAYER_API_MEDIA_PACKET_FINALIZE_CB;
+ muse_player_api_e api = MUSE_PLAYER_API_RETURN_VIDEO_DATA;
_media_pkt_fin_data *fin_data = (_media_pkt_fin_data *) user_data;
- intptr_t packet = 0;
+ intptr_t v_data = 0;
char *snd_msg = NULL;
int snd_len = 0;
goto EXIT;
}
- packet = fin_data->remote_pkt;
- snd_msg = muse_core_msg_new(api, MUSE_TYPE_POINTER, "packet", packet, 0);
+ v_data = fin_data->remote_v_data;
+ snd_msg = muse_core_msg_new(api, MUSE_TYPE_POINTER, "v_data", v_data, 0);
snd_len = muse_core_msg_send(fin_data->fd, snd_msg);
muse_core_msg_free(snd_msg);
bool make_pkt_fmt = false;
int ret = MEDIA_FORMAT_ERROR_NONE;
_media_pkt_fin_data *fin_data = NULL;
- intptr_t packet = 0;
+ intptr_t v_data = 0;
uint64_t pts = 0;
int i = 0;
muse_core_msg_parse_err_e err = MUSE_MSG_PARSE_ERROR_NONE;
!muse_core_msg_object_get_value("key[1]", jobj, MUSE_TYPE_ANY, &key[1]) ||
!muse_core_msg_object_get_value("key[2]", jobj, MUSE_TYPE_ANY, &key[2]) ||
!muse_core_msg_object_get_value("key[3]", jobj, MUSE_TYPE_ANY, &key[3]) ||
- !muse_core_msg_object_get_value("packet", jobj, MUSE_TYPE_POINTER, &packet) ||
+ !muse_core_msg_object_get_value("v_data", jobj, MUSE_TYPE_POINTER, &v_data) ||
!muse_core_msg_object_get_value("mimetype", jobj, MUSE_TYPE_ANY, &mimetype) ||
!muse_core_msg_object_get_value("pts", jobj, MUSE_TYPE_INT64, &pts) ||
!muse_core_msg_object_get_value("surface_info", jobj, MUSE_TYPE_ARRAY, surface_info)) {
}
if (!cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]) {
- /* send msg to release packet. */
+ /* send msg to release v_data. */
LOGE("_video_decoded_cb is not set");
goto ERROR;
}
LOGE("failed to alloc fin_data");
goto ERROR;
}
- fin_data->remote_pkt = packet;
+ fin_data->remote_v_data = v_data;
fin_data->fd = cb_info->fd;
fin_data->use_tsurf_pool = cb_info->use_tsurf_pool;
}
memset(recv_data->tfd, INVALID_DEFAULT_VALUE, sizeof(recv_data->tfd));
- if (cb_info && packet)
- player_msg_send1_no_return(MUSE_PLAYER_API_MEDIA_PACKET_FINALIZE_CB, cb_info->fd, POINTER, packet);
+ if (cb_info && v_data)
+ player_msg_send1_no_return(MUSE_PLAYER_API_RETURN_VIDEO_DATA, cb_info->fd, POINTER, v_data);
return;
}
int player_get_codec_info(player_h player, char **paudio_codec, char **pvideo_codec)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(paudio_codec && pvideo_codec);
+ PLAYER_NULL_ARG_CHECK(paudio_codec || pvideo_codec);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_INFO;
player_cli_s *pc = (player_cli_s *) player;
if (ret == PLAYER_ERROR_NONE) {
player_msg_get_string2(ret_buf, video_codec, audio_codec, ret_val);
if (ret_val) {
- *pvideo_codec = strndup(video_codec, MUSE_MSG_MAX_LENGTH);
- *paudio_codec = strndup(audio_codec, MUSE_MSG_MAX_LENGTH);
+ if (pvideo_codec)
+ *pvideo_codec = strndup(video_codec, MUSE_MSG_MAX_LENGTH);
+ if (paudio_codec)
+ *paudio_codec = strndup(audio_codec, MUSE_MSG_MAX_LENGTH);
} else {
ret = PLAYER_ERROR_INVALID_OPERATION;
}
int player_get_audio_stream_info(player_h player, int *psample_rate, int *pchannel, int *pbit_rate)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(psample_rate && pchannel && pbit_rate);
+ PLAYER_NULL_ARG_CHECK(psample_rate || pchannel || pbit_rate);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO;
player_cli_s *pc = (player_cli_s *) player;
bool ret_val = TRUE;
player_msg_get3(ret_buf, sample_rate, INT, channel, INT, bit_rate, INT, ret_val);
if (ret_val) {
- *psample_rate = sample_rate;
- *pchannel = channel;
- *pbit_rate = bit_rate;
+ if (psample_rate)
+ *psample_rate = sample_rate;
+ if (pchannel)
+ *pchannel = channel;
+ if (pbit_rate)
+ *pbit_rate = bit_rate;
} else {
ret = PLAYER_ERROR_INVALID_OPERATION;
}
int player_get_video_stream_info(player_h player, int *pfps, int *pbit_rate)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pfps && pbit_rate);
+ PLAYER_NULL_ARG_CHECK(pfps || pbit_rate);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_STREAM_INFO;
player_cli_s *pc = (player_cli_s *) player;
bool ret_val = TRUE;
player_msg_get2(ret_buf, fps, INT, bit_rate, INT, ret_val);
if (ret_val) {
- *pfps = fps;
- *pbit_rate = bit_rate;
+ if (pfps)
+ *pfps = fps;
+ if (pbit_rate)
+ *pbit_rate = bit_rate;
} else {
ret = PLAYER_ERROR_INVALID_OPERATION;
}