- if( convert_vframe_picture(&vframe, op, ofmt, ow, oh) ) return 1;
- return 0;
+ if( !convert_vframe_picture(&vframe, op, ofmt, ow, oh) ) return 1;
+ return -1;
+}
+
+int FFVideoConvert::transfer_pixfmt(VFrame *frame,
+ AVFrame *ofp, PixelFormat ofmt, int ow, int oh)
+{
+ int ret = convert_pixfmt(frame, (AVPicture *)ofp, ofmt, ow, oh);
+ if( ret > 0 ) {
+ BC_Hash *hp = frame->get_params();
+ AVDictionary **dict = avpriv_frame_get_metadatap(ofp);
+ //av_dict_free(dict);
+ for( int i=0; i<hp->size(); ++i ) {
+ char *key = hp->get_key(i), *val = hp->get_value(i);
+ av_dict_set(dict, key, val, 0);
+ }
+ }
+ return ret;