* @parameter FILE *fd, unsigned char* nal
* @return void
*/
+unsigned char sps[100] = {'\0'};
+unsigned char pps[100] = {'\0'};
+int sps_len = 0, pps_len = 0;
+
unsigned int ByteStreamToNalUnit(FILE *fd, unsigned char* nal)
{
- unsigned char sps[100] = {'\0'};
- unsigned char pps[100] = {'\0'};
unsigned char tmp_buf[1000000] = {'\0'};
- int sps_len = 0, pps_len = 0;
int nal_length = 0;
size_t result;
int read_size = 1;
*/
static void PlayerPreparedCB(void *user_data)
{
- int nRet = player_set_play_position(g_player, 2, TRUE, SeekCompletedCB, NULL);
- if ( PLAYER_ERROR_NONE != nRet )
- {
- FPRINTF("[Line : %d][%s] player seek is failed\\n", __LINE__, API_NAMESPACE);
- }
- nRet = player_start(g_player);
+ int nRet = player_start(g_player);
if ( PLAYER_ERROR_NONE != nRet )
{
FPRINTF("[Line : %d][%s] player_start is failed\\n", __LINE__, API_NAMESPACE);
int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject);
#endif //MOBILE //End MOBILE or TV
#if defined( WEARABLE) || defined(COMMON_IOT) //Starts WEARABLE
- int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow);
+ int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow);
#endif //WEARABLE //End WEARABLE
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet));
}
#if defined(MOBILE) || defined(TV) //Starts MOBILE or COMMON_IOT or TV
int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject);
- #endif //End MOBILE or COMMON_IOT or TV
+ #endif //End MOBILE or COMMON_IOT or TV
#if defined(WEARABLE) || defined(COMMON_IOT) //Starts WEARABLE
int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow);
#endif //WEARABLE //End WEARABLE
-
+
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet));
char pstrValue[CONFIG_VALUE_LEN_MAX] = {0,};
#endif //End MOBILE or COMMON_IOT or TV
#if defined(WEARABLE) || defined(COMMON_IOT) //Starts WEARABLE
int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow);
- #endif //WEARABLE //End WEARABLE
+ #endif //WEARABLE //End WEARABLE
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet));
char pstrValue[CONFIG_VALUE_LEN_MAX] = {0,};
return 1;
}
-
+
#if defined(MOBILE) || defined(TV) //Starts MOBILE or COMMON_IOT or TV
int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject);
#endif //End MOBILE or COMMON_IOT or TV
#if defined(WEARABLE) || defined(COMMON_IOT) //Starts WEARABLE
int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow);
- #endif //WEARABLE //End WEARABLE
+ #endif //WEARABLE //End WEARABLE
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet));
-
+
char pstrValue[CONFIG_VALUE_LEN_MAX] = {0,};
if ( true == GetValueFromConfigFile("PLAYER_DOWNLOAD_PROGRESS_URL", pstrValue, API_NAMESPACE) )
#endif //End MOBILE or COMMON_IOT or TV
#if defined(WEARABLE) || defined(COMMON_IOT) //Starts WEARABLE
int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow);
- #endif //WEARABLE //End WEARABLE
+ #endif //WEARABLE //End WEARABLE
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet));
-
+
sleep(2);
int nRet = player_set_completed_cb(g_player, PlayerCompletedCallback, NULL);
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_completed_cb", PlayerGetError(nRet));
-
+
#if defined(MOBILE) || defined(TV) //Starts MOBILE or COMMON_IOT or TV
nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, GET_DISPLAY(g_pEvasObject));
#endif //End MOBILE or COMMON_IOT or TV
#if defined(WEARABLE) || defined(COMMON_IOT)//Starts WEARABLE
- nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(g_pEvasWindow));
- #endif //WEARABLE //End WEARABLE
+ nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(g_pEvasWindow));
+ #endif //WEARABLE //End WEARABLE
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet));
if ( InitializePlayerHandler(true, 1) == false )
nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_NONE, GET_DISPLAY(g_pEvasObject));
#endif //End MOBILE or COMMON_IOT
#ifdef WEARABLE //Starts WEARABLE
- nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_NONE, GET_DISPLAY(g_pEvasWindow));
- #endif //WEARABLE //End WEARABLE
+ nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_NONE, GET_DISPLAY(g_pEvasWindow));
+ #endif //WEARABLE //End WEARABLE
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet));
if ( InitializePlayerHandler(true, 1) == false )
player_unprepare(g_player);
return 1;
}
-
+
//player_stop(g_player);
nRet = player_get_state(g_player,&state);
PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler);
return 1;
}
-
+
#if defined(MOBILE) || defined(TV) //Starts MOBILE or COMMON_IOT or TV
int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject);
#endif //End MOBILE or TV
START_TEST;s
media_format_h hMediaFormat = NULL;
media_packet_h hMediaPacket = NULL;
-
+
guint8 *buff_ptr = NULL;
void *src = NULL;
guint64 pts = 0L;
uint64_t nSize = 1024;
-
+
//get media format
int nRet = media_format_create(&hMediaFormat);
PRINT_RESULT(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_create", MediaFormatGetError(nRet));
-
+
//set audio format
nRet = media_format_set_audio_mime(hMediaFormat, MEDIA_FORMAT_AAC);
PRINT_RESULT_CLEANUP(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_set_audio_mime", MediaFormatGetError(nRet), media_format_unref(hMediaFormat));
-
+
nRet = media_format_set_audio_channel(hMediaFormat, 2);
PRINT_RESULT_CLEANUP(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_set_audio_channel", MediaFormatGetError(nRet), media_format_unref(hMediaFormat));
-
+
nRet = media_format_set_audio_samplerate(hMediaFormat, 48000);
PRINT_RESULT_CLEANUP(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_set_audio_samplerate", MediaFormatGetError(nRet), media_format_unref(hMediaFormat));
//Target API
nRet = player_push_media_stream(g_player, hMediaPacket);
PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_media_stream_video_info", PlayerGetError(nRet), g_free(buff_ptr);media_format_unref(hMediaFormat));
-
+
if ( buff_ptr )
{
g_free(buff_ptr);
buff_ptr = NULL;
}
-
+
nRet = media_format_unref(hMediaFormat);
PRINT_RESULT(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_unref", MediaFormatGetError(nRet));
return 1;
}
file_src = fopen(pPath, "r");
+ if (!file_src)
+ {
+ FPRINTF("[Line : %d][%s] Fail to open file\\n", __LINE__, API_NAMESPACE);
+ return 1;
+ }
int nRet = player_set_uri(g_player, ES_FEEDING_PATH);
PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_uri", PlayerGetError(nRet), fclose(file_src));
nRet = player_set_media_stream_buffer_status_cb(g_player, PLAYER_STREAM_TYPE_VIDEO, PlayerMediaStreamBufferStatusCallback, NULL);
PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_media_stream_buffer_status_cb", PlayerGetError(nRet), media_format_unref(g_hMediaFormat); fclose(file_src));
- nRet = player_set_media_stream_buffer_max_size(g_player, PLAYER_STREAM_TYPE_VIDEO, 10000);
+ nRet = player_set_media_stream_buffer_max_size(g_player, PLAYER_STREAM_TYPE_VIDEO, 3*1024*1024);
PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_media_stream_buffer_max_size", PlayerGetError(nRet), media_format_unref(g_hMediaFormat); fclose(file_src));
nRet = player_set_media_stream_seek_cb(g_player, PLAYER_STREAM_TYPE_VIDEO, PlayerMediaStreamSeekCallBack, NULL);
#if defined(MOBILE) //Starts MOBILE or COMMON_IOT
nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject);
- #endif //End MOBILE
+ #endif //End MOBILE
#if defined(WEARABLE) || defined(COMMON_IOT) //Starts WEARABLE
nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow);
#endif //WEARABLE //End WEARABLE
#if defined(WEARABLE) || defined(COMMON_IOT) //Starts WEARABLE
int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow);
#endif //WEARABLE //End WEARABLE
-
+
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet));
sleep(2);
player_state_e state;
int nCount = 0, nIndex = 0;
char *pszLangCode = NULL;
-
+
#if defined(MOBILE) || defined(TV)
int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject);
#endif //End MOBILE or COMMON_IOT or TV
* @type auto
* @description Registers a callback function to be invoked when the audio input handle is interrupted or the interrupt is completed.
* @scenario Registers a callback function \n
- UnRegisters a callback function
-* @apicovered player_set_interrupted_cb, player_unset_interrupted_cb
+ UnRegisters a callback function
+* @apicovered player_set_interrupted_cb, player_unset_interrupted_cb
* @passcase When player_set_interrupted_cb is successful.
* @failcase If target api player_set_interrupted_cb fails or any precondition api fails.
* @precondition Audio handle must be created
* @postcondition Audio handle must be released
-*
+*
*/
int ITc_player_in_set_unset_interrupted_cb_p(void)
-{
+{
START_TEST;
-
+
int nRet = player_set_interrupted_cb(g_player, PlayerInterruptCb, NULL);
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_interrupted_cb", PlayerGetError(nRet));
-
+
nRet = player_unset_interrupted_cb(g_player);
PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unset_interrupted_cb", PlayerGetError(nRet));