Hi Jean-Marc, randoms, I've been playing with the 1.1.x api, more specifically modifying code to conditionally build against the 1.0.x api or the 1.1.x api. Code written for 1.0.x builds, with a few warnings, against 1.1.x. The major API change is of course that the type of PCM buffers has changed from float to int. This causes a few warnings related to speex_encode() and speex_decode() etc., but otherwise, existing code continues to build. The problem is of course that application binaries built against speex 1.0.x will load against speex 1.1.x. The encode and decode functions have the same number and size arguments, so everything will load and execute just the same at runtime. An application will run, libspeex will try to do stuff, but the two will disagree about the types and sizes of the buffers. The expected behaviour might be a 1/4 second of random noise, followed by a segfault :) Of course, a user will find this out when they upgrade (say) kphone, and suddenly xine starts crashing, for example. So, the obvious suggestion is to have different function names for the functions that take shorts instead of floats. It's then also possible to maintain backwards compatability, by providing wrapper functions with the same prototype as the functions in 1.0.x. (rillian mentioned this was done for a similar change in libvorbis). These functions could simply return an error when building for an integer-only version of the library. cheers, Conrad. -- now hacking: http://www.annodex.net/software/libfishsound/ mood: my cyborg henchmen will teach your daughter to dance the rhumba, LOL etc. etc. --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
OK, I'll try to do *something* about it. It'll be either "support the 1.0 ABI" or "make sure the link will break". While the former would be nice, I'm not sure I want to really want to force 1.2 to have the same ABI as 1.0.x. More on this when I have some time to think about it. Suggestions are welcome. Jean-Marc Le lun 19/04/2004 à 02:18, Conrad Parker a écrit :> Hi Jean-Marc, randoms, > > I've been playing with the 1.1.x api, more specifically modifying code to > conditionally build against the 1.0.x api or the 1.1.x api. > > Code written for 1.0.x builds, with a few warnings, against 1.1.x. > > The major API change is of course that the type of PCM buffers has changed > from float to int. This causes a few warnings related to speex_encode() > and speex_decode() etc., but otherwise, existing code continues to build. > > The problem is of course that application binaries built against speex 1.0.x > will load against speex 1.1.x. The encode and decode functions have the same > number and size arguments, so everything will load and execute just the same > at runtime. An application will run, libspeex will try to do stuff, but the > two will disagree about the types and sizes of the buffers. The expected > behaviour might be a 1/4 second of random noise, followed by a segfault :) > > Of course, a user will find this out when they upgrade (say) kphone, and > suddenly xine starts crashing, for example. > > So, the obvious suggestion is to have different function names for the > functions that take shorts instead of floats. > > It's then also possible to maintain backwards compatability, by providing > wrapper functions with the same prototype as the functions in 1.0.x. (rillian > mentioned this was done for a similar change in libvorbis). > > These functions could simply return an error when building for an > integer-only version of the library. > > cheers, > > Conrad.-- Jean-Marc Valin http://www.xiph.org/~jm/ LABORIUS Université de Sherbrooke, Québec, Canada -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 190 bytes Desc: Ceci est une partie de message numériquement signée. Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20040419/cd75b617/signature-0001.pgp
On Mon, Apr 19, 2004 at 02:46:44AM -0400, Jean-Marc Valin wrote:> OK, I'll try to do *something* about it. It'll be either "support the > 1.0 ABI" or "make sure the link will break". While the former would be > nice, I'm not sure I want to really want to force 1.2 to have the same > ABI as 1.0.x. More on this when I have some time to think about it. > Suggestions are welcome.I second this; changing the argument type to one of the main functions is a bad idea. It's true that the soname mechanism can take care of this on platforms that support it, but it's just confusing. I'd suggest doing something like we did with vorbis (but in reverse): Add new speex_encode_int() and speex_decode_int() calls that that take the short* argument (or a typedef that's definitely 16 bits). Leave the plain speex_decode() and speex_encode() functions taking floats, and make them a simple wrapper that does the conversion and calls the _int version. That way software written against 1.0.x still works, just with a performance penalty, and the path to upgrade is very clear. If you want to have a completely different api for 1.2, that's fine, but there seem to be only minor changes. In that case it's nicer to maintain compatibility if at all possible. IMO, -r --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Jean-Marc,> OK, I'll try to do *something* about it. It'll be either "support the > 1.0 ABI" or "make sure the link will break". While the former would be > nice, I'm not sure I want to really want to force 1.2 to have the same > ABI as 1.0.x. More on this when I have some time to think about it. > Suggestions are welcome.The obvious way to handle this is to bump up the major revision on the library. LDD should not try to link apps and libs of differing major revisions. Cheers, David --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.