i have a little problem -.-
I compiled successful ffmpeg with the ndk!!
But then i created a new .cpp class and included some ffmpeg libs and the ndk cant find the header files.
So what can i do?!
My Android.mk file:
- Code: Select all
include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES := ffmpeg \
LOCAL_C_INCLUDES += $(PATH_TO_FFMPEG_SOURCE)
LOCAL_LDLIBS += -L$(PATH_TO_LIBFFMPEG_SO) -lffmpeg
LOCAL_MODULE := ffmpegtests
LOCAL_SRC_FILES := FFMpegTests.cpp
include $(BUILD_SHARED_LIBRARY)
My .cpp class:
- Code: Select all
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}
#include "FFMpegTests.h"
FFMpegTests::FFMpegTests() {
// TODO Auto-generated constructor stub
}
FFMpegTests::~FFMpegTests() {
// TODO Auto-generated destructor stub
}
extern "C"
int FFMpegTests::showFilmInformation() {
/*
* Starts with ffmpeg source
*/
av_register_all();
AVFormatContext *pFormatCtx;
const char* filename = "irgenwas";
/*
* Open video file
* We get our filename from the first argument.
* This function reads the file header and stores information about the file format
* in the AVFormatContext structure we have given it.
* The last three arguments are used to specify the file format,
* buffer size, and format options, but by setting this to NULL or 0,
* libavformat will auto-detect these.
*/
if (av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL) != 0) {
return -1; //Couldn't open file
}
// Retrieve stream information
if(av_find_stream_info(pFormatCtx)<0) {
return -1; //Couldn't find stream information
}
/*
*This function populates pFormatCtx->streams with the proper information.
*This We introduce a handy debugging function to show us what's inside:
*/
// Dump information about file onto standard error
//dump_format(pFormatCtx, 0, filename, 0);
return 1;
}

