no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / fileffmpeg.C
index 58125d691c8b82856759326f7891e864de0d6cb7..2fbf6c86f80327055b703295b5d66017895aaf0e 100644 (file)
@@ -1,3 +1,24 @@
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2010 Monty Montgomery
+ * 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
+ * 
+ */
 
 #include <stdio.h>
 #include <stdint.h>
@@ -159,7 +180,7 @@ void FFMpegPixelFormat::update_formats()
        pixfmts.remove_all_objects();
        char video_codec[BCSTRLEN]; video_codec[0] = 0;
        const char *vcodec = vid_config->asset->vcodec;
-       AVCodec *av_codec = !FFMPEG::get_codec(video_codec, "video", vcodec) ?
+       const AVCodec *av_codec = !FFMPEG::get_codec(video_codec, "video", vcodec) ?
                avcodec_find_encoder_by_name(video_codec) : 0;
        const AVPixelFormat *pix_fmts = av_codec ? av_codec->pix_fmts : 0;
        if( pix_fmts ) {
@@ -190,7 +211,7 @@ void FFMpegSampleFormat::update_formats()
        samplefmts.remove_all_objects();
        char audio_codec[BCSTRLEN]; audio_codec[0] = 0;
        const char *acodec = aud_config->asset->acodec;
-       AVCodec *av_codec = !FFMPEG::get_codec(audio_codec, "audio", acodec) ?
+       const AVCodec *av_codec = !FFMPEG::get_codec(audio_codec, "audio", acodec) ?
                avcodec_find_encoder_by_name(audio_codec) : 0;
        const AVSampleFormat *sample_fmts = av_codec ? av_codec->sample_fmts : 0;
        if( sample_fmts ) {
@@ -345,7 +366,7 @@ int FileFFMPEG::open_file(int rd, int wr)
                                asset->aspect_ratio = ff->ff_aspect_ratio(0);
                                if (!asset->interlace_mode) asset->interlace_mode = ff->ff_interlace(0);
                                if ( ff->ff_video_frames(0) > 1 ) {
-                               ff->video_probe(1);
+//                             ff->video_probe(1);
                                 if (!asset->interlace_mode && (ff->interlace_from_codec) ) asset->interlace_mode = ff->video_probe(1); 
                                }
                                if( !asset->layers ) asset->layers = video_layers;
@@ -516,6 +537,8 @@ FFMPEGConfigAudio::FFMPEGConfigAudio(BC_WindowBase *parent_window,
        audio_options = 0;
        format_name = asset->fformat;
        codec_name = asset->acodec;
+// *** CONTEXT_HELP ***
+       context_help_set_keyword("Options for Render with FFmpeg");
 }
 
 FFMPEGConfigAudio::~FFMPEGConfigAudio()
@@ -681,6 +704,8 @@ FFMPEGConfigVideo::FFMPEGConfigVideo(BC_WindowBase *parent_window,
        bitrate = 0;
        quality = 0;
        video_options = 0;
+// *** CONTEXT_HELP ***
+       context_help_set_keyword("Options for Render with FFmpeg");
 }
 
 FFMPEGConfigVideo::~FFMPEGConfigVideo()
@@ -847,6 +872,8 @@ FFMPEGConfigFormat::FFMPEGConfigFormat(FFOptionsFormatViewDialog *view_dialog,
        format_options = 0;
        format_name = asset->fformat;
        codec_name = 0;
+// *** CONTEXT_HELP ***
+       context_help_set_keyword("Modifying FFmpeg Format Options");
 }
 
 FFMPEGConfigFormat::~FFMPEGConfigFormat()
@@ -1593,6 +1620,8 @@ FFOptionsWindow::FFOptionsWindow(FFOptionsDialog *dialog, int x, int y)
        this->dialog = dialog;
        this->selected = 0;
        this->kind = 0;
+// *** CONTEXT_HELP ***
+       context_help_set_keyword("Modifying FFmpeg Format Options");
 }
 
 FFOptionsWindow::~FFOptionsWindow()
@@ -1844,7 +1873,7 @@ int FFOptionsViewAudio::handle_event()
        const char *name = asset->acodec;
        char audio_format[BCSTRLEN];  audio_format[0] = 0;
        char audio_codec[BCSTRLEN];   audio_codec[0] = 0;
-       AVCodec *codec = !ret &&
+       const AVCodec *codec = !ret &&
            !FFMPEG::get_format(audio_format, "audio", name) &&
            !FFMPEG::get_codec(audio_codec, "audio", name) ?
                avcodec_find_encoder_by_name(audio_codec) : 0;
@@ -1882,7 +1911,7 @@ int FFOptionsViewVideo::handle_event()
        const char *name = asset->vcodec;
        char video_format[BCSTRLEN];  video_format[0] = 0;
        char video_codec[BCSTRLEN];   video_codec[0] = 0;
-       AVCodec *codec = !ret &&
+       const AVCodec *codec = !ret &&
            !FFMPEG::get_format(video_format, "video", name) &&
            !FFMPEG::get_codec(video_codec, "video", name) ?
                avcodec_find_encoder_by_name(video_codec) : 0;