Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / ffmpeg.h
index 2e1f201f328a38b2dc06dcde889df283ce8922ca..ed864b59663dda321523ef54ee68aec587831744 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * CINELERRA
+ * Copyright (C) 2012-2014 Paolo Rampino
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
 #ifndef FFMPEG_H
 #define FFMPEG_H
 
@@ -28,6 +48,9 @@ extern "C" {
 #include "libavformat/avformat.h"
 #include "libavformat/avio.h"
 #include "libavcodec/avcodec.h"
+#if LIBAVCODEC_VERSION_INT  >= AV_VERSION_INT(59,18,100)
+#include "libavcodec/bsf.h"
+#endif
 #include "libavfilter/avfilter.h"
 #include "libavutil/avutil.h"
 #include "libavfilter/buffersrc.h"
@@ -86,7 +109,11 @@ public:
        virtual int encode_activate();
        virtual int decode_activate();
        virtual AVHWDeviceType decode_hw_activate();
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59,16,100)
+       virtual int decode_hw_format(const AVCodec *decoder, AVHWDeviceType type);
+#else
        virtual int decode_hw_format(AVCodec *decoder, AVHWDeviceType type);
+#endif
        virtual int write_packet(FFPacket &pkt);
        int read_packet();
        int seek(int64_t no, double rate);
@@ -246,7 +273,11 @@ public:
        int is_video() { return 1; }
        int decode_frame(AVFrame *frame);
        AVHWDeviceType decode_hw_activate();
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59,16,100)
+       int decode_hw_format(const AVCodec *decoder, AVHWDeviceType type);
+#else
        int decode_hw_format(AVCodec *decoder, AVHWDeviceType type);
+#endif
        AVHWDeviceType encode_hw_activate(const char *hw_dev);
        int encode_hw_write(FFrame *picture);
        int encode_frame(AVFrame *frame);
@@ -256,6 +287,7 @@ public:
 
        int init_frame(AVFrame *picture);
        int load(VFrame *vframe, int64_t pos);
+       int probe(int64_t pos);
        int video_seek(int64_t pos);
        int encode(VFrame *vframe);
        int drain();
@@ -289,7 +321,11 @@ class FFCodecRemaps : public ArrayList<FFCodecRemap>
 public:
        FFCodecRemaps() {}
        int add(const char *val);
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59,16,100)
+       int update(AVCodecID &codec_id, const AVCodec *&decoder);
+#else
        int update(AVCodecID &codec_id, AVCodec *&decoder);
+#endif
 };
 
 // for get_initial_timecode auto deletes
@@ -330,7 +366,11 @@ public:
        static void ff_lock(const char *cp=0) { fflock.lock(cp); }
        static void ff_unlock() { fflock.unlock(); }
 
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59,16,100)
+       int check_sample_rate(const AVCodec *codec, int sample_rate);
+#else
        int check_sample_rate(AVCodec *codec, int sample_rate);
+#endif
        AVRational check_frame_rate(const AVRational *p, double frame_rate);
        AVRational to_sample_aspect_ratio(Asset *asset);
        AVRational to_time_base(int sample_rate);
@@ -383,6 +423,7 @@ public:
        double get_initial_timecode(int data_type, int channel, double frame_rate);
 
        int audio_seek(int ch, int64_t pos);
+       int video_probe(int64_t pos);
        int video_seek(int layer, int64_t pos);
 
        int decode(int chn, int64_t pos, double *samples, int len);
@@ -434,6 +475,7 @@ public:
 
        int decoding, encoding;
        int has_audio, has_video;
+       int interlace_from_codec;
 
        FFMPEG(FileBase *file_base=0);
        ~FFMPEG();
@@ -463,6 +505,7 @@ public:
        float ff_aspect_ratio(int stream);
        int ff_color_range(int stream);
        int ff_color_space(int stream);
+       int ff_interlace(int stream);
        double ff_frame_rate(int stream);
        const char *ff_video_codec(int stream);
        int64_t ff_video_frames(int stream);