]> git.pld-linux.org Git - packages/ffmpeg.git/blob - imagewidth.patch
- release 2
[packages/ffmpeg.git] / imagewidth.patch
1 http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-July/072472.html
2
3 --- ffmpeg-0.5/vhook/imlib2.c~  2009-07-16 13:32:19.000000000 +0300
4 +++ ffmpeg-0.5/vhook/imlib2.c   2009-07-16 13:34:17.095314527 +0300
5 @@ -85,12 +85,12 @@
6      AVEvalExpr *eval_r, *eval_g, *eval_b, *eval_a;
7      char *expr_R, *expr_G, *expr_B, *expr_A;
8      int eval_colors;
9 -    double x, y;
10 +    double x, y, X, Y;
11      char *fileImage;
12      struct CachedImage *cache;
13      Imlib_Image imageOverlaid;
14 -    AVEvalExpr *eval_x, *eval_y;
15 -    char *expr_x, *expr_y;
16 +    AVEvalExpr *eval_x, *eval_y, *eval_X, *eval_Y;
17 +    char *expr_x, *expr_y, *expr_X, *expr_Y;
18      int frame_number;
19      int imageOverlaid_width, imageOverlaid_height;
20  
21 @@ -123,6 +123,8 @@
22          }
23          ff_eval_free(ci->eval_x);
24          ff_eval_free(ci->eval_y);
25 +        ff_eval_free(ci->eval_X);
26 +        ff_eval_free(ci->eval_Y);
27          ff_eval_free(ci->eval_r);
28          ff_eval_free(ci->eval_g);
29          ff_eval_free(ci->eval_b);
30 @@ -130,6 +132,8 @@
31  
32          av_free(ci->expr_x);
33          av_free(ci->expr_y);
34 +        av_free(ci->expr_X);
35 +        av_free(ci->expr_Y);
36          av_free(ci->expr_R);
37          av_free(ci->expr_G);
38          av_free(ci->expr_B);
39 @@ -157,8 +161,12 @@
40  
41      ci->x = 0.0;
42      ci->y = 0.0;
43 +    ci->X = 0.0;
44 +    ci->Y = 0.0;
45      ci->expr_x = "0.0";
46      ci->expr_y = "0.0";
47 +    ci->expr_X = "0.0";
48 +    ci->expr_Y = "0.0";
49  
50      optind = 0;
51  
52 @@ -173,7 +181,7 @@
53          imlib_add_path_to_font_path(fp);
54  
55  
56 -    while ((c = getopt(argc, argv, "R:G:B:A:C:c:f:F:t:x:y:i:")) > 0) {
57 +    while ((c = getopt(argc, argv, "R:G:B:A:C:c:f:F:t:x:y:i:X:Y:")) > 0) {
58          switch (c) {
59              case 'R':
60                  ci->expr_R = av_strdup(optarg);
61 @@ -211,6 +219,12 @@
62              case 'y':
63                  ci->expr_y = av_strdup(optarg);
64                  break;
65 +            case 'X':
66 +                ci->expr_X = av_strdup(optarg);
67 +                break;
68 +            case 'Y':
69 +                ci->expr_Y = av_strdup(optarg);
70 +                break;
71              case 'i':
72                  ci->fileImage = av_strdup(optarg);
73                  break;
74 @@ -316,6 +330,16 @@
75          ci->imageOverlaid_height = imlib_image_get_height();
76      }
77  
78 +    if (!(ci->eval_X = ff_parse(ci->expr_X, const_names, NULL, NULL, NULL, NULL, &error))){
79 +        av_log(NULL, AV_LOG_ERROR, "Couldn't parse X expression '%s': %s\n", ci->expr_X, error);
80 +        return -1;
81 +    }
82 +
83 +    if (!(ci->eval_Y = ff_parse(ci->expr_Y, const_names, NULL, NULL, NULL, NULL, &error))){
84 +        av_log(NULL, AV_LOG_ERROR, "Couldn't parse Y expression '%s': %s\n", ci->expr_Y, error);
85 +        return -1;
86 +    }
87 +
88      if (!(ci->eval_x = ff_parse(ci->expr_x, const_names, NULL, NULL, NULL, NULL, &error))){
89          av_log(NULL, AV_LOG_ERROR, "Couldn't parse x expression '%s': %s\n", ci->expr_x, error);
90          return -1;
91 @@ -438,6 +462,8 @@
92          ci->x = ff_parse_eval(ci->eval_x, const_values, ci);
93          ci->y = ff_parse_eval(ci->eval_y, const_values, ci);
94          y = ci->y;
95 +        ci->X = ff_parse_eval(ci->eval_X, const_values, ci);
96 +        ci->Y = ff_parse_eval(ci->eval_Y, const_values, ci);
97  
98          if (ci->eval_a) {
99              ci->a = ff_parse_eval(ci->eval_a, const_values, ci);
100 @@ -464,10 +490,12 @@
101          }
102  
103          if (ci->imageOverlaid) {
104 +                       if (ci->X == 0) ci->X = ci->imageOverlaid_width;
105 +                       if (ci->Y == 0) ci->Y = ci->imageOverlaid_height;
106              imlib_context_set_image(image);
107              imlib_blend_image_onto_image(ci->imageOverlaid, 0,
108                  0, 0, ci->imageOverlaid_width, ci->imageOverlaid_height,
109 -                ci->x, ci->y, ci->imageOverlaid_width, ci->imageOverlaid_height);
110 +                ci->x, ci->y, ci->X, ci->Y);
111          }
112  
113      }
This page took 0.081103 seconds and 3 git commands to generate.