On Mon, Nov 26, 2018 at 04:19:20PM +0100, Martin Vignali wrote: > > > + > > > + switch (pict->colorspace) { > > > + case AVCOL_SPC_BT709: > > > + case AVCOL_SPC_UNSPECIFIED: > > > + case AVCOL_SPC_SMPTE170M: > > > + case AVCOL_SPC_BT2020_NCL: > > > + colorspace = pict->colorspace; > > > + break; > > > + default: > > > + av_log(avctx, AV_LOG_DEBUG, > > > + "Frame colorspace %d are not supported in prores frame. > > Set prores frame value to unspecified\n", pict->colorspace); > > > + break; > > > + } > > > + *buf++ = color_primaries; > > > + *buf++ = color_trc; > > > + *buf++ = colorspace; > > > > we maybe should write a generic function that takes a list of supported > > types > > and the undefined one and then does the check, debug print and all that > > that could be used in other encoders too. > > just an idea, that can be done later > > > > the patch > > LGTM > > > > > Don't know for others codecs, but this check can also probably be add when > setting AvFrame color properties in prores dec. > > As a generic function, do you mean something like this : > (If yes, where do you think it's better to declare this func) > (untested, and not sure, what is the right log level for this (debug or > warning ?)) > ---------------- > int ff_check_value(AVCodecContext *avctx, const char * val_name, int val,
ff_int_is_in_list() or something similar would be more descriptive and specific this one doesnt suggest though that the return is teh value or default so its still maybe not the best identifer > int * array_valid_values, int nb_values, int > default_value) { nb_values could be replaced by a -1 or so terminated array, making the API slightly more robust AVCodecContext* should be void * but yes this is what i had in mind If it has uses in multiple libs then it has to be in a lib that all depend on. This would dictate in which lib to put it thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship: All citizens are under surveillance, all their steps and actions recorded, for the politicians to enforce control. Democracy: All politicians are under surveillance, all their steps and actions recorded, for the citizens to enforce control.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel