diff --git a/common.mak b/common.mak index 6836c11241dee71e4caacbb438e178aa835911fe..ade937619188853198c16c6c95c43a91d0d6134f 100644 --- a/common.mak +++ b/common.mak @@ -14,7 +14,6 @@ TESTPROGS += $(TESTPROGS-yes) LDLIBS = $(FFLIBS:%=%$(BUILDSUF)) FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS) -EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF)) OBJS := $(sort $(OBJS:%=$(SUBDIR)%)) TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o) TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF)) diff --git a/configure b/configure index a5407c7c5b91611b3096b25a913839509532ee18..292da47f72343a831bef9938c3e75ea4159bdbf6 100755 --- a/configure +++ b/configure @@ -1095,6 +1095,8 @@ COMPONENT_LIST=" " EXAMPLE_LIST=" + avcodec_example + metadata_example output_example transcode_aac_example " @@ -2020,6 +2022,8 @@ ocv_filter_deps="libopencv" scale_filter_deps="swscale" # examples +avcodec_example_deps="avcodec avutil" +metadata_example_deps="avformat avutil" output_example_deps="avcodec avformat avutil swscale" transcode_aac_example_deps="avcodec avformat avresample" diff --git a/doc/Makefile b/doc/Makefile index 6af811653345166a6253a846c2304c4e5babf883..0cb2335768c4e63825f75f9a01234317d5b1e7e9 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -15,9 +15,11 @@ DOCS-$(CONFIG_POD2MAN) += $(MANPAGES) $(PODPAGES) DOCS-$(CONFIG_TEXI2HTML) += $(HTMLPAGES) DOCS = $(DOCS-yes) +DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE) += avcodec +DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata DOC_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE) += output DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE) += transcode_aac -ALL_DOC_EXAMPLES = output transcode_aac +ALL_DOC_EXAMPLES = avcodec metadata output transcode_aac DOC_EXAMPLES := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF)) ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES:%=doc/examples/%$(EXESUF)) diff --git a/doc/doxy-wrapper.sh b/doc/doxy-wrapper.sh index e1b8363e5f732aa4efa32c109727602e1265faae..d38dd0bcdd155dfc695f61225040e0d9086d3bd9 100755 --- a/doc/doxy-wrapper.sh +++ b/doc/doxy-wrapper.sh @@ -8,7 +8,7 @@ shift 2 doxygen - <<EOF @INCLUDE = ${DOXYFILE} INPUT = $@ -EXAMPLE_PATH = ${SRC_PATH}/ +EXAMPLE_PATH = ${SRC_PATH}/doc/examples HTML_HEADER = ${SRC_PATH}/doc/doxy/header.html HTML_FOOTER = ${SRC_PATH}/doc/doxy/footer.html HTML_STYLESHEET = ${SRC_PATH}/doc/doxy/doxy_stylesheet.css diff --git a/libavcodec/api-example.c b/doc/examples/avcodec.c similarity index 99% rename from libavcodec/api-example.c rename to doc/examples/avcodec.c index 6abbddc7a7a5f468f513acc29d93339f06bcfadb..1478881c2533d54bc04217e16d250228f64c7a50 100644 --- a/libavcodec/api-example.c +++ b/doc/examples/avcodec.c @@ -22,7 +22,7 @@ * @file * libavcodec API use example. * - * @example libavcodec/api-example.c + * @example avcodec.c * Note that this library only handles codecs (mpeg, mpeg4, etc...), * not file formats (avi, vob, etc...). See library 'libavformat' for the * format handling diff --git a/libavformat/metadata-example.c b/doc/examples/metadata.c similarity index 97% rename from libavformat/metadata-example.c rename to doc/examples/metadata.c index 7bf77e73788d4aa43af9b75260f574c3825fc944..f4c6eee9c389e63885a7e4cdebcfe9f6fa03ab44 100644 --- a/libavformat/metadata-example.c +++ b/doc/examples/metadata.c @@ -22,7 +22,7 @@ /** * @file - * @example libavformat/metadata-example.c + * @example metadata.c * Shows how the metadata API can be used in application programs. */ diff --git a/doc/examples/output.c b/doc/examples/output.c index 3be85dec9a3c545fabc2505e96a44c4c8eea5d35..dd0e6a224e6b599b554f85be059ec7e162a5f172 100644 --- a/doc/examples/output.c +++ b/doc/examples/output.c @@ -24,7 +24,7 @@ * @file * libavformat API example. * - * @example doc/examples/output.c + * @example output.c * Output a media file in any supported libavformat format. The default * codecs are used. */ diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c index 07f7fe765ee8ac325938f03ab8b73605eb78713f..6206afe2e45136c93b6f07d1feabd54f8d8cf15f 100644 --- a/doc/examples/transcode_aac.c +++ b/doc/examples/transcode_aac.c @@ -20,7 +20,7 @@ * @file * simple audio converter * - * @example doc/examples/transcode_aac.c + * @example transcode_aac.c * Convert an input audio file to AAC in an MP4 container using Libav. * @author Andreas Unterweger (dustsigns@gmail.com) */ diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 58defc9c21b966a1a1d123383de65f7449117a2e..7b50c2787888a1a9fa156f15003755e6a7a5d3dc 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -697,8 +697,6 @@ SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_internal.h SKIPHEADERS-$(CONFIG_VDA) += vda.h SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h -EXAMPLES = api - TESTPROGS = dct \ fft \ fft-fixed \ diff --git a/libavformat/Makefile b/libavformat/Makefile index 4da3c3b08237583c6dc8a45648480a8976ad7276..d491d43fd2e152bcd589875a2132fee5beff3479 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -392,8 +392,6 @@ OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o SKIPHEADERS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh.h SKIPHEADERS-$(CONFIG_NETWORK) += network.h rtsp.h -EXAMPLES = metadata \ - TESTPROGS = seek \ srtp \ url \ diff --git a/library.mak b/library.mak index 800c5e07f3914966294706fb67686f7f6091fe53..af33206434ec50af36294dd93f189f77c8e64019 100644 --- a/library.mak +++ b/library.mak @@ -5,7 +5,6 @@ LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR) LIBMINOR := $(lib$(NAME)_VERSION_MINOR) INCINSTDIR := $(INCDIR)/lib$(NAME) -LIB_EXAMPLES := $(LIB_EXAMPLES) $(EXAMPLES) INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%) all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME) @@ -43,10 +42,10 @@ install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared define RULES -$(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB)) -$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME) +$(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB)) +$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME) -$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS) +$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS) $$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS) $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) @@ -58,7 +57,7 @@ $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver $(DEP_LIBS) $(SLIB_EXTRA_CMD) clean:: - $(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ + $(RM) $(addprefix $(SUBDIR),*-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ $(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) distclean:: clean @@ -101,8 +100,7 @@ endef $(eval $(RULES)) -$(EXAMPLES) $(TOOLS): $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME) -$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME) +$(TOOLS): $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME) +$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME) -examples: $(EXAMPLES) testprogs: $(TESTPROGS)