[gst-devel] ffmpeg patch for Solaris
Brian Cameron
Brian.Cameron at sun.com
Fri May 23 10:14:06 CEST 2003
Gstreamer
I'm attaching this patch which makes ffmpeg compile on Solaris with
the Forte compiler. It would be nice if these changes could go back
to the community. I think most of the changes are compiler agnostic.
Sun would like to consider releasing ffmpeg in future releases of
Solaris. However, Sun's Gnome must compile with the Forte compiler.
So I really hope these changes can go in.
Thanks!
Brian
-------------- next part --------------
diff -r -u /home/bc99092/temp/ffmpeg/libavcodec/common.h ./libavcodec/common.h
--- /home/bc99092/temp/ffmpeg/libavcodec/common.h Tue Nov 26 04:29:40 2002
+++ ./libavcodec/common.h Fri May 23 16:44:57 2003
@@ -145,11 +145,23 @@
# else
+#if defined(G_HAVE_GNUC_VARARGS)
+
# ifdef DEBUG
# define dprintf(fmt,args...) printf(fmt, ## args)
# else
# define dprintf(fmt,args...)
# endif
+
+#else
+
+# ifdef DEBUG
+# define dprintf(...) printf(__VA_ARGS__)
+# else
+# define dprintf(...)
+# endif
+
+#endif
# endif /* !CONFIG_WIN32 */
diff -r -u /home/bc99092/temp/ffmpeg/libavcodec/h263.c ./libavcodec/h263.c
--- /home/bc99092/temp/ffmpeg/libavcodec/h263.c Mon Dec 9 00:06:15 2002
+++ ./libavcodec/h263.c Fri May 23 16:32:47 2003
@@ -3891,7 +3891,7 @@
int a= 2<<s->sprite_warping_accuracy;
int rho= 3-s->sprite_warping_accuracy;
int r=16/a;
- const int vop_ref[4][2]= {{0,0}, {s->width,0}, {0, s->height}, {s->width, s->height}}; // only true for rectangle shapes
+ int vop_ref[4][2]= {{0,0}, {s->width,0}, {0, s->height}, {s->width, s->height}}; // only true for rectangle shapes
int d[4][2]={{0,0}, {0,0}, {0,0}, {0,0}};
int sprite_ref[4][2];
int virtual_ref[2][2];
diff -r -u /home/bc99092/temp/ffmpeg/libavcodec/mpegaudiodec.c ./libavcodec/mpegaudiodec.c
--- /home/bc99092/temp/ffmpeg/libavcodec/mpegaudiodec.c Tue Dec 3 19:40:35 2002
+++ ./libavcodec/mpegaudiodec.c Fri May 23 16:32:47 2003
@@ -2286,7 +2286,10 @@
if (s->error_protection)
get_bits(&s->gb, 16);
+#ifdef DEBUG
dprintf("frame %d:\n", s->frame_count);
+#endif
+
switch(s->layer) {
case 1:
nb_frames = mp_decode_layer1(s);
diff -r -u /home/bc99092/temp/ffmpeg/libavformat/asf.c ./libavformat/asf.c
--- /home/bc99092/temp/ffmpeg/libavformat/asf.c Mon Dec 9 12:03:43 2002
+++ ./libavformat/asf.c Fri May 23 16:34:08 2003
@@ -48,7 +48,11 @@
UINT8 v4[8];
} GUID;
+#ifdef __SUNPRO_C
+typedef struct {
+#else
typedef struct __attribute__((packed)) {
+#endif
GUID guid; // generated by client computer
uint64_t file_size; // in bytes
// invalid if broadcasting
diff -r -u /home/bc99092/temp/ffmpeg/libavformat/avienc.c ./libavformat/avienc.c
--- /home/bc99092/temp/ffmpeg/libavformat/avienc.c Mon Dec 9 12:03:43 2002
+++ ./libavformat/avienc.c Fri May 23 16:34:08 2003
@@ -60,18 +60,18 @@
{ CODEC_ID_H263P, MKTAG('H', '2', '6', '3') },
{ CODEC_ID_H263I, MKTAG('I', '2', '6', '3') }, /* intel h263 */
{ CODEC_ID_MJPEG, MKTAG('M', 'J', 'P', 'G') },
- { CODEC_ID_MPEG4, MKTAG('D', 'I', 'V', 'X'), .invalid_asf = 1 },
- { CODEC_ID_MPEG4, MKTAG('d', 'i', 'v', 'x'), .invalid_asf = 1 },
- { CODEC_ID_MPEG4, MKTAG('D', 'X', '5', '0'), .invalid_asf = 1 },
- { CODEC_ID_MPEG4, MKTAG('X', 'V', 'I', 'D'), .invalid_asf = 1 },
- { CODEC_ID_MPEG4, MKTAG('x', 'v', 'i', 'd'), .invalid_asf = 1 },
- { CODEC_ID_MPEG4, MKTAG('m', 'p', '4', 's'), .invalid_asf = 1 },
+ { CODEC_ID_MPEG4, MKTAG('D', 'I', 'V', 'X'), 1 },
+ { CODEC_ID_MPEG4, MKTAG('d', 'i', 'v', 'x'), 1 },
+ { CODEC_ID_MPEG4, MKTAG('D', 'X', '5', '0'), 1 },
+ { CODEC_ID_MPEG4, MKTAG('X', 'V', 'I', 'D'), 1 },
+ { CODEC_ID_MPEG4, MKTAG('x', 'v', 'i', 'd'), 1 },
+ { CODEC_ID_MPEG4, MKTAG('m', 'p', '4', 's'), 1 },
{ CODEC_ID_MPEG4, MKTAG('M', 'P', '4', 'S') },
{ CODEC_ID_MPEG4, MKTAG('M', '4', 'S', '2') },
{ CODEC_ID_MPEG4, MKTAG('m', '4', 's', '2') },
{ CODEC_ID_MPEG4, MKTAG(0x04, 0, 0, 0) }, /* some broken avi use this */
- { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '3'), .invalid_asf = 1 }, /* default signature when using MSMPEG4 */
- { CODEC_ID_MSMPEG4V3, MKTAG('d', 'i', 'v', '3'), .invalid_asf = 1 },
+ { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '3'), 1 }, /* default signature when using MSMPEG4 */
+ { CODEC_ID_MSMPEG4V3, MKTAG('d', 'i', 'v', '3'), 1 },
{ CODEC_ID_MSMPEG4V3, MKTAG('M', 'P', '4', '3') },
{ CODEC_ID_MSMPEG4V2, MKTAG('M', 'P', '4', '2') },
{ CODEC_ID_MSMPEG4V1, MKTAG('M', 'P', 'G', '4') },
diff -r -u /home/bc99092/temp/ffmpeg/libavformat/dv.c ./libavformat/dv.c
--- /home/bc99092/temp/ffmpeg/libavformat/dv.c Mon Nov 11 09:05:57 2002
+++ ./libavformat/dv.c Fri May 23 16:34:08 2003
@@ -89,7 +89,8 @@
dv_read_header,
dv_read_packet,
dv_read_close,
- .extensions = "dv",
+ NULL,
+ "dv",
};
#if 0
diff -r -u /home/bc99092/temp/ffmpeg/libavformat/img.c ./libavformat/img.c
--- /home/bc99092/temp/ffmpeg/libavformat/img.c Wed Dec 11 03:18:47 2002
+++ ./libavformat/img.c Fri May 23 16:34:08 2003
@@ -750,7 +750,7 @@
img_read_close,
NULL,
AVFMT_NOFILE | AVFMT_NEEDNUMBER,
- .extensions = "pgm",
+ "pgm",
};
static AVOutputFormat pgm_oformat = {
@@ -803,7 +803,7 @@
img_read_close,
NULL,
AVFMT_NOFILE | AVFMT_NEEDNUMBER | AVFMT_RGB24,
- .extensions = "ppm",
+ "ppm",
};
static AVOutputFormat ppm_oformat = {
@@ -830,7 +830,7 @@
img_read_close,
NULL,
AVFMT_NOFILE | AVFMT_NEEDNUMBER,
- .extensions = "Y",
+ "Y",
};
static AVOutputFormat imgyuv_oformat = {
@@ -904,7 +904,7 @@
img_read_packet,
img_read_close,
NULL,
- .flags = AVFMT_RGB24,
+ AVFMT_RGB24,
};
static AVOutputFormat ppmpipe_oformat = {
@@ -918,7 +918,8 @@
img_write_header,
img_write_packet,
img_write_trailer,
- .flags = AVFMT_RGB24,
+ NULL,
+ AVFMT_RGB24,
};
diff -r -u /home/bc99092/temp/ffmpeg/libavformat/jpeg.c ./libavformat/jpeg.c
--- /home/bc99092/temp/ffmpeg/libavformat/jpeg.c Wed Dec 4 10:04:03 2002
+++ ./libavformat/jpeg.c Fri May 23 16:34:08 2003
@@ -240,8 +240,8 @@
jpeg_read_packet,
jpeg_read_close,
NULL,
- .flags = AVFMT_NOFILE | AVFMT_NEEDNUMBER,
- .extensions = "jpg,jpeg",
+ AVFMT_NOFILE | AVFMT_NEEDNUMBER,
+ "jpg,jpeg",
};
static AVOutputFormat jpeg_oformat = {
@@ -255,7 +255,7 @@
jpeg_write_header,
jpeg_write_packet,
jpeg_write_trailer,
- .flags = AVFMT_NOFILE | AVFMT_NEEDNUMBER,
+ AVFMT_NOFILE | AVFMT_NEEDNUMBER,
};
int jpeg_init(void)
diff -r -u /home/bc99092/temp/ffmpeg/libavformat/mpeg.c ./libavformat/mpeg.c
--- /home/bc99092/temp/ffmpeg/libavformat/mpeg.c Mon Oct 21 16:57:21 2002
+++ ./libavformat/mpeg.c Fri May 23 16:34:08 2003
@@ -672,7 +672,8 @@
mpegps_read_header,
mpegps_read_packet,
mpegps_read_close,
- .flags = AVFMT_NOHEADER,
+ NULL,
+ AVFMT_NOHEADER,
};
int mpegps_init(void)
diff -r -u /home/bc99092/temp/ffmpeg/libavformat/mpegts.c ./libavformat/mpegts.c
--- /home/bc99092/temp/ffmpeg/libavformat/mpegts.c Mon Oct 7 00:06:06 2002
+++ ./libavformat/mpegts.c Fri May 23 16:34:08 2003
@@ -306,7 +306,8 @@
mpegts_read_header,
mpegts_read_packet,
mpegts_read_close,
- .flags = AVFMT_NOHEADER | AVFMT_SHOW_IDS,
+ NULL,
+ AVFMT_NOHEADER | AVFMT_SHOW_IDS,
};
int mpegts_init(void)
diff -r -u /home/bc99092/temp/ffmpeg/libavformat/raw.c ./libavformat/raw.c
--- /home/bc99092/temp/ffmpeg/libavformat/raw.c Mon Nov 18 17:33:03 2002
+++ ./libavformat/raw.c Fri May 23 16:34:08 2003
@@ -182,7 +182,9 @@
mp3_read_header,
raw_read_packet,
raw_read_close,
- .extensions = "mp2,mp3", /* XXX: use probe */
+ NULL,
+ 0,
+ "mp2,mp3", /* XXX: use probe */
};
AVOutputFormat mp2_oformat = {
@@ -207,8 +209,10 @@
raw_read_header,
raw_read_packet,
raw_read_close,
- .extensions = "ac3",
- .value = CODEC_ID_AC3,
+ NULL,
+ 0,
+ "ac3",
+ CODEC_ID_AC3,
};
AVOutputFormat ac3_oformat = {
@@ -245,8 +249,10 @@
video_read_header,
raw_read_packet,
raw_read_close,
- .extensions = "m4v", //FIXME remove after writing mpeg4_probe
- .value = CODEC_ID_MPEG4,
+ NULL,
+ 0,
+ "m4v", //FIXME remove after writing mpeg4_probe
+ CODEC_ID_MPEG4,
};
AVOutputFormat m4v_oformat = {
@@ -270,7 +276,10 @@
video_read_header,
raw_read_packet,
raw_read_close,
- .value = CODEC_ID_MPEG1VIDEO,
+ NULL,
+ 0,
+ NULL,
+ CODEC_ID_MPEG1VIDEO,
};
AVOutputFormat mpeg1video_oformat = {
@@ -294,8 +303,10 @@
video_read_header,
raw_read_packet,
raw_read_close,
- .extensions = "mjpg,mjpeg",
- .value = CODEC_ID_MJPEG,
+ NULL,
+ 0,
+ "mjpg,mjpeg",
+ CODEC_ID_MJPEG,
};
AVOutputFormat mjpeg_oformat = {
@@ -322,8 +333,10 @@
raw_read_header,\
raw_read_packet,\
raw_read_close,\
- .extensions = ext,\
- .value = codec,\
+ NULL,\
+ 0,\
+ ext,\
+ codec,\
};\
\
AVOutputFormat pcm_ ## name ## _oformat = {\
@@ -423,8 +436,10 @@
raw_read_header,
rawvideo_read_packet,
raw_read_close,
- .extensions = "yuv",
- .value = CODEC_ID_RAWVIDEO,
+ NULL,
+ 0,
+ "yuv",
+ CODEC_ID_RAWVIDEO,
};
AVOutputFormat rawvideo_oformat = {
@@ -462,7 +477,7 @@
raw_write_header,
null_write_packet,
raw_write_trailer,
- .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
+ AVFMT_NOFILE | AVFMT_RAWPICTURE,
};
int raw_init(void)
diff -r -u /home/bc99092/temp/ffmpeg/libavformat/rtp.c ./libavformat/rtp.c
--- /home/bc99092/temp/ffmpeg/libavformat/rtp.c Wed Nov 20 20:53:32 2002
+++ ./libavformat/rtp.c Fri May 23 16:34:08 2003
@@ -663,7 +663,8 @@
rtp_read_header,
rtp_read_packet,
rtp_read_close,
- .flags = AVFMT_NOHEADER,
+ NULL,
+ AVFMT_NOHEADER,
};
AVOutputFormat rtp_mux = {
diff -r -u /home/bc99092/temp/ffmpeg/libavformat/rtsp.c ./libavformat/rtsp.c
--- /home/bc99092/temp/ffmpeg/libavformat/rtsp.c Wed Nov 20 14:54:13 2002
+++ ./libavformat/rtsp.c Fri May 23 16:34:08 2003
@@ -981,7 +981,8 @@
rtsp_read_header,
rtsp_read_packet,
rtsp_read_close,
- .flags = AVFMT_NOFILE,
+ NULL,
+ AVFMT_NOFILE,
};
static int sdp_probe(AVProbeData *p1)
More information about the gstreamer-devel
mailing list