Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 12
Registered: ‎12-03-2013
My Device: Developer
My Carrier: none
Accepted Solution

ffmpeg compilation problem

[ Edited ]

I have compiled ffmpeg along with the other libraries I need for Blackberry 10. I am getting the following two errors when including the library in my project

 

/Applications/Momentics.app/target_10_2_0_1155/qnx6/usr/include/cpp/xlocinfo:167:10: error: 'strftime' is not a member of 'std'

 

../../../ffmpeg/ffmpeg-2.0.2/dist/include/libavutil/time.h:29:1: error: 'int64_t' does not name a type

 

Could someone help me out with these issues? I'm not completey sure where to go. When I find int64_t in time.h and select "Open Declaration" it takes me to its declaration in stdint.h (/Applications/Momentics.app/target_10_2_0_1155/qnx6/usr/include/stdint.h) so it seems like it is defined. The use in time.h:

 

/**

 * Get the current time in microseconds.

 */

int64_t av_gettime(void);

 

New Developer
Posts: 12
Registered: ‎12-03-2013
My Device: Developer
My Carrier: none

Re: ffmpeg compilation problem

After reading doturner's guide (http://supportforums.blackberry.com/t5/Native-Development/Porting-libraries-ffmpeg/td-p/2685845) I was able to get rid of the errors above. The change I made was to make the library shared instead of static. I am now running into another problem.

 

../ffmpeg/include/libavutil/common.h:178:47: error: 'UINT64_C' was not declared in this scope

 

Maybe something to do with the compiler used to compile ffmpeg?

New Developer
Posts: 12
Registered: ‎12-03-2013
My Device: Developer
My Carrier: none

Re: ffmpeg compilation problem

[ Edited ]

Well I may have spoken too soon. The initial errors returned. I was able to get rid of the UINT64_C error by adding this to the labavutil/common.h file:

 

#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif

 

Now I'm back to the int64_t and strftime issues. Anyone have any ideas?

Highlighted
New Developer
Posts: 12
Registered: ‎12-03-2013
My Device: Developer
My Carrier: none

Re: ffmpeg compilation problem

[ Edited ]

In case anyone comes across this, I was able to get the library compiled and included in the project. The instructions on doturner's post are correct. I was sourcing the wrong bbndk-env script and I think that was causing some issue. I still received the UINT64_C error, but they were fixed by including the library headers like this:

 

extern"C"

{

#define UINT64_C uint64_t

#define INT64_C int64_t

#include<libavformat/avformat.h>

...

}

 

You don't need to change the library files at all, so don't do what I did in the post above. The definition of UINT64_C and INT64_C take care of it.