Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv11161/src

Modified Files:
        FFmpeg.cpp FFmpeg.h 
Log Message:
New functions being imported from FFmpeg libraries (will be required for 
exporter and required for some improvements in importer).
Moved log callback to FFmpeg.cpp (used in both importer and exporter).
Changed import progress report - file size is used.

Index: FFmpeg.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/FFmpeg.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- FFmpeg.cpp  6 Jun 2008 21:26:16 -0000       1.5
+++ FFmpeg.cpp  12 Jun 2008 09:16:39 -0000      1.6
@@ -24,10 +24,38 @@
 #endif
 
 #if defined(USE_FFMPEG)
+
+      
 //----------------------------------------------------------------------------
 // FFmpegLibs
 //----------------------------------------------------------------------------
 
+void av_log_wx_callback(void* ptr, int level, const char* fmt, va_list vl)
+{
+   int av_log_level = AV_LOG_WARNING;
+   AVClass* avc = ptr ? *(AVClass**)ptr : NULL;
+   if (level > av_log_level)
+      return;
+   wxString printstring(wxT(""));
+
+   if (avc) {
+      printstring.Append(wxString::Format(wxT("[%s @ %p] "), 
wxString::FromUTF8(avc->item_name(ptr)).c_str(), avc));
+   }
+
+   wxString frm(fmt,wxConvLibc);
+   printstring.Append(wxString::FormatV(frm,vl));
+
+   wxString cpt;
+   switch (level)
+   {
+   case 0: cpt = wxT("Error"); break;
+   case 1: cpt = wxT("Info"); break;
+   case 2: cpt = wxT("Debug"); break;
+   default: cpt = wxT("Log"); break;
+   }
+   wxLogMessage(wxT("%s: %s"),cpt.c_str(),printstring.c_str());
+}
+
 //shared object
 FFmpegLibs *FFmpegLibsInst = NULL;
 
@@ -182,7 +210,17 @@
    INITDYN(avformat,av_index_search_timestamp);
    INITDYN(avformat,av_write_header);
    INITDYN(avformat,av_interleaved_write_frame);
+   INITDYN(avformat,av_write_frame);
    INITDYN(avformat,av_iformat_next);
+   INITDYN(avformat,av_set_parameters);
+   INITDYN(avformat,url_fopen);
+   INITDYN(avformat,url_fclose);
+   INITDYN(avformat,url_fsize);
+   INITDYN(avformat,av_new_stream);
+   INITDYN(avformat,av_alloc_format_context);
+   INITDYN(avformat,guess_format);
+   INITDYN(avformat,av_write_trailer);
+   INITDYN(avformat,av_init_packet);
 
    INITDYN(avcodec,avcodec_init);
    INITDYN(avcodec,avcodec_find_encoder);
@@ -208,6 +246,14 @@
    INITDYN(avutil,av_free);
    INITDYN(avutil,av_log_set_callback);
    INITDYN(avutil,av_log_default_callback);
+   INITDYN(avutil,av_fifo_init);
+   INITDYN(avutil,av_fifo_free);
+   INITDYN(avutil,av_fifo_read);
+   INITDYN(avutil,av_fifo_size);
+   INITDYN(avutil,av_fifo_generic_write);
+   INITDYN(avutil,av_malloc);
+   INITDYN(avutil,av_freep);
+   INITDYN(avutil,av_rescale_q);
 
 #if defined(__WXMSW__)
    //Return error mode to normal

Index: FFmpeg.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/FFmpeg.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- FFmpeg.h    6 Jun 2008 22:15:18 -0000       1.9
+++ FFmpeg.h    12 Jun 2008 09:16:39 -0000      1.10
@@ -33,6 +33,7 @@
 #define __STDC_CONSTANT_MACROS
 #include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>
+#include <libavutil/fifo.h>
 }
 #include "Audacity.h"
 /* rather earlier than normal, but pulls in config*.h and other program stuff
@@ -47,6 +48,8 @@
 
 #define INITDYN(w,f) if ((*(void**)&this->f=(void*)w->GetSymbol(wxT(#f))) == 
NULL) return false
 
+void av_log_wx_callback(void* ptr, int level, const char* fmt, va_list vl);
+
 class FFmpegLibs
 {
 public:
@@ -63,7 +66,7 @@
    AVCodec*          (*avcodec_find_decoder)          (enum CodecID id);
    AVCodec*          (*avcodec_find_decoder_by_name)  (const char *name);
    void              (*avcodec_string)                (char *buf, int 
buf_size, AVCodecContext *enc, int encode);
-   void              (*avcodec_get_context_defaults)  (AVCodecContext *s) ;
+   void              (*avcodec_get_context_defaults)  (AVCodecContext *s);
    AVCodecContext*   (*avcodec_alloc_context)         (void);
    void              (*avcodec_get_frame_defaults)    (AVFrame *pic);
    AVFrame*          (*avcodec_alloc_frame)           (void);
@@ -84,8 +87,28 @@
    int               (*av_close_input_file)           (AVFormatContext *s);
    int               (*av_index_search_timestamp)     (AVStream *st, int64_t 
timestamp, int flags);
    int               (*av_write_header)               (AVFormatContext *s);
-   int               (*av_interleaved_write_frame)    (AVFormatContext *s, 
AVPacket *pkt);
    AVInputFormat*    (*av_iformat_next)               (AVInputFormat *f);
+   int               (*av_set_parameters)             (AVFormatContext *s, 
AVFormatParameters *ap);
+   int               (*url_fopen)                     (ByteIOContext **s, 
const char *filename, int flags);
+   int               (*url_fclose)                    (ByteIOContext *s);
+   int               (*url_fsize)                     (ByteIOContext *s);
+   AVStream*         (*av_new_stream)                 (AVFormatContext *s, int 
id);
+   AVFormatContext*  (*av_alloc_format_context)       (void);
+   AVOutputFormat*   (*guess_format)                  (const char *short_name, 
const char *filename, const char *mime_type);
+   int               (*av_write_trailer)              (AVFormatContext *s);
+   int               (*av_interleaved_write_frame)    (AVFormatContext *s, 
AVPacket *pkt);
+   int               (*av_write_frame)    (AVFormatContext *s, AVPacket *pkt);
+   void              (*av_init_packet)                (AVPacket *pkt);
+   int               (*av_fifo_init)                  (AVFifoBuffer *f, int 
size);
+   void              (*av_fifo_free)                  (AVFifoBuffer *f);
+   int               (*av_fifo_read)                  (AVFifoBuffer *f, 
uint8_t *buf, int buf_size);
+   int               (*av_fifo_size)                  (AVFifoBuffer *f);
+   int               (*av_fifo_generic_write)         (AVFifoBuffer *f, void 
*src, int size, int (*func)(void*, void*, int));
+   void*             (*av_malloc)                     (unsigned int size);
+   void              (*av_freep)                      (void *ptr);
+   int64_t           (*av_rescale_q)                  (int64_t a, AVRational 
bq, AVRational cq);
+
+
 
    bool LoadLibs(wxWindow *parent, bool showerr);
    bool ValidLibsLoaded();


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to