Thank you ... now, everything compiles... I've got to modify a little bit. VS2010 complains the return value is "uint8_t *" rather than "char *" --- for uint8_t *ret;
return ret; to > return (char *)ret; And some other trivial staffs... Thanks Ronald !! Best Regards Pei On Wed, Aug 8, 2012 at 10:49 PM, JIA Pei <[email protected]> wrote: > > Wow, Ronald: > > Thanks !!!! But this seems to be the part that cannot be compiled/built > successfully under Visual Studio, right? > Alright... Thanks!! I'll manually modify it.... > > > Thank you !!! > > > /** >> * Define a function for building a string containing a list of >> * allowed formats, >> */ >> #define DEF_CHOOSE_FORMAT(type, var, supported_list, none, get_name, >> separator) \ >> static char *choose_ ## var ## s(OutputStream *ost) >> \ >> { >> \ >> if (ost->st->codec->var != none) { >> \ >> get_name(ost->st->codec->var); >> \ >> return av_strdup(name); >> \ >> } else if (ost->enc->supported_list) { >> \ >> const type *p; >> \ >> AVIOContext *s = NULL; >> \ >> uint8_t *ret; >> \ >> int len; >> \ >> >> \ >> if (avio_open_dyn_buf(&s) < 0) >> \ >> exit_program(1); >> \ >> >> \ >> for (p = ost->enc->supported_list; *p != none; p++) { >> \ >> get_name(*p); >> \ >> avio_printf(s, "%s" separator, name); >> \ >> } >> \ >> len = avio_close_dyn_buf(s, &ret); >> \ >> ret[len - 1] = 0; >> \ >> return ret; >> \ >> } else >> \ >> return NULL; >> \ >> } >> #define GET_PIX_FMT_NAME(pix_fmt)\ >> const char *name = av_get_pix_fmt_name(pix_fmt); >> DEF_CHOOSE_FORMAT(enum PixelFormat, pix_fmt, pix_fmts, PIX_FMT_NONE, >> GET_PIX_FMT_NAME, ":") >> #define GET_SAMPLE_FMT_NAME(sample_fmt)\ >> const char *name = av_get_sample_fmt_name(sample_fmt) >> DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts, >> AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME, ",") >> #define GET_SAMPLE_RATE_NAME(rate)\ >> char name[16];\ >> snprintf(name, sizeof(name), "%d", rate); >> DEF_CHOOSE_FORMAT(int, sample_rate, supported_samplerates, 0, >> GET_SAMPLE_RATE_NAME, ",") >> #define GET_CH_LAYOUT_NAME(ch_layout)\ >> char name[16];\ >> snprintf(name, sizeof(name), "0x%"PRIx64, ch_layout); >> DEF_CHOOSE_FORMAT(uint64_t, channel_layout, channel_layouts, 0, >> GET_CH_LAYOUT_NAME, ",") > > > > > > > > > On Wed, Aug 8, 2012 at 9:04 PM, Ronald S. Bultje <[email protected]>wrote: > >> Hi, >> >> On Wed, Aug 8, 2012 at 6:56 PM, JIA Pei <[email protected]> wrote: >> > >> > Hi, all: >> > >> > I'm trying to build avconv.c ... However, I can't find a place that >> defines >> > the following 4 functions: >> >> >> >> choose_pix_fmts() >> >> choose_sample_fmts() >> >> choose_sample_rates() >> >> choose_channel_layouts() >> >> See DEF_CHOOSE_FORMAT(), line 460. >> >> Ronald >> _______________________________________________ >> libav-devel mailing list >> [email protected] >> https://lists.libav.org/mailman/listinfo/libav-devel >> > > > > -- > > Pei JIA > > Email: [email protected] > cell: +1 604-362-5816 > > Welcome to Vision Open > http://www.visionopen.com > -- Pei JIA Email: [email protected] cell: +1 604-362-5816 Welcome to Vision Open http://www.visionopen.com
_______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
