Re: [bugle-users] src/filters/screenshot.c does not compile on Ubuntu 11.10. Here is a fix.
Status: Inactive
Brought to you by:
bmerry
|
From: Bruce M. <bm...@gm...> - 2011-10-19 06:55:11
|
Thanks! I've just installed 11.10 on a machine but hadn't gotten around to trying bugle on it yet. I'll definitely get this applied soon, although sadly I don't seem to find as much time to work on bugle as I used to. Bruce On 19 October 2011 05:18, _ _ <fbe...@gm...> wrote: > Hello, > > src/filters/screenshot.c does not compile on Ubuntu 11.10 because it uses a > recent version of libavformat where PKT_FLAG_KEY has been replaced by > AV_PKT_FLAG_KEY and CODEC_TYPE_VIDEO by AVMEDIA_TYPE_VIDEO. > > This is happening both for the release 0.0.20101121 and svn trunk. > > > Searching the web for the error message: 'CODEC_TYPE_VIDEO’ undeclared, I > found that using "#if LIBAVFORMAT_BUILD < 4621" fix the compilation error: > > > Here is a diff againt the svn trunk. There are 3 occurrences of the fix in > this file. > > Index: src/filters/screenshot.c > =================================================================== > --- src/filters/screenshot.c (revision 1031) > +++ src/filters/screenshot.c (working copy) > @@ -267,7 +267,11 @@ > if (!codec) codec = avcodec_find_encoder(CODEC_ID_HUFFYUV); > if (!codec) return BUGLE_FALSE; > c = video_stream->codec; > +#if LIBAVFORMAT_BUILD < 4621 > c->codec_type = CODEC_TYPE_VIDEO; > +#else > + c->codec_type = AVMEDIA_TYPE_VIDEO; > +#endif > c->codec_id = codec->id; > if (c->codec_id == CODEC_ID_HUFFYUV) c->pix_fmt = PIX_FMT_YUV422P; > else c->pix_fmt = PIX_FMT_YUV420P; > @@ -313,7 +317,11 @@ > av_init_packet(&pkt); > pkt.pts = c->coded_frame->pts; > if (c->coded_frame->key_frame) > +#if LIBAVFORMAT_BUILD < 4621 > pkt.flags |= PKT_FLAG_KEY; > +#else > + pkt.flags |= AV_PKT_FLAG_KEY; > +#endif > pkt.stream_index = video_stream->index; > pkt.data = video_buffer; > pkt.size = out_size; > @@ -579,7 +587,11 @@ > av_init_packet(&pkt); > pkt.pts = c->coded_frame->pts; > if (c->coded_frame->key_frame) > +#if LIBAVFORMAT_BUILD < 4621 > pkt.flags |= PKT_FLAG_KEY; > +#else > + pkt.flags |= AV_PKT_FLAG_KEY; > +#endif > pkt.stream_index = video_stream->index; > pkt.data = video_buffer; > pkt.size = out_size; > > > FYI, here are the ubuntu 11.10 packages required to build bugle: > > libswscale, libswscale-dev, libavformat libavformat-dev, libavcodec-dev, > libavcodec53 version=4:0.7.2-1ubuntu1 > > libgtkglext1 and libgtkglext1-dev version=1.2.0-1.2fakesync1 > libglew1.5 and libglew1.5-dev version=1.5.7.is.1.5.2-1ubuntu4 > freeglut3 and freeglut3-dev version=2.6.0-1ubuntu2 > > > Regards, > > -- > François Bertel > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2d-oct > _______________________________________________ > bugle-users mailing list > bug...@li... > https://lists.sourceforge.net/lists/listinfo/bugle-users > > -- Dr Bruce Merry bmerry <@> gmail <.> com http://www.brucemerry.org.za/ http://blog.brucemerry.org.za/ |