openbsd-ports/net/openh323/patches/patch-src_ffh263codec_cxx
jakemsr 6838aeee39 * FFmpeg headers moved
* FFmpeg LIB_DEPENDS/WANTLIB changes
* add @bin markers in PLISTs
* bump PKGNAMEs

feedback/ok brad@
2008-07-09 02:07:36 +00:00

96 lines
3.0 KiB
Plaintext

$OpenBSD: patch-src_ffh263codec_cxx,v 1.3 2008/07/09 02:13:59 jakemsr Exp $
--- src/ffh263codec.cxx.orig Tue Dec 7 18:03:59 2004
+++ src/ffh263codec.cxx Sun Jun 29 16:00:47 2008
@@ -142,6 +142,7 @@
*
*/
#include <ptlib.h>
+#include <ptlib/video.h>
#include "h263codec.h"
#ifdef __GNUC__
@@ -193,7 +194,7 @@ class FfmpgLink : public H323DynaLink
AVFrame *AvcodecAllocFrame(void);
- BOOL IsLoaded();
+ //BOOL IsLoaded();
int AvcodecClose(AVCodecContext *ctx);
int AvcodecDecodeVideo(AVCodecContext *ctx, AVFrame *picture, int *got_picture_ptr, BYTE *buf, int buf_size);
@@ -217,7 +218,9 @@ class FfmpgLink : public H323DynaLink
void (*Favcodec_get_context_defaults)(AVCodecContext *s);
void (*Favcodec_init)(void);
+#ifdef H323_RFC2190_AVCODEC
void (*Favcodec_set_print_fn)(void (*print_fn)(char *));
+#endif
void (*Favcodec_register_all)(void);
};
@@ -287,17 +290,21 @@ FfmpgLink::FfmpgLink()
return;
}
+#ifdef H323_RFC2190_AVCODEC
if (!GetFunction("avcodec_set_print_fn", (Function &)Favcodec_set_print_fn)) {
cerr << "Failed to load avcodec_set_print_fn" << endl;
return;
}
+#endif
/* must be called before using avcodec lib */
Favcodec_init();
Favcodec_register_all();
+#ifdef H323_RFC2190_AVCODEC
Favcodec_set_print_fn(h263_ffmpeg_printon);
+#endif
isLoadedOK = TRUE;
}
@@ -357,7 +364,7 @@ int FfmpgLink::AvcodecDecodeVideo(AVCodecContext *ctx,
PWaitAndSignal m(processLock);
PTRACE(6, "Avcodec decode video at " << ::hex << ctx << " frame" << picture
- << " buf" << (int)buf << ::dec << " got picture" << *got_picture_ptr
+ << " buf" << (long)buf << ::dec << " got picture" << *got_picture_ptr
<< " buffer size is" << buf_size);
int res = Favcodec_decode_video(ctx, picture, got_picture_ptr, buf, buf_size);
PTRACE(6, "Avcodec decode video of " <<buf_size << " bytes. result is " << res );
@@ -370,7 +377,7 @@ int FfmpgLink::AvcodecEncodeVideo(AVCodecContext *ctx,
PWaitAndSignal m(processLock);
PTRACE(6, "Avcodec encode video for ctxt " << ::hex << ctx << " picture" << pict
- << " buf" << (int)buf << ::dec << " buffer size is" << buf_size);
+ << " buf" << (long)buf << ::dec << " buffer size is" << buf_size);
int res = Favcodec_encode_video(ctx, buf, buf_size, pict);
PTRACE(6, "Avcodec encode video into " << res << " bytes.");
@@ -388,10 +395,12 @@ void FfmpgLink::AvcodecInit(void)
Favcodec_init();
}
+#ifdef H323_RFC2190_AVCODEC
void FfmpgLink::AvcodecSetPrintFn(void (*print_fn)(char *))
{
Favcodec_set_print_fn(print_fn);
}
+#endif
void FfmpgLink::AFavcodecRegisterAll(void)
{
@@ -614,9 +623,9 @@ void H323_FFH263Codec::InitialiseCodec()
}
#ifdef FRAME_RATE_BASE
- context->frame_rate = framesPerSec * FRAME_RATE_BASE;
+ context->time_base.den = framesPerSec * FRAME_RATE_BASE;
#else
- context->frame_rate = framesPerSec * DEFAULT_FRAME_RATE_BASE;
+ context->time_base.den = framesPerSec * DEFAULT_FRAME_RATE_BASE;
#endif
context->rtp_mode = 0;