-Index: libinstrudeo-0.1.4/configure.ac
-===================================================================
---- libinstrudeo-0.1.4.orig/configure.ac
-+++ libinstrudeo-0.1.4/configure.ac
-@@ -92,6 +92,7 @@ AC_CHECK_LIB([vorbisenc], [vorbis_encode
+ configure.ac | 3 ++-
+ src/libinstrudeo/isdffmpegexporter.cpp | 17 +++++++++++------
+ src/libinstrudeo/isdffmpegexporter.h | 7 +++++--
+ 3 files changed, 18 insertions(+), 9 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2549623..002f4f4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -92,6 +92,7 @@ AC_CHECK_LIB([vorbisenc], [vorbis_encode_init], , AC_MSG_ERROR([*** vorbisenc mi
AC_CHECK_LIB([theora], [theora_info_init], , AC_MSG_ERROR([*** theora missing - please install libtheora development package ***]))
AC_CHECK_LIB([avcodec], [avcodec_init], , AC_MSG_ERROR([*** avcodec missing - please install avcodec development package ***]), [-lavutil])
AC_CHECK_LIB([avformat], [av_open_input_stream], , AC_MSG_ERROR([*** avformat missing - please install avformat development package ***]), [-lavutil])
AC_CONFIG_FILES(Makefile src/Makefile src/libinstrudeo/webservice/Makefile src/libinstrudeo/Makefile src/isdexport/Makefile data/Makefile data/commentboxes/Makefile data/fonts/Makefile)
-AC_OUTPUT
-\ Pas de fin de ligne à la fin du fichier.
+\ No newline at end of file
+AC_OUTPUT
-Index: libinstrudeo-0.1.4/src/libinstrudeo/isdffmpegexporter.cpp
-===================================================================
---- libinstrudeo-0.1.4.orig/src/libinstrudeo/isdffmpegexporter.cpp
-+++ libinstrudeo-0.1.4/src/libinstrudeo/isdffmpegexporter.cpp
+diff --git a/src/libinstrudeo/isdffmpegexporter.cpp b/src/libinstrudeo/isdffmpegexporter.cpp
+index 3bf38f5..62836c2 100644
+--- a/src/libinstrudeo/isdffmpegexporter.cpp
++++ b/src/libinstrudeo/isdffmpegexporter.cpp
@@ -79,6 +79,7 @@ ISDFFmpegExporter::~ISDFFmpegExporter()
ISDObject::ISDErrorCode ISDFFmpegExporter::doExport(char* pixelBuffer)
{
if (!initOK) {
LOG_WARNING("Export routine called without initializing the encoder.");
-@@ -96,6 +97,10 @@ ISDObject::ISDErrorCode ISDFFmpegExporte
+@@ -95,6 +96,9 @@ ISDObject::ISDErrorCode ISDFFmpegExporter::doExport(char* pixelBuffer)
+ int bufSize = videoProperties->getHeight()*videoProperties->getWidth()*videoProperties->getBytesPerPixel();
grabBuffer = (char*)malloc(bufSize);
}
-
+ toYUV_convert_ctx = sws_getContext(codecContext->width, codecContext->height, inputPixFmt,
+ outputContext->streams[0]->codec->width, outputContext->streams[0]->codec->height,
+ FFMPEG_STREAM_PIX_FMT, SWS_BICUBIC, NULL, NULL, NULL);
-+
+
/*
* Note: video time is in milliseconds, so if we have a framerate
- * of 25, we must increment the loop with 1000/25 milliseconds
-@@ -126,13 +131,13 @@ ISDObject::ISDErrorCode ISDFFmpegExporte
+@@ -126,12 +130,13 @@ ISDObject::ISDErrorCode ISDFFmpegExporter::doExport(char* pixelBuffer)
}
//convert input pic to yuv420p
- LOG_WARNING("Pixel format conversion not handled while exporting.");
- RETURN_ERROR(ISD_EXPORT_FORMAT_ERROR);
- }
--
+ if (sws_scale(toYUV_convert_ctx, inputPicture.data, inputPicture.linesize, 0, codecContext->height,
+ yuvInputPicture.data, yuvInputPicture.linesize) < 0)
+ {
+ RETURN_ERROR(ISD_EXPORT_FORMAT_ERROR);
+ }
+
+
outSize = avcodec_encode_video(codecContext, outputBuf, outputBufSize, inputFrame);
//if zero size, it means the image was buffered
- if (outSize > 0) {
-Index: libinstrudeo-0.1.4/src/libinstrudeo/isdffmpegexporter.h
-===================================================================
---- libinstrudeo-0.1.4.orig/src/libinstrudeo/isdffmpegexporter.h
-+++ libinstrudeo-0.1.4/src/libinstrudeo/isdffmpegexporter.h
+diff --git a/src/libinstrudeo/isdffmpegexporter.h b/src/libinstrudeo/isdffmpegexporter.h
+index 06082ec..b69f317 100644
+--- a/src/libinstrudeo/isdffmpegexporter.h
++++ b/src/libinstrudeo/isdffmpegexporter.h
@@ -47,8 +47,11 @@
#include <libinstrudeo/isdexporter.h>
+-#include <ffmpeg/avcodec.h>
+-#include <ffmpeg/avformat.h>
+extern "C" {
- #include <libavcodec/avcodec.h>
- #include <libavformat/avformat.h>
++#include <libavcodec/avcodec.h>
++#include <libavformat/avformat.h>
+#include <libswscale/swscale.h>
+}