*/
int ITc_media_format_set_get_container_mime_p(void)
{
- START_TEST;
- media_format_h fmt_container;
-
- int nRet = media_format_create(&fmt_container);
- PRINT_RESULT(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_create", MediaFormatGetError(nRet));
-
- media_format_mimetype_e eGetMimeType;
-
- media_format_mimetype_e eMimeType[] = {
- /* CONTAINER VIDEO */
- MEDIA_FORMAT_CONTAINER_MP4, /**< media format mime type is MP4 container, VIDEO, (Since 3.0) */
- MEDIA_FORMAT_CONTAINER_AVI, /**< media format mime type is AVI container, VIDEO, (Since 3.0) */
- MEDIA_FORMAT_CONTAINER_MPEG2TS, /**< media format mime type is MPEG2TS container, VIDEO, (Since 3.0) */
- MEDIA_FORMAT_CONTAINER_MPEG2PS, /**< media format mime type is MPEG2PS container, VIDEO, (Since 3.0) */
- MEDIA_FORMAT_CONTAINER_MATROSKA, /**< media format mime type is MATROSKA container, VIDEO, (Since 3.0) */
- MEDIA_FORMAT_CONTAINER_WEBM, /**< media format mime type is WEBM container, VIDEO, (Since 3.0) */
- MEDIA_FORMAT_CONTAINER_3GP, /**< media format mime type is 3GP container, VIDEO, (Since 3.0) */
-
- /*CONTAINER AUDIO */
- MEDIA_FORMAT_CONTAINER_WAV, /**< media format mime type is WAV container, AUDIO, (Since 3.0) */
- MEDIA_FORMAT_CONTAINER_OGG, /**< media format mime type is OGG container, AUDIO, (Since 3.0) */
- MEDIA_FORMAT_CONTAINER_AAC_ADTS, /**< media format mime type is AAC_ADTS container, AUDIO, (Since 3.0) */
- };
-
- int nEnumSize = sizeof(eMimeType) / sizeof(eMimeType[0]);
- int nEnumCounter = 0;
- for ( nEnumCounter=0; nEnumCounter<nEnumSize; nEnumCounter++)
- {
- nRet = media_format_set_container_mime(fmt_container,eMimeType[nEnumCounter]);
- if ( nRet != MEDIA_FORMAT_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] Failed , for enum = [ %s ]\\n", __LINE__, API_NAMESPACE, MediaFormatMimeTypeGetEnum(eMimeType[nEnumCounter]), MediaFormatGetError(nRet));
- return 1;
- }
- nRet = media_format_get_container_mime(fmt_container,&eGetMimeType);
- if ( nRet != MEDIA_FORMAT_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] Failed , for enum = [ %s ]\\n", __LINE__, API_NAMESPACE, MediaFormatMimeTypeGetEnum(eGetMimeType), MediaFormatGetError(nRet));
- return 1;
- }
- if (eMimeType[nEnumCounter] != eGetMimeType)
- {
- FPRINTF("Line : %d][%s] %s != %s\\n",__LINE__, API_NAMESPACE, MediaFormatMimeTypeGetEnum(eMimeType[nEnumCounter]), MediaFormatMimeTypeGetEnum(eGetMimeType));
- media_format_unref(fmt_container);
- return 1;
- }
- }
- nRet = media_format_unref(fmt_container);
- PRINT_RESULT(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_unref", MediaFormatGetError(nRet));
- return 0;
+ START_TEST;
+ media_format_h fmt_container;
+ int nRet = -1;
+
+ nRet = media_format_make_writable(g_Oldhfmt, &g_hfmt);
+ PRINT_RESULT(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_make_writable", MediaFormatGetError(nRet));
+
+ media_format_mimetype_e eGetMimeType;
+
+ media_format_mimetype_e eMimeType[] = {
+ /* CONTAINER VIDEO */
+ MEDIA_FORMAT_CONTAINER_MP4, /**< media format mime type is MP4 container, VIDEO, (Since 3.0) */
+ MEDIA_FORMAT_CONTAINER_AVI, /**< media format mime type is AVI container, VIDEO, (Since 3.0) */
+ MEDIA_FORMAT_CONTAINER_MPEG2TS, /**< media format mime type is MPEG2TS container, VIDEO, (Since 3.0) */
+ MEDIA_FORMAT_CONTAINER_MPEG2PS, /**< media format mime type is MPEG2PS container, VIDEO, (Since 3.0) */
+ MEDIA_FORMAT_CONTAINER_MATROSKA, /**< media format mime type is MATROSKA container, VIDEO, (Since 3.0) */
+ MEDIA_FORMAT_CONTAINER_WEBM, /**< media format mime type is WEBM container, VIDEO, (Since 3.0) */
+ MEDIA_FORMAT_CONTAINER_3GP, /**< media format mime type is 3GP container, VIDEO, (Since 3.0) */
+
+ /*CONTAINER AUDIO */
+ MEDIA_FORMAT_CONTAINER_WAV, /**< media format mime type is WAV container, AUDIO, (Since 3.0) */
+ MEDIA_FORMAT_CONTAINER_OGG, /**< media format mime type is OGG container, AUDIO, (Since 3.0) */
+ MEDIA_FORMAT_CONTAINER_AAC_ADTS, /**< media format mime type is AAC_ADTS container, AUDIO, (Since 3.0) */
+ };
+
+ int nEnumSize = sizeof(eMimeType) / sizeof(eMimeType[0]);
+ int nEnumCounter = 0;
+ for ( nEnumCounter=0; nEnumCounter<nEnumSize; nEnumCounter++)
+ {
+ nRet = media_format_set_container_mime(g_hfmt,eMimeType[nEnumCounter]);
+ if ( nRet != MEDIA_FORMAT_ERROR_NONE )
+ {
+ FPRINTF("[Line : %d][%s] Failed , for enum = [ %s ]\\n", __LINE__, API_NAMESPACE, MediaFormatMimeTypeGetEnum(eMimeType[nEnumCounter]), MediaFormatGetError(nRet));
+ return 1;
+ }
+ nRet = media_format_get_container_mime(g_hfmt,&eGetMimeType);
+ if ( nRet != MEDIA_FORMAT_ERROR_NONE )
+ {
+ FPRINTF("[Line : %d][%s] Failed , for enum = [ %s ]\\n", __LINE__, API_NAMESPACE, MediaFormatMimeTypeGetEnum(eGetMimeType), MediaFormatGetError(nRet));
+ return 1;
+ }
+ if (eMimeType[nEnumCounter] != eGetMimeType)
+ {
+ FPRINTF("Line : %d][%s] %s != %s\\n",__LINE__, API_NAMESPACE, MediaFormatMimeTypeGetEnum(eMimeType[nEnumCounter]), MediaFormatMimeTypeGetEnum(eGetMimeType));
+ return 1;
+ }
+ }
+
+ return 0;
}
//& purpose: Sets text MIME type & text TYPE and Gets text track information of media format
*/
int ITc_media_format_set_text_mime_set_text_type_get_text_info_p(void)
{
- START_TEST;
-
- media_format_h hFmtContainer = NULL;
- media_format_mimetype_e eGetMimeType;
- media_format_text_type_e eGetTextType;
-
- int nRet = media_format_create(&hFmtContainer);
- PRINT_RESULT(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_create", MediaFormatGetError(nRet));
- CHECK_HANDLE(hFmtContainer,"media_format_create");
-
- media_format_mimetype_e eSetMimeType[] = {
- /* Text */
- MEDIA_FORMAT_TEXT_MP4, /**< media format mime type is MP4, TEXT, (Since 3.0) */
- MEDIA_FORMAT_TEXT_3GP, /**< media format mime type is 3GP, TEXT, (Since 3.0) */
- };
-
- media_format_text_type_e eSetTextType[] = {
- MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_MP4, /**< media format text type is MPEG-4 Timed Text */
- MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_3GPP, /**< media format text type is 3GPP Timed Text */
- };
-
- int nEnumSize = sizeof(eSetMimeType) / sizeof(eSetMimeType[0]);
- int nEnumCounter = 0;
- for ( nEnumCounter=0; nEnumCounter<nEnumSize; nEnumCounter++)
- {
- nRet = media_format_set_text_mime(hFmtContainer, eSetMimeType[nEnumCounter]);
- PRINT_RESULT_CLEANUP(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_set_text_mime",MediaFormatGetError(nRet), MediaFormatMimeTypeGetEnum(eSetMimeType[nEnumCounter]);media_format_unref(hFmtContainer););
-
- nRet = media_format_set_text_type(hFmtContainer, eSetTextType[nEnumCounter]);
- PRINT_RESULT_CLEANUP(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_set_text_type", MediaFormatGetError(nRet),MediaFormatTextTypeGetEnum(eSetTextType[nEnumCounter]);media_format_unref(hFmtContainer););
-
- nRet = media_format_get_text_info(hFmtContainer,&eGetMimeType,&eGetTextType);
- PRINT_RESULT_CLEANUP(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_get_text_info", MediaFormatGetError(nRet),MediaFormatMimeTypeGetEnum(eGetMimeType);MediaFormatTextTypeGetEnum(eGetTextType);media_format_unref(hFmtContainer););
- if ((eSetMimeType[nEnumCounter] != eGetMimeType) || (eSetTextType[nEnumCounter] != eGetTextType))
- {
- FPRINTF("Line : %d][%s]value mismatch\\n",__LINE__, API_NAMESPACE);
- media_format_unref(hFmtContainer);
- return 1;
- }
- }
- nRet = media_format_unref(hFmtContainer);
- PRINT_RESULT(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_unref", MediaFormatGetError(nRet));
-
- return 0;
+ START_TEST;
+
+ media_format_h hFmtContainer = NULL;
+ media_format_mimetype_e eGetMimeType;
+ media_format_text_type_e eGetTextType;
+ int nRet = -1;
+
+ nRet = media_format_make_writable(g_Oldhfmt, &g_hfmt);
+ PRINT_RESULT(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_make_writable", MediaFormatGetError(nRet));
+
+ media_format_mimetype_e eSetMimeType[] = {
+ /* Text */
+ MEDIA_FORMAT_TEXT_MP4, /**< media format mime type is MP4, TEXT, (Since 3.0) */
+ MEDIA_FORMAT_TEXT_3GP, /**< media format mime type is 3GP, TEXT, (Since 3.0) */
+ };
+
+ media_format_text_type_e eSetTextType[] = {
+ MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_MP4, /**< media format text type is MPEG-4 Timed Text */
+ MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_3GPP, /**< media format text type is 3GPP Timed Text */
+ };
+
+ int nEnumSize = sizeof(eSetMimeType) / sizeof(eSetMimeType[0]);
+ int nEnumCounter = 0;
+ for ( nEnumCounter=0; nEnumCounter<nEnumSize; nEnumCounter++)
+ {
+ nRet = media_format_set_text_mime(g_hfmt, eSetMimeType[nEnumCounter]);
+ PRINT_RESULT_CLEANUP(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_set_text_mime",MediaFormatGetError(nRet), MediaFormatMimeTypeGetEnum(eSetMimeType[nEnumCounter]));
+
+ nRet = media_format_set_text_type(g_hfmt, eSetTextType[nEnumCounter]);
+ PRINT_RESULT_CLEANUP(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_set_text_type", MediaFormatGetError(nRet),MediaFormatTextTypeGetEnum(eSetTextType[nEnumCounter]));
+
+ nRet = media_format_get_text_info(g_hfmt,&eGetMimeType,&eGetTextType);
+ PRINT_RESULT_CLEANUP(MEDIA_FORMAT_ERROR_NONE, nRet, "media_format_get_text_info", MediaFormatGetError(nRet),MediaFormatMimeTypeGetEnum(eGetMimeType);MediaFormatTextTypeGetEnum(eGetTextType));
+ if ((eSetMimeType[nEnumCounter] != eGetMimeType) || (eSetTextType[nEnumCounter] != eGetTextType))
+ {
+ FPRINTF("Line : %d][%s]value mismatch\\n",__LINE__, API_NAMESPACE);
+ return 1;
+ }
+ }
+
+ return 0;
}
#if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE or WEARABLE