MD_MEMORY_ALLOCED = -16, /**< codec has got memory and can decode one frame */
MD_COURRPTED_INI = -17, /**< value in the ini file is not valid */
MD_ERROR_FILE_NOT_FOUND = -18,
- MD_EOS, /** read sample reached end of stream */
+ MD_EOS = -19, /** read sample reached end of stream */
} md_ret_e;
#define MD_ERROR_CLASS 0x80000000 /**< Definition of number describing error group */
temp->name = name;
temp->caps_string = gst_caps_to_string(temp->caps);
temp->next = NULL;
+ temp->format = NULL;
temp->appsink = gst_element_factory_make("appsink", NULL);
if (!temp->appsink) {
MD_E("factory not able to make appsink");
temp = temp->next;
count++;
}
-
+ if (temp->format != NULL) {
+ ret = media_format_ref(temp->format);
+ if (ret != MEDIA_FORMAT_ERROR_NONE) {
+ MD_E("Mediaformat reference count increment failed. returned %d\n", ret);
+ ret = MD_INTERNAL_ERROR;
+ goto ERROR;
+ }
+ ret = media_format_make_writable(temp->format, format); /* copy the content */
+ if (ret != MEDIA_FORMAT_ERROR_NONE) {
+ MD_E("Mediaformat create copy failed. returned %d\n", ret);
+ media_format_unref(temp->format);
+ ret = MD_INTERNAL_ERROR;
+ goto ERROR;
+ }
+ MEDIADEMUXER_FLEAVE();
+ return ret;
+ }
ret = media_format_create(&(temp->format));
if (ret != MEDIA_FORMAT_ERROR_NONE) {
MD_E("Mediaformat creation failed. returned %d\n", ret);