return;
}
-static int _get_video_size(media_packet_h packet, mm_evas_info *evas_info)
+static bool _get_video_size(media_packet_h packet, mm_evas_info *evas_info)
{
media_format_h fmt;
+ int w, h;
+ bool ret = true;
- MMER_FENTER();
+ MMEVAS_RETURN_VAL_IF_FAIL(packet, false);
+ MMEVAS_RETURN_VAL_IF_FAIL(evas_info, false);
- if (media_packet_get_format(packet, &fmt) == MEDIA_PACKET_ERROR_NONE) {
- int w, h;
- if (media_format_get_video_info(fmt, NULL, &w, &h, NULL, NULL) == MEDIA_PACKET_ERROR_NONE) {
- LOGD("video width = %d, height =%d", w, h);
- if (w != evas_info->w || h != evas_info->h) {
- evas_info->w = w;
- evas_info->h = h;
- evas_info->rendering_info_changed = TRUE;
- evas_info->video_size_changed = TRUE;
- }
- return true;
- } else
- LOGW("media_format_get_video_info is failed");
- if (media_format_unref(fmt) != MEDIA_PACKET_ERROR_NONE) /* because of media_packet_get_format */
- LOGW("media_format_unref is failed");
- } else {
- LOGW("media_packet_get_format is failed");
+ if (media_packet_get_format(packet, &fmt) != MEDIA_PACKET_ERROR_NONE) {
+ LOGE("media_packet_get_format is failed");
+ return false;
}
- MMER_FLEAVE();
+ if (media_format_get_video_info(fmt, NULL, &w, &h, NULL, NULL) != MEDIA_FORMAT_ERROR_NONE) {
+ LOGE("media_format_get_video_info is failed");
+ ret = false;
+ goto end;
+ }
- return false;
+ if (w != evas_info->w || h != evas_info->h) {
+ LOGD("previous: (%dx%d)", evas_info->w, evas_info->w);
+ evas_info->w = w;
+ evas_info->h = h;
+ evas_info->rendering_info_changed = TRUE;
+ evas_info->video_size_changed = TRUE;
+ }
+ LOGD("(%dx%d)", evas_info->w, evas_info->w);
+
+end:
+ if (media_format_unref(fmt) != MEDIA_FORMAT_ERROR_NONE)
+ LOGW("media_format_unref is failed");
+
+ return ret;
}
static int _find_empty_index(mm_evas_info *evas_info)