search for: ogg_sync_wrote

Displaying 20 results from an estimated 23 matches for "ogg_sync_wrote".

2008 Aug 28
0
Error while cross compiling libvorbis 1.2.0
...bis.so, not found (try using -rpath or -rpath-link) decoder_example.o: In function `main': decoder_example.o(.text+0x18): undefined reference to `ogg_sync_init' decoder_example.o(.text+0x3c): undefined reference to `ogg_sync_buffer' decoder_example.o(.text+0x64): undefined reference to `ogg_sync_wrote' decoder_example.o(.text+0x70): undefined reference to `ogg_sync_pageout' decoder_example.o(.text+0x8c): undefined reference to `ogg_page_serialno' decoder_example.o(.text+0xa8): undefined reference to `ogg_stream_init' decoder_example.o(.text+0xc8): undefined reference to `ogg_stre...
2001 Sep 22
3
retrieving "instant" bitrate without vo_open?
ok, I'm aware that vo_open cant be used at the same time as other functions such as ogg_sync_wrote, ogg_sync_pageout, ogg_stream_pagein, ogg_stream_packetout and vorbis_synthesis_headerin. In order to get information from the bitstream i've been using this method because it's fast and doesn't require decoding of the stream. But, i can only retrieve the average bitrate of the o...
1999 Oct 04
3
Detailed decoder pseudocode (was: Re: ETA?)
...ream. We want the first page (which is guaranteed to be small and only contain the Vorbis stream initial header) We need the first page to get the stream serialno. */ /* submit a 4k block (safe size) to libvorbis */ buffer=ogg_sync_buffer(&oy,4096); bytes=read(STDIN_FILENO,buffer,4096); ogg_sync_wrote(&oy,bytes); /* Get the first page. */ if(ogg_sync_pageout(&oy,&og)!=1){ /* error case. Must not be Vorbis data */} /* Get the serial number and use it to set up a logical stream */ ogg_stream_init(&os,ogg_page_serialno(&og)); /* extract the initial header from the first page...
2006 Aug 06
2
Speex + Ogg package
...op.b_o_s = 0; op.packetno = packet_id; packet_id++; ogg_stream_packetin(&os, &op); ogg_stream_flush(&os, &audio_page); return audio_page; } As for the decoder I have this. //Incoming data from udp is on buffer char *buffer=ogg_sync_buffer(&oy,4096); memcpy(buffer,buff,len); ogg_sync_wrote(&oy,len); while(ogg_sync_pageout(&oy,&audio_page)>0) { if (stream_init == 0) { ogg_stream_init(&os, ogg_page_serialno(&audio_page)); stream_init = 1; } queue_page(&audio_page); while(ogg_stream_packetout(&os,&op)>0) {...
2009 May 13
2
Speex seek with high precision
...lso used ogg_page_granulepos for seeking but it seems more difficult to use. I use something like this: do { while (ogg_sync_pageout(&oy, &og) != 1) { data = ogg_sync_buffer(&oy, 512); readbytes = fread(data, 1, 512, spxfile); ogg_sync_wrote(&oy, readbytes); } //printf("ogg_page_granulepos: %lld\n", ogg_page_granulepos(&og)); } while (ogg_page_granulepos(&og) < time * freq); // time in seconds, freq: 16000 But this way I can't get enough precision neither. Could anyone give me some...
2005 Jun 22
2
ogg_sync_pageout
It seems to me that running ogg_sync_pageout doesn't automatically advance the page. This is good if you haven't worked with the given page, makes coding somewhat easier. However, when does a page advance. Is it after a call to ogg_stream_pagein? On a side note, I need to do seeking on top of libvorbis, I'd love to use vorbisfile but sadly I can't. Is there a reasonable way to
2009 May 12
2
compile error of libtheora example
....0/examples/. error message: ivysummer at ivysummer-desktop:~/??/libtheora-1.0/examples$ gcc -o player player_example.c /tmp/ccpyle3c.o: In function `buffer_data': player_example.c:(.text+0x15): undefined reference to `ogg_sync_buffer' player_example.c:(.text+0x4f): undefined reference to `ogg_sync_wrote' /tmp/ccpyle3c.o: In function `open_video': player_example.c:(.text+0x7a5): undefined reference to `SDL_Init' player_example.c:(.text+0x7ae): undefined reference to `SDL_GetError' player_example.c:(.text+0x7fc): undefined reference to `SDL_SetVideoMode' player_example.c:(.text+0...
2001 Apr 05
1
decoder_example -- event driven?
...t and second packet i grab all the header stuff in the same way as decoder_example. From the third packet on, I send it to a bunch of code: float **pcm; int samples; buffer=ogg_sync_buffer(&oy,4096); bytes = 4096; buffer = memcpy (buffer, data, bytes); ogg_sync_wrote(&oy,bytes); ogg_sync_pageout(&oy,&og); ogg_stream_pagein(&os,&og); /* can safely ignore errors at this point */ /* we have a packet. Decode it */ if(vorbis_synthesis(&vb,&op)==0) /* test for suc...
2006 Oct 09
1
Vorbis primitive API examples (LONG)
...places that can throw errors int grabData(ogg_sync_state *oy) { unsigned char* bb = ogg_sync_bufferin(oy, BCHUNKSIZE); long bytesRead = fread(bb, 1, BCHUNKSIZE, stdin); dprintf("Consumed: %ld bytes\n", bytesRead); if (bytesRead == 0) { // For now, EOF return(-1); } ogg_sync_wrote(oy, bytesRead); bytesConsumed += bytesRead; return(0); } int main() { int rv0 = 0; int dr0 = 0; // These abbreviations use the ogg internal conventions // Caution: libogg uses NULL as a sentinel in places. If you feed non-NULL, // on initial calls you can get into trouble ogg_s...
2002 Aug 06
0
Getting a GUI to work with Vorbis code
...bmit a 4k block to libvorbis' Ogg layer */ buffer=ogg_sync_buffer(&oy,4096); /* changed from stdin to myFile in next line - GK*/ bytes=fread(buffer,1,4096,myFile); /* added the following line - GK */ printf("%d bytes read successfully\n",bytes); ogg_sync_wrote(&oy,bytes); /* Get the first page. */ if(ogg_sync_pageout(&oy,&og)!=1){ /* have we simply run out of data? If so, we're done. */ if(bytes<4096)break; /* error case. Must not be Vorbis data */ fprintf(outputFile,"Input does not appear...
2006 Aug 06
0
Speex + Ogg package
...g_stream_packetin(&os, &op); > ogg_stream_flush(&os, &audio_page); > > return audio_page; > } > > As for the decoder I have this. > > //Incoming data from udp is on buffer > char *buffer=ogg_sync_buffer(&oy,4096); > memcpy(buffer,buff,len); > ogg_sync_wrote(&oy,len); > while(ogg_sync_pageout(&oy,&audio_page)>0) > { > if (stream_init == 0) > { > ogg_stream_init(&os, ogg_page_serialno(&audio_page)); > stream_init = 1; > } > queue_page(&audio_page); > > while(o...
2009 May 16
1
Speex seek with high precision
...// Skip pages until the page we want to seek granulepos = ogg_page_granulepos(&og); // previous granulepos while (ogg_sync_pageout(&oy, &og) != 1) { data = ogg_sync_buffer(&oy, 512); nb_read = fread(data, 1, 512, fin); ogg_sync_wrote(&oy, nb_read); } nPages++; } while (ogg_page_granulepos(&og) < position); printf("ogg_page_packets: %d\n", ogg_page_packets(&og)); // Add page to the bitstream ogg_stream_pagein(&os, &og); printf("ogg_page_packets: %d...
2006 May 09
0
libvorbis build errors when using configure
...ating library file: .libs/libvorbisfile.dll.a .libs/vorbisfile.o(.text+0x73):vorbisfile.c: undefined reference to `ogg_sync_pageseek' .libs/vorbisfile.o(.text+0xb8):vorbisfile.c: undefined reference to `ogg_sync_buffer' .libs/vorbisfile.o(.text+0xec):vorbisfile.c: undefined reference to `ogg_sync_wrote' .libs/vorbisfile.o(.text+0x237):vorbisfile.c: undefined reference to `ogg_page_serialno' and this goes on for some time. Again it is not finding the libogg file for linking. Any idea as to why it is not working?
2009 May 13
0
Speex seek with high precision
...it seems more difficult > to use. I use something like this: > > ??? do > ??? { > ??? ??? while (ogg_sync_pageout(&oy, &og) != 1) > ??? ??? { > ??? ??? ??? data = ogg_sync_buffer(&oy, 512); > ??? ??? ??? readbytes = fread(data, 1, 512, spxfile); > ??? ??? ??? ogg_sync_wrote(&oy, readbytes); > ??? ??? } > ??? ??? //printf("ogg_page_granulepos: %lld\n", ogg_page_granulepos(&og)); > ??? } > ??? while (ogg_page_granulepos(&og) < time * freq); // time in seconds, > freq: 16000 > > But this way I can't get enough precision n...
2009 May 16
2
Speex seek with high precision
Hello Conrad, I'm trying to seek the way you told but I'm facing a problem. ogg_page_packets returns 164 and following code returns 189. Shouldn't it be the same, what does that means ? int res; while (true) { res = ogg_stream_packetout(&os, &op); if (res == 1) nPackets++; if (res == -1)
2008 Apr 29
2
More trival questions
...ode Packet\n"); send_to_my_decoder( the_ogg_packet.packet, the_ogg_packet.bytes ); } buffer = ogg_sync_buffer(&the_ogg_sync_state, BUF_SIZE); bytes_actually_read = fread(buffer, 1, BUF_SIZE, source); ogg_sync_wrote(&the_ogg_sync_state, bytes_actually_read); } while (feof(source) == 0 ); ogg_stream_clear( &the_ogg_stream_state ); ogg_sync_clear( &the_ogg_sync_state ); fclose(source); return 1; } >>> $ ./a.out 320x240.ogg | head -20 Decode Page Ma...
2001 Oct 23
0
NEW Real Media plugin, WAS: libvorbisrtp-0.1
...etc...) But it's a start. There is one thing I absolutely DISLIKE about the Ogg SDK. Why is it the programmer's responsibility to do a fallback like this? ogg_stream_packetout() -> returns 0 ogg_sync_pageout() -> returns 1: ogg_stream_pagein() -> returns 0 fread(), ogg_sync_wrote(), This sucks major. Especially if the read() functionality is asynchronous, like in the Real Media architecture. Why doesn't the Ogg API contain a mechanism using callback hooks, for example? So I would ONLY have to bother calling ogg_stream_packetout(). In case the ogg stream runs out of p...
2006 Aug 06
2
Speex + Ogg package
...stream_flush(&os, &audio_page); > > > > return audio_page; > > } > > > > As for the decoder I have this. > > > > //Incoming data from udp is on buffer > > char *buffer=ogg_sync_buffer(&oy,4096); > > memcpy(buffer,buff,len); > > ogg_sync_wrote(&oy,len); > > while(ogg_sync_pageout(&oy,&audio_page)>0) > > { > > if (stream_init == 0) > > { > > ogg_stream_init(&os, ogg_page_serialno(&audio_page)); > > stream_init = 1; > > } > > queue_page(&...
2006 Aug 06
0
Newbie: How to rewind a videostream (long)
...(&theoraState, &yuvBuffer); } int VideoStreamTheora::buffer_data () { char *buffer = ogg_sync_buffer (&oggSyncState,4096); int bytes = videoStream.tellg(); videoStream.read (buffer, 4096); bytes = int(videoStream.tellg()) - bytes; ogg_sync_wrote (&oggSyncState, bytes); return(bytes); } int VideoStreamTheora::queue_page (ogg_page *oggPage) { if(theoraPageCount > 0) ogg_stream_pagein (&theoraStreamState, oggPage); return 0; } void VideoStreamTheora::decodeAndRenderFrameToTexture (irr...
2015 Nov 05
3
Opusfile seeking bug
...acketOutRet; FILE* fp = fopen(filename, "rb"); ogg_sync_init(&m_syncState); while(decoding) { while(ogg_sync_pageout(&m_syncState, &page) != 1) { buffer = ogg_sync_buffer(&m_syncState, BufferSize); bytesRead = fread(buffer, sizeof(char), BufferSize, fp); ogg_sync_wrote(&m_syncState, bytesRead); } // If this is the last page, then don't loop again. if(ogg_page_eos(&page) > 0) decoding = 0; if(serialno < 0) { serialno = ogg_page_serialno(&page);; ogg_stream_init(&m_streamState, serialno); } headerFLags = page.head...