Click here to Skip to main content
15,906,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: dlete pointer. Pin
Hamid_RT13-Jun-06 22:10
Hamid_RT13-Jun-06 22:10 
GeneralRe: delete pointer. Pin
see me13-Jun-06 22:27
see me13-Jun-06 22:27 
GeneralRe: delete pointer. Pin
Hamid_RT13-Jun-06 22:51
Hamid_RT13-Jun-06 22:51 
Questionhow to know the values for event masks Pin
thathvamsi13-Jun-06 21:12
thathvamsi13-Jun-06 21:12 
AnswerRe: how to know the values for event masks Pin
Viorel.13-Jun-06 21:19
Viorel.13-Jun-06 21:19 
GeneralRe: how to know the values for event masks Pin
thathvamsi13-Jun-06 22:37
thathvamsi13-Jun-06 22:37 
AnswerRe: how to know the values for event masks Pin
Hamid_RT13-Jun-06 22:20
Hamid_RT13-Jun-06 22:20 
GeneralRe: how to know the values for event masks Pin
thathvamsi13-Jun-06 22:36
thathvamsi13-Jun-06 22:36 
QuestionOpen vc8 project using vc7.1 [modified] Pin
chybin13-Jun-06 20:55
chybin13-Jun-06 20:55 
QuestionError when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 20:50
RahulOP13-Jun-06 20:50 
AnswerRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen13-Jun-06 20:59
Cedric Moonen13-Jun-06 20:59 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 21:09
RahulOP13-Jun-06 21:09 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen13-Jun-06 21:24
Cedric Moonen13-Jun-06 21:24 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 21:41
RahulOP13-Jun-06 21:41 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen13-Jun-06 21:50
Cedric Moonen13-Jun-06 21:50 
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 

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.