.so include errors and functions errors

Put problems with the Android NDK in this forum.

.so include errors and functions errors

Postby BerlinerMC » Wed Nov 03, 2010 1:13 pm

Hello Android devs,

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;


}
BerlinerMC
Freshman
Freshman
 
Posts: 5
Joined: Sun Jan 17, 2010 10:48 pm

Top

Re: .so include errors and functions errors

Postby lancelot » Mon Jan 31, 2011 10:27 am

Hi,

I'm facing the same problem. Did you solved it???

Thanks.
lancelot
Freshman
Freshman
 
Posts: 2
Joined: Tue Dec 04, 2007 1:40 pm

Top

Return to NDK Problems

Who is online

Users browsing this forum: No registered users and 5 guests