⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wma文件信息格式分析及代码 - mokemars的专栏 - csdnblog.htm

📁 ASF格式说明
💻 HTM
📖 第 1 页 / 共 4 页
字号:
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; free(string);<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // extract the 
rating<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if((len = 
contenth-&gt;rating_size) != 0)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; wstring = 
(uint16_t*)&amp;hdr[pos];<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; pos += len;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; if (pos &gt; hdr_len) goto len_err_out;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ((string = get_ucs2str(wstring, 
len)))<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
strcpy(tags-&gt;rating, string);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; free(string);<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; pos = find_asf_guid(hdr, 
asf_stream_ext_desc_guid, 0, hdr_len);/*找到扩展信息标志位置*/<BR>&nbsp;&nbsp;&nbsp; if 
(pos &gt;= 0)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
int i;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //unsigned char 
*ext_desc;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; uint16_t 
flag;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; uint16_t 
ext_desc_num;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; unsigned char 
*string_name=NULL;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; unsigned char 
*string_info=NULL;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; uint16_t* wstring = 
NULL;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; uint16_t 
len;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
ext_desc_num=(*(uint16_t*)(&amp;hdr[pos]));<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; //printf("%d\n",ext_desc_num);<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; pos += 2;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; for(i=0;i&lt;ext_desc_num;i++)<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
len=(*(uint16_t*)(&amp;hdr[pos]));/*扩展名字信息大小*/<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pos+=2;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
wstring=(uint16_t*)&amp;hdr[pos];<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; if ((string_name = get_ucs2str(wstring, 
len)))<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //printf(" %d.扩展信息名字 
%s\n", i,string_name);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //free(string_name);<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; pos+=len;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; 
flag=(*(uint16_t*)(&amp;hdr[pos]));/*标志*/<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pos+=2;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
len=(*(uint16_t*)(&amp;hdr[pos]));/*扩展名字对应值大小*/<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pos+=2;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
wstring=(uint16_t*)&amp;hdr[pos];<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; if ((string_info = get_ucs2str(wstring, 
len)))<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //printf(" 扩展信息对应的值 
%s\n",string_info);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; //free(string_info);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
asf_ext_info_add(tags,string_name,string_info);<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pos+=len;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; 
close(fd);<BR>&nbsp;&nbsp;&nbsp; munmap(hdr,sb.st_size);<BR>&nbsp;&nbsp;&nbsp; 
return 1;<BR>&nbsp;&nbsp;&nbsp; len_err_out:<BR>&nbsp;&nbsp;&nbsp; 
close(fd);<BR>&nbsp;&nbsp;&nbsp; munmap(hdr,sb.st_size);<BR>&nbsp;&nbsp;&nbsp; 
return 0;<BR>}<BR>int main(int argc,char **argv)<BR>{<BR>&nbsp;&nbsp;&nbsp; char 
*filename=argv[1];<BR>&nbsp;&nbsp;&nbsp; int i;<BR>&nbsp;&nbsp;&nbsp; char 
**info;<BR>&nbsp;&nbsp;&nbsp; struct asf_tags tags;<BR>&nbsp;&nbsp;&nbsp; 
tags.ext_info=(char**)malloc(2*sizeof(char*));<BR>&nbsp;&nbsp;&nbsp; 
read_asf_header(filename,&amp;tags);<BR>&nbsp;&nbsp;&nbsp; char 
**ext_info;<BR>&nbsp;&nbsp;&nbsp; 
printf("Title:%s\n",tags.title);<BR>&nbsp;&nbsp;&nbsp; 
printf("Author:%s\n",tags.author);<BR>&nbsp;&nbsp;&nbsp; 
printf("Copyright:%s\n",tags.copyright);<BR>&nbsp;&nbsp;&nbsp; 
printf("Comment:%s\n",tags.comment);<BR>&nbsp;&nbsp;&nbsp; 
printf("Rating:%s\n",tags.rating);<BR>&nbsp;&nbsp;&nbsp; info = 
tags.ext_info;<BR>&nbsp;&nbsp;&nbsp; for(i = 0; info[2*i] != NULL ; 
i++)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
printf("%s: %s\n",info[2*i],info[2*i+1]);<BR>&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp; return 
0;<BR>}<BR>这里已经做了相关信息的接口,利于扩展开发。希望这些能对那些正在进行相关开发的人员提供一点帮助。本人从事音频视频解码,希望能和大家一起探讨,共通进步。联系方法QQ:263542344
<P class="right articalinfo">发表于 @ <A title=permalink 
href="http://blog.csdn.net/mokemars/archive/2008/03/20/2201064.aspx">2008年03月20日 
21:17:00</A>|<A title=评论 
href="http://blog.csdn.net/mokemars/archive/2008/03/20/2201064.aspx#FeedBack">评论(<SPAN 
id=FeedbackCount_2201064>loading...</SPAN>
<SCRIPT type=text/javascript>AddFeedbackCountStack("2201064")</SCRIPT>
)</A>|<A title=编辑 
href="http://writeblog.csdn.net/PostEdit.aspx?entryId=2201064">编辑</A></P><SPAN 
id=Post.ascx_ViewPost_PreviousAndNextEntriesDown>
<H3><A 
href="http://blog.csdn.net/mokemars/archive/2008/03/20/2201083.aspx">新一篇:&nbsp;rtc在linux上的测试代码</A>&nbsp;|&nbsp;<A 
href="http://blog.csdn.net/mokemars/archive/2006/09/26/1287943.aspx">旧一篇:&nbsp;WIN32 
汇编写的加密解密软件</A></H3></SPAN></DIV></DIV>
<DIV class=commentslist><SPAN id=Anthem_Post.ascx_Comments_ltlComments__><SPAN 
id=Post.ascx_Comments_ltlComments>
<DIV id=commentslist>
<H3>评论:没有评论。</H3></DIV></SPAN></SPAN></DIV>
<DIV class=spacecommment>
<DIV id=Anthem_Post.ascx_PostComment_CommentUpdatePanel__>
<DIV id=Post.ascx_PostComment_CommentUpdatePanel>
<FIELDSET><LEGEND>发表评论</LEGEND>
<UL>
  <LI>姓&nbsp;&nbsp;&nbsp;名:<INPUT id=Post.ascx_PostComment_tbName disabled 
  maxLength=32 size=40 name=Post.ascx:PostComment:tbName><SPAN 
  id=Post.ascx_PostComment_RequiredFieldValidator2 
  style="VISIBILITY: hidden; COLOR: red" initialvalue="" 
  evaluationfunction="RequiredFieldValidatorEvaluateIsValid" 
  errormessage="请输入名字" 
  controltovalidate="Post.ascx_PostComment_tbName">请输入名字</SPAN> 
  <LI>主&nbsp;&nbsp;&nbsp;页:<INPUT id=Post.ascx_PostComment_tbUrl disabled 
  maxLength=256 size=40 name=Post.ascx:PostComment:tbUrl> 
  <LI>
  <DIV id=Post.ascx_PostComment_AntiBotImageRegion>校验码: <INPUT 
  id=Post.ascx_PostComment_tbAntiBotImage style="WIDTH: 75px" 
  name=Post.ascx:PostComment:tbAntiBotImage> <SPAN 
  id=Post.ascx_PostComment_valAntiBotImage style="DISPLAY: none; COLOR: red" 
  evaluationfunction="CustomValidatorEvaluateIsValid" 
  display="Dynamic">检验码无效!</SPAN> <SPAN 
  id=Anthem_Post.ascx_PostComment_imgAntiBotImage__><IMG 
  id=Post.ascx_PostComment_imgAntiBotImage alt="" 
  src="WMA文件信息格式分析及代码 - mokemars的专栏 - CSDNBlog.files/AntiBotImage.jpg" 
  align=absMiddle border=0></SPAN> <SPAN 
  id=Anthem_Post.ascx_PostComment_lbCreateAntiBotImage__><A 
  id=Post.ascx_PostComment_lbCreateAntiBotImage 
  onclick="javascript:Anthem_FireCallBackEvent(this,event,'Post.ascx:PostComment:lbCreateAntiBotImage','',false,'','','',true,null,null,null,true,true);return false;" 
  href="javascript:__doPostBack('Post.ascx$PostComment$lbCreateAntiBotImage','')">看不清,换一张</A></SPAN> 
  </DIV></LI></UL><SPAN id=Post.ascx_PostComment_RequiredFieldValidator3 
