I defined the following header file (in C), did not use the implementation of the function, since this is not required:
#ifndef FFMPEG_MEDIAMETADATARETRIEVER_H_ #define FFMPEG_MEDIAMETADATARETRIEVER_H_ #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libavutil/dict.h> int setDataSource(AVFormatContext** pFormatCtx, const char* path); #endif /*FFMPEG_MEDIAMETADATARETRIEVER_H_*/
In C ++, I defined my second header file:
#ifndef MEDIAMETADATARETRIEVER_H #define MEDIAMETADATARETRIEVER_H using namespace std; extern "C" { #include "ffmpeg_mediametadataretriever.h" } class MediaMetadataRetriever { public: MediaMetadataRetriever(); ~MediaMetadataRetriever(); int setDataSource(const char* dataSourceUrl); }; #endif
In, mediametadataretriever.cpp I defined the following function:
int MediaMetadataRetriever::setDataSource( const char *srcUrl) {
When I try to compile this (C ++) project in Eclipse, I get the error message "There is no function matching ..." associated with:
return setDataSource(&pFormatCtx, srcUrl);
If I comment on the call, the code compiles fine:
int MediaMetadataRetriever::setDataSource( const char *srcUrl) { return 0; }
This seems to be a binding problem, does anyone know what I'm doing wrong?
source share