search for: write_callback

Displaying 20 results from an estimated 45 matches for "write_callback".

2017 Dec 13
3
using libflac++ on a live internet stream
Thanks Brian. I converted everything to libFLAC and got the same results. Here is some debug output encoder: [34.270050] FLAC encoder set succeeded [34.271183] write_callback, frame: 0, samples: 0 [34.271282] write_callback, frame: 0, samples: 0 [34.271313] write_callback, frame: 0, samples: 0 [34.271351] FLAC encoder initialization succeeded [34.356251] write_callback, frame: 0, samples: 4096 [34.441582] write_callback, frame: 1, samples: 4096 [34.526905] write_callbac...
2017 Dec 12
2
using libflac++ on a live internet stream
I'm trying to use libflac++ on a live internet audio stream. I don't see anything mentioned in the documentation that suggests this should not be possible, so I hope I'm not chasing down the wrong path (two weeks in). The encoder seems to be working fine and creates data for the write_callback, which I have coded to packetize that data and send it across the network. The question is how the decoder at the receiver should operate. Ideally, when a packet arrives, it can be fed to the decoder. When the decoder has enough data for a new uncompressed frame, it returns one. But the decoder...
2017 Dec 13
0
using libflac++ on a live internet stream
On Wed, 13 Dec 2017 09:12:43 -0700 Chris Barrett <cbarrett.colo at gmail.com> wrote: > Thanks Brian. I converted everything to libFLAC and got the same > results. > > Here is some debug output > encoder: > [34.270050] FLAC encoder set succeeded > [34.271183] write_callback, frame: 0, samples: 0 > [34.271282] write_callback, frame: 0, samples: 0 > [34.271313] write_callback, frame: 0, samples: 0 > [34.271351] FLAC encoder initialization succeeded > [34.356251] write_callback, frame: 0, samples: 4096 > [34.441582] write_callback, frame: 1, samples: 4096...
2004 Sep 10
2
FLAC++ SeekableStream write_callback not being called?
...gin for the K3b CD burning program. To do this I have subclassed the FLAC::Decoder::SeekableStream class. I can obtain the vorbiscomment data using set_metadata_respond, process_until_end_of_metadata and the metadata_callback, however I cannot decode the audio data. It seems to me as though the write_callback is never actually being called. Before I pepper my code with a bazillion trace statements, can anyone tell me if there is some obvious "trick-for-new-players" which I might have missed? My write_callback looks like: ::FLAC__StreamDecoderWriteStatus K3bFLACDecoder::Private::write_call...
2004 Sep 10
0
FLAC++ SeekableStream write_callback not being called?
...To do this > I have subclassed the FLAC::Decoder::SeekableStream class. I can > obtain the > vorbiscomment data using set_metadata_respond, > process_until_end_of_metadata > and the metadata_callback, however I cannot decode the audio data. It > seems > to me as though the write_callback is never actually being called. > > Before I pepper my code with a bazillion trace statements, can anyone > tell me > if there is some obvious "trick-for-new-players" which I might have > missed? > > My write_callback looks like: > > ::FLAC__StreamDecoderWri...
2017 Dec 12
0
using libflac++ on a live internet stream
...9;m trying to use libflac++ on a live internet audio stream. I don't see anything mentioned in the documentation that suggests this should not be possible, so I hope I'm not chasing down the wrong path (two weeks in). > > The encoder seems to be working fine and creates data for the write_callback, which I have coded to packetize that data and send it across the network. > > The question is how the decoder at the receiver should operate. Ideally, when a packet arrives, it can be fed to the decoder. When the decoder has enough data for a new uncompressed frame, it returns one. >...
2006 Jun 17
3
Assistance with an encoding plugin
...tion. My basic setup which follows gets me oddly high pitched audio with lots of noise (although the music IS somewhat recognizable). #include <FLAC/stream_encoder.h> FLAC__StreamEncoder *encoder; FILE *output_file_descriptor; encoder = FLAC__stream_encoder_new(); FLAC__stream_encoder_set_write_callback(plugin->encoder, write_callback); FLAC__stream_encoder_set_metadata_callback(plugin->encoder, metadata_callback); FLAC__stream_encoder_set_client_data(plugin->encoder, output_file_descriptor); FLAC__stream_encoder_init(plugin->encoder); while(/* audio data left to extract */) { /* au...
2013 Feb 09
2
Newbie question about those callbacks
For instance the write_callback thing: client_data ? can it be a pointer to just about anything? For instance a pointer to a two-dimensional array? Are those FLAC-WAV and WAV-FLAC examples the only examples available? What would be the best approach to read a FLAC file to an array of some kind? Passing a pointer to the array as...
2014 Mar 08
2
16 bits FLAC file data to 32 bit float buffer for CPU processing
...ng into decoding buffer values of sine wave, instead of decoded FLAC file data, and it also works without problems; now I try different approaches to convert FLAC 16 bits sound data to 32 bits float CPU buffer, but they give noise or sound with artefacts. I use Stream Decoder from FLAC C API and my write_callback is as follows : FLAC__StreamDecoderWriteStatus write_callback ( const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void * client_data ) { size_t i; BYTE * ChannelDataBuffer; WORD *...
2016 Jan 19
0
FLAC__stream_decoder_seek_absolute calling write callback
...the problem. Thanks for your response! Here's an example: #include <iostream> #include <FLAC++/all.h> int main(int argc, const char * argv[]) { class Decoder : public FLAC::Decoder::File { protected: virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) override { std::cout << "write_callback called!" << std::endl; abort(); return FLAC__StreamDecoderWriteStatus::FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;...
2019 Jun 04
2
Re: [PATCH libnbd v2 3/4] api: Implement concurrent writer.
There are several races / deadlocks which I've thought about. Let's see if I can remember them all ... (1) This I experienced: nbd_aio_get_fd deadlocks if there are concurrent synchronous APIs going on. A typical case is where you set up the concurrent writer thread before connecting, and then call a synchronous connect function such as connect_tcp. The synchronous function grabs
2016 Nov 02
0
[PATCH 2/6] New API: yara_load
.../xdr.h> +#include <rpc/types.h> +#include <sys/types.h> +#include <sys/stat.h> + +#include "daemon.h" +#include "actions.h" +#include "optgroups.h" +#include "guestfs_protocol.h" + +#ifdef HAVE_LIBYARA + +#include <yara.h> + +struct write_callback_data { + int fd; + uint64_t written; +}; + +/* Yara compiled rules. */ +static YR_RULES *rules = NULL; + +static int upload_rules_file (char *); +static int compile_rules_file (const char *); +static int write_callback (void *, const void *, size_t); + +/* Has one FileIn parameter. */ +int +do_ya...
2004 Oct 16
1
FLAC Process_single... read:write ratio ?
I'm just trying to wrap the flac decoder into a push model class... as i'm having a few threading problems in corner cases. One thing i need to fnid out is... if i call process_single() and let the read callback give the decoder exactly one packet/frame. Is the write_callback garaunteed to only be fired once ? Also one other thing... this where is always crashes... Line 374 in bitbuffer.c, at bit_buffer_clear(...) the state is ABORTED, and blurbs and bits are both ~2^32 and it tries to do a memset. I know the issue is primarily a threading one... is it normal for th...
2016 Jul 10
1
[PATCH] set decoding status if write callback failed.
Open src/flac/decode.c, find write_callback() function and add return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; to the beginning of the function. Decoding will fail with the following message: test.flac: ERROR while decoding data state = FLAC__STREAM_DECODER_READ_FRAME As you can see, decoder state isn't quite corre...
2006 Jun 19
0
Assistance with an encoding plugin
...me oddly high pitched audio with lots of >noise (although the music IS somewhat recognizable). > >#include <FLAC/stream_encoder.h> > >FLAC__StreamEncoder *encoder; >FILE *output_file_descriptor; > >encoder = FLAC__stream_encoder_new(); > >FLAC__stream_encoder_set_write_callback(plugin->encoder, write_callback); >FLAC__stream_encoder_set_metadata_callback(plugin->encoder, >metadata_callback); >FLAC__stream_encoder_set_client_data(plugin->encoder, >output_file_descriptor); >FLAC__stream_encoder_init(plugin->encoder); > >while(/* audio data l...
2013 Apr 05
1
flac 1.3.0pre3 pre-release
...and something I have noted to fix in the release after the one I'm working on. Basically is a name clash between a local variable named 'index' and a function in <string.h>. Later versions of GCC don't complain about this even with -Wshadow. > > decode.c: In function ?write_callback?: > > decode.c:965:28: warning: cast increases required alignment of target > > type [-Wcast-align] > > decode.c:966:28: warning: cast increases required alignment of target > > type [-Wcast-align] > > decode.c:967:28: warning: cast increases required alignment of ta...
2013 May 24
1
FLAC for Android: warning: cast increases required alignment of target type
...t when building for Android: android-make | grep warn md5.c: In function 'format_input_': md5.c:282:25: warning: cast increases required alignment of target type [-Wcast-align] md5.c:288:24: warning: cast increases required alignment of target type [-Wcast-align] decode.c: In function 'write_callback': decode.c:970:28: warning: cast increases required alignment of target type [-Wcast-align] decode.c:971:28: warning: cast increases required alignment of target type [-Wcast-align] decode.c:972:28: warning: cast increases required alignment of target type [-Wcast-align] decode.c:973:28: warnin...
2004 Sep 10
2
Using libFLAC++
...ust want to get a feel for programming with the flac api). I've inherited from FLAC::Decoder:File, and am now implementing a "::Play" function, that will eventually take a file name as a parameter and play it. I've stub-implemented all the required functions (meta,error, and write_callback). However, when I do the following, it prints 7, which appears to be FLAC__FILE_DECODER_INVALID_CALLBACK, meaning I haven't set up one of the callbacks that I need to. bool FlacDecoder::play(const char *filename) { FLAC__FileDecoderState fstate; set_filename(filename); fstat...
2016 Nov 09
0
[PATCH v2 2/6] New API: yara_load
...rpc/xdr.h> +#include <rpc/types.h> +#include <sys/types.h> +#include <sys/stat.h> + +#include "daemon.h" +#include "actions.h" +#include "optgroups.h" +#include "guestfs_protocol.h" + +#ifdef HAVE_YARA + +#include <yara.h> + +struct write_callback_data { + int fd; + uint64_t written; +}; + +/* Yara compiled rules. */ +static YR_RULES *rules = NULL; +static bool initialized = false; + +static int upload_rules_file (char *); +static int compile_rules_file (const char *); +static int write_callback (void *, const void *, size_t); +static void...
2014 Mar 08
0
16 bits FLAC file data to 32 bit float buffer for CPU processing
...fer values of sine wave, instead of decoded FLAC file > data, and it also works without problems; now I try different approaches to > convert FLAC 16 bits sound data to 32 bits float CPU buffer, but they give > noise or sound with artefacts. I use Stream Decoder from FLAC C API and my > write_callback is as follows : > I've used code like the following to convert decoded FLAC to normalized floating point audio in the interval [-1,1): float scaleFactor = (1L << ((((frame->header.bits_per_sample + 7) / 8) * 8) - 1)); for(unsigned channel = 0; channel < frame->header.channel...