copy of an AVPacket structure
【摘要】 a copy of an AVPacket structure
参考:https://stackoverflow.com/questions/12929330/create-a-copy-of-an-avpacket-structure
ok:
AVPacket newPacket(oldPacket);newPacket->data = reinterpret_...
a copy of an AVPacket structure
参考:https://stackoverflow.com/questions/12929330/create-a-copy-of-an-avpacket-structure
ok:
-
AVPacket newPacket(oldPacket);
-
newPacket->data = reinterpret_cast<uint8_t*>(new uint64_t[(oldPacket->size + FF_INPUT_BUFFER_PADDING_SIZE)/sizeof(uint64_t) + 1]);
-
memcpy(newPacket->data, oldPacket->data, oldPacket->size);
-
AVPacket *newpacket = (AVPacket*)malloc(sizeof(struct AVPacket));
-
av_init_packet(newpacket);
-
av_packet_ref(newpacket, packet);
-
-
av_packet_unref(packet);
-
free(packet);
-
packet = nil;
文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/jacke121/article/details/88397048
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)