Displaying 20 results from an estimated 24 matches for "ogg_sync_buffer".
2007 Mar 16
1
ogg_sync_buffer() memory alignment
I am writing an Ogg Vorbis decoder for win32.
I want a memory buffer which is aligned to the disk sector size (512
bytes on hard disk, 2048 bytes on cd/dvd), so that the win32 function
ReadFile can be persuaded to do 'unbuffered IO'.
Unfortunately, the ogg_sync_buffer() call gives me a pointer from its
own, internally allocated buffer. I have found no docs to indicate that
this would be "page-aligned' (say 4k memory pages).
Hopefully I can alter the source to guarantee buffer alignment (about to
check), but has this issue been addressed elsewhere, p...
2008 Aug 28
0
Error while cross compiling libvorbis 1.2.0
.../../../arm-linux/bin/ld:
warning: libogg.so.0, needed by ../lib/.libs/libvorbis.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_strea...
1999 Oct 04
3
Detailed decoder pseudocode (was: Re: ETA?)
> > Which part?
>
> Well, my biggest problem is dealing with files. As you have mentioned
> that fill_buffer() is obsolete, what has replaced it? ogg_sync_buffer()
> didn't seem to be what I was looking for, as far as I can tell... am I
> headed in completely the wrong direction?
Ah, OK, I understand where you're headed now.
The libvorbis API is different than the preceeding generations of Ogg.
Unfortunately, the command line player that...
2000 Jun 27
1
vorbis-tools/Makefile.in glitch...
..../lib/libvorbis.a ../lib/vorbisfile.a
../lib/vorbisfile.a(vorbisfile.o): In function `_get_prev_page':
vorbisfile.o(.text+0x54): undefined reference to `ogg_sync_reset'
vorbisfile.o(.text+0xa9): undefined reference to `ogg_sync_pageseek'
vorbisfile.o(.text+0xd2): undefined reference to `ogg_sync_buffer'
...
This is obviously because libvorbis comes before vorbisfile on the command
line ;). It really seems like we should be doing "-L../lib -lvorbis"
instead of ../lib/libvorbis.a though, and that would fix the problem.
Anybody have any objections to that, or any other suggestion of...
2006 Aug 06
2
Speex + Ogg package
....packet = (unsigned char *)packet;
op.bytes = nbBytes+4;
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);
whi...
2009 May 13
2
Speex seek with high precision
...oment where it should start. Only when I seek to position 0 I get
the desired result.
I've also 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...
2000 Jul 24
3
Decoder example question
...ing into a
problem with the decoder though. It plays FINE under the WinAmp plugin but I
when I try and use the decoder_example.c to decode the file it says "End of
file before finding all Vorbis headers!"
Snippet from ln 169
/* no harm in not checking before adding more */
buffer=ogg_sync_buffer(&oy,4096);
bytes=fread(buffer,1,4096,stdin);
if(bytes==0 && i<2){
fprintf(stderr,"End of file before finding all Vorbis headers!\n");
exit(1);
}
For whatever reason bytes is comming back as 0...can sombody please tell me
what I'm doing...
2009 May 12
2
compile error of libtheora example
...ch error message popped.
i tried to run player_example.c under /libtheora_1.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+0x7f...
2001 Apr 05
1
decoder_example -- event driven?
...played.
My current attack is as follows (note this isn't very robust and I
realized that):
For first 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 */...
2002 Aug 06
0
Getting a GUI to work with Vorbis code
.../* grab some data at the head of the stream. 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 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_s...
2006 Aug 06
0
Speex + Ogg package
...= 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;
>...
2009 May 16
1
Speex seek with high precision
..._t position = (this->seek_to * rate) / 1000;
ogg_int64_t granulepos;
do
{ // 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...
2006 May 09
0
libvorbis build errors when using configure
...Wl,--image-base=0x10000000
-Wl,--out-implib,.libs/libvorbisfile.dll.a where it told me
Creating 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...
2010 Jan 06
1
Initializing vorbis using ov_open_callbacks fail with OV_ENOTVORBIS. But why?
...ng to demux a physical ogg stream
(theora and vorbis) and play the audio part using vorbisfile.
I hope that one of you can give me a hint or point me to additional
documentation.
I used ogg.h and vorbisfile.h.
The way so far:
- initializing an ogg_sync_state
- inserting data to sync_state using ogg_sync_buffer
- when whole page found (ogg_sync_pageseek(&sync, &page) > 0) I
initialize a ogg_stream_state and add page using ogg_stream_packetin.
(in the case the first packet is vorbis - ogg_stream_packetout and
check for first some bytes)
- next pages with same serial number are handled equiva...
2009 May 13
0
Speex seek with high precision
...t of
liboggz atm, so this is good feedback :-)
> I've also 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) < ti...
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
..._page);
ogg_stream_packetout(&the_ogg_stream_state, &the_ogg_packet);
printf("Decode 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_syn...
2006 Aug 06
2
Speex + Ogg package
...+;
> >
> > 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));
&g...
2006 Aug 06
0
Newbie: How to rewind a videostream (long)
...sync_pageout (&oggSyncState, &oggPage) > 0) {
queue_page (&oggPage);
}
}
}
theora_decode_YUVout (&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)...
2015 Nov 05
3
Opusfile seeking bug
...8_t headerFLags = 0;
int pageContinuesPacket = 0;
int firstPacketInPage = 1;
int packetsToFetch = 1;
int packetOutRet;
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 = og...