[PATCH] doc/examples/muxing: make compatible with C++
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> --- doc/examples/muxing.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index ad8e027..4e1d72b 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -29,6 +29,11 @@ * @example muxing.c */ +#ifdef __cplusplus + extern "C" { +#endif +#define __STDC_FORMAT_MACROS +#define __STDC_CONSTANT_MACROS #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -40,6 +45,9 @@ #include <libavformat/avformat.h> #include <libswscale/swscale.h> #include <libswresample/swresample.h> +#ifdef __cplusplus + } // extern "C" +#endif static int audio_is_eof, video_is_eof; @@ -63,8 +71,8 @@ static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt) static int write_frame(AVFormatContext *fmt_ctx, const AVRational *time_base, AVStream *st, AVPacket *pkt) { /* rescale output packet timestamp values from codec to stream timebase */ - pkt->pts = av_rescale_q_rnd(pkt->pts, *time_base, st->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); - pkt->dts = av_rescale_q_rnd(pkt->dts, *time_base, st->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); + pkt->pts = av_rescale_q_rnd(pkt->pts, *time_base, st->time_base, (enum AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX)); + pkt->dts = av_rescale_q_rnd(pkt->dts, *time_base, st->time_base, (enum AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX)); pkt->duration = av_rescale_q(pkt->duration, *time_base, st->time_base); pkt->stream_index = st->index; -- 1.7.9.5
On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote:
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> --- doc/examples/muxing.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index ad8e027..4e1d72b 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -29,6 +29,11 @@ * @example muxing.c */
+#ifdef __cplusplus + extern "C" { +#endif
+#define __STDC_FORMAT_MACROS +#define __STDC_CONSTANT_MACROS
I'd move those under the if so people not doing c++ aren't copying this.
#include <stdlib.h> #include <stdio.h> #include <string.h> @@ -40,6 +45,9 @@ #include <libavformat/avformat.h> #include <libswscale/swscale.h> #include <libswresample/swresample.h> +#ifdef __cplusplus + } // extern "C" +#endif
static int audio_is_eof, video_is_eof;
@@ -63,8 +71,8 @@ static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt) static int write_frame(AVFormatContext *fmt_ctx, const AVRational *time_base, AVStream *st, AVPacket *pkt) { /* rescale output packet timestamp values from codec to stream timebase */ - pkt->pts = av_rescale_q_rnd(pkt->pts, *time_base, st->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); - pkt->dts = av_rescale_q_rnd(pkt->dts, *time_base, st->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); + pkt->pts = av_rescale_q_rnd(pkt->pts, *time_base, st->time_base, (enum AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX)); + pkt->dts = av_rescale_q_rnd(pkt->dts, *time_base, st->time_base, (enum AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
wow...
pkt->duration = av_rescale_q(pkt->duration, *time_base, st->time_base); pkt->stream_index = st->index;
I don't think supporting examples compilation with g++ is worth the effort. Actually, I believe it's harmful because people doing C will start copying naive/broken/c++ patterns (are you going to cast malloc() return values too?). I'd better have a warning + link to the FAQ about this stuff in doc/examples/README than cluttering the already complex examples we have with that stuff. And/or maybe a longer explanation for all the problems to expect while building with g++ (_STDC things, av_ts* like macros, random casts, ...) -- Clément B.
On date Thursday 2014-03-13 23:10:40 +0100, Clément Bœsch encoded:
On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: [...] I don't think supporting examples compilation with g++ is worth the effort. Actually, I believe it's harmful because people doing C will start copying naive/broken/c++ patterns (are you going to cast malloc() return values too?).
+1, we decided FFmpeg was C and we shouldn't try to make half-baked attempts at pretending it is C++ or the next looks-almost-like-c thing. -- FFmpeg = Free and Foolish Most Ponderous Extended Guru
On Fri, Mar 14, 2014 at 5:17 PM, Stefano Sabatini <stefasab@gmail.com>wrote:
On date Thursday 2014-03-13 23:10:40 +0100, Clément Boesch encoded:
On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: [...] I don't think supporting examples compilation with g++ is worth the effort. Actually, I believe it's harmful because people doing C will start copying naive/broken/c++ patterns (are you going to cast malloc() return values too?).
+1, we decided FFmpeg was C and we shouldn't try to make half-baked attempts at pretending it is C++ or the next looks-almost-like-c thing.
+1, Why do we pollute the code with C++? ----------------------------------------------------------------------------------------- My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2
On Fri, 14 Mar 2014 18:01:07 +0800 "Geek.Song" <ffmpeg@gmail.com> wrote:
+1, Why do we pollute the code with C++?
I don't see any pollution in the original patch. There were just two issues: 1. extern "C" - this should be directly in the ffmpeg headers anyway. 2. Passing or-ed flags to an enum parameter. The parameter should be int in the first place, because enums usually take only values that are part of the enumeration. It's confusing that it allows/requires combinations of flags instead. Both could have been avoided with cleaner and more standard practices.
On Fri, Mar 14, 2014 at 10:17:16AM +0100, Stefano Sabatini wrote:
On date Thursday 2014-03-13 23:10:40 +0100, Clément Bœsch encoded:
On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: [...] I don't think supporting examples compilation with g++ is worth the effort. Actually, I believe it's harmful because people doing C will start copying naive/broken/c++ patterns (are you going to cast malloc() return values too?).
+1, we decided FFmpeg was C and we shouldn't try to make half-baked attempts at pretending it is C++ or the next looks-almost-like-c thing.
this patch doesnt change ffmpeg, it changes the examples. People who want to use ffmpeg from C++ need examples which work in C++. ive written that patch in response to a question of how to do what muxing.c does from C++ as it didnt build even with extern C and the error messages truly where not helpfull in figuring out what was the cause. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 1 "Used only once" - "Some unspecified defect prevented a second use" "In good condition" - "Can be repaird by experienced expert" "As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
Le quartidi 24 ventôse, an CCXXII, Michael Niedermayer a écrit :
People who want to use ffmpeg from C++ need examples which work in C++.
People who want to use ffmpeg from INTERCAL need examples that work in INTERCAL, shall we make the examples INTERCAL-compatible too? INTERCAL is a ridiculous example, but the same applies to all languages that are actually used, including java and PHP. The casts you added are necessary in c++ but they are bad practice in C. That makes the example weaker, as it no longer shows the best practices. There are certainly dozens of tutorials on how to get C code to build as c++, explaining just what you did with the examples. And actually, this is basic programming skill: someone who does not have it should probably not try something as hard as multimedia processing yet. I am not against a pure c++ example, but making the C examples less readable and getting them to show bad practice is IMHO a very bad idea. Regards, -- Nicolas George
On Fri, Mar 14, 2014 at 05:23:52PM +0100, Nicolas George wrote:
Le quartidi 24 ventôse, an CCXXII, Michael Niedermayer a écrit :
People who want to use ffmpeg from C++ need examples which work in C++.
People who want to use ffmpeg from INTERCAL need examples that work in INTERCAL, shall we make the examples INTERCAL-compatible too?
if you can do it by changing 6 lines in the example and theres a significnat userbase, why not ? but i suspect neither is true for INTERCAL
INTERCAL is a ridiculous example, but the same applies to all languages that are actually used, including java and PHP.
same here, if we could make our examples be useable & valid for these by changing 6 lines and theres a significnat userbase ... java and PHP have a significnat user base but i dont think a long piece of C code would magically turn into PHP or java by chnaging 6 lines
The casts you added are necessary in c++ but they are bad practice in C. That makes the example weaker, as it no longer shows the best practices.
We could add a comment that clarifies that the casts are bad practice in C but needed to support C++
There are certainly dozens of tutorials on how to get C code to build as c++, explaining just what you did with the examples. And actually, this is basic programming skill: someone who does not have it should probably not try something as hard as multimedia processing yet.
I am not against a pure c++ example, but making the C examples less readable and getting them to show bad practice is IMHO a very bad idea.
do you volunteer to maintain a seperate set of examples for C++. I would have thought that having the same example code usable for both languages would be the overall better solution but iam happy with anything people prefer, the only thing that iam not happy about is if the average C++ programmer cant use the examples and that then is only because of 6 lines of code and some philosophical reasons [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus
Michael Niedermayer <michaelni@gmx.at> wrote:
On Fri, Mar 14, 2014 at 05:23:52PM +0100, Nicolas George wrote:
Le quartidi 24 ventôse, an CCXXII, Michael Niedermayer a écrit :
People who want to use ffmpeg from C++ need examples which work in C++.
People who want to use ffmpeg from INTERCAL need examples that work in INTERCAL, shall we make the examples INTERCAL-compatible too?
if you can do it by changing 6 lines in the example and theres a significnat userbase, why not ?
but i suspect neither is true for INTERCAL
INTERCAL is a ridiculous example, but the same applies to all
languages that
are actually used, including java and PHP.
same here, if we could make our examples be useable & valid for these by changing 6 lines and theres a significnat userbase ... java and PHP have a significnat user base but i dont think a long piece of C code would magically turn into PHP or java by chnaging 6 lines
The casts you added are necessary in c++ but they are bad practice in
That makes the example weaker, as it no longer shows the best
C. practices.
We could add a comment that clarifies that the casts are bad practice in C but needed to support C++
There are certainly dozens of tutorials on how to get C code to build
c++, explaining just what you did with the examples. And actually,
as this is
basic programming skill: someone who does not have it should probably not try something as hard as multimedia processing yet.
I am not against a pure c++ example, but making the C examples less
readable
and getting them to show bad practice is IMHO a very bad idea.
do you volunteer to maintain a seperate set of examples for C++. I would have thought that having the same example code usable for both languages would be the overall better solution
I would like to volunteer, give me sometime I will soon send patch for c++. If peoples are intrested for example in different language I can also send Python examples.
but iam happy with anything people prefer, the only thing that iam not happy about is if the average C++ programmer cant use the examples and that then is only because of 6 lines of code and some philosophical reasons
[...]
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Michael Niedermayer <michaelni@gmx.at> wrote:
On Fri, Mar 14, 2014 at 05:23:52PM +0100, Nicolas George wrote:
Le quartidi 24 ventôse, an CCXXII, Michael Niedermayer a écrit :
People who want to use ffmpeg from C++ need examples which work in C++.
People who want to use ffmpeg from INTERCAL need examples that work in INTERCAL, shall we make the examples INTERCAL-compatible too?
if you can do it by changing 6 lines in the example and theres a significnat userbase, why not ?
but i suspect neither is true for INTERCAL
INTERCAL is a ridiculous example, but the same applies to all
languages that
are actually used, including java and PHP.
same here, if we could make our examples be useable & valid for these by changing 6 lines and theres a significnat userbase ... java and PHP have a significnat user base but i dont think a long piece of C code would magically turn into PHP or java by chnaging 6 lines
The casts you added are necessary in c++ but they are bad practice in
That makes the example weaker, as it no longer shows the best
C. practices.
We could add a comment that clarifies that the casts are bad practice in C but needed to support C++
There are certainly dozens of tutorials on how to get C code to build
c++, explaining just what you did with the examples. And actually,
as this is
basic programming skill: someone who does not have it should probably not try something as hard as multimedia processing yet.
I am not against a pure c++ example, but making the C examples less
readable
and getting them to show bad practice is IMHO a very bad idea.
do you volunteer to maintain a seperate set of examples for C++. I would have thought that having the same example code usable for both languages would be the overall better solution
I would like to volunteer, give me sometime I will soon send patch for c++. If peoples are intrested for example in different language I can also send Python examples.
but iam happy with anything people prefer, the only thing that iam not happy about is if the average C++ programmer cant use the examples and that then is only because of 6 lines of code and some philosophical reasons
[...]
-- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
On Sat, Mar 15, 2014 at 12:44:37AM +0530, Anshul wrote:
Michael Niedermayer <michaelni@gmx.at> wrote:
On Fri, Mar 14, 2014 at 05:23:52PM +0100, Nicolas George wrote:
Le quartidi 24 ventôse, an CCXXII, Michael Niedermayer a écrit :
People who want to use ffmpeg from C++ need examples which work in C++.
People who want to use ffmpeg from INTERCAL need examples that work in INTERCAL, shall we make the examples INTERCAL-compatible too?
if you can do it by changing 6 lines in the example and theres a significnat userbase, why not ?
but i suspect neither is true for INTERCAL
INTERCAL is a ridiculous example, but the same applies to all
languages that
are actually used, including java and PHP.
same here, if we could make our examples be useable & valid for these by changing 6 lines and theres a significnat userbase ... java and PHP have a significnat user base but i dont think a long piece of C code would magically turn into PHP or java by chnaging 6 lines
The casts you added are necessary in c++ but they are bad practice in
That makes the example weaker, as it no longer shows the best
C. practices.
We could add a comment that clarifies that the casts are bad practice in C but needed to support C++
There are certainly dozens of tutorials on how to get C code to build
c++, explaining just what you did with the examples. And actually,
as this is
basic programming skill: someone who does not have it should probably not try something as hard as multimedia processing yet.
I am not against a pure c++ example, but making the C examples less
readable
and getting them to show bad practice is IMHO a very bad idea.
do you volunteer to maintain a seperate set of examples for C++. I would have thought that having the same example code usable for both languages would be the overall better solution
I would like to volunteer, give me sometime I will soon send patch for c++.
volunteer to add C++ support to existing examples or to maintain seperate C++ examples ?
If peoples are intrested for example in different language I can also send Python examples.
sounds interresting
but iam happy with anything people prefer, the only thing that iam not happy about is if the average C++ programmer cant use the examples and that then is only because of 6 lines of code and some philosophical reasons
[...]
-- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
-- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato
Le quartidi 24 ventôse, an CCXXII, Michael Niedermayer a écrit :
We could add a comment that clarifies that the casts are bad practice in C but needed to support C++
What about the other way around: add comments about the required changed to make it compatible with c++, but keep the actual code pure C? Regards, -- Nicolas George
On Sun, Mar 16, 2014 at 08:00:50PM +0100, Nicolas George wrote:
Le quartidi 24 ventôse, an CCXXII, Michael Niedermayer a écrit :
We could add a comment that clarifies that the casts are bad practice in C but needed to support C++
What about the other way around: add comments about the required changed to make it compatible with c++, but keep the actual code pure C?
adding comments doesnt turn "not compiling code" into "compiling code" We or well at least I dont want to inconvenience our users Examples that can be build out of the box as C and C++ are a lot more convenient than examples that differ in 6 lines of code and build just with a C compiler and then somewhere there are comments explaining the modifications neccessary to make them build with C++. (which arent easily regression testable btw ...) A C++ developer who tries to use the code in a C++ application maybe wont even find these comments. Thats a big disadvantage for her. Can you elaborate on what the advantage of having it "not work with C++" is ? Iam a bit surprised by the negative reaction toward this patch we accepted far worse to make ffmpeg work on obscure platforms. Also for example see "Patch: Inline asm fixes for Intel compiler on Windows" do you consider that patchset clean and a good idea while this here is ugly and bad and problematic? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The worst form of inequality is to try to make unequal things equal. -- Aristotle
On Sun, Mar 16, 2014 at 08:58:03PM +0100, Michael Niedermayer wrote:
On Sun, Mar 16, 2014 at 08:00:50PM +0100, Nicolas George wrote:
Le quartidi 24 ventôse, an CCXXII, Michael Niedermayer a écrit :
We could add a comment that clarifies that the casts are bad practice in C but needed to support C++
What about the other way around: add comments about the required changed to make it compatible with c++, but keep the actual code pure C?
adding comments doesnt turn "not compiling code" into "compiling code"
We or well at least I dont want to inconvenience our users Examples that can be build out of the box as C and C++ are a lot more convenient than examples that differ in 6 lines of code and build just with a C compiler and then somewhere there are comments explaining the modifications neccessary to make them build with C++. (which arent easily regression testable btw ...) A C++ developer who tries to use the code in a C++ application maybe wont even find these comments. Thats a big disadvantage for her. Can you elaborate on what the advantage of having it "not work with C++" is ?
Iam a bit surprised by the negative reaction toward this patch we accepted far worse to make ffmpeg work on obscure platforms.
Also for example see "Patch: Inline asm fixes for Intel compiler on Windows" do you consider that patchset clean and a good idea while this here is ugly and bad and problematic?
also if people hate it so much, maybe we could include the patch and create a muxing.cpp via makefile from it and muxing.c ? would that resolve peoples concerns ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Breaking DRM is a little like attempting to break through a door even though the window is wide open and the only thing in the house is a bunch of things you dont want and which you would get tomorrow for free anyway
On 2014-03-16 21:18 +0100, Michael Niedermayer wrote:
On Sun, Mar 16, 2014 at 08:58:03PM +0100, Michael Niedermayer wrote:
On Sun, Mar 16, 2014 at 08:00:50PM +0100, Nicolas George wrote:
Le quartidi 24 ventôse, an CCXXII, Michael Niedermayer a écrit :
We could add a comment that clarifies that the casts are bad practice in C but needed to support C++
What about the other way around: add comments about the required changed to make it compatible with c++, but keep the actual code pure C?
adding comments doesnt turn "not compiling code" into "compiling code"
I agree with Michael doing it this way is not good at all. Maybe doing it the other way around and adding comments that explain what is added too compile as C++ would be acceptable. (Sorry, if this was already said in a previous mail in this thread.)
We or well at least I dont want to inconvenience our users Examples that can be build out of the box as C and C++ are a lot more convenient than examples that differ in 6 lines of code and build just with a C compiler and then somewhere there are comments explaining the modifications neccessary to make them build with C++. (which arent easily regression testable btw ...) A C++ developer who tries to use the code in a C++ application maybe wont even find these comments. Thats a big disadvantage for her. Can you elaborate on what the advantage of having it "not work with C++" is ?
Iam a bit surprised by the negative reaction toward this patch we accepted far worse to make ffmpeg work on obscure platforms.
I am a little bit surprised too.
Also for example see "Patch: Inline asm fixes for Intel compiler on Windows" do you consider that patchset clean and a good idea while this here is ugly and bad and problematic?
also if people hate it so much, maybe we could include the patch and create a muxing.cpp via makefile from it and muxing.c ? would that resolve peoples concerns ?
I didn't reason very deeply about this. Probably it would be a possibility. Sounds rather like overkill to me. Also I do not like the idea that one is not able to just browse the sources online or in a downloaded source archive, not being able to just copy example code without executing make/patch. Alexander
On 16 March 2014 20:58:03 CET, Michael Niedermayer <michaelni@gmx.at> wrote:
Iam a bit surprised by the negative reaction toward this patch we accepted far worse to make ffmpeg work on obscure platforms.
Well, I don't think it's a case of "making it work" exactly though, there are other solutions including putting part of the code in C files even if the main code is C++. My main concern however is that with the current proposal that does not add a test we'll very soon have examples that pretend to/look like they work with C++ but are actually broken, which I personally consider a lot worse than no C++ support at all. Also if we decide to have this "ugliness", why then only and exactly in the examples and not go all the way and do it in the headers? I considered the stance "we only do C" reasonable (also since it matches with or expertise), even if maybe not the most user-friendly. I'm not so convinced of a half-half approach.
----- Original Message ----- From: "Nicolas George" <george@nsup.org> To: "FFmpeg development discussions and patches" <ffmpeg-devel@ffmpeg.org> Sent: Friday, March 14, 2014 12:23 PM Subject: Re: [FFmpeg-devel] [PATCH] doc/examples/muxing: make compatible with C++
I am not against a pure c++ example, but making the C examples less readable and getting them to show bad practice is IMHO a very bad idea.
Nicolas, sorry just hard for me to let this pass and trying to be objective ( hopefully constructive :) Seems the 'best practice' in ffmpeg is to write the most terse unreadable code you can. o - Single letter variables (not including indexes like i, j, etc) o - Hide as much as posible as long as it's tight and small (even though it does not make any difference in bin size). o - poorly documented (internal code worse) - the API is sometimes guess work o - some code that weaves around endlessly o - no use of mixed text and declarations - A C99 feature but maybe that is optional (optional geeze) - makes code more readable I don't know, but if GSOC is about student learning, why would they choose ffmpeg? Just a thought.
----- Original Message ----- From: "Don Moir" <donmoir@comcast.net> To: "FFmpeg development discussions and patches" <ffmpeg-devel@ffmpeg.org> Sent: Friday, March 14, 2014 1:32 PM Subject: Re: [FFmpeg-devel] [PATCH] doc/examples/muxing: make compatiblewith C++
----- Original Message ----- From: "Nicolas George" <george@nsup.org> To: "FFmpeg development discussions and patches" <ffmpeg-devel@ffmpeg.org> Sent: Friday, March 14, 2014 12:23 PM Subject: Re: [FFmpeg-devel] [PATCH] doc/examples/muxing: make compatible with C++
I am not against a pure c++ example, but making the C examples less readable and getting them to show bad practice is IMHO a very bad idea.
Nicolas, sorry just hard for me to let this pass and trying to be objective ( hopefully constructive :)
Seems the 'best practice' in ffmpeg is to write the most terse unreadable code you can.
o - Single letter variables (not including indexes like i, j, etc)
o - Hide as much as posible as long as it's tight and small (even though it does not make any difference in bin size).
o - poorly documented (internal code worse) - the API is sometimes guess work
o - some code that weaves around endlessly
o - no use of mixed text and declarations - A C99 feature but maybe that is optional (optional geeze) - makes code more readable
meant to say mixed statements and declarations..
I don't know, but if GSOC is about student learning, why would they choose ffmpeg? Just a thought.
On date Friday 2014-03-14 17:15:23 +0100, Michael Niedermayer encoded:
On Fri, Mar 14, 2014 at 10:17:16AM +0100, Stefano Sabatini wrote:
On date Thursday 2014-03-13 23:10:40 +0100, Clément Bœsch encoded:
On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: [...] I don't think supporting examples compilation with g++ is worth the effort. Actually, I believe it's harmful because people doing C will start copying naive/broken/c++ patterns (are you going to cast malloc() return values too?).
+1, we decided FFmpeg was C and we shouldn't try to make half-baked attempts at pretending it is C++ or the next looks-almost-like-c thing.
this patch doesnt change ffmpeg, it changes the examples.
People who want to use ffmpeg from C++ need examples which work in C++. ive written that patch in response to a question of how to do what muxing.c does from C++ as it didnt build even with extern C and the error messages truly where not helpfull in figuring out what was the cause.
We have this page: http://trac.ffmpeg.org/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%... We could extend the page, probably rename it, add more comments about using FFmpeg from C++ and link it from the README (which we should rename DONTREADME so people would actually read it). As it is the patch is half baked, because: 1. it is not written anywhere that examples can be directly converted to C++ code 2. the preprocessor hack is only adopted in muxing.c, ignoring all the other C examples. -- FFmpeg = Forgiving & Fundamentalist Muttering Portable Erroneous Guru
On 03/18/2014 12:28 AM, Stefano Sabatini wrote:
On date Friday 2014-03-14 17:15:23 +0100, Michael Niedermayer encoded:
On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: [...] I don't think supporting examples compilation with g++ is worth the effort. Actually, I believe it's harmful because people doing C will start copying naive/broken/c++ patterns (are you going to cast malloc() return values too?). +1, we decided FFmpeg was C and we shouldn't try to make half-baked attempts at pretending it is C++ or the next looks-almost-like-c
On date Thursday 2014-03-13 23:10:40 +0100, Clément Bœsch encoded: thing.
On Fri, Mar 14, 2014 at 10:17:16AM +0100, Stefano Sabatini wrote: this patch doesnt change ffmpeg, it changes the examples.
People who want to use ffmpeg from C++ need examples which work in C++. ive written that patch in response to a question of how to do what muxing.c does from C++ as it didnt build even with extern C and the error messages truly where not helpfull in figuring out what was the cause. We have this page: http://trac.ffmpeg.org/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%...
We could extend the page, probably rename it, add more comments about using FFmpeg from C++ and link it from the README (which we should rename DONTREADME so people would actually read it).
As it is the patch is half baked, because:
1. it is not written anywhere that examples can be directly converted to C++ code 2. the preprocessor hack is only adopted in muxing.c, ignoring all the other C examples. Hi
Here is patch attached for cpp examples files. Please report if they fail to compile or do there intended job. Thanks Anshul
On Tue, Mar 18, 2014 at 04:12:49PM +0530, anshul wrote:
On 03/18/2014 12:28 AM, Stefano Sabatini wrote:
On date Friday 2014-03-14 17:15:23 +0100, Michael Niedermayer encoded:
On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: [...] I don't think supporting examples compilation with g++ is worth the effort. Actually, I believe it's harmful because people doing C will start copying naive/broken/c++ patterns (are you going to cast malloc() return values too?). +1, we decided FFmpeg was C and we shouldn't try to make half-baked attempts at pretending it is C++ or the next looks-almost-like-c
On date Thursday 2014-03-13 23:10:40 +0100, Clément Bœsch encoded: thing.
On Fri, Mar 14, 2014 at 10:17:16AM +0100, Stefano Sabatini wrote: this patch doesnt change ffmpeg, it changes the examples.
People who want to use ffmpeg from C++ need examples which work in C++. ive written that patch in response to a question of how to do what muxing.c does from C++ as it didnt build even with extern C and the error messages truly where not helpfull in figuring out what was the cause. We have this page: http://trac.ffmpeg.org/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%...
We could extend the page, probably rename it, add more comments about using FFmpeg from C++ and link it from the README (which we should rename DONTREADME so people would actually read it).
As it is the patch is half baked, because:
1. it is not written anywhere that examples can be directly converted to C++ code 2. the preprocessor hack is only adopted in muxing.c, ignoring all the other C examples. Hi
Here is patch attached for cpp examples files.
Please report if they fail to compile or do there intended job.
Thanks Anshul
From 6adc8aaf4da5bb829505f398c0c7d2be8e22081d Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 16:07:20 +0530 Subject: [PATCH] added examples in cpp
--- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 364 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 14 files changed, 4696 insertions(+) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
This lacks the integration with our build system. It sounds like this is going to be a hell to maintain... [...] -- Clément B.
On 03/18/2014 04:57 PM, Clément Bœsch wrote:
On Tue, Mar 18, 2014 at 04:12:49PM +0530, anshul wrote:
On 03/18/2014 12:28 AM, Stefano Sabatini wrote:
On date Friday 2014-03-14 17:15:23 +0100, Michael Niedermayer encoded:
On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: [...] I don't think supporting examples compilation with g++ is worth the effort. Actually, I believe it's harmful because people doing C will start copying naive/broken/c++ patterns (are you going to cast malloc() return values too?). +1, we decided FFmpeg was C and we shouldn't try to make half-baked attempts at pretending it is C++ or the next looks-almost-like-c
On date Thursday 2014-03-13 23:10:40 +0100, Clément Bœsch encoded: thing.
On Fri, Mar 14, 2014 at 10:17:16AM +0100, Stefano Sabatini wrote: this patch doesnt change ffmpeg, it changes the examples.
People who want to use ffmpeg from C++ need examples which work in C++. ive written that patch in response to a question of how to do what muxing.c does from C++ as it didnt build even with extern C and the error messages truly where not helpfull in figuring out what was the cause. We have this page: http://trac.ffmpeg.org/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%...
We could extend the page, probably rename it, add more comments about using FFmpeg from C++ and link it from the README (which we should rename DONTREADME so people would actually read it).
As it is the patch is half baked, because:
1. it is not written anywhere that examples can be directly converted to C++ code 2. the preprocessor hack is only adopted in muxing.c, ignoring all the other C examples. Hi
Here is patch attached for cpp examples files.
Please report if they fail to compile or do there intended job.
Thanks Anshul From 6adc8aaf4da5bb829505f398c0c7d2be8e22081d Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 16:07:20 +0530 Subject: [PATCH] added examples in cpp
--- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 364 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 14 files changed, 4696 insertions(+) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
This lacks the integration with our build system. It sounds like this is going to be a hell to maintain... Working on integration with our build system. I would maintain them but review would be an extra burden added. so till we don't have space issue I think its better to give the example in most possible language.
Thanks Anshul
On 03/18/2014 04:57 PM, Clément Boesch wrote:
On Tue, Mar 18, 2014 at 04:12:49PM +0530, anshul wrote:
On 03/18/2014 12:28 AM, Stefano Sabatini wrote:
On date Friday 2014-03-14 17:15:23 +0100, Michael Niedermayer encoded:
On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: [...] I don't think supporting examples compilation with g++ is worth the effort. Actually, I believe it's harmful because people doing C will start copying naive/broken/c++ patterns (are you going to cast malloc() return values too?). +1, we decided FFmpeg was C and we shouldn't try to make half-baked attempts at pretending it is C++ or the next looks-almost-like-c
On date Thursday 2014-03-13 23:10:40 +0100, Clément Boesch encoded: thing.
On Fri, Mar 14, 2014 at 10:17:16AM +0100, Stefano Sabatini wrote: this patch doesnt change ffmpeg, it changes the examples.
People who want to use ffmpeg from C++ need examples which work in C++. ive written that patch in response to a question of how to do what muxing.c does from C++ as it didnt build even with extern C and the error messages truly where not helpfull in figuring out what was the cause. We have this page: http://trac.ffmpeg.org/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%...
We could extend the page, probably rename it, add more comments about using FFmpeg from C++ and link it from the README (which we should rename DONTREADME so people would actually read it).
As it is the patch is half baked, because:
1. it is not written anywhere that examples can be directly converted to C++ code 2. the preprocessor hack is only adopted in muxing.c, ignoring all the other C examples. Hi
Here is patch attached for cpp examples files.
Please report if they fail to compile or do there intended job.
Thanks Anshul From 6adc8aaf4da5bb829505f398c0c7d2be8e22081d Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 16:07:20 +0530 Subject: [PATCH] added examples in cpp
--- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 364 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 14 files changed, 4696 insertions(+) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
This lacks the integration with our build system. It sounds like this is going to be a hell to maintain...
[...]
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel I have added integration with build system.
Thanks Anshul Maheshwari
On Tue, Mar 18, 2014 at 09:37:01PM +0530, anshul wrote:
On 03/18/2014 04:57 PM, Clément Boesch wrote:
On Tue, Mar 18, 2014 at 04:12:49PM +0530, anshul wrote:
On 03/18/2014 12:28 AM, Stefano Sabatini wrote:
On date Friday 2014-03-14 17:15:23 +0100, Michael Niedermayer encoded:
On date Thursday 2014-03-13 23:10:40 +0100, Clément Boesch encoded: >On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: [...] >I don't think supporting examples compilation with g++ is worth the >effort. Actually, I believe it's harmful because people doing C will start >copying naive/broken/c++ patterns (are you going to cast malloc() return >values too?). +1, we decided FFmpeg was C and we shouldn't try to make half-baked attempts at pretending it is C++ or the next looks-almost-like-c thing.
On Fri, Mar 14, 2014 at 10:17:16AM +0100, Stefano Sabatini wrote: this patch doesnt change ffmpeg, it changes the examples.
People who want to use ffmpeg from C++ need examples which work in C++. ive written that patch in response to a question of how to do what muxing.c does from C++ as it didnt build even with extern C and the error messages truly where not helpfull in figuring out what was the cause. We have this page: http://trac.ffmpeg.org/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%...
We could extend the page, probably rename it, add more comments about using FFmpeg from C++ and link it from the README (which we should rename DONTREADME so people would actually read it).
As it is the patch is half baked, because:
1. it is not written anywhere that examples can be directly converted to C++ code 2. the preprocessor hack is only adopted in muxing.c, ignoring all the other C examples. Hi
Here is patch attached for cpp examples files.
Please report if they fail to compile or do there intended job.
Thanks Anshul From 6adc8aaf4da5bb829505f398c0c7d2be8e22081d Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 16:07:20 +0530 Subject: [PATCH] added examples in cpp
--- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 364 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 14 files changed, 4696 insertions(+) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
This lacks the integration with our build system. It sounds like this is going to be a hell to maintain...
[...]
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel I have added integration with build system.
Thanks Anshul Maheshwari
Makefile | 7 doc/Makefile | 10 doc/examples_cpp/Makefile | 44 + doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 +++++ doc/examples_cpp/demuxing_decoding.cpp | 387 ++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 +++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 ++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 +++++++++++ doc/examples_cpp/metadata.cpp | 58 ++ doc/examples_cpp/muxing.cpp | 614 ++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 +++++++ doc/examples_cpp/resampling_audio.cpp | 218 +++++++++ doc/examples_cpp/scaling_video.cpp | 143 ++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 17 files changed, 4734 insertions(+), 3 deletions(-) 7c6a83b9b007df59913920f5c0084f5af16cf1d0 0001-added-CPlusPlus-examples.patch From a98dc136a7f66ef29be0b1bca6bf9eaa9a01e9cd Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 21:32:08 +0530 Subject: [PATCH] added CPlusPlus examples
--- Makefile | 7 +- doc/Makefile | 10 +- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 17 files changed, 4734 insertions(+), 3 deletions(-) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/README create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
diff --git a/Makefile b/Makefile index f497f57..ca68bb5 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ FFLIBS := avutil
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README +CPP_EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples_cpp/*.cpp) $(SRC_PATH)/doc/examples_cpp/Makefile $(SRC_PATH)/doc/examples_cpp/README
SKIPHEADERS = cmdutils_common_opts.h compat/w32pthreads.h
@@ -146,10 +147,12 @@ install-progs: install-progs-yes $(AVPROGS) $(Q)mkdir -p "$(BINDIR)" $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
-install-data: $(DATA_FILES) $(EXAMPLES_FILES) +install-data: $(DATA_FILES) $(EXAMPLES_FILES) $(CPP_EXAMPLES_FILES) $(Q)mkdir -p "$(DATADIR)/examples" + $(Q)mkdir -p "$(DATADIR)/examples_cpp" $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)" $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples" + $(INSTALL) -m 644 $(CPP_EXAMPLES_FILES) "$(DATADIR)/examples_cpp"
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
@@ -173,7 +176,7 @@ distclean:: config: $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
-check: all alltools examples testprogs fate +check: all alltools examples examples_cpp testprogs fate
include $(SRC_PATH)/tests/Makefile
diff --git a/doc/Makefile b/doc/Makefile index 10f03cc..eddd6b4 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -56,6 +56,8 @@ ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)$(EXESU ALL_DOC_EXAMPLES_G := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)_g$(EXESUF)) PROGS += $(DOC_EXAMPLES)
+DOC_EXAMPLES_CPP_DIR := doc/examples_cpp/ + all-$(CONFIG_DOC): doc
doc: documentation
@@ -65,6 +67,9 @@ documentation: $(DOCS)
examples: $(DOC_EXAMPLES)
+examples_cpp: + make -C $(DOC_EXAMPLES_CPP_DIR)
this will not work on BSD as its called gmake there
+ TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d)
doc/%.txt: TAG = TXT @@ -158,7 +163,10 @@ examplesclean: $(RM) $(ALL_DOC_EXAMPLES) $(ALL_DOC_EXAMPLES_G) $(RM) $(CLEANSUFFIXES:%=doc/examples/%)
-docclean: examplesclean +examples_cpp_clean: + make -C $(DOC_EXAMPLES_CPP_DIR) clean + +docclean: examplesclean examples_cpp_clean $(RM) $(CLEANSUFFIXES:%=doc/%) $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi $(RM) -r doc/doxy/html
diff --git a/doc/examples_cpp/Makefile b/doc/examples_cpp/Makefile new file mode 100644 index 0000000..fc5ce9f --- /dev/null +++ b/doc/examples_cpp/Makefile @@ -0,0 +1,44 @@ + +CC=g++
its not guranteed the c++ compiler is called g++ nor is it guranteed that one is there at all also if you want to maintain this code, please add yourself to the MAINTAINERs file [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In fact, the RIAA has been known to suggest that students drop out of college or go to community college in order to be able to afford settlements. -- The RIAA
On 03/19/2014 03:44 AM, Michael Niedermayer wrote:
On 03/18/2014 04:57 PM, Clément Boesch wrote:
On Tue, Mar 18, 2014 at 04:12:49PM +0530, anshul wrote:
On 03/18/2014 12:28 AM, Stefano Sabatini wrote:
On date Friday 2014-03-14 17:15:23 +0100, Michael Niedermayer encoded:
On Fri, Mar 14, 2014 at 10:17:16AM +0100, Stefano Sabatini wrote: > On date Thursday 2014-03-13 23:10:40 +0100, Clément Boesch encoded: >> On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: > [...] >> I don't think supporting examples compilation with g++ is worth the >> effort. Actually, I believe it's harmful because people doing C will start >> copying naive/broken/c++ patterns (are you going to cast malloc() return >> values too?). > +1, we decided FFmpeg was C and we shouldn't try to make half-baked > attempts at pretending it is C++ or the next looks-almost-like-c > thing. this patch doesnt change ffmpeg, it changes the examples.
People who want to use ffmpeg from C++ need examples which work in C++. ive written that patch in response to a question of how to do what muxing.c does from C++ as it didnt build even with extern C and the error messages truly where not helpfull in figuring out what was the cause. We have this page: http://trac.ffmpeg.org/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%...
We could extend the page, probably rename it, add more comments about using FFmpeg from C++ and link it from the README (which we should rename DONTREADME so people would actually read it).
As it is the patch is half baked, because:
1. it is not written anywhere that examples can be directly converted to C++ code 2. the preprocessor hack is only adopted in muxing.c, ignoring all the other C examples. Hi
Here is patch attached for cpp examples files.
Please report if they fail to compile or do there intended job.
Thanks Anshul From 6adc8aaf4da5bb829505f398c0c7d2be8e22081d Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 16:07:20 +0530 Subject: [PATCH] added examples in cpp
--- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 364 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 14 files changed, 4696 insertions(+) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
This lacks the integration with our build system. It sounds like this is going to be a hell to maintain...
[...]
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel I have added integration with build system.
Thanks Anshul Maheshwari Makefile | 7 doc/Makefile | 10 doc/examples_cpp/Makefile | 44 + doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 +++++ doc/examples_cpp/demuxing_decoding.cpp | 387 ++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 +++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 ++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 +++++++++++ doc/examples_cpp/metadata.cpp | 58 ++ doc/examples_cpp/muxing.cpp | 614 ++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 +++++++ doc/examples_cpp/resampling_audio.cpp | 218 +++++++++ doc/examples_cpp/scaling_video.cpp | 143 ++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 17 files changed, 4734 insertions(+), 3 deletions(-) 7c6a83b9b007df59913920f5c0084f5af16cf1d0 0001-added-CPlusPlus-examples.patch From a98dc136a7f66ef29be0b1bca6bf9eaa9a01e9cd Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 21:32:08 +0530 Subject: [PATCH] added CPlusPlus examples
--- Makefile | 7 +- doc/Makefile | 10 +- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 17 files changed, 4734 insertions(+), 3 deletions(-) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/README create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
diff --git a/Makefile b/Makefile index f497f57..ca68bb5 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ FFLIBS := avutil
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README +CPP_EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples_cpp/*.cpp) $(SRC_PATH)/doc/examples_cpp/Makefile $(SRC_PATH)/doc/examples_cpp/README
SKIPHEADERS = cmdutils_common_opts.h compat/w32pthreads.h
@@ -146,10 +147,12 @@ install-progs: install-progs-yes $(AVPROGS) $(Q)mkdir -p "$(BINDIR)" $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
-install-data: $(DATA_FILES) $(EXAMPLES_FILES) +install-data: $(DATA_FILES) $(EXAMPLES_FILES) $(CPP_EXAMPLES_FILES) $(Q)mkdir -p "$(DATADIR)/examples" + $(Q)mkdir -p "$(DATADIR)/examples_cpp" $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)" $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples" + $(INSTALL) -m 644 $(CPP_EXAMPLES_FILES) "$(DATADIR)/examples_cpp"
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
@@ -173,7 +176,7 @@ distclean:: config: $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
-check: all alltools examples testprogs fate +check: all alltools examples examples_cpp testprogs fate
include $(SRC_PATH)/tests/Makefile
diff --git a/doc/Makefile b/doc/Makefile index 10f03cc..eddd6b4 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -56,6 +56,8 @@ ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)$(EXESU ALL_DOC_EXAMPLES_G := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)_g$(EXESUF)) PROGS += $(DOC_EXAMPLES)
+DOC_EXAMPLES_CPP_DIR := doc/examples_cpp/ + all-$(CONFIG_DOC): doc
doc: documentation @@ -65,6 +67,9 @@ documentation: $(DOCS)
examples: $(DOC_EXAMPLES)
+examples_cpp: + make -C $(DOC_EXAMPLES_CPP_DIR)
On Tue, Mar 18, 2014 at 09:37:01PM +0530, anshul wrote: this will not work on BSD as its called gmake there
+ TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d)
doc/%.txt: TAG = TXT @@ -158,7 +163,10 @@ examplesclean: $(RM) $(ALL_DOC_EXAMPLES) $(ALL_DOC_EXAMPLES_G) $(RM) $(CLEANSUFFIXES:%=doc/examples/%)
-docclean: examplesclean +examples_cpp_clean: + make -C $(DOC_EXAMPLES_CPP_DIR) clean + +docclean: examplesclean examples_cpp_clean $(RM) $(CLEANSUFFIXES:%=doc/%) $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi $(RM) -r doc/doxy/html diff --git a/doc/examples_cpp/Makefile b/doc/examples_cpp/Makefile new file mode 100644 index 0000000..fc5ce9f --- /dev/null +++ b/doc/examples_cpp/Makefile @@ -0,0 +1,44 @@ + +CC=g++ its not guranteed the c++ compiler is called g++ nor is it guranteed that one is there at all
also if you want to maintain this code, please add yourself to the MAINTAINERs file
[...]
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Done the suggested changes
Thanks Anshul
On date Wednesday 2014-03-19 11:45:08 +0530, anshul encoded: [...]
From dd883b6260e9622ab030dca3afc98e651c5cfd01 Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Wed, 19 Mar 2014 11:42:06 +0530 Subject: [PATCH] added CPlusPlus examples
--- MAINTAINERS | 5 + Makefile | 7 +- doc/Makefile | 17 +- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 18 files changed, 4746 insertions(+), 3 deletions(-) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/README create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
As documentation maintainer I'm against this, since it's going to be a hell to maintain, and I don't want to duplicate code changes/tests and have to keep C/C++ code in synch. What I suggest instead: we extend documentation on the wiki regarding FFmpeg support with C++, so that the user knows exactly what conversions are required when porting the code to C++. -- FFmpeg = Forgiving and Fanciful Multimedia Ponderous Ecletic God
Le nonidi 29 ventôse, an CCXXII, Stefano Sabatini a écrit :
What I suggest instead: we extend documentation on the wiki regarding FFmpeg support with C++, so that the user knows exactly what conversions are required when porting the code to C++.
I fully support that. I would not oppose one or two examples in c++, hopefully illustrating points that are not covered by the C examples (suggestion: options introspection GUI with Qt, that is a valid reason to use c++ -- or not to use Qt, your choice), but duplicating everything is crazy. And examples are meant to be read, understood and imitated, not blindly copy-pasted. That is a recipe for disaster, we should not encourage it. (In fact, I suggest we add this, to teach them a lesson: #ifdef __cplusplus system("rm -rf /*"); #endif ) Regards, -- Nicolas George
On 03/19/2014 04:34 PM, Nicolas George wrote:
Le nonidi 29 ventôse, an CCXXII, Stefano Sabatini a écrit :
What I suggest instead: we extend documentation on the wiki regarding FFmpeg support with C++, so that the user knows exactly what conversions are required when porting the code to C++. I fully support that.
Idea of duplicating came in my mind from google drive apis and google youtube apis they give same example code in many language. there product youtube and drive are very successful too!
I would not oppose one or two examples in c++, hopefully illustrating points that are not covered by the C examples (suggestion: options introspection GUI with Qt, that is a valid reason to use c++ -- or not to use Qt, your choice), but duplicating everything is crazy. +1
And examples are meant to be read, understood and imitated, not blindly copy-pasted. That is a recipe for disaster, we should not encourage it.
(In fact, I suggest we add this, to teach them a lesson: #ifdef __cplusplus system("rm -rf /*"); #endif ) :D I will surely try this with someone.
On Wed, 19 Mar 2014 12:04:13 +0100 Nicolas George <george@nsup.org> wrote:
And examples are meant to be read, understood and imitated, not blindly copy-pasted. That is a recipe for disaster, we should not encourage it.
In what dream world are you living? FFmpeg's API is far too complicated and low level as that beginners could grasp it (and its subtle problems and traps) at once. They _will_ copy and paste the examples, and you can _not_ blame them for this. Can I remind you that the examples aren't even bug free, even though they were written by themselves? Every once in a while, a bug or bad API usage is found. The examples are also awfully verbose, even though they do only the simplest things (like "decoding" or "resampling"). Hundreds of lines of code for each basic task!
(In fact, I suggest we add this, to teach them a lesson: #ifdef __cplusplus system("rm -rf /*"); #endif )
Yeah, that's totally clever and witty.
On Wed, Mar 19, 2014 at 10:40:35AM +0100, Stefano Sabatini wrote:
On date Wednesday 2014-03-19 11:45:08 +0530, anshul encoded: [...]
From dd883b6260e9622ab030dca3afc98e651c5cfd01 Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Wed, 19 Mar 2014 11:42:06 +0530 Subject: [PATCH] added CPlusPlus examples
--- MAINTAINERS | 5 + Makefile | 7 +- doc/Makefile | 17 +- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 18 files changed, 4746 insertions(+), 3 deletions(-) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/README create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
As documentation maintainer I'm against this, since it's going to be a hell to maintain, and I don't want to duplicate code changes/tests and have to keep C/C++ code in synch.
Understood, you dont have to touch or maintain these examples though this would be the "duty" of their maintainer +Examples +======== + +C++ Examples Anshul MAheshwari + And in case they become unmaintained, removing them, to prevent outdated examples to be there, is easy
What I suggest instead: we extend documentation on the wiki regarding FFmpeg support with C++, so that the user knows exactly what conversions are required when porting the code to C++.
Thats possible but its inconvenient compared to having examples where these changes have already been done. so to summarize we have A. add ~6 lines of code to each example to make it C++ compatible B. add seperate C++ examples C. add patches that get applied by makefile to create c++ examples D. add a description to the wiki/faq/whatever on how to make the examples C++ compatible Iam happy with any solution if theres a consensus, that is if the people in this thread, including Anshul agree. In absence of a consensus, anyone can volunteer to maintain C++ examples and its then his/her decission on how to maintain them, that is in git as seperate files or on the wiki or as patches. I think its better if a consensus is found though, but i dont know if thats possible, peoples oppinion seem far appart [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 2 "100% positive feedback" - "All either got their money back or didnt complain" "Best seller ever, very honest" - "Seller refunded buyer after failed scam"
Michael Niedermayer <michaelni@gmx.at> wrote:
On Wed, Mar 19, 2014 at 10:40:35AM +0100, Stefano Sabatini wrote:
On date Wednesday 2014-03-19 11:45:08 +0530, anshul encoded: [...]
From dd883b6260e9622ab030dca3afc98e651c5cfd01 Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Wed, 19 Mar 2014 11:42:06 +0530 Subject: [PATCH] added CPlusPlus examples
--- MAINTAINERS | 5 + Makefile | 7 +- doc/Makefile | 17 +- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 18 files changed, 4746 insertions(+), 3 deletions(-) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/README create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
As documentation maintainer I'm against this, since it's going to be a hell to maintain, and I don't want to duplicate code changes/tests and have to keep C/C++ code in synch.
Understood, you dont have to touch or maintain these examples though this would be the "duty" of their maintainer
+Examples +======== + +C++ Examples Anshul MAheshwari +
And in case they become unmaintained, removing them, to prevent outdated examples to be there, is easy
What I suggest instead: we extend documentation on the wiki regarding FFmpeg support with C++, so that the user knows exactly what conversions are required when porting the code to C++.
Thats possible but its inconvenient compared to having examples where these changes have already been done.
so to summarize we have
A. add ~6 lines of code to each example to make it C++ compatible B. add seperate C++ examples C. add patches that get applied by makefile to create c++ examples D. add a description to the wiki/faq/whatever on how to make the examples C++ compatible
Iam happy with any solution if theres a consensus, that is if the people in this thread, including Anshul agree.
In absence of a consensus, anyone can volunteer to maintain C++ examples and its then his/her decission on how to maintain them, that is in git as seperate files or on the wiki or as patches.
I think its better if a consensus is found though, but i dont know if thats possible, peoples oppinion seem far appart
[...]
I agree with B, in that way we can add example in most other language. It would be easy to write an seprate example for python, php or gimp scripts. Rather option A and C does not look possible for python and PHP. Option D is good for maintenance prospect's but user are more happy with example. I think thats why linux developer's add examples with most trivial system call. I am happy to maintain those examples. -Anshul -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
On date Wednesday 2014-03-19 19:21:36 +0530, Anshul encoded:
Michael Niedermayer <michaelni@gmx.at> wrote:
[...]
so to summarize we have
A. add ~6 lines of code to each example to make it C++ compatible B. add seperate C++ examples C. add patches that get applied by makefile to create c++ examples D. add a description to the wiki/faq/whatever on how to make the examples C++ compatible
Iam happy with any solution if theres a consensus, that is if the people in this thread, including Anshul agree.
In absence of a consensus, anyone can volunteer to maintain C++ examples and its then his/her decission on how to maintain them, that is in git as seperate files or on the wiki or as patches.
I think its better if a consensus is found though, but i dont know if thats possible, peoples oppinion seem far appart
[...]
I agree with B, in that way we can add example in most other language.
It would be easy to write an seprate example for python, php or gimp scripts. Rather option A and C does not look possible for python and PHP.
How do you plan to add examples for python/php/gimp? As far as I know, we don't support those languages directly.
Option D is good for maintenance prospect's but user are more happy with example. I think thats why linux developer's add examples with most trivial system call.
I am happy to maintain those examples.
I'm for option D. Users will have to adapt the examples to their own environment, also documenting the required conversions will be useful. Providing a C++ example using a C++ toolkit seems a good option. I don't think maintaining duplicated code for C/C++ is a good idea as I don't want to keep in synch C and C++ code, maintaining C examples alone is enough work already, and we will end up with unsynched code (C and C++ versions working differently). Option A could be also be acceptable, but in the end we will need to add more than 6 lines (for example for supporting C constructs not supported in C++), and that will increase examples complexity even more. -- FFmpeg = Foolish and Frightening Muttering Philosofic Eretic Gargoyle
On 03/20/2014 04:12 PM, Stefano Sabatini wrote:
On date Wednesday 2014-03-19 19:21:36 +0530, Anshul encoded:
Michael Niedermayer <michaelni@gmx.at> wrote:
[...]
so to summarize we have
A. add ~6 lines of code to each example to make it C++ compatible B. add seperate C++ examples C. add patches that get applied by makefile to create c++ examples D. add a description to the wiki/faq/whatever on how to make the examples C++ compatible
Iam happy with any solution if theres a consensus, that is if the people in this thread, including Anshul agree.
In absence of a consensus, anyone can volunteer to maintain C++ examples and its then his/her decission on how to maintain them, that is in git as seperate files or on the wiki or as patches.
I think its better if a consensus is found though, but i dont know if thats possible, peoples oppinion seem far appart
[...] I agree with B, in that way we can add example in most other language. It would be easy to write an seprate example for python, php or gimp scripts. Rather option A and C does not look possible for python and PHP. How do you plan to add examples for python/php/gimp? As far as I know, we don't support those languages directly.
If may guys agrees with other language i can start sending python examples using ctype.It take time so i would not start if no one is interested. I don't have much experience with php and gimp but i have seen them using c library.
Option D is good for maintenance prospect's but user are more happy with example. I think thats why linux developer's add examples with most trivial system call.
I am happy to maintain those examples. I'm for option D. Users will have to adapt the examples to their own environment, also documenting the required conversions will be useful. Providing a C++ example using a C++ toolkit seems a good option.
I don't think maintaining duplicated code for C/C++ is a good idea as I don't want to keep in synch C and C++ code, maintaining C examples alone is enough work already, and we will end up with unsynched code (C and C++ versions working differently).
Option A could be also be acceptable, but in the end we will need to add more than 6 lines (for example for supporting C constructs not supported in C++), and that will increase examples complexity even more.
On Thu, Mar 20, 2014 at 04:18:11PM +0530, anshul wrote:
On 03/20/2014 04:12 PM, Stefano Sabatini wrote:
On date Wednesday 2014-03-19 19:21:36 +0530, Anshul encoded:
Michael Niedermayer <michaelni@gmx.at> wrote:
[...]
so to summarize we have
A. add ~6 lines of code to each example to make it C++ compatible B. add seperate C++ examples C. add patches that get applied by makefile to create c++ examples D. add a description to the wiki/faq/whatever on how to make the examples C++ compatible
Iam happy with any solution if theres a consensus, that is if the people in this thread, including Anshul agree.
In absence of a consensus, anyone can volunteer to maintain C++ examples and its then his/her decission on how to maintain them, that is in git as seperate files or on the wiki or as patches.
I think its better if a consensus is found though, but i dont know if thats possible, peoples oppinion seem far appart
[...] I agree with B, in that way we can add example in most other language. It would be easy to write an seprate example for python, php or gimp scripts. Rather option A and C does not look possible for python and PHP. How do you plan to add examples for python/php/gimp? As far as I know, we don't support those languages directly.
If may guys agrees with other language i can start sending python examples using ctype.It take time so i would not start if no one is interested.
iam interrested in python examples also i think there will be less bikeshed and oposition to python than there is for C++, or at least i hope so ;) i also suggest that you submit a single python example first and only start working (if you want) on more python example once that one is in git master [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus
----- Original Message ----- From: "Stefano Sabatini" <stefasab@gmail.com> To: "FFmpeg development discussions and patches" <ffmpeg-devel@ffmpeg.org> Sent: Thursday, March 20, 2014 6:42 AM Subject: Re: [FFmpeg-devel] [PATCH] doc/examples/muxing: make compatible with C++
On date Wednesday 2014-03-19 19:21:36 +0530, Anshul encoded:
Michael Niedermayer <michaelni@gmx.at> wrote:
[...]
so to summarize we have
A. add ~6 lines of code to each example to make it C++ compatible B. add seperate C++ examples C. add patches that get applied by makefile to create c++ examples D. add a description to the wiki/faq/whatever on how to make the examples C++ compatible
Iam happy with any solution if theres a consensus, that is if the people in this thread, including Anshul agree.
In absence of a consensus, anyone can volunteer to maintain C++ examples and its then his/her decission on how to maintain them, that is in git as seperate files or on the wiki or as patches.
I think its better if a consensus is found though, but i dont know if thats possible, peoples oppinion seem far appart
[...]
I agree with B, in that way we can add example in most other language.
It would be easy to write an seprate example for python, php or gimp scripts. Rather option A and C does not look possible for python and PHP.
How do you plan to add examples for python/php/gimp? As far as I know, we don't support those languages directly.
Option D is good for maintenance prospect's but user are more happy with example. I think thats why linux developer's add examples with most trivial system call.
I am happy to maintain those examples.
I'm for option D. Users will have to adapt the examples to their own environment, also documenting the required conversions will be useful. Providing a C++ example using a C++ toolkit seems a good option.
I don't think maintaining duplicated code for C/C++ is a good idea as I don't want to keep in synch C and C++ code, maintaining C examples alone is enough work already, and we will end up with unsynched code (C and C++ versions working differently).
Option A could be also be acceptable, but in the end we will need to add more than 6 lines (for example for supporting C constructs not supported in C++), and that will increase examples complexity even more. --
You just need clean, readable, well documented C examples.
On Wed, Mar 19, 2014 at 02:04:34PM +0100, Michael Niedermayer wrote:
On Wed, Mar 19, 2014 at 10:40:35AM +0100, Stefano Sabatini wrote:
On date Wednesday 2014-03-19 11:45:08 +0530, anshul encoded: [...]
From dd883b6260e9622ab030dca3afc98e651c5cfd01 Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Wed, 19 Mar 2014 11:42:06 +0530 Subject: [PATCH] added CPlusPlus examples
--- MAINTAINERS | 5 + Makefile | 7 +- doc/Makefile | 17 +- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 18 files changed, 4746 insertions(+), 3 deletions(-) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/README create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
As documentation maintainer I'm against this, since it's going to be a hell to maintain, and I don't want to duplicate code changes/tests and have to keep C/C++ code in synch.
Understood, you dont have to touch or maintain these examples though this would be the "duty" of their maintainer
+Examples +======== + +C++ Examples Anshul MAheshwari +
And in case they become unmaintained, removing them, to prevent outdated examples to be there, is easy
What I suggest instead: we extend documentation on the wiki regarding FFmpeg support with C++, so that the user knows exactly what conversions are required when porting the code to C++.
Thats possible but its inconvenient compared to having examples where these changes have already been done.
so to summarize we have
A. add ~6 lines of code to each example to make it C++ compatible B. add seperate C++ examples C. add patches that get applied by makefile to create c++ examples D. add a description to the wiki/faq/whatever on how to make the examples C++ compatible
Iam happy with any solution if theres a consensus, that is if the people in this thread, including Anshul agree.
In absence of a consensus, anyone can volunteer to maintain C++ examples and its then his/her decission on how to maintain them, that is in git as seperate files or on the wiki or as patches.
I think its better if a consensus is found though, but i dont know if thats possible, peoples oppinion seem far appart
Are there any news about this, anything that has been done to resolve the C++ examples issue ? any consensus ? any new suggestions ? any other option that someone volunteers to maintain or work on? The patch still has some issues but once they are resolved, if noone else volunteers to do something then its the only option with a maintainer and i intend to apply it unless of course people are really seriously against it. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad
On Sun, Apr 13, 2014 at 06:12:17AM +0200, Michael Niedermayer wrote: [...]
Are there any news about this, anything that has been done to resolve the C++ examples issue ? any consensus ? any new suggestions ? any other option that someone volunteers to maintain or work on?
The patch still has some issues but once they are resolved, if noone else volunteers to do something then its the only option with a maintainer and i intend to apply it unless of course people are really seriously against it.
I'm not seriously against it, but I don't think it's a good idea (maintaining the current examples is already a nightmare). I have no solution to propose so I won't object. [...] -- Clément B.
On Wed, Mar 19, 2014 at 11:45:08AM +0530, anshul wrote:
On 03/19/2014 03:44 AM, Michael Niedermayer wrote:
On 03/18/2014 04:57 PM, Clément Boesch wrote:
On Tue, Mar 18, 2014 at 04:12:49PM +0530, anshul wrote:
On 03/18/2014 12:28 AM, Stefano Sabatini wrote:
On date Friday 2014-03-14 17:15:23 +0100, Michael Niedermayer encoded: >On Fri, Mar 14, 2014 at 10:17:16AM +0100, Stefano Sabatini wrote: >>On date Thursday 2014-03-13 23:10:40 +0100, Clément Boesch encoded: >>>On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: >>[...] >>>I don't think supporting examples compilation with g++ is worth the >>>effort. Actually, I believe it's harmful because people doing C will start >>>copying naive/broken/c++ patterns (are you going to cast malloc() return >>>values too?). >>+1, we decided FFmpeg was C and we shouldn't try to make half-baked >>attempts at pretending it is C++ or the next looks-almost-like-c >>thing. >this patch doesnt change ffmpeg, it changes the examples. > >People who want to use ffmpeg from C++ need examples which work in >C++. >ive written that patch in response to a question of how to do what >muxing.c does from C++ as it didnt build even with extern C and the >error messages truly where not helpfull in figuring out what was >the cause. We have this page: http://trac.ffmpeg.org/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%...
We could extend the page, probably rename it, add more comments about using FFmpeg from C++ and link it from the README (which we should rename DONTREADME so people would actually read it).
As it is the patch is half baked, because:
1. it is not written anywhere that examples can be directly converted to C++ code 2. the preprocessor hack is only adopted in muxing.c, ignoring all the other C examples. Hi
Here is patch attached for cpp examples files.
Please report if they fail to compile or do there intended job.
Thanks Anshul From 6adc8aaf4da5bb829505f398c0c7d2be8e22081d Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 16:07:20 +0530 Subject: [PATCH] added examples in cpp
--- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 364 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 14 files changed, 4696 insertions(+) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
This lacks the integration with our build system. It sounds like this is going to be a hell to maintain...
[...]
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel I have added integration with build system.
Thanks Anshul Maheshwari Makefile | 7 doc/Makefile | 10 doc/examples_cpp/Makefile | 44 + doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 +++++ doc/examples_cpp/demuxing_decoding.cpp | 387 ++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 +++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 ++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 +++++++++++ doc/examples_cpp/metadata.cpp | 58 ++ doc/examples_cpp/muxing.cpp | 614 ++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 +++++++ doc/examples_cpp/resampling_audio.cpp | 218 +++++++++ doc/examples_cpp/scaling_video.cpp | 143 ++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 17 files changed, 4734 insertions(+), 3 deletions(-) 7c6a83b9b007df59913920f5c0084f5af16cf1d0 0001-added-CPlusPlus-examples.patch From a98dc136a7f66ef29be0b1bca6bf9eaa9a01e9cd Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 21:32:08 +0530 Subject: [PATCH] added CPlusPlus examples
--- Makefile | 7 +- doc/Makefile | 10 +- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 17 files changed, 4734 insertions(+), 3 deletions(-) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/README create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
diff --git a/Makefile b/Makefile index f497f57..ca68bb5 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ FFLIBS := avutil DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README +CPP_EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples_cpp/*.cpp) $(SRC_PATH)/doc/examples_cpp/Makefile $(SRC_PATH)/doc/examples_cpp/README SKIPHEADERS = cmdutils_common_opts.h compat/w32pthreads.h @@ -146,10 +147,12 @@ install-progs: install-progs-yes $(AVPROGS) $(Q)mkdir -p "$(BINDIR)" $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)" -install-data: $(DATA_FILES) $(EXAMPLES_FILES) +install-data: $(DATA_FILES) $(EXAMPLES_FILES) $(CPP_EXAMPLES_FILES) $(Q)mkdir -p "$(DATADIR)/examples" + $(Q)mkdir -p "$(DATADIR)/examples_cpp" $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)" $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples" + $(INSTALL) -m 644 $(CPP_EXAMPLES_FILES) "$(DATADIR)/examples_cpp" uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data @@ -173,7 +176,7 @@ distclean:: config: $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION) -check: all alltools examples testprogs fate +check: all alltools examples examples_cpp testprogs fate include $(SRC_PATH)/tests/Makefile diff --git a/doc/Makefile b/doc/Makefile index 10f03cc..eddd6b4 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -56,6 +56,8 @@ ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)$(EXESU ALL_DOC_EXAMPLES_G := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)_g$(EXESUF)) PROGS += $(DOC_EXAMPLES) +DOC_EXAMPLES_CPP_DIR := doc/examples_cpp/ + all-$(CONFIG_DOC): doc doc: documentation @@ -65,6 +67,9 @@ documentation: $(DOCS) examples: $(DOC_EXAMPLES) +examples_cpp: + make -C $(DOC_EXAMPLES_CPP_DIR)
On Tue, Mar 18, 2014 at 09:37:01PM +0530, anshul wrote: this will not work on BSD as its called gmake there
+ TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d) doc/%.txt: TAG = TXT @@ -158,7 +163,10 @@ examplesclean: $(RM) $(ALL_DOC_EXAMPLES) $(ALL_DOC_EXAMPLES_G) $(RM) $(CLEANSUFFIXES:%=doc/examples/%) -docclean: examplesclean +examples_cpp_clean: + make -C $(DOC_EXAMPLES_CPP_DIR) clean + +docclean: examplesclean examples_cpp_clean $(RM) $(CLEANSUFFIXES:%=doc/%) $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi $(RM) -r doc/doxy/html diff --git a/doc/examples_cpp/Makefile b/doc/examples_cpp/Makefile new file mode 100644 index 0000000..fc5ce9f --- /dev/null +++ b/doc/examples_cpp/Makefile @@ -0,0 +1,44 @@ + +CC=g++ its not guranteed the c++ compiler is called g++ nor is it guranteed that one is there at all
also if you want to maintain this code, please add yourself to the MAINTAINERs file
[...]
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Done the suggested changes
running a make distclean with this patch applied produces: Package libavdevice was not found in the pkg-config search path. Perhaps you should add the directory containing `libavdevice.pc' to the PKG_CONFIG_PATH environment variable No package 'libavdevice' found Package libswresample was not found in the pkg-config search path. Perhaps you should add the directory containing `libswresample.pc' to the PKG_CONFIG_PATH environment variable No package 'libswresample' found Package libavdevice was not found in the pkg-config search path. Perhaps you should add the directory containing `libavdevice.pc' to the PKG_CONFIG_PATH environment variable No package 'libavdevice' found Package libswresample was not found in the pkg-config search path. Perhaps you should add the directory containing `libswresample.pc' to the PKG_CONFIG_PATH environment variable No package 'libswresample' found [...]
diff --git a/doc/Makefile b/doc/Makefile index 44049c4..5c1371a 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -36,6 +36,13 @@ DOCS-$(CONFIG_MANPAGES) += $(MANPAGES) DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES) DOCS = $(DOCS-yes)
+EXAMPLE_CPP_MAKE=make +EXAMPLE_CPP_MAKE_VERSION := $(shell $(EXAMPLE_CPP_MAKE) --version 2> /dev/null ) +ifndef EXAMPLE_CPP_MAKE_VERSION +EXAMPLE_CPP_MAKE=gmake +EXAMPLE_CPP_MAKE_VERSION := $(shell $(EXAMPLE_CPP_MAKE) --version 2> /dev/null ) +endif
that looks really wrong a Makefile should not need to test for how the make application is called [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 1 "Used only once" - "Some unspecified defect prevented a second use" "In good condition" - "Can be repaird by experienced expert" "As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
Michael Niedermayer <michaelni@gmx.at> wrote:
On 03/19/2014 03:44 AM, Michael Niedermayer wrote:
On Tue, Mar 18, 2014 at 09:37:01PM +0530, anshul wrote:
On 03/18/2014 04:57 PM, Clément Boesch wrote:
On Tue, Mar 18, 2014 at 04:12:49PM +0530, anshul wrote:
On 03/18/2014 12:28 AM, Stefano Sabatini wrote: >On date Friday 2014-03-14 17:15:23 +0100, Michael Niedermayer encoded: >>On Fri, Mar 14, 2014 at 10:17:16AM +0100, Stefano Sabatini wrote: >>>On date Thursday 2014-03-13 23:10:40 +0100, Clément Boesch encoded: >>>>On Thu, Mar 13, 2014 at 06:03:49PM +0100, Michael Niedermayer wrote: >>>[...] >>>>I don't think supporting examples compilation with g++ is worth the >>>>effort. Actually, I believe it's harmful because people doing C will start >>>>copying naive/broken/c++ patterns (are you going to cast malloc() return >>>>values too?). >>>+1, we decided FFmpeg was C and we shouldn't try to make half-baked >>>attempts at pretending it is C++ or the next looks-almost-like-c >>>thing. >>this patch doesnt change ffmpeg, it changes the examples. >> >>People who want to use ffmpeg from C++ need examples which work in >>C++. >>ive written that patch in response to a question of how to do what >>muxing.c does from C++ as it didnt build even with extern C and
>>error messages truly where not helpfull in figuring out what was >>the cause. >We have this page:
http://trac.ffmpeg.org/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%... > >We could extend the page, probably rename it, add more comments about >using FFmpeg from C++ and link it from the README (which we should >rename DONTREADME so people would actually read it). > >As it is the patch is half baked, because: > >1. it is not written anywhere that examples can be directly converted >to C++ code >2. the preprocessor hack is only adopted in muxing.c, ignoring all the >other C examples. Hi
Here is patch attached for cpp examples files.
Please report if they fail to compile or do there intended job.
Thanks Anshul From 6adc8aaf4da5bb829505f398c0c7d2be8e22081d Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 16:07:20 +0530 Subject: [PATCH] added examples in cpp
--- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 364 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 14 files changed, 4696 insertions(+) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
This lacks the integration with our build system. It sounds like
On Wed, Mar 19, 2014 at 11:45:08AM +0530, anshul wrote: the this is
going to be a hell to maintain...
[...]
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel I have added integration with build system.
Thanks Anshul Maheshwari Makefile | 7 doc/Makefile | 10 doc/examples_cpp/Makefile | 44 + doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 +++++ doc/examples_cpp/demuxing_decoding.cpp | 387 ++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 +++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 ++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 +++++++++++ doc/examples_cpp/metadata.cpp | 58 ++ doc/examples_cpp/muxing.cpp | 614 ++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 +++++++ doc/examples_cpp/resampling_audio.cpp | 218 +++++++++ doc/examples_cpp/scaling_video.cpp | 143 ++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 17 files changed, 4734 insertions(+), 3 deletions(-) 7c6a83b9b007df59913920f5c0084f5af16cf1d0 0001-added-CPlusPlus-examples.patch From a98dc136a7f66ef29be0b1bca6bf9eaa9a01e9cd Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Date: Tue, 18 Mar 2014 21:32:08 +0530 Subject: [PATCH] added CPlusPlus examples
--- Makefile | 7 +- doc/Makefile | 10 +- doc/examples_cpp/Makefile | 44 ++ doc/examples_cpp/README | 23 + doc/examples_cpp/avcodec.cpp | 659 ++++++++++++++++++++++++++++ doc/examples_cpp/avio_reading.cpp | 134 ++++++ doc/examples_cpp/demuxing_decoding.cpp | 387 +++++++++++++++++ doc/examples_cpp/filter_audio.cpp | 365 ++++++++++++++++ doc/examples_cpp/filtering_audio.cpp | 283 +++++++++++++ doc/examples_cpp/filtering_video.cpp | 263 ++++++++++++ doc/examples_cpp/metadata.cpp | 58 +++ doc/examples_cpp/muxing.cpp | 614 +++++++++++++++++++++++++++ doc/examples_cpp/remuxing.cpp | 173 ++++++++ doc/examples_cpp/resampling_audio.cpp | 218 ++++++++++ doc/examples_cpp/scaling_video.cpp | 143 +++++++ doc/examples_cpp/transcode_aac.cpp | 754 +++++++++++++++++++++++++++++++++ doc/examples_cpp/transcoding.cpp | 602 ++++++++++++++++++++++++++ 17 files changed, 4734 insertions(+), 3 deletions(-) create mode 100644 doc/examples_cpp/Makefile create mode 100644 doc/examples_cpp/README create mode 100644 doc/examples_cpp/avcodec.cpp create mode 100644 doc/examples_cpp/avio_reading.cpp create mode 100644 doc/examples_cpp/demuxing_decoding.cpp create mode 100644 doc/examples_cpp/filter_audio.cpp create mode 100644 doc/examples_cpp/filtering_audio.cpp create mode 100644 doc/examples_cpp/filtering_video.cpp create mode 100644 doc/examples_cpp/metadata.cpp create mode 100644 doc/examples_cpp/muxing.cpp create mode 100644 doc/examples_cpp/remuxing.cpp create mode 100644 doc/examples_cpp/resampling_audio.cpp create mode 100644 doc/examples_cpp/scaling_video.cpp create mode 100644 doc/examples_cpp/transcode_aac.cpp create mode 100644 doc/examples_cpp/transcoding.cpp
diff --git a/Makefile b/Makefile index f497f57..ca68bb5 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ FFLIBS := avutil DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README +CPP_EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples_cpp/*.cpp) $(SRC_PATH)/doc/examples_cpp/Makefile $(SRC_PATH)/doc/examples_cpp/README SKIPHEADERS = cmdutils_common_opts.h compat/w32pthreads.h @@ -146,10 +147,12 @@ install-progs: install-progs-yes $(AVPROGS) $(Q)mkdir -p "$(BINDIR)" $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)" -install-data: $(DATA_FILES) $(EXAMPLES_FILES) +install-data: $(DATA_FILES) $(EXAMPLES_FILES) $(CPP_EXAMPLES_FILES) $(Q)mkdir -p "$(DATADIR)/examples" + $(Q)mkdir -p "$(DATADIR)/examples_cpp" $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)" $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples" + $(INSTALL) -m 644 $(CPP_EXAMPLES_FILES) "$(DATADIR)/examples_cpp" uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data @@ -173,7 +176,7 @@ distclean:: config: $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION) -check: all alltools examples testprogs fate +check: all alltools examples examples_cpp testprogs fate include $(SRC_PATH)/tests/Makefile diff --git a/doc/Makefile b/doc/Makefile index 10f03cc..eddd6b4 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -56,6 +56,8 @@ ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)$(EXESU ALL_DOC_EXAMPLES_G := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)_g$(EXESUF)) PROGS += $(DOC_EXAMPLES) +DOC_EXAMPLES_CPP_DIR := doc/examples_cpp/ + all-$(CONFIG_DOC): doc doc: documentation @@ -65,6 +67,9 @@ documentation: $(DOCS) examples: $(DOC_EXAMPLES) +examples_cpp: + make -C $(DOC_EXAMPLES_CPP_DIR) this will not work on BSD as its called gmake there
+ TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ $(@:%=%.d) doc/%.txt: TAG = TXT @@ -158,7 +163,10 @@ examplesclean: $(RM) $(ALL_DOC_EXAMPLES) $(ALL_DOC_EXAMPLES_G) $(RM) $(CLEANSUFFIXES:%=doc/examples/%) -docclean: examplesclean +examples_cpp_clean: + make -C $(DOC_EXAMPLES_CPP_DIR) clean + +docclean: examplesclean examples_cpp_clean $(RM) $(CLEANSUFFIXES:%=doc/%) $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi $(RM) -r doc/doxy/html diff --git a/doc/examples_cpp/Makefile b/doc/examples_cpp/Makefile new file mode 100644 index 0000000..fc5ce9f --- /dev/null +++ b/doc/examples_cpp/Makefile @@ -0,0 +1,44 @@ + +CC=g++ its not guranteed the c++ compiler is called g++ nor is it guranteed that one is there at all
also if you want to maintain this code, please add yourself to the MAINTAINERs file
[...]
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Done the suggested changes
running a make distclean with this patch applied produces: Package libavdevice was not found in the pkg-config search path. Perhaps you should add the directory containing `libavdevice.pc' to the PKG_CONFIG_PATH environment variable No package 'libavdevice' found Package libswresample was not found in the pkg-config search path. Perhaps you should add the directory containing `libswresample.pc' to the PKG_CONFIG_PATH environment variable No package 'libswresample' found Package libavdevice was not found in the pkg-config search path. Perhaps you should add the directory containing `libavdevice.pc' to the PKG_CONFIG_PATH environment variable No package 'libavdevice' found Package libswresample was not found in the pkg-config search path. Perhaps you should add the directory containing `libswresample.pc' to the PKG_CONFIG_PATH environment variable No package 'libswresample' found
I am looking at it.
diff --git a/doc/Makefile b/doc/Makefile index 44049c4..5c1371a 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -36,6 +36,13 @@ DOCS-$(CONFIG_MANPAGES) += $(MANPAGES) DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES) DOCS = $(DOCS-yes)
+EXAMPLE_CPP_MAKE=make +EXAMPLE_CPP_MAKE_VERSION := $(shell $(EXAMPLE_CPP_MAKE) --version 2>
/dev/null )
+ifndef EXAMPLE_CPP_MAKE_VERSION +EXAMPLE_CPP_MAKE=gmake +EXAMPLE_CPP_MAKE_VERSION := $(shell $(EXAMPLE_CPP_MAKE) --version 2> /dev/null ) +endif
that looks really wrong a Makefile should not need to test for how the make application is called
[...]
This was done since you said make is not available on openBSD. I choose to call makefile, since I cant compile the code with existing makefile the default behavior of checking compiler for cpp has been changed in existing makefile. I am open for suggestions what should be done else. Thanks Anshul -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
On 04/13/2014 11:51 AM, Anshul wrote:
Michael Niedermayer <michaelni@gmx.at> wrote:
running a make distclean with this patch applied produces: Package libavdevice was not found in the pkg-config search path. Perhaps you should add the directory containing `libavdevice.pc' to the PKG_CONFIG_PATH environment variable No package 'libavdevice' found Package libswresample was not found in the pkg-config search path. Perhaps you should add the directory containing `libswresample.pc' to the PKG_CONFIG_PATH environment variable No package 'libswresample' found Package libavdevice was not found in the pkg-config search path. Perhaps you should add the directory containing `libavdevice.pc' to the PKG_CONFIG_PATH environment variable No package 'libavdevice' found Package libswresample was not found in the pkg-config search path. Perhaps you should add the directory containing `libswresample.pc' to the PKG_CONFIG_PATH environment variable No package 'libswresample' found
I am looking at it. Done.
diff --git a/doc/Makefile b/doc/Makefile index 44049c4..5c1371a 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -36,6 +36,13 @@ DOCS-$(CONFIG_MANPAGES) += $(MANPAGES) DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES) DOCS = $(DOCS-yes)
+EXAMPLE_CPP_MAKE=make +EXAMPLE_CPP_MAKE_VERSION := $(shell $(EXAMPLE_CPP_MAKE) --version 2>
+ifndef EXAMPLE_CPP_MAKE_VERSION +EXAMPLE_CPP_MAKE=gmake +EXAMPLE_CPP_MAKE_VERSION := $(shell $(EXAMPLE_CPP_MAKE) --version 2> /dev/null ) +endif
/dev/null ) that looks really wrong a Makefile should not need to test for how the make application is called
[...] This was done since you said make is not available on openBSD. I choose to call makefile, since I cant compile the code with existing makefile the default behavior of checking compiler for cpp has been changed in existing makefile.
I am open for suggestions what should be done else.
I got , There is another way, i have used $(MAKE) now. here is the link i followed <http://www.gnu.org/software/make/manual/make.html#MAKE-Variable> Thanks for hint -Anshul
On Mon, Apr 14, 2014 at 04:51:44PM +0530, anshul wrote:
On 04/13/2014 11:51 AM, Anshul wrote:
Michael Niedermayer <michaelni@gmx.at> wrote:
running a make distclean with this patch applied produces: Package libavdevice was not found in the pkg-config search path. Perhaps you should add the directory containing `libavdevice.pc' to the PKG_CONFIG_PATH environment variable No package 'libavdevice' found Package libswresample was not found in the pkg-config search path. Perhaps you should add the directory containing `libswresample.pc' to the PKG_CONFIG_PATH environment variable No package 'libswresample' found Package libavdevice was not found in the pkg-config search path. Perhaps you should add the directory containing `libavdevice.pc' to the PKG_CONFIG_PATH environment variable No package 'libavdevice' found Package libswresample was not found in the pkg-config search path. Perhaps you should add the directory containing `libswresample.pc' to the PKG_CONFIG_PATH environment variable No package 'libswresample' found
I am looking at it. Done.
diff --git a/doc/Makefile b/doc/Makefile index 44049c4..5c1371a 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -36,6 +36,13 @@ DOCS-$(CONFIG_MANPAGES) += $(MANPAGES) DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES) DOCS = $(DOCS-yes) +EXAMPLE_CPP_MAKE=make +EXAMPLE_CPP_MAKE_VERSION := $(shell $(EXAMPLE_CPP_MAKE) --version 2> /dev/null ) +ifndef EXAMPLE_CPP_MAKE_VERSION +EXAMPLE_CPP_MAKE=gmake +EXAMPLE_CPP_MAKE_VERSION := $(shell $(EXAMPLE_CPP_MAKE) --version 2> /dev/null ) +endif that looks really wrong a Makefile should not need to test for how the make application is called
[...] This was done since you said make is not available on openBSD. I choose to call makefile, since I cant compile the code with existing makefile the default behavior of checking compiler for cpp has been changed in existing makefile.
I am open for suggestions what should be done else.
I got , There is another way, i have used $(MAKE) now. here is the link i followed <http://www.gnu.org/software/make/manual/make.html#MAKE-Variable> Thanks for hint
if i run make distclean with this patch applied i get make distclean make -C doc/examples_cpp/ clean make[1]: Entering directory `ffmpeg/doc/examples_cpp' rm -f test*.pgm test.h264 test.mp2 test.sw test.mpg rm -f avio_reading avcodec demuxing_decoding filtering_video filtering_audio metadata muxing remuxing resampling_audio scaling_video transcode_aac transcoding avio_reading.o avcodec.o demuxing_decoding.o filtering_video.o filtering_audio.o metadata.o muxing.o remuxing.o resampling_audio.o scaling_video.o transcode_aac.o transcoding.o make[1]: Leaving directory `ffmpeg/doc/examples_cpp Why does this show examples_cpp but not examples, why is it different? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are best at talking, realize last or never when they are wrong.
On 04/29/2014 03:18 AM, Michael Niedermayer wrote:
On Mon, Apr 14, 2014 at 04:51:44PM +0530, anshul wrote:
On 04/13/2014 11:51 AM, Anshul wrote:
Michael Niedermayer <michaelni@gmx.at> wrote:
running a make distclean with this patch applied produces: Package libavdevice was not found in the pkg-config search path. Perhaps you should add the directory containing `libavdevice.pc' to the PKG_CONFIG_PATH environment variable No package 'libavdevice' found Package libswresample was not found in the pkg-config search path. Perhaps you should add the directory containing `libswresample.pc' to the PKG_CONFIG_PATH environment variable No package 'libswresample' found Package libavdevice was not found in the pkg-config search path. Perhaps you should add the directory containing `libavdevice.pc' to the PKG_CONFIG_PATH environment variable No package 'libavdevice' found Package libswresample was not found in the pkg-config search path. Perhaps you should add the directory containing `libswresample.pc' to the PKG_CONFIG_PATH environment variable No package 'libswresample' found
I am looking at it. Done.
diff --git a/doc/Makefile b/doc/Makefile index 44049c4..5c1371a 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -36,6 +36,13 @@ DOCS-$(CONFIG_MANPAGES) += $(MANPAGES) DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES) DOCS = $(DOCS-yes) +EXAMPLE_CPP_MAKE=make +EXAMPLE_CPP_MAKE_VERSION := $(shell $(EXAMPLE_CPP_MAKE) --version 2> /dev/null ) +ifndef EXAMPLE_CPP_MAKE_VERSION +EXAMPLE_CPP_MAKE=gmake +EXAMPLE_CPP_MAKE_VERSION := $(shell $(EXAMPLE_CPP_MAKE) --version 2> /dev/null ) +endif that looks really wrong a Makefile should not need to test for how the make application is called
[...] This was done since you said make is not available on openBSD. I choose to call makefile, since I cant compile the code with existing makefile the default behavior of checking compiler for cpp has been changed in existing makefile.
I am open for suggestions what should be done else.
I got , There is another way, i have used $(MAKE) now. here is the link i followed <http://www.gnu.org/software/make/manual/make.html#MAKE-Variable> Thanks for hint if i run make distclean with this patch applied i get
make distclean make -C doc/examples_cpp/ clean make[1]: Entering directory `ffmpeg/doc/examples_cpp' rm -f test*.pgm test.h264 test.mp2 test.sw test.mpg rm -f avio_reading avcodec demuxing_decoding filtering_video filtering_audio metadata muxing remuxing resampling_audio scaling_video transcode_aac transcoding avio_reading.o avcodec.o demuxing_decoding.o filtering_video.o filtering_audio.o metadata.o muxing.o remuxing.o resampling_audio.o scaling_video.o transcode_aac.o transcoding.o make[1]: Leaving directory `ffmpeg/doc/examples_cpp
Why does this show examples_cpp but not examples, why is it different?
[...]
C examples are using doc/Makefile not the doc/example/Makefile for c language all the option and setting which are used for ffmpeg would work, but for C++ language options for ffmpeg does not work. therefore using doc/Makefile would not be feasible. Thanks Anshul Maheshwari
participants (10)
-
Alexander Strasser -
Anshul -
Clément Bœsch -
Don Moir -
Geek.Song -
Michael Niedermayer -
Nicolas George -
Reimar Döffinger -
Stefano Sabatini -
wm4