[MPlayer-dev-eng] [PATCH] vd_null to output black frames
Xidorn Quan
quanxunzhen at gmail.com
Wed Oct 31 08:41:53 CET 2012
On Tue, Oct 16, 2012 at 2:26 PM, Reimar Döffinger
<Reimar.Doeffinger at gmx.de>wrote:
>
>
> On 15 Oct 2012, at 21:48, Alexander Strasser <eclipse7 at gmx.net> wrote:
>
> > Xidorn Quan wrote:
> >> On Mon, Oct 15, 2012 at 6:23 AM, Alexander Strasser <eclipse7 at gmx.net
> >wrote:
> >>> Reimar Döffinger wrote:
> >>>> Sorry, I'm travelling, and won't be able to apply in the
> >>>> next few days, but if someone else wants feel free.
> >>>> I think it's ok, even though I would have slightly preferred to
> >>>> keep vd_null as a simple trivial example and make a completely
> >>>> separate vd_black or similar filter.
> >>>
> >>> I separated Xidorn's code into a new decoder vd black (patch
> >>> attached). Additionally made some small mostly cosmetic changes.
> >>> I thought putting it in a new file is a good occusion to do so.
> >>>
> >>> Xidorn, could you please test if this fulfills your needs?
> >>>
> >>
> >> Yes, it fulfills my needs accurately.
> >>
> >>
> >>> Also I think I didn't test properly, so I would be glad to
> >>> hear your use cases for the new functionality.
> >>>
> >>
> >> I just use it for testing filters like vf_ass, doing performance
> >> benchmark for vfs and vos. There is no other use cases for me.
> >>
> >> Because it output simple frames as quickly as possible, I can easily
> >> speed up playback a lot without waiting for slow decoding.
> >
> > Seems to work as expected.
> >
> >>> If everything works as you like I hope you do not mind if
> >>> I put your full name into the header comment as copyright
> >>> statement and in the author field of mp_codec_info_t.
> >>>
> >>
> >> I certainly would not mind that.
> >
> > Done and committed.
>
> Thanks for taking care of it.
> Btw. it might make sense to point to the special-case null and black
> strcmp code from the codecs.conf entries, since it is related to why a
> codec entry without any fourccs even makes sense.
> Alternatively, having a flag in the codec structure to indicate such
> "dummy" codecs might make it more obvious, too.
>
The patch attached adds a flag for dummy codecs. Is it ok?
-------------- next part --------------
Index: etc/codecs.conf
===================================================================
--- etc/codecs.conf (revision 35305)
+++ etc/codecs.conf (working copy)
@@ -4218,6 +4218,7 @@
status crashing
comment "for unknown/unsupported codecs or testing"
driver null
+ flags dummy
out YV12
out I420
out YUY2
@@ -4230,6 +4231,7 @@
status buggy
comment "for unknown/unsupported codecs or testing"
driver black
+ flags dummy
out YV12
out I420
out YUY2
Index: codec-cfg.c
===================================================================
--- codec-cfg.c (revision 35305)
+++ codec-cfg.c (working copy)
@@ -752,6 +752,9 @@
if (!strcmp(token[0], "align16"))
codec->flags |= CODECS_FLAG_ALIGN16;
else
+ if (!strcmp(token[0], "dummy"))
+ codec->flags |= CODECS_FLAG_DUMMY;
+ else
goto err_out_parse_error;
} else if (!strcmp(token[0], "status")) {
if (get_token(1, 1) < 0)
@@ -870,8 +873,7 @@
for (/* NOTHING */; i--; c++) {
if(start && c<=start) continue;
for (j = 0; j < CODECS_MAX_FOURCC; j++) {
- // FIXME: do NOT hardwire 'null' and 'black' here:
- if (c->fourcc[j]==fourcc || !strcmp(c->drv,"null") || !strcmp(c->drv,"black")) {
+ if (c->fourcc[j]==fourcc || c->flags & CODECS_FLAG_DUMMY) {
if (fourccmap)
*fourccmap = c->fourccmap[j];
return c;
Index: codec-cfg.h
===================================================================
--- codec-cfg.h (revision 35305)
+++ codec-cfg.h (working copy)
@@ -26,6 +26,7 @@
// Global flags:
#define CODECS_FLAG_SEEKABLE (1<<0)
#define CODECS_FLAG_ALIGN16 (1<<1)
+#define CODECS_FLAG_DUMMY (1<<2)
// Outfmt flags:
#define CODECS_FLAG_FLIP (1<<0)
More information about the MPlayer-dev-eng
mailing list