Click here to Skip to main content
15,897,094 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Eytukan13-Jun-06 22:11
Eytukan13-Jun-06 22:11 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 22:22
RahulOP13-Jun-06 22:22 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 22:16
RahulOP13-Jun-06 22:16 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen13-Jun-06 22:27
Cedric Moonen13-Jun-06 22:27 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 22:39
RahulOP13-Jun-06 22:39 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen13-Jun-06 23:14
Cedric Moonen13-Jun-06 23:14 
GeneralRe: Error when using libavcodec dll in vc++ [modified] Pin
RahulOP13-Jun-06 23:29
RahulOP13-Jun-06 23:29 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP14-Jun-06 21:00
RahulOP14-Jun-06 21:00 
All right to cut a long story short, the lib files were faulty. So I went back to Dynamic Linking.
AVCodec *codec;<br />
 int i, out_size, size, x, y, outbuf_size;<br />
    FILE *f;    <br />
    uint8_t *outbuf, *picture_buf;<br />
<br />
<br />
HMODULE hDll3 = LoadLibrary("avcodec.dll");<br />
typedef void (avcodec_find_encoder)(int CODECID);<br />
avcodec_find_encoder* p3 = (avcodec_find_encoder*)GetProcAddress(hDll3, "avcodec_find_encoder");<br />
if(p3==NULL)<br />
AfxMessageBox("Failed loading3");<br />
p3(CODEC_ID_MPEG1VIDEO);<br />
if(p3==NULL)<br />
AfxMessageBox("Failed loading3");<br />
<br />
<br />
codec=(AVCodec *)p3;<br />
<br />
HMODULE hDll4 = LoadLibrary("avcodec.dll");<br />
//(hDll should not be NULL here)<br />
typedef AVCodecContext* (avcodec_alloc_context)();<br />
avcodec_alloc_context* p4 = (avcodec_alloc_context*)GetProcAddress(hDll4, "avcodec_alloc_context");<br />
if(p4==NULL)<br />
AfxMessageBox("Failed loading4");<br />
p4();<br />
if(p4==NULL)<br />
AfxMessageBox("Failed loading4");<br />
<br />
AVCodecContext *avctx = p4();<br />
<br />
    avctx->bit_rate=400000;<br />
    avctx->width = 352;  <br />
    avctx->height = 288;<br />
    /* frames per second */<br />
    avctx->frame_rate = 25;  <br />
    avctx->frame_rate_base= 1;<br />
    avctx->gop_size = 10; /* emit one intra frame every ten frames */<br />
    avctx->max_b_frames=1;<br />
<br />
HMODULE hDll2 = LoadLibrary("avcodec.dll");<br />
//(hDll should not be NULL here)<br />
typedef int (avcodec_open)(AVCodecContext *avctx, AVCodec *codec);<br />
avcodec_open* p2 = (avcodec_open*)GetProcAddress(hDll2, "avcodec_open");<br />
if(p2==NULL)<br />
AfxMessageBox("Failed loading2");<br />
p2((AVCodecContext *)p4,(AVCodec*)p3);<br />

Notice the last line--p2. p2 should be of the form (avctx,codec) i.e.alloc_code_context and avcodec_find_Encoder. The problem(given my display of my knowledge of pointes, does this really surprise you?) is that I cant pass avctx and codec directly. Also, since avctx takes values like bit_rate, width,height, those have to be reflected when I open the required codec. Any ideas??
GeneralRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen15-Jun-06 1:24
Cedric Moonen15-Jun-06 1:24 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP15-Jun-06 2:53
RahulOP15-Jun-06 2:53 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Eytukan13-Jun-06 22:27
Eytukan13-Jun-06 22:27 
AnswerRe: Error when using libavcodec dll in vc++ Pin
Viorel.13-Jun-06 21:00
Viorel.13-Jun-06 21:00 
AnswerRe: Error when using libavcodec dll in vc++ Pin
Eytukan13-Jun-06 22:01
Eytukan13-Jun-06 22:01 
Question[Message Deleted] Pin
angelfirefox13-Jun-06 20:07
angelfirefox13-Jun-06 20:07 
AnswerRe: CTreeCtrl Height bright Display Pin
Sarath C13-Jun-06 20:35
Sarath C13-Jun-06 20:35 
AnswerRe: CTreeCtrl Height bright Display Pin
Hamid_RT13-Jun-06 20:47
Hamid_RT13-Jun-06 20:47 
QuestionRe: [Message Deleted] Pin
toxcct13-Jun-06 22:24
toxcct13-Jun-06 22:24 
AnswerRe: [Message Deleted] Pin
ThatsAlok13-Jun-06 22:44
ThatsAlok13-Jun-06 22:44 
QuestionCRichEditCtrl show gif [modified] Pin
chybin13-Jun-06 20:03
chybin13-Jun-06 20:03 
QuestionSet beginning of file? Pin
_johan13-Jun-06 20:02
_johan13-Jun-06 20:02 
AnswerRe: Set beginning of file? Pin
kakan13-Jun-06 20:08
professionalkakan13-Jun-06 20:08 
AnswerRe: Set beginning of file? Pin
Laxman Auti13-Jun-06 20:25
Laxman Auti13-Jun-06 20:25 
GeneralRe: Set beginning of file? Pin
_johan13-Jun-06 20:30
_johan13-Jun-06 20:30 
Questionhow to convert output of console based in VC++ to windows based in C++ .NET Pin
YogeshRT13-Jun-06 19:31
YogeshRT13-Jun-06 19:31 
AnswerRe: how to convert output of console based in VC++ to windows based in C++ .NET Pin
_AnsHUMAN_ 13-Jun-06 19:34
_AnsHUMAN_ 13-Jun-06 19:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.