[FFmpeg-devel] [RFC] SDP Generation
Wed Jun 20 10:48:06 CEST 2007
Michael Niedermayer wrote:
>>> is the dependancy on ByteIOContext really needed? what is its advantage?
>> It's a way to address the code quadruplication you noticed in my
>> previous version. I could move the buffer size checks in an
>> "sdp_print()" function, or use ByteIOContext. I have no problems in
>> using another solution.
> well id like to avoid dependancies if possible, that is IMHO the most
> standard stuff should be used if you can, that is if the iso c functions
> are enough they should be used and no dynamic ByteIOContext url_fprintf()
Ok, I'll update my other version of the SDP generator, which only uses
snprintf, and post it.
>>> theres no need to do 4 calls
>> I did this to have a printf per SDP line (it looks more readable to me),
>> but I can switch to a single call, if needed.
> foo_fprintf(buff, "v=%d\r\n"
> "o=- %d %d IN IPV4 %s\r\n"
> "t=%d %d\r\n"
> , s->sdp_version
> , s->id, s->version, s->src_addr
> , s->start_time, s->end_time
> , s->name);
> doesnt look worse IMHO
Well, here we are in the field of subjective opinions... ;-)
As I said, I have no problems with using on one printf; I'll update the
patch in this way.
>> I'll look at this again, and try to support the "many avformats with
>> many streams" case (but first I have to understand in which case a user
>> might want to use it :)
> you dont have to support that, i just like you to merge the 2 for loops
> somehow if possible and
> for all avformat contest
> for all streams in the current context
> seemed like a natural way to do it but maybe iam missing some complexities
> this would cause
Well, the loop are doing slightly different things, but I'll try to
More information about the ffmpeg-devel