style="VISIBILITY: hidden; COLOR: red" initialvalue="" 
evaluationfunction="RequiredFieldValidatorEvaluateIsValid" errormessage="请输入评论" 
controltovalidate="Post.ascx_PostComment_tbComment">请输入评论</SPAN><BR><TEXTAREA id=Post.ascx_PostComment_tbComment disabled name=Post.ascx:PostComment:tbComment rows=10 cols=50></TEXTAREA><BR><SPAN 
id=Anthem_Post.ascx_PostComment_btnSubmit__></SPAN><BR><SPAN 
id=Post.ascx_PostComment_Message 
style="COLOR: red">当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击<A 
href="http://passport.csdn.net/member/UserLogin.aspx?from=http://blog.csdn.net/mokemars/archive/2008/03/20/2201064.aspx">登录</A></SPAN> 
</FIELDSET> </DIV></DIV></DIV>
<SCRIPT type=text/javascript>
    LoadFeedbackCount();//加载评论
    document.write("<img src='http://counter.csdn.net/pv.aspx?id=24' border=0 width=0 height=0>");// 计数器
    </SCRIPT>

<SCRIPT src="WMA文件信息格式分析及代码 - mokemars的专栏 - CSDNBlog.files/HighLighter.js" 
type=text/javascript></SCRIPT>
</DIV></DIV></DIV>
<DIV id=pubfooter>
<DL>
  <DT>
  <DD>Csdn Blog version 3.1a 
  <DD>Copyright © mokemars </DD></DL></DIV></DIV>
<SCRIPT type=text/javascript>
<!--
var Page_Validators =  new Array(document.getElementById("Post.ascx_PostComment_RequiredFieldValidator2"), document.getElementById("Post.ascx_PostComment_valAntiBotImage"), document.getElementById("Post.ascx_PostComment_RequiredFieldValidator3"));
// -->
</SCRIPT>

<SCRIPT type=text/javascript>
<!--
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}

function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
// -->
</SCRIPT>
</FORM>
<SCRIPT src="WMA文件信息格式分析及代码 - mokemars的专栏 - CSDNBlog.files/counter.js" 
type=text/javascript></SCRIPT>
</DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -