static media_packet_h packet2;
static media_packet_h pkt_create_alloc;
static media_packet_h pkt_create_alloc_tbm;
-static media_packet_h pkt_create_alloc_audio;
static media_packet_pool_h pool;
void utc_media_packet_startup(void)
{
- if (media_format_create(&format) == MEDIA_FORMAT_ERROR_NONE)
- {
- int ret_video = MEDIA_FORMAT_ERROR_NONE;
- ret_video |= media_format_set_video_mime(format, MEDIA_FORMAT_H264_HP);
- ret_video |= media_format_set_video_width(format, 480);
- ret_video |= media_format_set_video_height(format, 640);
- ret_video |= media_format_set_video_avg_bps(format, 10000000);
- ret_video |= media_format_set_video_max_bps(format, 15000000);
- ret_video |= media_format_set_video_frame_rate(format, 30);
-
- }
-
- if (media_format_create(&format_audio) == MEDIA_FORMAT_ERROR_NONE)
- {
- int ret_audio = MEDIA_FORMAT_ERROR_NONE ;
- ret_audio |= media_format_set_audio_mime(format_audio, MEDIA_FORMAT_AAC_LC);
- ret_audio |= media_format_set_audio_channel(format_audio, 2000);
- ret_audio |= media_format_set_audio_samplerate(format_audio, 20000);
- ret_audio |= media_format_set_audio_bit(format_audio, 200000);
- ret_audio |= media_format_set_audio_avg_bps(format_audio, 1000000);
- ret_audio |= media_format_set_audio_aac_type(format_audio, false);
- ret_audio |= media_format_set_audio_aac_header_type(format_audio, MEDIA_FORMAT_AAC_HEADER_ADIF);
-
- }
-
- if (media_format_create(&format_for_tbm) == MEDIA_FORMAT_ERROR_NONE)
- {
- int ret_tbm = MEDIA_FORMAT_ERROR_NONE;
- ret_tbm |= media_format_set_video_mime(format_for_tbm, MEDIA_FORMAT_I420);
- ret_tbm |= media_format_set_video_width(format_for_tbm, 128);
- ret_tbm |= media_format_set_video_height(format_for_tbm, 128);
- ret_tbm |= media_format_set_video_avg_bps(format_for_tbm, 10000000);
- ret_tbm |= media_format_set_video_max_bps(format_for_tbm, 15000000);
- }
-
- if (media_format_create(&empty_format) != MEDIA_FORMAT_ERROR_NONE)
- {
- fprintf(stderr, "media_format_create , empty_format failed!");
- }
-
- if (media_format_create(&format_text) == MEDIA_FORMAT_ERROR_NONE)
- {
- int ret_text = MEDIA_FORMAT_ERROR_NONE;
- ret_text |= media_format_set_text_mime(format_text, MEDIA_FORMAT_TEXT_MP4);
- ret_text |= media_format_set_text_type(format_text, MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_3GPP);
- if (ret_text != MEDIA_FORMAT_ERROR_NONE)
- {
- fprintf(stderr, "media_format_set_text_xxxx failed!");
- }
- }
-
- if (media_packet_create_alloc(format, NULL, NULL, &pkt_create_alloc) != MEDIA_PACKET_ERROR_NONE)
- {
- fprintf(stderr, "media_packet_create_alloc , pkt_create_alloc failed!");
- }
-
- if (media_packet_create_alloc(format_for_tbm, NULL, NULL, &pkt_create_alloc_tbm) != MEDIA_PACKET_ERROR_NONE)
- {
- fprintf(stderr, "media_packet_create_alloc , pkt_create_alloc_tbm failed!");
- }
+ if (media_format_create(&format) == MEDIA_FORMAT_ERROR_NONE) {
+ int ret_video = MEDIA_FORMAT_ERROR_NONE;
+ ret_video |= media_format_set_video_mime(format, MEDIA_FORMAT_H264_HP);
+ ret_video |= media_format_set_video_width(format, 480);
+ ret_video |= media_format_set_video_height(format, 640);
+ ret_video |= media_format_set_video_avg_bps(format, 10000000);
+ ret_video |= media_format_set_video_max_bps(format, 15000000);
+ ret_video |= media_format_set_video_frame_rate(format, 30);
+
+ }
+
+ if (media_format_create(&format_audio) == MEDIA_FORMAT_ERROR_NONE) {
+ int ret_audio = MEDIA_FORMAT_ERROR_NONE ;
+ ret_audio |= media_format_set_audio_mime(format_audio, MEDIA_FORMAT_AAC_LC);
+ ret_audio |= media_format_set_audio_channel(format_audio, 2000);
+ ret_audio |= media_format_set_audio_samplerate(format_audio, 20000);
+ ret_audio |= media_format_set_audio_bit(format_audio, 200000);
+ ret_audio |= media_format_set_audio_avg_bps(format_audio, 1000000);
+ ret_audio |= media_format_set_audio_aac_type(format_audio, false);
+ ret_audio |= media_format_set_audio_aac_header_type(format_audio, MEDIA_FORMAT_AAC_HEADER_ADIF);
+
+ }
+
+ if (media_format_create(&format_for_tbm) == MEDIA_FORMAT_ERROR_NONE) {
+ int ret_tbm = MEDIA_FORMAT_ERROR_NONE;
+ ret_tbm |= media_format_set_video_mime(format_for_tbm, MEDIA_FORMAT_I420);
+ ret_tbm |= media_format_set_video_width(format_for_tbm, 128);
+ ret_tbm |= media_format_set_video_height(format_for_tbm, 128);
+ ret_tbm |= media_format_set_video_avg_bps(format_for_tbm, 10000000);
+ ret_tbm |= media_format_set_video_max_bps(format_for_tbm, 15000000);
+ }
+
+ if (media_format_create(&empty_format) != MEDIA_FORMAT_ERROR_NONE) {
+ fprintf(stderr, "media_format_create , empty_format failed!");
+ }
+
+ if (media_format_create(&format_text) == MEDIA_FORMAT_ERROR_NONE) {
+ int ret_text = MEDIA_FORMAT_ERROR_NONE;
+ ret_text |= media_format_set_text_mime(format_text, MEDIA_FORMAT_TEXT_MP4);
+ ret_text |= media_format_set_text_type(format_text, MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_3GPP);
+ if (ret_text != MEDIA_FORMAT_ERROR_NONE) {
+ fprintf(stderr, "media_format_set_text_xxxx failed!");
+ }
+ }
+
+ if (media_packet_create_alloc(format, NULL, NULL, &pkt_create_alloc) != MEDIA_PACKET_ERROR_NONE) {
+ fprintf(stderr, "media_packet_create_alloc , pkt_create_alloc failed!");
+ }
+
+ if (media_packet_create_alloc(format_for_tbm, NULL, NULL, &pkt_create_alloc_tbm) != MEDIA_PACKET_ERROR_NONE) {
+ fprintf(stderr, "media_packet_create_alloc , pkt_create_alloc_tbm failed!");
+ }
}
/**
*/
void utc_media_packet_cleanup(void)
{
- if (pkt_create_alloc_tbm)
- media_packet_destroy(pkt_create_alloc_tbm);
- if (pkt_create_alloc)
- media_packet_destroy(pkt_create_alloc);
- if (pkt_create_alloc_audio)
- media_packet_destroy(pkt_create_alloc_audio);
- if (empty_format)
- media_format_unref(empty_format);
- if (format)
- media_format_unref(format_audio);
- if (format_text)
- media_format_unref(format_text);
+ if (pkt_create_alloc_tbm)
+ media_packet_destroy(pkt_create_alloc_tbm);
+ if (pkt_create_alloc)
+ media_packet_destroy(pkt_create_alloc);
+
+ if (empty_format)
+ media_format_unref(empty_format);
+ if (format)
+ media_format_unref(format);
+ if (format_audio)
+ media_format_unref(format_audio);
+ if (format_text)
+ media_format_unref(format_text);
+ if (format_for_tbm)
+ media_format_unref(format_for_tbm);
}
static int _finalize_callback(media_packet_h packet, int err, void * userdata)
{
- finalizeCB_called = 1;
- return MEDIA_PACKET_FINALIZE;
+ finalizeCB_called = 1;
+ return MEDIA_PACKET_FINALIZE;
}
/**
*/
int utc_media_packet_create_alloc_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+
+ ret = media_packet_create_alloc(format, NULL, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- ret = media_packet_create_alloc(format, NULL, NULL, &packet);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- if (ret == MEDIA_PACKET_ERROR_NONE)
- media_packet_destroy(packet);
+ if (ret == MEDIA_PACKET_ERROR_NONE)
+ media_packet_destroy(packet);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_create_alloc_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
-
- ret = media_packet_create_alloc(empty_format, NULL, NULL, &packet);
+ int ret = MEDIA_PACKET_ERROR_NONE;
- assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
+ ret = media_packet_create_alloc(empty_format, NULL, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_create_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_create(format, NULL, NULL, &packet);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- if (ret == MEDIA_PACKET_ERROR_NONE)
- media_packet_destroy(packet);
+ ret = media_packet_create(format, NULL, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ if (ret == MEDIA_PACKET_ERROR_NONE)
+ media_packet_destroy(packet);
+
+ return 0;
}
/**
*/
int utc_media_packet_create_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
-
- ret = media_packet_create(empty_format, NULL, NULL, &packet);
+ int ret = MEDIA_PACKET_ERROR_NONE;
- assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
+ ret = media_packet_create(empty_format, NULL, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_copy_p(void)
{
- int ret1 = MEDIA_PACKET_ERROR_NONE;
- int ret2 = MEDIA_PACKET_ERROR_NONE;
+ int ret1 = MEDIA_PACKET_ERROR_NONE;
+ int ret2 = MEDIA_PACKET_ERROR_NONE;
+
+ ret1 = media_packet_create(format, NULL, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
- ret1 = media_packet_create(format, NULL, NULL, &packet);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
+ ret2 = media_packet_copy(packet, NULL, NULL, &packet2);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
- ret2 = media_packet_copy(packet, NULL, NULL, &packet2);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
+ if (ret1 == MEDIA_PACKET_ERROR_NONE)
+ media_packet_destroy(packet);
- if(ret2 == MEDIA_PACKET_ERROR_NONE)
- media_packet_destroy(packet2);
+ if (ret2 == MEDIA_PACKET_ERROR_NONE)
+ media_packet_destroy(packet2);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_copy_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_copy(NULL, NULL, NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_copy(NULL, NULL, NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_format_p(void)
{
- int ret1 = MEDIA_PACKET_ERROR_NONE;
- int ret2 = MEDIA_PACKET_ERROR_NONE;
-
- media_format_h fmt;
- if (media_format_create(&fmt) == MEDIA_FORMAT_ERROR_NONE)
- {
- int ret_video = MEDIA_FORMAT_ERROR_NONE;
- ret_video = media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
- ret_video = media_format_set_video_width(fmt, 320);
- ret_video = media_format_set_video_height(fmt, 240);
- ret_video = media_format_set_video_avg_bps(fmt, 10000000);
- ret_video = media_format_set_video_max_bps(fmt, 15000000);
- if (ret_video != MEDIA_FORMAT_ERROR_NONE)
- {
- fprintf(stderr, "media_format_set_video_xxxx failed!");
- }
- }
- else
- {
- fprintf(stderr, "media_format_create failed!");
- }
-
- ret1 = media_packet_create(format, NULL, NULL, &packet);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
+ int ret1 = MEDIA_PACKET_ERROR_NONE;
+ int ret2 = MEDIA_PACKET_ERROR_NONE;
+
+ media_format_h fmt;
+ if (media_format_create(&fmt) == MEDIA_FORMAT_ERROR_NONE) {
+ int ret_video = MEDIA_FORMAT_ERROR_NONE;
+ ret_video = media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
+ ret_video = media_format_set_video_width(fmt, 320);
+ ret_video = media_format_set_video_height(fmt, 240);
+ ret_video = media_format_set_video_avg_bps(fmt, 10000000);
+ ret_video = media_format_set_video_max_bps(fmt, 15000000);
+ if (ret_video != MEDIA_FORMAT_ERROR_NONE)
+ {
+ fprintf(stderr, "media_format_set_video_xxxx failed!");
+ }
+ } else {
+ fprintf(stderr, "media_format_create failed!");
+ }
+
+ ret1 = media_packet_create(format, NULL, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
+
+ ret2 = media_packet_set_format(packet, fmt);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
+
+ if(ret1 == MEDIA_PACKET_ERROR_NONE)
+ media_packet_destroy(packet);
- ret2 = media_packet_set_format(packet, fmt);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
-
- return 0;
+ return 0;
}
*/
int utc_media_packet_set_format_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_set_format(NULL, NULL);
+ ret = media_packet_set_format(NULL, NULL);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
*/
int utc_media_packet_alloc_p(void)
{
- int ret1 = MEDIA_PACKET_ERROR_NONE;
- int ret2 = MEDIA_PACKET_ERROR_NONE;
+ int ret1 = MEDIA_PACKET_ERROR_NONE;
+ int ret2 = MEDIA_PACKET_ERROR_NONE;
- ret1 = media_packet_create(format, NULL, NULL, &packet);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
+ ret1 = media_packet_create(format, NULL, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
- ret2 = media_packet_alloc(packet);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
+ ret2 = media_packet_alloc(packet);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
- return 0;
+ if(ret2 == MEDIA_PACKET_ERROR_NONE)
+ media_packet_destroy(packet);
+
+ return 0;
}
/**
*/
int utc_media_packet_alloc_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_alloc(NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_alloc(NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_flags_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- media_buffer_flags_e flag = MEDIA_PACKET_CODEC_CONFIG;
+ media_buffer_flags_e flag = MEDIA_PACKET_CODEC_CONFIG;
- ret = media_packet_set_flags(pkt_create_alloc, flag);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_set_flags(pkt_create_alloc, flag);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_flags_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_set_flags(NULL, 0);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_set_flags(NULL, 0);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_flags_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- media_buffer_flags_e set_flag = MEDIA_PACKET_CODEC_CONFIG;
- media_packet_set_flags(pkt_create_alloc, set_flag);
+ media_buffer_flags_e set_flag = MEDIA_PACKET_CODEC_CONFIG;
+ media_packet_set_flags(pkt_create_alloc, set_flag);
- media_buffer_flags_e flag;
- ret = media_packet_get_flags(pkt_create_alloc, &flag);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- assert(flag & set_flag);
+ media_buffer_flags_e flag;
+ ret = media_packet_get_flags(pkt_create_alloc, &flag);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert(flag & set_flag);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_flags_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_get_flags(NULL, NULL);
+ ret = media_packet_get_flags(NULL, NULL);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_unset_flags_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- media_buffer_flags_e flag = MEDIA_PACKET_CODEC_CONFIG;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ media_buffer_flags_e flag = MEDIA_PACKET_CODEC_CONFIG;
- ret = media_packet_unset_flags(pkt_create_alloc, flag);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_unset_flags(pkt_create_alloc, flag);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_unset_flags_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_unset_flags(NULL, 0);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_unset_flags(NULL, 0);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
* @testcase utc_media_packet_is_codec_config_p
*/
int utc_media_packet_is_codec_config_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- bool is_codec_config;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ bool is_codec_config;
- ret = media_packet_is_codec_config(pkt_create_alloc, &is_codec_config);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- assert(!is_codec_config);
+ ret = media_packet_is_codec_config(pkt_create_alloc, &is_codec_config);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert(!is_codec_config);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_codec_config_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_is_codec_config(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_is_codec_config(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_end_of_stream_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- bool is_eos;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ bool is_eos;
- ret = media_packet_is_end_of_stream(pkt_create_alloc, &is_eos);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- assert(!is_eos);
+ ret = media_packet_is_end_of_stream(pkt_create_alloc, &is_eos);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert(!is_eos);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_end_of_stream_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_is_end_of_stream(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_is_end_of_stream(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_sync_frame_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- bool is_sync;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ bool is_sync;
- ret = media_packet_is_sync_frame(pkt_create_alloc, &is_sync);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- assert(!is_sync);
+ ret = media_packet_is_sync_frame(pkt_create_alloc, &is_sync);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert(!is_sync);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_sync_frame_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_is_sync_frame(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_is_sync_frame(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_has_tbm_surface_buffer_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- bool has_tbm;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ bool has_tbm;
- ret = media_packet_has_tbm_surface_buffer(pkt_create_alloc, &has_tbm);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- assert(!has_tbm);
+ ret = media_packet_has_tbm_surface_buffer(pkt_create_alloc, &has_tbm);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert(!has_tbm);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_has_tbm_surface_buffer_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_has_tbm_surface_buffer(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_has_tbm_surface_buffer(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
int utc_media_packet_create_from_tbm_surface_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- if (packet)
- ret = media_packet_destroy(packet);
-
- if (ret != MEDIA_PACKET_ERROR_NONE)
- fprintf(stderr, "destory exsit packet handle failed..\n");
+ int ret = MEDIA_PACKET_ERROR_NONE;
- tbm_surface_h surface;
- int width = 128;
- int height = 128;
- tbm_format tbm_fmt = TBM_FORMAT_YUV420;
- surface = tbm_surface_create (width, height, tbm_fmt);
+ tbm_surface_h surface;
+ int width = 128;
+ int height = 128;
+ tbm_format tbm_fmt = TBM_FORMAT_YUV420;
+ surface = tbm_surface_create (width, height, tbm_fmt);
- if (surface == NULL)
- {
- fprintf(stderr, "tbm_surface_create failed..\n");
- assert(false);
- }
+ ret = media_packet_create_from_tbm_surface(format_for_tbm, surface, _finalize_callback, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- ret = media_packet_create_from_tbm_surface(format_for_tbm, surface, _finalize_callback, NULL, &packet);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ if (ret == MEDIA_PACKET_ERROR_NONE) {
+ media_packet_destroy(packet);
+ media_format_unref(format_for_tbm);
+ }
- return 0;
+ return 0;
}
/**
int utc_media_packet_create_from_tbm_surface_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_create_from_tbm_surface(NULL, NULL, NULL,NULL, NULL);
+ ret = media_packet_create_from_tbm_surface(NULL, NULL, NULL,NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_create_from_external_memory_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- if (packet)
- ret = media_packet_destroy(packet);
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ uint64_t size = 1000;
+ void* ext_mem = (void*)malloc(size);
- if (ret != MEDIA_PACKET_ERROR_NONE)
- fprintf(stderr, "destory exist packet handle failed..\n");
- uint64_t size = 1000;
- void* ext_mem = (void*)malloc(size);
+ if (ext_mem == NULL)
+ assert(false);
- if (ext_mem == NULL)
- assert(false);
+ ret = media_packet_create_from_external_memory(format, ext_mem, size, NULL, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- ret = media_packet_create_from_external_memory(format, ext_mem, size, NULL, NULL, &packet);
- free(ext_mem);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ if (ret == MEDIA_PACKET_ERROR_NONE)
+ media_packet_destroy(packet);
- return 0;
+ free(ext_mem);
+ return 0;
}
/**
*/
int utc_media_packet_create_from_external_memory_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ uint64_t size = 1000;
+ void* ext_mem = (void*)malloc(size);
- if (packet)
- ret = media_packet_destroy(packet);
+ if (ext_mem == NULL)
+ assert(false);
+ ret = media_packet_create_from_external_memory(empty_format, ext_mem, size, NULL, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
- if (ret != MEDIA_PACKET_ERROR_NONE)
- fprintf(stderr, "destory exist packet handle failed..\n");
- uint64_t size = 1000;
- void* ext_mem = (void*)malloc(size);
+ if (ret == MEDIA_PACKET_ERROR_NONE)
+ media_packet_destroy(packet);
- if (ext_mem == NULL)
- assert(false);
- ret = media_packet_create_from_external_memory(empty_format, ext_mem, size, NULL, NULL, &packet);
- free(ext_mem);
+ free(ext_mem);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_format_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- media_format_h fmt;
- int width;
- ret = media_packet_get_format(pkt_create_alloc, &fmt);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ media_format_h fmt;
+ int width;
+ ret = media_packet_get_format(pkt_create_alloc, &fmt);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- media_format_get_video_info(fmt, NULL, &width, NULL, NULL, NULL);
- assert_eq(480, width);
+ media_format_get_video_info(fmt, NULL, &width, NULL, NULL, NULL);
+ assert_eq(480, width);
- media_format_unref(format);
+ media_format_unref(fmt);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_format_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_get_format(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_get_format(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_pts_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- uint64_t pts = 1234567;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ uint64_t pts = 1234567;
- ret = media_packet_set_pts(pkt_create_alloc, pts);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_set_pts(pkt_create_alloc, pts);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_pts_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_set_pts(NULL, 0);
+ ret = media_packet_set_pts(NULL, 0);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_dts_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- uint64_t dts = 7654321;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ uint64_t dts = 7654321;
- ret = media_packet_set_dts(pkt_create_alloc, dts);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_set_dts(pkt_create_alloc, dts);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_dts_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_set_dts(NULL, 0);
+ ret = media_packet_set_dts(NULL, 0);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_duration_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- uint64_t duration = 5000000;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ uint64_t duration = 5000000;
- ret = media_packet_set_duration(pkt_create_alloc, duration);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_set_duration(pkt_create_alloc, duration);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_duration_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
-
- ret = media_packet_set_duration(NULL, 0);
+ int ret = MEDIA_PACKET_ERROR_NONE;
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_set_duration(NULL, 0);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_buffer_size_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- uint64_t size = 10000;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ uint64_t size = 10000;
- ret = media_packet_set_buffer_size(pkt_create_alloc, size);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_set_buffer_size(pkt_create_alloc, size);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_buffer_size_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
-
- ret = media_packet_set_buffer_size(NULL, 0);
+ int ret = MEDIA_PACKET_ERROR_NONE;
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_set_buffer_size(NULL, 0);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_pts_p(void)
{
- int ret1 = MEDIA_PACKET_ERROR_NONE;
- int ret2 = MEDIA_PACKET_ERROR_NONE;
+ int ret1 = MEDIA_PACKET_ERROR_NONE;
+ int ret2 = MEDIA_PACKET_ERROR_NONE;
- uint64_t get_pts;
- uint64_t pts = 1234567;
+ uint64_t get_pts;
+ uint64_t pts = 1234567;
- ret1 = media_packet_set_pts(pkt_create_alloc, pts);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
+ ret1 = media_packet_set_pts(pkt_create_alloc, pts);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
- ret2 = media_packet_get_pts(pkt_create_alloc, &get_pts);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
- assert_eq(1234567, get_pts);
+ ret2 = media_packet_get_pts(pkt_create_alloc, &get_pts);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
+ assert_eq(1234567, get_pts);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_pts_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_get_pts(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_get_pts(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_dts_p(void)
{
- int ret1 = MEDIA_PACKET_ERROR_NONE;
- int ret2 = MEDIA_PACKET_ERROR_NONE;
- uint64_t get_dts;
- uint64_t dts = 7654321;
+ int ret1 = MEDIA_PACKET_ERROR_NONE;
+ int ret2 = MEDIA_PACKET_ERROR_NONE;
+ uint64_t get_dts;
+ uint64_t dts = 7654321;
- ret1 = media_packet_set_dts(pkt_create_alloc, dts);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
+ ret1 = media_packet_set_dts(pkt_create_alloc, dts);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
- ret2 = media_packet_get_dts(pkt_create_alloc, &get_dts);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
- assert_eq(7654321, get_dts);
+ ret2 = media_packet_get_dts(pkt_create_alloc, &get_dts);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
+ assert_eq(7654321, get_dts);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_dts_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_get_dts(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_get_dts(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_duration_p(void)
{
- int ret1 = MEDIA_PACKET_ERROR_NONE;
- int ret2 = MEDIA_PACKET_ERROR_NONE;
- uint64_t get_duration;
- uint64_t duration = 5000000;
+ int ret1 = MEDIA_PACKET_ERROR_NONE;
+ int ret2 = MEDIA_PACKET_ERROR_NONE;
+ uint64_t get_duration;
+ uint64_t duration = 5000000;
- ret1 = media_packet_set_duration(pkt_create_alloc, duration);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
+ ret1 = media_packet_set_duration(pkt_create_alloc, duration);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
- ret2 = media_packet_get_duration(pkt_create_alloc, &get_duration);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
- assert_eq(5000000, duration);
+ ret2 = media_packet_get_duration(pkt_create_alloc, &get_duration);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
+ assert_eq(5000000, duration);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_duration_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_get_duration(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_get_duration(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_buffer_size_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- uint64_t size;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ uint64_t size;
- ret = media_packet_get_buffer_size(pkt_create_alloc, &size);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_get_buffer_size(pkt_create_alloc, &size);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_buffer_size_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_get_buffer_size(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_get_buffer_size(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_buffer_data_ptr_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- void* data;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ void* data;
- ret = media_packet_get_buffer_data_ptr(pkt_create_alloc, &data);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_get_buffer_data_ptr(pkt_create_alloc, &data);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- if (data == NULL)
- assert(false);
+ if (data == NULL)
+ assert(false);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_buffer_data_ptr_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_get_buffer_data_ptr(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_get_buffer_data_ptr(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_tbm_surface_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- tbm_surface_h surface;
+ tbm_surface_h surface;
- ret = media_packet_get_tbm_surface(pkt_create_alloc, &surface);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_get_tbm_surface(pkt_create_alloc, &surface);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_tbm_surface_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_get_tbm_surface(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_get_tbm_surface(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_extra_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- char* extra = "extra";
-
- ret = media_packet_set_extra(pkt_create_alloc, (void*)extra);
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ char* extra = "extra";
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_set_extra(pkt_create_alloc, (void*)extra);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_set_extra_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_set_extra(NULL, NULL);
+ ret = media_packet_set_extra(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_extra_p(void)
{
- int ret1 = MEDIA_PACKET_ERROR_NONE;
- int ret2 = MEDIA_PACKET_ERROR_NONE;
- void* get_extra;
- char* extra = "extra";
+ int ret1 = MEDIA_PACKET_ERROR_NONE;
+ int ret2 = MEDIA_PACKET_ERROR_NONE;
+ void* get_extra;
+ char* extra = "extra";
- ret1 = media_packet_set_extra(pkt_create_alloc, (void*)extra);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
+ ret1 = media_packet_set_extra(pkt_create_alloc, (void*)extra);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
- ret2 = media_packet_get_extra(pkt_create_alloc, &get_extra);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
+ ret2 = media_packet_get_extra(pkt_create_alloc, &get_extra);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
- if (strcmp (extra, (char*)get_extra) != 0)
- assert(false);
+ if (strcmp (extra, (char*)get_extra) != 0)
+ assert(false);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_extra_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_get_extra(NULL, NULL);
+ ret = media_packet_get_extra(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
*/
int utc_media_packet_is_video_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- bool is_video;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ bool is_video;
- ret = media_packet_is_video(pkt_create_alloc, &is_video);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_is_video(pkt_create_alloc, &is_video);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_video_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_is_video(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_is_video(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_audio_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- bool is_audio;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ bool is_audio;
- ret = media_packet_is_audio(pkt_create_alloc, &is_audio);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_is_audio(pkt_create_alloc, &is_audio);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_audio_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_is_audio(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_is_audio(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_encoded_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- bool is_enc;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ bool is_enc;
- ret = media_packet_is_encoded(pkt_create_alloc, &is_enc);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_is_encoded(pkt_create_alloc, &is_enc);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_encoded_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_is_encoded(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_is_encoded(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_raw_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- bool is_raw;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ bool is_raw;
- ret = media_packet_is_raw(pkt_create_alloc, &is_raw);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_is_raw(pkt_create_alloc, &is_raw);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_raw_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_is_raw(NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_is_raw(NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_number_of_video_planes_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- uint32_t num;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ uint32_t num;
- ret = media_packet_get_number_of_video_planes(pkt_create_alloc_tbm, &num);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_get_number_of_video_planes(pkt_create_alloc_tbm, &num);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_number_of_video_planes_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- uint32_t num;
-
- ret = media_packet_get_number_of_video_planes(pkt_create_alloc, &num);
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ uint32_t num;
- assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
+ ret = media_packet_get_number_of_video_planes(pkt_create_alloc, &num);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_video_stride_width_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- int stride_w;
- ret = media_packet_get_video_stride_width(pkt_create_alloc_tbm, 0, &stride_w);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ int stride_w;
- return 0;
+ ret = media_packet_get_video_stride_width(pkt_create_alloc_tbm, 0, &stride_w);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+
+ return 0;
}
/**
*/
int utc_media_packet_get_video_stride_width_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- int stride_w;
- ret = media_packet_get_video_stride_width(pkt_create_alloc, 0, &stride_w);
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ int stride_w;
- assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
+ ret = media_packet_get_video_stride_width(pkt_create_alloc, 0, &stride_w);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_video_stride_height_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- int stride_h;
- ret = media_packet_get_video_stride_height(pkt_create_alloc_tbm, 0, &stride_h);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ int stride_h;
- return 0;
+ ret = media_packet_get_video_stride_height(pkt_create_alloc_tbm, 0, &stride_h);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+
+ return 0;
}
/**
*/
int utc_media_packet_get_video_stride_height_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- int stride_h;
-
- ret = media_packet_get_video_stride_height(pkt_create_alloc, 0, &stride_h);
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ int stride_h;
- assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
+ ret = media_packet_get_video_stride_height(pkt_create_alloc, 0, &stride_h);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_video_plane_data_ptr_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- void* ptr;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ void* ptr;
- ret = media_packet_get_video_plane_data_ptr(pkt_create_alloc_tbm, 0, &ptr);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_get_video_plane_data_ptr(pkt_create_alloc_tbm, 0, &ptr);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_video_plane_data_ptr_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- void* ptr;
-
- ret = media_packet_get_video_plane_data_ptr(pkt_create_alloc, 0, &ptr);
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ void* ptr;
- assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
+ ret = media_packet_get_video_plane_data_ptr(pkt_create_alloc, 0, &ptr);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_get_codec_data_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_get_codec_data(NULL, NULL, NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_get_codec_data(NULL, NULL, NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_destroy_p(void)
{
- int ret1 = MEDIA_PACKET_ERROR_NONE;
- int ret2 = MEDIA_PACKET_ERROR_NONE;
+ int ret1 = MEDIA_PACKET_ERROR_NONE;
+ int ret2 = MEDIA_PACKET_ERROR_NONE;
- ret1 = media_packet_create_alloc(format, _finalize_callback, NULL, &packet);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
+ ret1 = media_packet_create_alloc(format, _finalize_callback, NULL, &packet);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret1);
- ret2 = media_packet_destroy(packet);
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
- assert_eq(1, finalizeCB_called);
+ ret2 = media_packet_destroy(packet);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret2);
+ assert_eq(1, finalizeCB_called);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_destroy_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
+ int ret = MEDIA_PACKET_ERROR_NONE;
- ret = media_packet_destroy(NULL);
- assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_destroy(NULL);
+ assert_neq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_create_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+
+ media_format_h fmt;
+ ret = media_format_create(&fmt);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- media_format_h fmt;
- ret = media_format_create(&fmt);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
+ if (ret == MEDIA_FORMAT_ERROR_NONE)
+ media_format_unref(fmt);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_create_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_create(NULL);
+ ret = media_format_create(NULL);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_video_info_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_mimetype_e mime;
- int w;
- int h;
- int avg_bps;
- int max_bps;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_mimetype_e mime;
+ int w;
+ int h;
+ int avg_bps;
+ int max_bps;
- ret = media_format_get_video_info(format, &mime, &w, &h, &avg_bps, &max_bps);
+ ret = media_format_get_video_info(format, &mime, &w, &h, &avg_bps, &max_bps);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_video_info_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_get_video_info(format_audio, NULL, NULL, NULL, NULL, NULL);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
+ ret = media_format_get_video_info(format_audio, NULL, NULL, NULL, NULL, NULL);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
*/
int utc_media_format_get_audio_info_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_mimetype_e mime;
- int channel;
- int samplerate;
- int bit;
- int avg_bps;
-
- ret = media_format_get_audio_info(format_audio, &mime, &channel, &samplerate, &bit, &avg_bps);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_mimetype_e mime;
+ int channel;
+ int samplerate;
+ int bit;
+ int avg_bps;
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
+ ret = media_format_get_audio_info(format_audio, &mime, &channel, &samplerate, &bit, &avg_bps);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_audio_info_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_get_audio_info(format, NULL, NULL, NULL, NULL, NULL);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
+ ret = media_format_get_audio_info(format, NULL, NULL, NULL, NULL, NULL);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_audio_aac_type_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- bool is_adts;
- media_format_set_audio_mime(format_audio, MEDIA_FORMAT_AAC_LC);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ bool is_adts;
+ media_format_set_audio_mime(format_audio, MEDIA_FORMAT_AAC_LC);
- ret = media_format_get_audio_aac_type(format_audio, &is_adts);
+ ret = media_format_get_audio_aac_type(format_audio, &is_adts);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_audio_aac_type_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- bool is_adts;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ bool is_adts;
- ret = media_format_get_audio_aac_type(empty_format, &is_adts);
+ ret = media_format_get_audio_aac_type(empty_format, &is_adts);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_video_mime_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_h fmt;
-
- media_format_create(&fmt);
- ret = media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_h fmt;
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ media_format_create(&fmt);
+ ret = media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt);
+ media_format_unref(fmt);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_video_mime_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_video_mime(NULL, MEDIA_FORMAT_H264_HP);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER,ret);
+ ret = media_format_set_video_mime(NULL, MEDIA_FORMAT_H264_HP);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER,ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_video_width_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_h fmt;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_h fmt;
- media_format_create(&fmt);
- media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
+ media_format_create(&fmt);
+ media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
- ret = media_format_set_video_width(fmt, 320);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ ret = media_format_set_video_width(fmt, 320);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt);
+ media_format_unref(fmt);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_video_width_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_video_width(format_audio, 320);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER,ret);
+ ret = media_format_set_video_width(format_audio, 320);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER,ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_video_height_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_h fmt;
+ media_format_h fmt;
- media_format_create(&fmt);
- media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
+ media_format_create(&fmt);
+ media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
- ret = media_format_set_video_height(fmt, 240);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ ret = media_format_set_video_height(fmt, 240);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt);
- return 0;
+ media_format_unref(fmt);
+ return 0;
}
/**
*/
int utc_media_format_set_video_height_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_video_height(format_audio, 240);
+ ret = media_format_set_video_height(format_audio, 240);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_video_avg_bps_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_h fmt;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_h fmt;
- media_format_create(&fmt);
- media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
+ media_format_create(&fmt);
+ media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
- ret = media_format_set_video_avg_bps(fmt, 200000);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ ret = media_format_set_video_avg_bps(fmt, 200000);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt);
- return 0;
+ media_format_unref(fmt);
+ return 0;
}
/**
*/
int utc_media_format_set_video_avg_bps_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_set_video_avg_bps(format_audio, 200000);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_set_video_avg_bps(format_audio, 200000);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_video_max_bps_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_h fmt;
+ media_format_h fmt;
- media_format_create(&fmt);
- media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
+ media_format_create(&fmt);
+ media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
- ret = media_format_set_video_max_bps(fmt, 1000000);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ ret = media_format_set_video_max_bps(fmt, 1000000);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt);
+ media_format_unref(fmt);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_video_max_bps_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_set_video_max_bps(format_audio, 1000000);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_set_video_max_bps(format_audio, 1000000);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_mime_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_audio_mime(format_audio, MEDIA_FORMAT_AAC_HE);
+ ret = media_format_set_audio_mime(format_audio, MEDIA_FORMAT_AAC_HE);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_mime_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_audio_mime(format_audio, MEDIA_FORMAT_H264_HP);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_set_audio_mime(format_audio, MEDIA_FORMAT_H264_HP);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_channel_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_audio_channel(format_audio, 4);
+ ret = media_format_set_audio_channel(format_audio, 4);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_channel_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_audio_channel(format_text, 4);
+ ret = media_format_set_audio_channel(format_text, 4);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_samplerate_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_set_audio_samplerate(format_audio, 200);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
+ ret = media_format_set_audio_samplerate(format_audio, 200);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_samplerate_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_set_audio_samplerate(format_text, 200);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_set_audio_samplerate(format_text, 200);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_bit_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_set_audio_bit(format_audio, 2000);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
+ ret = media_format_set_audio_bit(format_audio, 2000);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_bit_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_audio_bit(format_text, 2000);
+ ret = media_format_set_audio_bit(format_text, 2000);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_avg_bps_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_audio_avg_bps(format_audio, 20000);
+ ret = media_format_set_audio_avg_bps(format_audio, 20000);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_avg_bps_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_set_audio_avg_bps(format_text, 20000);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_set_audio_avg_bps(format_text, 20000);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_aac_type_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- bool adts = true;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_audio_aac_type(format_audio, adts);
+ bool adts = true;
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
+ ret = media_format_set_audio_aac_type(format_audio, adts);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_aac_type_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_h fmt;
- bool adts = true;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_h fmt;
+ bool adts = true;
- media_format_create(&fmt);
- media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
+ media_format_create(&fmt);
+ media_format_set_video_mime(fmt, MEDIA_FORMAT_H264_HP);
- ret = media_format_set_audio_aac_type(fmt, adts);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_set_audio_aac_type(fmt, adts);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- media_format_unref(fmt);
+ media_format_unref(fmt);
- return 0;
+ return 0;
}
*/
int utc_media_format_ref_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+
+ ret = media_format_ref(format);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- ret = media_format_ref(format);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
+ ret = media_format_unref(format);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- ret = media_format_unref(format);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_ref_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_ref(NULL);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_ref(NULL);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_unref_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_ref(format);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
+ ret = media_format_ref(format);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- ret = media_format_unref(format);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
+ ret = media_format_unref(format);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_unref_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_unref(NULL);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_unref(NULL);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_is_writable_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- bool writable;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ bool writable;
- ret = media_format_is_writable(format, &writable);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
+ ret = media_format_is_writable(format, &writable);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_is_writable_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_is_writable(NULL, NULL);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_is_writable(NULL, NULL);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_make_writable_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_h fmt;
- media_format_h fmt;
- ret = media_format_make_writable(format, &fmt);
- assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
+ ret = media_format_make_writable(format, &fmt);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE,ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_make_writable_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ ret = media_format_make_writable(NULL, NULL);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- ret = media_format_make_writable(NULL, NULL);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_container_mime_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- media_format_h fmt_container;
- media_format_create(&fmt_container);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_set_container_mime(fmt_container, MEDIA_FORMAT_CONTAINER_MP4);
+ media_format_h fmt_container;
+ media_format_create(&fmt_container);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt_container);
+ ret = media_format_set_container_mime(fmt_container, MEDIA_FORMAT_CONTAINER_MP4);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ media_format_unref(fmt_container);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_container_mime_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_h fmt_container;
- media_format_create(&fmt_container);
+ media_format_h fmt_container;
+ media_format_create(&fmt_container);
- ret = media_format_set_container_mime(fmt_container, MEDIA_FORMAT_MP3);
+ ret = media_format_set_container_mime(fmt_container, MEDIA_FORMAT_MP3);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- media_format_unref(fmt_container);
+ media_format_unref(fmt_container);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_container_mime_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_h fmt_container;
- media_format_mimetype_e mime;
+ media_format_h fmt_container;
+ media_format_mimetype_e mime;
- media_format_create(&fmt_container);
+ media_format_create(&fmt_container);
- media_format_set_container_mime(fmt_container, MEDIA_FORMAT_CONTAINER_MP4);
+ ret = media_format_set_container_mime(fmt_container, MEDIA_FORMAT_CONTAINER_MP4);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- ret = media_format_get_container_mime(fmt_container, &mime);
+ ret = media_format_get_container_mime(fmt_container, &mime);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt_container);
+ media_format_unref(fmt_container);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_container_mime_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- media_format_mimetype_e mime;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_get_container_mime(format, &mime);
+ media_format_mimetype_e mime;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_get_container_mime(format, &mime);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_type_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_type_e fmt_type;
+ media_format_type_e fmt_type;
- ret = media_format_get_type(format, &fmt_type);
+ ret = media_format_get_type(format, &fmt_type);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- assert_eq(MEDIA_FORMAT_VIDEO, fmt_type);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ assert_eq(MEDIA_FORMAT_VIDEO, fmt_type);
- ret = media_format_get_type(format_audio, &fmt_type);
+ ret = media_format_get_type(format_audio, &fmt_type);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- assert_eq(MEDIA_FORMAT_AUDIO, fmt_type);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ assert_eq(MEDIA_FORMAT_AUDIO, fmt_type);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_type_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- media_format_type_e fmt_type;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- ret = media_format_get_type(empty_format, &fmt_type);
+ media_format_type_e fmt_type;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
+ ret = media_format_get_type(empty_format, &fmt_type);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_video_frame_rate_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ int frame_rate = 10000;
+ media_format_h fmt;
+
+ media_format_create(&fmt);
- media_format_h fmt;
- media_format_create(&fmt);
- media_format_set_video_mime(fmt, MEDIA_FORMAT_MPEG4_SP);
- int frame_rate = 10000;
+ ret = media_format_set_video_mime(fmt, MEDIA_FORMAT_MPEG4_SP);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- ret = media_format_set_video_frame_rate(fmt, frame_rate);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ ret = media_format_set_video_frame_rate(fmt, frame_rate);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt);
+ media_format_unref(fmt);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_video_frame_rate_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ int frame_rate = 10000;
+ media_format_h fmt;
- media_format_h fmt;
- media_format_create(&fmt);
- media_format_set_audio_mime(fmt, MEDIA_FORMAT_AAC_LC);
- int frame_rate = 10000;
+ media_format_create(&fmt);
- ret = media_format_set_video_frame_rate(fmt, frame_rate);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_set_audio_mime(fmt, MEDIA_FORMAT_AAC_LC);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt);
+ ret = media_format_set_video_frame_rate(fmt, frame_rate);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ media_format_unref(fmt);
+
+ return 0;
}
/**
*/
int utc_media_format_get_video_frame_rate_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- int frame_rate = 0;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ int frame_rate = 0;
- ret = media_format_get_video_frame_rate(format ,&frame_rate);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- assert_eq(frame_rate, 30);
+ ret = media_format_get_video_frame_rate(format ,&frame_rate);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ assert_eq(frame_rate, 30);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_video_frame_rate_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- int frame_rate = 0;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ int frame_rate = 0;
- ret = media_format_get_video_frame_rate(format_audio ,&frame_rate);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
+ ret = media_format_get_video_frame_rate(format_audio ,&frame_rate);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_text_mime_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_h fmt_text;
- media_format_create(&fmt_text);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_h fmt_text;
+
+ media_format_create(&fmt_text);
- ret = media_format_set_text_mime(fmt_text, MEDIA_FORMAT_TEXT_MP4);
+ ret = media_format_set_text_mime(fmt_text, MEDIA_FORMAT_TEXT_MP4);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt_text);
+ media_format_unref(fmt_text);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_text_mime_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_set_text_mime(NULL, MEDIA_FORMAT_TEXT_MP4);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_set_text_mime(NULL, MEDIA_FORMAT_TEXT_MP4);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_text_type_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_h fmt_text;
- media_format_create(&fmt_text);
- media_format_set_text_mime(fmt_text, MEDIA_FORMAT_TEXT_MP4);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_h fmt_text;
+
+ media_format_create(&fmt_text);
+
+ ret = media_format_set_text_mime(fmt_text, MEDIA_FORMAT_TEXT_MP4);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- ret = media_format_set_text_type(fmt_text, MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_3GPP);
+ ret = media_format_set_text_type(fmt_text, MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_3GPP);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- media_format_unref(fmt_text);
+ media_format_unref(fmt_text);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_text_type_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_set_text_type(format_audio, MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_3GPP);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_set_text_type(format_audio, MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_3GPP);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_text_info_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_mimetype_e mime;
- media_format_text_type_e text_type;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_mimetype_e mime;
+ media_format_text_type_e text_type;
- ret = media_format_get_text_info(format_text, &mime, &text_type);
+ ret = media_format_get_text_info(format_text, &mime, &text_type);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- assert_eq(MEDIA_FORMAT_TEXT_MP4, mime);
- assert_eq(MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_3GPP, text_type);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ assert_eq(MEDIA_FORMAT_TEXT_MP4, mime);
+ assert_eq(MEDIA_FORMAT_TEXT_TYPE_TIMED_TEXT_3GPP, text_type);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_text_info_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_mimetype_e mime;
- media_format_text_type_e text_type;
-
- ret = media_format_get_text_info(format_audio, &mime, &text_type);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_mimetype_e mime;
+ media_format_text_type_e text_type;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
+ ret = media_format_get_text_info(format_audio, &mime, &text_type);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_aac_header_type_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_set_audio_aac_header_type(format_audio, MEDIA_FORMAT_AAC_HEADER_ADIF);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ ret = media_format_set_audio_aac_header_type(format_audio, MEDIA_FORMAT_AAC_HEADER_ADIF);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_set_audio_aac_header_type_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
-
- ret = media_format_set_audio_aac_header_type(format_text, MEDIA_FORMAT_AAC_HEADER_ADIF);
+ int ret = MEDIA_FORMAT_ERROR_NONE;
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
+ ret = media_format_set_audio_aac_header_type(format_text, MEDIA_FORMAT_AAC_HEADER_ADIF);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_audio_aac_header_type_p(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_aac_header_type_e aac_header_type;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_aac_header_type_e aac_header_type;
- ret = media_format_get_audio_aac_header_type(format_audio, &aac_header_type);
+ ret = media_format_get_audio_aac_header_type(format_audio, &aac_header_type);
+ assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
+ assert_eq(MEDIA_FORMAT_AAC_HEADER_ADIF, aac_header_type);
- assert_eq(MEDIA_FORMAT_ERROR_NONE, ret);
- assert_eq(MEDIA_FORMAT_AAC_HEADER_ADIF, aac_header_type);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_format_get_audio_aac_header_type_n(void)
{
- int ret = MEDIA_FORMAT_ERROR_NONE;
- media_format_aac_header_type_e aac_header_type;
+ int ret = MEDIA_FORMAT_ERROR_NONE;
+ media_format_aac_header_type_e aac_header_type;
- ret = media_format_get_audio_aac_header_type(format_text, &aac_header_type);
+ ret = media_format_get_audio_aac_header_type(format_text, &aac_header_type);
+ assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
- assert_eq(MEDIA_FORMAT_ERROR_INVALID_OPERATION, ret);
-
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_text_p(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- bool is_text;
-
- ret = media_packet_is_text(pkt_create_alloc , &is_text);
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ bool is_text;
- assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
+ ret = media_packet_is_text(pkt_create_alloc , &is_text);
+ assert_eq(MEDIA_PACKET_ERROR_NONE, ret);
- return 0;
+ return 0;
}
/**
*/
int utc_media_packet_is_text_n(void)
{
- int ret = MEDIA_PACKET_ERROR_NONE;
- bool is_text;
-
- ret = media_packet_is_text(NULL , &is_text);
+ int ret = MEDIA_PACKET_ERROR_NONE;
+ bool is_text;
- assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
+ ret = media_packet_is_text(NULL , &is_text);
+ assert_eq(MEDIA_PACKET_ERROR_INVALID_PARAMETER, ret);
- return 0;
+ return 0;
}
/**