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 301783 - [PATCH] enable our get/release_buffer functions in ffmpegdec
[PATCH] enable our get/release_buffer functions in ffmpegdec
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal normal
: 0.8.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-04-24 11:24 UTC by Luca Ognibene
Modified: 2005-05-06 07:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
enable our get/release buffer functions (4.66 KB, patch)
2005-04-24 11:25 UTC, Luca Ognibene
none Details | Review
disable force_our_get_buffer by default (7.12 KB, patch)
2005-04-26 21:30 UTC, Luca Ognibene
none Details | Review
don't disable my own patch (7.15 KB, patch)
2005-04-26 21:40 UTC, Luca Ognibene
none Details | Review
better error handling (oooops) (7.20 KB, patch)
2005-05-03 15:16 UTC, Luca Ognibene
none Details | Review
fix negotiation and a memory leak (8.28 KB, patch)
2005-05-04 09:36 UTC, Luca Ognibene
none Details | Review

Description Luca Ognibene 2005-04-24 11:24:35 UTC
This patch enable our get/release_buffer functions in ffmpegdec. There are two
define in the code:
- ENABLE_OUR_GET_BUFFER
  This define enables the patch. 
- FORCE_OUR_GET_BUFFER
  This define forces the usage of our get/release functions even if ffmpeg needs
to align width or height. 

The performance gain is something like 20% (ex. from 25% to 19%) when playing an
"aligned" video, it's ~5% (ex. from 43% to 40%) when width or height needs to be
aligned. 
Right now there is no codec whitelist/blacklist because i don't know how to test
it :) I have only xvid or divx files and they all works fine..
Comment 1 Luca Ognibene 2005-04-24 11:25:44 UTC
Created attachment 45607 [details] [review]
enable our get/release buffer functions
Comment 2 Ronald Bultje 2005-04-25 14:15:19 UTC
You can remove the ENABLE_OUR_GET_BUFFER, the compile will fail without it and I
don't think we want that. The FORCE_OUR_GET_BUFFER macro is probably a good
idea, though. Is there a reason why you've enabled it by default? I'd recommend
the opposite, since ffmpeg probably won't work (test, e.g., castaway.mov in our
testsutie, http://gstreamer.freedesktop.org/media/medium/).
Comment 3 Ronald Bultje 2005-04-25 15:44:26 UTC
Oh, also, please update the gst-core requirement in configure.ac, since you use
recent API.
Comment 4 Luca Ognibene 2005-04-26 21:30:16 UTC
Created attachment 45712 [details] [review]
disable force_our_get_buffer by default

Better patch. I've tested it with svq1 files (like castaway.mov).
Comment 5 Luca Ognibene 2005-04-26 21:36:31 UTC
Comment on attachment 45712 [details] [review]
disable force_our_get_buffer by default

ops, too much disabled
Comment 6 Luca Ognibene 2005-04-26 21:40:59 UTC
Created attachment 45714 [details] [review]
don't disable my own patch
Comment 7 Ronald Bultje 2005-05-01 10:10:12 UTC
+      if (!gst_ffmpegdec_negotiate (ffmpegdec))
+	g_assert (0);

Bad, bad, bad, bad, bad you. :). Please make it use the default implementations
in that case and throw an error, so we will be able to safely exit the
chainfunction.
Comment 8 Luca Ognibene 2005-05-03 15:16:57 UTC
Created attachment 45981 [details] [review]
better error handling (oooops)
Comment 9 Luca Ognibene 2005-05-04 08:26:33 UTC
Comment on attachment 45981 [details] [review]
better error handling (oooops)

this patch breaks negotiation (grrr)
Comment 10 Luca Ognibene 2005-05-04 09:36:53 UTC
Created attachment 46008 [details] [review]
fix negotiation and a memory leak

Q) What's last_buffer and why is it needed? 
A) I've tried using this patch with a program (that uses ffdec_mjpeg) and i've
seen a big memory leak, debugging this problem i've found that:
 - ffdec calls avcodec_decode_video
 - ffmpeg calls release_buffer 
 - ffmpeg calls get_buffer
 - ffdec push the buffer

So if i change ffdec status from PLAYING to READY the last buffer is not
unreffed. This patch just unrefs it.
Comment 11 Ronald Bultje 2005-05-06 07:48:05 UTC
Done, thanks a lot for the patch! We're almost completely on-par with mplayer
now. :).