From 2706cdd69036c066dab0757171bbed4eeea6c584 Mon Sep 17 00:00:00 2001 From: ronag Date: Fri, 19 Aug 2011 07:36:48 +0000 Subject: [PATCH] 2.0 ffmpeg_producer: Removed unused code. git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1221 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- modules/ffmpeg/producer/util.cpp | 60 +------------------------------- modules/ffmpeg/producer/util.h | 2 -- 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/modules/ffmpeg/producer/util.cpp b/modules/ffmpeg/producer/util.cpp index e52997a3e..4a5782dd7 100644 --- a/modules/ffmpeg/producer/util.cpp +++ b/modules/ffmpeg/producer/util.cpp @@ -197,67 +197,9 @@ safe_ptr make_write_frame(const void* tag, const safe_ptrcommit(n); } - - //for(int n = 0; n < static_cast(desc.planes.size()); ++n) - //{ - // auto plane = desc.planes[n]; - // auto result = write->image_data(n).begin(); - // auto decoded = decoded_frame->data[n]; - // auto decoded_linesize = decoded_frame->linesize[n]; - // - // for(size_t y = 0; y < static_cast(desc.planes[n].height); ++y) - // fast_memcpy(result + y*plane.linesize, decoded + y*decoded_linesize, plane.linesize); - - // write->commit(n); - //} - + return write; } } -bool is_sane_frame_rate(AVRational time_base) -{ - return true; -} - -//TODO: Not finished -void fix_meta_data(AVFormatContext& context) -{ - auto video_index = av_find_best_stream(&context, AVMEDIA_TYPE_VIDEO, -1, -1, 0, 0); - auto audio_index = av_find_best_stream(&context, AVMEDIA_TYPE_AUDIO, -1, -1, 0, 0); - - if(video_index > -1) - { - auto& video_stream = *context.streams[video_index]; - - if(video_stream.time_base.num == 1) - video_stream.time_base.num = static_cast(std::pow(10.0, static_cast(std::log10(static_cast(video_stream.time_base.den)))-1)); - - if(boost::filesystem2::path(context.filename).extension() == ".flv") - { - try - { - //auto meta = read_flv_meta_info(context.filename); - //fps_ = boost::lexical_cast(meta["framerate"]); - //video_stream.nb_frames = static_cast(boost::lexical_cast(meta["duration"])*fps_); - } - catch(...){} - } - else - { - if(video_stream.nb_frames == 0) - video_stream.nb_frames = video_stream.duration; - } - - if(!is_sane_frame_rate(video_stream.time_base)) - { - if(audio_index > -1) - { - video_stream.time_base.num = video_stream.nb_frames; - video_stream.time_base.den = context.streams[audio_index]->duration / context.streams[audio_index]->codec->sample_rate; - } - } - } -} - } \ No newline at end of file diff --git a/modules/ffmpeg/producer/util.h b/modules/ffmpeg/producer/util.h index 5d01bd195..f96117fc7 100644 --- a/modules/ffmpeg/producer/util.h +++ b/modules/ffmpeg/producer/util.h @@ -31,6 +31,4 @@ core::pixel_format_desc get_pixel_format_desc(PixelFormat pix_fmt, size_t width int make_alpha_format(int format); // NOTE: Be careful about CASPAR_PIX_FMT_LUMA, change it to PIX_FMT_GRAY8 if you want to use the frame inside some ffmpeg function. safe_ptr make_write_frame(const void* tag, const safe_ptr& decoded_frame, const safe_ptr& frame_factory, int hints); -void fix_meta_data(AVFormatContext& context); - } \ No newline at end of file -- 2.39.2