projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove old quicktime, replaced with current ffmpeg
[goodguy/history.git]
/
cinelerra-5.0
/
cinelerra
/
ffmpeg.C
diff --git
a/cinelerra-5.0/cinelerra/ffmpeg.C
b/cinelerra-5.0/cinelerra/ffmpeg.C
index decb3d0078260bf419a7469a16e00d62def79f89..b1272467a1c1e04cab8432b214ee143cc3e3f303 100644
(file)
--- a/
cinelerra-5.0/cinelerra/ffmpeg.C
+++ b/
cinelerra-5.0/cinelerra/ffmpeg.C
@@
-18,6
+18,8
@@
#include "fileffmpeg.h"
#include "file.h"
#include "ffmpeg.h"
#include "fileffmpeg.h"
#include "file.h"
#include "ffmpeg.h"
+#include "libdv.h"
+#include "libmjpeg.h"
#include "mainerror.h"
#include "mwindow.h"
#include "vframe.h"
#include "mainerror.h"
#include "mwindow.h"
#include "vframe.h"
@@
-941,8
+943,8
@@
FFMPEG::~FFMPEG()
delete flow_lock;
delete mux_lock;
av_dict_free(&opts);
delete flow_lock;
delete mux_lock;
av_dict_free(&opts);
- delete opt_video_filter;
- delete opt_audio_filter;
+ delete
[]
opt_video_filter;
+ delete
[]
opt_audio_filter;
}
int FFMPEG::check_sample_rate(AVCodec *codec, int sample_rate)
}
int FFMPEG::check_sample_rate(AVCodec *codec, int sample_rate)
@@
-1440,6
+1442,10
@@
int FFMPEG::open_encoder(const char *type, const char *spec)
return 1;
}
return 1;
}
+ if( !strcmp(codec_name, CODEC_TAG_DVSD) ) strcpy(codec_name, "dv");
+ else if( !strcmp(codec_name, CODEC_TAG_MJPEG) ) strcpy(codec_name, "mjpeg");
+ else if( !strcmp(codec_name, CODEC_TAG_JPEG) ) strcpy(codec_name, "jpeg");
+
int ret = 0;
ff_lock("FFMPEG::open_encoder");
FFStream *fst = 0;
int ret = 0;
ff_lock("FFMPEG::open_encoder");
FFStream *fst = 0;
@@
-1580,6
+1586,9
@@
int FFMPEG::open_encoder(const char *type, const char *spec)
}
}
if( !ret ) {
}
}
if( !ret ) {
+ if( fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER )
+ st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
+
ret = avcodec_open2(st->codec, codec, &sopts);
if( ret < 0 ) {
ff_err(ret,"FFMPEG::open_encoder");
ret = avcodec_open2(st->codec, codec, &sopts);
if( ret < 0 ) {
ff_err(ret,"FFMPEG::open_encoder");
@@
-1591,8
+1600,6
@@
int FFMPEG::open_encoder(const char *type, const char *spec)
ret = 0;
}
if( !ret ) {
ret = 0;
}
if( !ret ) {
- if( fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER )
- st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
if( fst && bsfilter[0] )
fst->add_bsfilter(bsfilter, !bsargs[0] ? 0 : bsargs);
}
if( fst && bsfilter[0] )
fst->add_bsfilter(bsfilter, !bsargs[0] ? 0 : bsargs);
}
@@
-2070,6
+2077,11
@@
int FFVideoStream::create_filter(const char *filter_spec,
AVCodecContext *src_ctx, AVCodecContext *sink_ctx)
{
avfilter_register_all();
AVCodecContext *src_ctx, AVCodecContext *sink_ctx)
{
avfilter_register_all();
+ AVFilter *filter = avfilter_get_by_name(filter_spec);
+ if( !filter || filter->inputs->type != AVMEDIA_TYPE_VIDEO ) {
+ ff_err(AVERROR(EINVAL), "FFVideoStream::create_filter: %s\n", filter_spec);
+ return -1;
+ }
filter_graph = avfilter_graph_alloc();
AVFilter *buffersrc = avfilter_get_by_name("buffer");
AVFilter *buffersink = avfilter_get_by_name("buffersink");
filter_graph = avfilter_graph_alloc();
AVFilter *buffersrc = avfilter_get_by_name("buffer");
AVFilter *buffersink = avfilter_get_by_name("buffersink");
@@
-2101,6
+2113,11
@@
int FFAudioStream::create_filter(const char *filter_spec,
AVCodecContext *src_ctx, AVCodecContext *sink_ctx)
{
avfilter_register_all();
AVCodecContext *src_ctx, AVCodecContext *sink_ctx)
{
avfilter_register_all();
+ AVFilter *filter = avfilter_get_by_name(filter_spec);
+ if( !filter || filter->inputs->type != AVMEDIA_TYPE_AUDIO ) {
+ ff_err(AVERROR(EINVAL), "FFAudioStream::create_filter: %s\n", filter_spec);
+ return -1;
+ }
filter_graph = avfilter_graph_alloc();
AVFilter *buffersrc = avfilter_get_by_name("abuffer");
AVFilter *buffersink = avfilter_get_by_name("abuffersink");
filter_graph = avfilter_graph_alloc();
AVFilter *buffersrc = avfilter_get_by_name("abuffer");
AVFilter *buffersink = avfilter_get_by_name("abuffersink");