1 |
aballier 12/03/22 01:51:23 |
2 |
|
3 |
Modified: series |
4 |
Added: 110_all_switcher.patch |
5 |
Log: |
6 |
fix switcher build, patch from upstream based on the one from Richard Grenville <pyxlcy@×××××.com> in bug #409001 |
7 |
|
8 |
Revision Changes Path |
9 |
1.2 src/patchsets/vlc/2.0.1/series |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/vlc/2.0.1/series?rev=1.2&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/vlc/2.0.1/series?rev=1.2&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/vlc/2.0.1/series?r1=1.1&r2=1.2 |
14 |
|
15 |
Index: series |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo/src/patchsets/vlc/2.0.1/series,v |
18 |
retrieving revision 1.1 |
19 |
retrieving revision 1.2 |
20 |
diff -u -r1.1 -r1.2 |
21 |
--- series 20 Mar 2012 09:08:19 -0000 1.1 |
22 |
+++ series 22 Mar 2012 01:51:23 -0000 1.2 |
23 |
@@ -1,4 +1,5 @@ |
24 |
010_all_freetype-font.patch |
25 |
020_all_check_headers_regexps.patch |
26 |
100_all_glx_swap_interval.patch |
27 |
+110_all_switcher.patch |
28 |
300_all_pic.patch |
29 |
|
30 |
|
31 |
|
32 |
1.1 src/patchsets/vlc/2.0.1/110_all_switcher.patch |
33 |
|
34 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/vlc/2.0.1/110_all_switcher.patch?rev=1.1&view=markup |
35 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/vlc/2.0.1/110_all_switcher.patch?rev=1.1&content-type=text/plain |
36 |
|
37 |
Index: 110_all_switcher.patch |
38 |
=================================================================== |
39 |
commit 66da497b2046f3835321bc9d83170285267e106a |
40 |
Author: Rafaël Carré <funman@××××××××.org> |
41 |
Date: Wed Mar 21 12:54:25 2012 -0400 |
42 |
|
43 |
switcher: convert to lavc 54 API |
44 |
|
45 |
based on patch by Richard Grenville <pyxlcy@×××××.com> |
46 |
|
47 |
Index: vlc-2.0.1/modules/stream_out/switcher.c |
48 |
=================================================================== |
49 |
--- vlc-2.0.1.orig/modules/stream_out/switcher.c |
50 |
+++ vlc-2.0.1/modules/stream_out/switcher.c |
51 |
@@ -292,7 +292,9 @@ static int Open( vlc_object_t *p_this ) |
52 |
p_stream->pf_send = Send; |
53 |
p_stream->p_sys = p_sys; |
54 |
|
55 |
+#if LIBAVCODEC_VERSION_MAJOR < 54 |
56 |
avcodec_init(); |
57 |
+#endif |
58 |
avcodec_register_all(); |
59 |
|
60 |
return VLC_SUCCESS; |
61 |
@@ -355,7 +357,11 @@ static sout_stream_id_t *Add( sout_strea |
62 |
return NULL; |
63 |
} |
64 |
|
65 |
+#if LIBAVCODEC_VERSION_MAJOR < 54 |
66 |
id->ff_enc_c = avcodec_alloc_context(); |
67 |
+#else |
68 |
+ id->ff_enc_c = avcodec_alloc_context3( id->ff_enc ); |
69 |
+#endif |
70 |
|
71 |
/* Set CPU capabilities */ |
72 |
unsigned i_cpu = vlc_CPU(); |
73 |
@@ -388,7 +394,11 @@ static sout_stream_id_t *Add( sout_strea |
74 |
id->ff_enc_c->bit_rate = p_fmt->i_bitrate; |
75 |
|
76 |
vlc_avcodec_lock(); |
77 |
+#if LIBAVCODEC_VERSION_MAJOR >= 54 |
78 |
+ if( avcodec_open2( id->ff_enc_c, id->ff_enc, NULL /* options */ ) ) |
79 |
+#else |
80 |
if( avcodec_open( id->ff_enc_c, id->ff_enc ) ) |
81 |
+#endif |
82 |
{ |
83 |
vlc_avcodec_unlock(); |
84 |
msg_Err( p_stream, "cannot open encoder" ); |
85 |
@@ -748,7 +758,11 @@ static mtime_t VideoCommand( sout_stream |
86 |
return 0; |
87 |
} |
88 |
|
89 |
+#if LIBAVCODEC_VERSION_MAJOR < 54 |
90 |
id->ff_enc_c = avcodec_alloc_context(); |
91 |
+#else |
92 |
+ id->ff_enc_c = avcodec_alloc_context3( id->ff_enc ); |
93 |
+#endif |
94 |
|
95 |
/* Set CPU capabilities */ |
96 |
unsigned i_cpu = vlc_CPU(); |
97 |
@@ -803,7 +817,11 @@ static mtime_t VideoCommand( sout_stream |
98 |
id->ff_enc_c->pix_fmt = PIX_FMT_YUV420P; |
99 |
|
100 |
vlc_avcodec_lock(); |
101 |
+#if LIBAVCODEC_VERSION_MAJOR >= 54 |
102 |
+ if( avcodec_open2( id->ff_enc_c, id->ff_enc, NULL /* options */ ) ) |
103 |
+#else |
104 |
if( avcodec_open( id->ff_enc_c, id->ff_enc ) ) |
105 |
+#endif |
106 |
{ |
107 |
vlc_avcodec_unlock(); |
108 |
msg_Err( p_stream, "cannot open encoder" ); |
109 |
@@ -844,7 +862,7 @@ static block_t *VideoGetBuffer( sout_str |
110 |
|
111 |
if ( id->i_nb_pred >= p_sys->i_gop ) |
112 |
{ |
113 |
- id->p_frame->pict_type = FF_I_TYPE; |
114 |
+ id->p_frame->pict_type = AV_PICTURE_TYPE_I; |
115 |
#if 0 |
116 |
id->p_frame->me_threshold = 0; |
117 |
id->p_frame->mb_threshold = 0; |
118 |
@@ -853,7 +871,7 @@ static block_t *VideoGetBuffer( sout_str |
119 |
} |
120 |
else |
121 |
{ |
122 |
- id->p_frame->pict_type = FF_P_TYPE; |
123 |
+ id->p_frame->pict_type = AV_PICTURE_TYPE_P; |
124 |
#if 0 |
125 |
if ( id->p_frame->mb_type != NULL ) |
126 |
{ |
127 |
@@ -873,7 +891,7 @@ static block_t *VideoGetBuffer( sout_str |
128 |
|
129 |
#if 0 |
130 |
if ( id->p_frame->mb_type == NULL |
131 |
- && id->ff_enc_c->coded_frame->pict_type != FF_I_TYPE ) |
132 |
+ && id->ff_enc_c->coded_frame->pict_type != AV_PICTURE_TYPE_I ) |
133 |
{ |
134 |
int mb_width = (id->ff_enc_c->width + 15) / 16; |
135 |
int mb_height = (id->ff_enc_c->height + 15) / 16; |
136 |
@@ -926,13 +944,13 @@ static block_t *VideoGetBuffer( sout_str |
137 |
|
138 |
switch ( id->ff_enc_c->coded_frame->pict_type ) |
139 |
{ |
140 |
- case FF_I_TYPE: |
141 |
+ case AV_PICTURE_TYPE_I: |
142 |
p_out->i_flags |= BLOCK_FLAG_TYPE_I; |
143 |
break; |
144 |
- case FF_P_TYPE: |
145 |
+ case AV_PICTURE_TYPE_P: |
146 |
p_out->i_flags |= BLOCK_FLAG_TYPE_P; |
147 |
break; |
148 |
- case FF_B_TYPE: |
149 |
+ case AV_PICTURE_TYPE_B: |
150 |
p_out->i_flags |= BLOCK_FLAG_TYPE_B; |
151 |
break; |
152 |
default: |