After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 113537 - xvid mega-patch
xvid mega-patch
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other other
: High normal
: 0.7.4
Assigned To: Ronald Bultje
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-05-22 16:48 UTC by Joshua N Pritikin
Modified: 2005-08-15 01:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
caps & FPS for xvid (6.09 KB, patch)
2003-05-22 16:49 UTC, Joshua N Pritikin
none Details | Review
similar patch for divxenc (2.87 KB, patch)
2003-06-01 17:44 UTC, Joshua N Pritikin
none Details | Review

Description Joshua N Pritikin 2003-05-22 16:48:26 UTC
The changes are building up in my tree so i better put this
in bugzilla.  There are two parts to this patch (so far):

1. Add convert to the src pad so downstream elements (like avimux)
can query the FPS.

2. Split the caps nego into two phases since each pad can be
ready or not ready independently.
Comment 1 Joshua N Pritikin 2003-05-22 16:49:23 UTC
Created attachment 16738 [details] [review]
caps & FPS for xvid
Comment 2 Ronald Bultje 2003-05-23 16:57:41 UTC
Concerning the convert() function: why? What's the use of it? I mean,
it's interesting if other elements can query these kind of properties,
but:
* bitrates are generally not constant (VBR)
* fps queries should be forwarded to elements upstream

For the other one, what's the use of changing capsnego from how it's
normally done in encoder/decoder elements? Can you explain why it's
needed?
Comment 3 Joshua N Pritikin 2003-05-31 14:29:54 UTC
Forward FPS requests upstream?  Good idea!  Ignore that part of my patch.

Concerning the caps nego, i start running a decode pipeline as below.
(Actually i am programming in C, but i will write in gst-launch syntax
because it's easier to explain what i'm doing.)

  filesrc location=/local/aleader/original/Star_Wars_1.mpg ! mpegdemux
name=demux demux.video_00 { queue name=vdemux_q ! mpeg2dec ! fakesink
} demux.audio_00 ! mad ! fakesink

Then i do a seek (via an index), unlink the fakesinks, and link the
outputs to the encode part of the pipeline so it looks like this:

  ./gst-launch { avimux name=mux ! filesink location=/tmp/test.avi }
filesrc location=/local/aleader/original/Star_Wars_1.mpg ! mpegdemux
name=demux demux.video_00 ! { queue name=vdemux_q ! mpeg2dec ! xvidenc
! queue name=vmux_q ! mux.video_00 } demux.audio_00 ! mad ! lame !
queue name=audio_q ! mux.audio_00

This is where the caps nego fails because half of the pipeline is
PAUSED and half is NULL.  For example, the sink pad of xvidenc can do
caps nego but the src pad can't because that part of the pipeline is
in the NULL state.  So when the sink pad does nego, it works but then
it tries to setup the src pad at the same time so it actually REJECTs
and the scheduler gives up.  So we need to nego each pad independently
and return DELAYED if the peer pad isn't ready yet.

(i make an assumption here that caps nego isn't possible when both
elements are in the NULL state.  Maybe we should blame the scheduler
instead of the caps nego.)
Comment 4 Joshua N Pritikin 2003-06-01 17:44:52 UTC
Created attachment 17044 [details] [review]
similar patch for divxenc
Comment 5 Joshua N Pritikin 2003-06-02 03:03:57 UTC
Conceptually, i think these patches are needed.  However, do not
simply apply them.  i suspect there is a reference counting problem
lurking (and i don't understand how to debug it yet).  So check these
patches carefully before committing.
Comment 6 Ronald Bultje 2003-06-02 06:22:40 UTC
I'm trying to think of why you'd want this and I can somehow see
why... I just don't think this is the right solution, but that's just
because I'm weird, I guess...

My brain is currently telling me that the right way to do it is to add
a _getcaps() function to the src pad (instead of a _link() function)
which returns variable or fixed caps (width/height) based on whether
the sink pad is linked or not. The capsnego system will then take care
of the rest.

What do you think?
Comment 7 Joshua N Pritikin 2003-06-02 10:43:22 UTC
Dunno for sure, but that's probably a better solution.
Comment 8 alexander.winston 2004-01-02 22:53:05 UTC
Adding the PATCH keyword and upgrading the priority level to High
because of the attached patches.
Comment 9 Ronald Bultje 2004-01-02 23:31:35 UTC
The new caps system implements all this. I'm closing this. Joshua, if
you find anything not working in re-negotiation, please open a new
bug. The current HEAD CVS should allow renego in all elements.