From: "softworkz ." <softworkz-at-hotmail.com@ffmpeg.org> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH 2/2] fftools/ffmpeg_filter: make InputFilterPriv and OutputFilterPriv private again Date: Sat, 31 May 2025 01:44:00 +0000 Message-ID: <DM8P223MB03653B8E4CC10F2ABE36683CBA60A@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM> (raw) In-Reply-To: <20250529030643.70454-2-jamrial@gmail.com> Hello James, > -----Original Message----- > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of James Almer > Sent: Donnerstag, 29. Mai 2025 05:07 > To: ffmpeg-devel@ffmpeg.org > Subject: [FFmpeg-devel] [PATCH 2/2] fftools/ffmpeg_filter: make > InputFilterPriv and OutputFilterPriv private again > > As the names imply, they are structs meant to be internal and private to the > filter handling code. If a field is required in other modules, then it can > be moved to the public facing structs, which is done in this commit. > > Signed-off-by: James Almer <jamrial@gmail.com> > --- [..] > } > @@ -535,10 +669,10 @@ static int ifilter_bind_ist(InputFilter *ifilter, > InputStream *ist, > av_assert0(!ifp->bound); > ifp->bound = 1; > > - if (ifp->type != ist->par->codec_type && > - !(ifp->type == AVMEDIA_TYPE_VIDEO && ist->par->codec_type == > AVMEDIA_TYPE_SUBTITLE)) { > + if (ifilter->type != ist->par->codec_type && > + !(ifilter->type == AVMEDIA_TYPE_VIDEO && ist->par->codec_type == > AVMEDIA_TYPE_SUBTITLE)) { > av_log(fgp, AV_LOG_ERROR, "Tried to connect %s stream to %s > filtergraph input\n", > - av_get_media_type_string(ist->par->codec_type), > av_get_media_type_string(ifp->type)); > + av_get_media_type_string(ist->par->codec_type), > av_get_media_type_string(ifilter->type)); > return AVERROR(EINVAL); > } > > @@ -553,8 +687,12 @@ static int ifilter_bind_ist(InputFilter *ifilter, > InputStream *ist, > if (ret < 0) > return ret; > > + ifilter->input_name = av_strdup(ifp->opts.name); > + if (!ifilter->input_name) > + return AVERROR(EINVAL); Shouldn't it be ENOMEM? opts.name hasn't been checked for NULL before, not sure if it's meant to check for that as well - the return would be null in either case (which you know of course) - so I'm just asking. (not marking the other 3 cases below) > + > ret = sch_connect(fgp->sch, > - src, SCH_FILTER_IN(fgp->sch_idx, ifp->index)); > + src, SCH_FILTER_IN(fgp->sch_idx, ifilter->index)); > if (ret < 0) > return ret; > [..] > --- a/fftools/graph/graphprint.c > +++ b/fftools/graph/graphprint.c > @@ -28,7 +28,7 @@ > > #include "graphprint.h" > > -#include "fftools/ffmpeg_filter.h" > +#include "fftools/ffmpeg.h" > #include "fftools/ffmpeg_mux.h" > > #include "libavutil/avassert.h" > @@ -490,7 +490,7 @@ static void print_filtergraph_single(GraphPrintContext > *gpc, FilterGraph *fg, AV > print_section_header_id(gpc, SECTION_ID_GRAPH_INPUTS, "Input_File", 0); > > for (int i = 0; i < fg->nb_inputs; i++) { > - InputFilterPriv *ifilter = ifp_from_ifilter(fg->inputs[i]); > + InputFilter *ifilter = fg->inputs[i]; > enum AVMediaType media_type = ifilter->type; > > avtext_print_section_header(tfc, NULL, SECTION_ID_GRAPH_INPUT); > @@ -507,8 +507,8 @@ static void print_filtergraph_single(GraphPrintContext > *gpc, FilterGraph *fg, AV > > if (ifilter->linklabel && ifilter->filter) > av_dict_set(&input_map, ifilter->filter->name, (const char > *)ifilter->linklabel, 0); > - else if (ifilter->opts.name && ifilter->filter) > - av_dict_set(&input_map, ifilter->filter->name, (const char > *)ifilter->opts.name, 0); > + else if (ifilter->input_name && ifilter->filter) > + av_dict_set(&input_map, ifilter->filter->name, (const char > *)ifilter->input_name, 0); > > print_str("media_type", av_get_media_type_string(media_type)); > > @@ -520,13 +520,13 @@ static void print_filtergraph_single(GraphPrintContext > *gpc, FilterGraph *fg, AV > print_section_header_id(gpc, SECTION_ID_GRAPH_OUTPUTS, "Output_File", 0); > > for (int i = 0; i < fg->nb_outputs; i++) { > - OutputFilterPriv *ofilter = ofp_from_ofilter(fg->outputs[i]); > + OutputFilter *ofilter = fg->outputs[i]; > > avtext_print_section_header(tfc, NULL, SECTION_ID_GRAPH_OUTPUT); > > print_int("output_index", ofilter->index); > > - print_str("name", ofilter->name); > + print_str("name", ofilter->output_name); > > if (fg->outputs[i]->linklabel) > print_str("link_label", (const char*)fg->outputs[i]->linklabel); 7 lines further down, there's another change needed: if (ofilter->output_name && ofilter->filter) av_dict_set(&output_map, ofilter->filter->name, ofilter->output_name, 0); This is what broke the graph connections on the output side. Thanks sw _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2025-05-31 1:44 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-05-29 3:06 [FFmpeg-devel] [PATCH 1/2] fftools/ffmpeg_filter: make FilterGraphPriv " James Almer 2025-05-29 3:06 ` [FFmpeg-devel] [PATCH 2/2] fftools/ffmpeg_filter: make InputFilterPriv and OutputFilterPriv " James Almer 2025-05-31 0:49 ` softworkz . 2025-05-31 1:44 ` softworkz . [this message] 2025-06-02 2:07 ` softworkz . 2025-06-02 2:40 ` James Almer 2025-06-02 2:46 ` softworkz . 2025-06-02 2:57 ` softworkz . 2025-05-29 3:16 ` [FFmpeg-devel] [PATCH 1/2] fftools/ffmpeg_filter: make FilterGraphPriv " softworkz . 2025-05-31 1:42 ` softworkz .
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=DM8P223MB03653B8E4CC10F2ABE36683CBA60A@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM \ --to=softworkz-at-hotmail.com@ffmpeg.org \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git