• R/O
  • HTTP
  • SSH
  • HTTPS

libav_saccubus: コミット

さきゅばす/いんきゅばす用libav(実験的)


コミットメタ情報

リビジョン828e0bcb869f0b97bc91105686d37ec855c62d6a (tree)
日時2011-09-12 00:30:04
作者Anton Khirnov <anton@khir...>
コミッターAnton Khirnov

ログメッセージ

avconv: move top_field_first to options context.

変更サマリ

差分

--- a/avconv.c
+++ b/avconv.c
@@ -104,7 +104,6 @@ static int nb_streamid_map = 0;
104104 static int video_discard = 0;
105105 static int same_quant = 0;
106106 static int do_deinterlace = 0;
107-static int top_field_first = -1;
108107 static int intra_dc_precision = 8;
109108 static int qp_hist = 0;
110109 #if CONFIG_AVFILTER
@@ -203,6 +202,7 @@ typedef struct OutputStream {
203202 int resample_pix_fmt;
204203 AVRational frame_rate;
205204 int force_fps;
205+ int top_field_first;
206206
207207 float frame_aspect_ratio;
208208
@@ -326,6 +326,8 @@ typedef struct OptionsContext {
326326 int nb_intra_matrices;
327327 SpecifierOpt *inter_matrices;
328328 int nb_inter_matrices;
329+ SpecifierOpt *top_field_first;
330+ int nb_top_field_first;
329331 } OptionsContext;
330332
331333 #define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
@@ -1205,10 +1207,10 @@ static void do_video_out(AVFormatContext *s,
12051207 settings */
12061208 big_picture.interlaced_frame = in_picture->interlaced_frame;
12071209 if (ost->st->codec->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)) {
1208- if(top_field_first == -1)
1210+ if (ost->top_field_first == -1)
12091211 big_picture.top_field_first = in_picture->top_field_first;
12101212 else
1211- big_picture.top_field_first = top_field_first;
1213+ big_picture.top_field_first = !!ost->top_field_first;
12121214 }
12131215
12141216 /* handles same_quant here. This is not correct because it may
@@ -2532,12 +2534,6 @@ static double parse_frame_aspect_ratio(const char *arg)
25322534 return ar;
25332535 }
25342536
2535-static int opt_top_field_first(const char *opt, const char *arg)
2536-{
2537- top_field_first = parse_number_or_die(opt, arg, OPT_INT, 0, 1);
2538- return 0;
2539-}
2540-
25412537 static int opt_audio_codec(OptionsContext *o, const char *opt, const char *arg)
25422538 {
25432539 return parse_option(o, "codec:a", arg, options);
@@ -3045,7 +3041,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
30453041 char *forced_key_frames = NULL, *frame_rate = NULL, *frame_size = NULL;
30463042 char *frame_aspect_ratio = NULL, *frame_pix_fmt = NULL;
30473043 char *intra_matrix = NULL, *inter_matrix = NULL;
3048- int i, force_fps = 0;
3044+ int i, force_fps = 0, top_field_first = -1;
30493045
30503046 MATCH_PER_STREAM_OPT(frame_rates, str, frame_rate, oc, st);
30513047 if (frame_rate && av_parse_video_rate(&ost->frame_rate, frame_rate) < 0) {
@@ -3131,6 +3127,9 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
31313127
31323128 MATCH_PER_STREAM_OPT(force_fps, i, force_fps, oc, st);
31333129 ost->force_fps = force_fps;
3130+
3131+ MATCH_PER_STREAM_OPT(top_field_first, i, top_field_first, oc, st);
3132+ ost->top_field_first = top_field_first;
31343133 }
31353134
31363135 return ost;
@@ -3970,7 +3969,7 @@ static const OptionDef options[] = {
39703969 #endif
39713970 { "intra_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_STRING | OPT_SPEC, {.off = OFFSET(intra_matrices)}, "specify intra matrix coeffs", "matrix" },
39723971 { "inter_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_STRING | OPT_SPEC, {.off = OFFSET(inter_matrices)}, "specify inter matrix coeffs", "matrix" },
3973- { "top", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_top_field_first}, "top=1/bottom=0/auto=-1 field first", "" },
3972+ { "top", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_INT| OPT_SPEC, {.off = OFFSET(top_field_first)}, "top=1/bottom=0/auto=-1 field first", "" },
39743973 { "dc", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&intra_dc_precision}, "intra_dc_precision", "precision" },
39753974 { "vtag", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_FUNC2, {(void*)opt_video_tag}, "force video tag/fourcc", "fourcc/tag" },
39763975 { "qphist", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, { (void *)&qp_hist }, "show QP histogram" },
旧リポジトリブラウザで表示