主题 : 求助呀,高手吗帮帮我吧 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 59644
精华: 0
发帖: 9
金钱: 45 两
威望: 9 点
综合积分: 18 分
注册时间: 2011-11-28
最后登录: 2013-06-04
楼主  发表于: 2012-12-19 13:35

 求助呀,高手吗帮帮我吧

请问大家一个问题,纠结已久
核心代码如下
encoded_buf = mfc_encoder_exe(handle, g_yuv, YUV_FRAME_BUFFER_SIZE, 0, &encoded_size);            
printf("encoded: %d bytes.\n",strlen(encoded_buf));  
fwrite(encoded_buf, 1, encoded_size, encoded_fp);

在执行后,会生存H264文件,有内容。encoded_buf是硬件编码mfc_encoder_exe函数返回的编码后的地址,然后把它通过fwrite写入到文件中。
但是,我strlen(encoded_buf),为什么是0呢?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2012-12-19 13:48

 回 楼主(ts-zhang) 的帖子

strlen是用来返回字符串长度的,encoded_buf里面放的字符串吗?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."