Lines Matching refs:og
29 int ogg_page_version(const ogg_page *og){ in ogg_page_version() argument
30 return((int)(og->header[4])); in ogg_page_version()
33 int ogg_page_continued(const ogg_page *og){ in ogg_page_continued() argument
34 return((int)(og->header[5]&0x01)); in ogg_page_continued()
37 int ogg_page_bos(const ogg_page *og){ in ogg_page_bos() argument
38 return((int)(og->header[5]&0x02)); in ogg_page_bos()
41 int ogg_page_eos(const ogg_page *og){ in ogg_page_eos() argument
42 return((int)(og->header[5]&0x04)); in ogg_page_eos()
45 ogg_int64_t ogg_page_granulepos(const ogg_page *og){ in ogg_page_granulepos() argument
46 unsigned char *page=og->header; in ogg_page_granulepos()
58 int ogg_page_serialno(const ogg_page *og){ in ogg_page_serialno() argument
59 return(og->header[14] | in ogg_page_serialno()
60 (og->header[15]<<8) | in ogg_page_serialno()
61 (og->header[16]<<16) | in ogg_page_serialno()
62 (og->header[17]<<24)); in ogg_page_serialno()
65 long ogg_page_pageno(const ogg_page *og){ in ogg_page_pageno() argument
66 return(og->header[18] | in ogg_page_pageno()
67 (og->header[19]<<8) | in ogg_page_pageno()
68 (og->header[20]<<16) | in ogg_page_pageno()
69 (og->header[21]<<24)); in ogg_page_pageno()
91 int ogg_page_packets(const ogg_page *og){ in ogg_page_packets() argument
92 int i,n=og->header[26],count=0; in ogg_page_packets()
94 if(og->header[27+i]<255)count++; in ogg_page_packets()
280 void ogg_page_checksum_set(ogg_page *og){ in ogg_page_checksum_set() argument
281 if(og){ in ogg_page_checksum_set()
286 og->header[22]=0; in ogg_page_checksum_set()
287 og->header[23]=0; in ogg_page_checksum_set()
288 og->header[24]=0; in ogg_page_checksum_set()
289 og->header[25]=0; in ogg_page_checksum_set()
291 for(i=0;i<og->header_len;i++) in ogg_page_checksum_set()
292 crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)&0xff)^og->header[i]]; in ogg_page_checksum_set()
293 for(i=0;i<og->body_len;i++) in ogg_page_checksum_set()
294 crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)&0xff)^og->body[i]]; in ogg_page_checksum_set()
296 og->header[22]=(unsigned char)(crc_reg&0xff); in ogg_page_checksum_set()
297 og->header[23]=(unsigned char)((crc_reg>>8)&0xff); in ogg_page_checksum_set()
298 og->header[24]=(unsigned char)((crc_reg>>16)&0xff); in ogg_page_checksum_set()
299 og->header[25]=(unsigned char)((crc_reg>>24)&0xff); in ogg_page_checksum_set()
372 static int ogg_stream_flush_i(ogg_stream_state *os,ogg_page *og, int force){ in ogg_stream_flush_i() argument
483 og->header=os->header; in ogg_stream_flush_i()
484 og->header_len=os->header_fill=vals+27; in ogg_stream_flush_i()
485 og->body=os->body_data+os->body_returned; in ogg_stream_flush_i()
486 og->body_len=bytes; in ogg_stream_flush_i()
497 ogg_page_checksum_set(og); in ogg_stream_flush_i()
517 int ogg_stream_flush(ogg_stream_state *os,ogg_page *og){ in ogg_stream_flush() argument
518 return ogg_stream_flush_i(os,og,1); in ogg_stream_flush()
525 int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og){ in ogg_stream_pageout() argument
533 return(ogg_stream_flush_i(os,og,force)); in ogg_stream_pageout()
636 long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og){ in ogg_sync_pageseek() argument
695 if(og){ in ogg_sync_pageseek()
696 og->header=page; in ogg_sync_pageseek()
697 og->header_len=oy->headerbytes; in ogg_sync_pageseek()
698 og->body=page+oy->headerbytes; in ogg_sync_pageseek()
699 og->body_len=oy->bodybytes; in ogg_sync_pageseek()
734 int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og){ in ogg_sync_pageout() argument
743 long ret=ogg_sync_pageseek(oy,og); in ogg_sync_pageout()
767 int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){ in ogg_stream_pagein() argument
768 unsigned char *header=og->header; in ogg_stream_pagein()
769 unsigned char *body=og->body; in ogg_stream_pagein()
770 long bodysize=og->body_len; in ogg_stream_pagein()
773 int version=ogg_page_version(og); in ogg_stream_pagein()
774 int continued=ogg_page_continued(og); in ogg_stream_pagein()
775 int bos=ogg_page_bos(og); in ogg_stream_pagein()
776 int eos=ogg_page_eos(og); in ogg_stream_pagein()
777 ogg_int64_t granulepos=ogg_page_granulepos(og); in ogg_stream_pagein()
778 int serialno=ogg_page_serialno(og); in ogg_stream_pagein()
779 long pageno=ogg_page_pageno(og); in ogg_stream_pagein()
1049 void check_page(unsigned char *data,const int *header,ogg_page *og){ in check_page() argument
1052 for(j=0;j<og->body_len;j++) in check_page()
1053 if(og->body[j]!=data[j]){ in check_page()
1055 j,data[j],og->body[j]); in check_page()
1060 for(j=0;j<og->header_len;j++){ in check_page()
1061 if(og->header[j]!=header[j]){ in check_page()
1064 fprintf(stderr," (%ld)%02x:%02x",j,header[j],og->header[j]); in check_page()
1069 if(og->header_len!=header[26]+27){ in check_page()
1071 og->header_len,header[26]+27); in check_page()
1076 void print_header(ogg_page *og){ in print_header() argument
1080 og->header[0],og->header[1],og->header[2],og->header[3], in print_header()
1081 (int)og->header[4],(int)og->header[5]); in print_header()
1084 (og->header[9]<<24)|(og->header[8]<<16)| in print_header()
1085 (og->header[7]<<8)|og->header[6], in print_header()
1086 (og->header[17]<<24)|(og->header[16]<<16)| in print_header()
1087 (og->header[15]<<8)|og->header[14], in print_header()
1088 ((long)(og->header[21])<<24)|(og->header[20]<<16)| in print_header()
1089 (og->header[19]<<8)|og->header[18]); in print_header()
1092 (int)og->header[22],(int)og->header[23], in print_header()
1093 (int)og->header[24],(int)og->header[25], in print_header()
1094 (int)og->header[26]); in print_header()
1096 for(j=27;j<og->header_len;j++) in print_header()
1097 fprintf(stderr,"%d ",(int)og->header[j]); in print_header()
1101 void copy_page(ogg_page *og){ in copy_page() argument
1102 unsigned char *temp=_ogg_malloc(og->header_len); in copy_page()
1103 memcpy(temp,og->header,og->header_len); in copy_page()
1104 og->header=temp; in copy_page()
1106 temp=_ogg_malloc(og->body_len); in copy_page()
1107 memcpy(temp,og->body,og->body_len); in copy_page()
1108 og->body=temp; in copy_page()
1111 void free_page(ogg_page *og){ in free_page() argument
1112 _ogg_free (og->header); in free_page()
1113 _ogg_free (og->body); in free_page()
1496 ogg_page og; in test_pack() local
1498 while(ogg_stream_pageout(&os_en,&og)){ in test_pack()
1508 check_page(data+outptr,headers[pageno],&og); in test_pack()
1510 outptr+=og.body_len; in test_pack()
1515 deptr+=og.body_len; in test_pack()
1523 char *buf=ogg_sync_buffer(&oy,og.header_len+og.body_len); in test_pack()
1525 byteskipcount+=og.header_len; in test_pack()
1527 memcpy(next,og.header,byteskipcount-byteskip); in test_pack()
1532 byteskipcount+=og.body_len; in test_pack()
1534 memcpy(next,og.body,byteskipcount-byteskip); in test_pack()
1773 ogg_page og[5]; in main() local
1794 if(ogg_stream_pageout(&os_en,&og[i])==0){ in main()
1798 copy_page(&og[i]); in main()
1811 memcpy(ogg_sync_buffer(&oy,og[i].header_len),og[i].header, in main()
1812 og[i].header_len); in main()
1813 ogg_sync_wrote(&oy,og[i].header_len); in main()
1814 memcpy(ogg_sync_buffer(&oy,og[i].body_len),og[i].body,og[i].body_len); in main()
1815 ogg_sync_wrote(&oy,og[i].body_len); in main()
1860 memcpy(ogg_sync_buffer(&oy,og[i].header_len),og[i].header, in main()
1861 og[i].header_len); in main()
1862 ogg_sync_wrote(&oy,og[i].header_len); in main()
1863 memcpy(ogg_sync_buffer(&oy,og[i].body_len),og[i].body,og[i].body_len); in main()
1864 ogg_sync_wrote(&oy,og[i].body_len); in main()
1913 memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header, in main()
1919 memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+3, in main()
1925 memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+23, in main()
1932 memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+28, in main()
1933 og[1].header_len-28); in main()
1934 ogg_sync_wrote(&oy,og[1].header_len-28); in main()
1937 memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,1000); in main()
1941 memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body+1000, in main()
1942 og[1].body_len-1000); in main()
1943 ogg_sync_wrote(&oy,og[1].body_len-1000); in main()
1955 memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header, in main()
1956 og[1].header_len); in main()
1957 ogg_sync_wrote(&oy,og[1].header_len); in main()
1959 memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body, in main()
1960 og[1].body_len); in main()
1961 ogg_sync_wrote(&oy,og[1].body_len); in main()
1963 memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header, in main()
1969 memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+20, in main()
1970 og[1].header_len-20); in main()
1971 ogg_sync_wrote(&oy,og[1].header_len-20); in main()
1972 memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body, in main()
1973 og[1].body_len); in main()
1974 ogg_sync_wrote(&oy,og[1].body_len); in main()
1987 memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body, in main()
1988 og[1].body_len); in main()
1989 ogg_sync_wrote(&oy,og[1].body_len); in main()
1991 memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header, in main()
1992 og[1].header_len); in main()
1993 ogg_sync_wrote(&oy,og[1].header_len); in main()
1995 memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body, in main()
1996 og[1].body_len); in main()
1997 ogg_sync_wrote(&oy,og[1].body_len); in main()
1999 memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header, in main()
2006 memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header+20, in main()
2007 og[2].header_len-20); in main()
2008 ogg_sync_wrote(&oy,og[2].header_len-20); in main()
2009 memcpy(ogg_sync_buffer(&oy,og[2].body_len),og[2].body, in main()
2010 og[2].body_len); in main()
2011 ogg_sync_wrote(&oy,og[2].body_len); in main()
2023 memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header, in main()
2024 og[1].header_len); in main()
2025 ogg_sync_wrote(&oy,og[1].header_len); in main()
2027 memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body, in main()
2028 og[1].body_len); in main()
2029 ogg_sync_wrote(&oy,og[1].body_len); in main()
2031 memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header, in main()
2032 og[2].header_len); in main()
2033 ogg_sync_wrote(&oy,og[2].header_len); in main()
2035 memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header, in main()
2036 og[2].header_len); in main()
2037 ogg_sync_wrote(&oy,og[2].header_len); in main()
2041 memcpy(ogg_sync_buffer(&oy,og[2].body_len),og[2].body, in main()
2042 og[2].body_len-5); in main()
2043 ogg_sync_wrote(&oy,og[2].body_len-5); in main()
2045 memcpy(ogg_sync_buffer(&oy,og[3].header_len),og[3].header, in main()
2046 og[3].header_len); in main()
2047 ogg_sync_wrote(&oy,og[3].header_len); in main()
2049 memcpy(ogg_sync_buffer(&oy,og[3].body_len),og[3].body, in main()
2050 og[3].body_len); in main()
2051 ogg_sync_wrote(&oy,og[3].body_len); in main()
2062 free_page(&og[i]); in main()