[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: chromium-browser from experimental has included h.264 by default?



On Wed, May 12, 2010 at 2:31 AM, Giuseppe Iuculano <giuseppe@iuculano.it> wrote:
> Il 12/05/2010 06:38, Reinhard Tartler ha scritto:
>> TBH, I'm very skeptical. While I'm not sure why google has decided to
>> choose astrange's branch/fork, I fear that there have been too many
>> changes to the external public API that this is not going to work out.
>> I'm basing this opinion on the Giuseppe's observation that Chromium does
>> not even compile against ffmpeg 0.5 (debian' system) ffmpeg.
>
>> It would be of course interesting to see how this works out with ffmpeg
>> 0.6 (currently in NEW), but for totally unrelated reasons to this one, I
>> fear it won't be processes as well, just like mplayer.
>
> I already tried to compile against the ffmpeg in NEW, and it compiles
> fine (and works fine). For this reason, waiting the new version in NEW,
> the ugly hack for the current version in unstable was a tentative to
> obtain a working chromium for users with and without debian-multimedia
> repository in sources.list.
>
>
>> For this reason, I think that chromium
>> upstream is providing excellent security support for its copy of ffmpeg!
>
> I full agree, I contacted the chromium security team some time ago
> asking an help to triage all security vulnerabilities in our sec
> tracker. I was impressed by their responsiveness and helpfulness.
>
> Cheers,
> Giuseppe.
>
>

Just so you know,  ffmpeg-0.6 which sits in NEW is meant for
experimental. Furthermore, there's currently no plans to move it into
unstable until after the release of Squeeze.

Here's a preliminary patch that allows chromium-browser to build with
system ffmpeg-0.5.1. This is a hard hack to drop back to functions
that were not deprecated until 0.6. Also, this patch shouldn't be
submitted upstream as is. It patches the packaging done in the bzr
branch.

Aside from allowing it to build with system ffmpeg 0.5.1, the
packaging is updated to make use of the shlib files for the ffmpeg
libs, to acquire proper entries for the Depends field.

I'm writing this email through gmail with the newly built
chromium-browser, although I'm still getting the 'Aw Snap' message
trying to view HTML5 content. I was getting that message with the
current chromium in experimental as well. I guess this patch is a
start to figuring out that issue at least : /

-- 
Regards,
Andres Mejia
=== modified file 'debian/changelog'
--- debian/changelog	2010-05-10 18:46:43 +0000
+++ debian/changelog	2010-05-12 00:18:07 +0000
@@ -1,5 +1,6 @@
 chromium-browser (5.0.375.29~r46008-4) UNRELEASED; urgency=low
 
+  [ Giuseppe Iuculano ]
   * Use system copy of libv8
    - update debian/control
    - update debian/patches/series
@@ -12,7 +13,10 @@
     - update debian/patches/series
     - add debian/patches/memory_iceweasel.patch
 
- -- Giuseppe Iuculano <iuculano@debian.org>  Mon, 10 May 2010 20:46:26 +0200
+  [ Andres Mejia ]
+  * Be able to use system ffmpeg-0.5.1.
+
+ -- Andres Mejia <mcitadel@gmail.com>  Tue, 11 May 2010 20:17:48 -0400
 
 chromium-browser (5.0.375.29~r46008-3) experimental; urgency=low
 

=== removed file 'debian/chromium-browser.links'
--- debian/chromium-browser.links	2010-05-07 22:37:15 +0000
+++ debian/chromium-browser.links	1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-usr/lib/libavcodec.so.52 usr/lib/chromium-browser/libavcodec.so.52
-usr/lib/libavformat.so.52 usr/lib/chromium-browser/libavformat.so.52
-usr/lib/libavutil.so.50 usr/lib/chromium-browser/libavutil.so.50

=== modified file 'debian/control'
--- debian/control	2010-05-10 17:33:49 +0000
+++ debian/control	2010-05-12 07:56:55 +0000
@@ -55,15 +55,16 @@
 	libicu-dev,
 	libevent-dev,
 	yasm,
-	libv8-dev (>= 2.2.7-1)
+	libv8-dev (>= 2.2.7-1),
+	libavcodec-dev,
+	libavformat-dev,
+	libavutil-dev
 Standards-Version: 3.8.4
 
 Package: chromium-browser
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends},
 	libnss3-1d (>= 3.12.3),
-	libavcodec52,
-	libavformat52,
 	xdg-utils,
 	chromium-browser-inspector
 Suggests: chromium-browser-l10n

=== removed file 'debian/patches/ffmpeg-no-pkgconfig.patch'
--- debian/patches/ffmpeg-no-pkgconfig.patch	2010-05-07 22:37:15 +0000
+++ debian/patches/ffmpeg-no-pkgconfig.patch	1970-01-01 00:00:00 +0000
@@ -1,21 +0,0 @@
---- a/third_party/ffmpeg/ffmpeg.gyp
-+++ b/third_party/ffmpeg/ffmpeg.gyp
-@@ -767,12 +767,14 @@
- 
-             # Add pkg-config result to include path when use_system_ffmpeg!=0
-             ['use_system_ffmpeg!=0', {
--              'cflags': [
--                '<!@(pkg-config --cflags libavcodec libavformat libavutil)',
-+              'include_dirs': [
-+                'source/config',
-+                'source/patched-ffmpeg-mt',
-               ],
-               'direct_dependent_settings': {
--                'cflags': [
--                  '<!@(pkg-config --cflags libavcodec libavformat libavutil)',
-+                'include_dirs': [
-+                  'source/config',
-+                  'source/patched-ffmpeg-mt',
-                 ],
-               },
-             }, {  # else use_system_ffmpeg==0, add local copy to include path

=== modified file 'debian/patches/ffmpegfix.patch'
--- debian/patches/ffmpegfix.patch	2010-05-07 22:37:15 +0000
+++ debian/patches/ffmpegfix.patch	2010-05-12 06:03:01 +0000
@@ -1,10 +1,56 @@
---- a/third_party/ffmpeg/source/patched-ffmpeg-mt/libavutil/pixfmt.h
-+++ b/third_party/ffmpeg/source/patched-ffmpeg-mt/libavutil/pixfmt.h
-@@ -29,7 +29,6 @@
-  * header, so it should not be directly included in your projects.
-  */
- 
--#include "libavutil/avconfig.h"
- 
- /**
-  * Pixel format. Notes:
+Allow chromium-browser to be built with ffmpeg-0.5.1.
+This patch is not meant to be submitted upstream.
+==========================================================================
+--- a/media/ffmpeg/file_protocol.cc
++++ b/media/ffmpeg/file_protocol.cc
+@@ -80,5 +80,4 @@
+   NULL,  // *next
+   NULL,  // url_read_pause
+   NULL,  // url_read_seek
+-  &GetHandle
+ };
+--- a/media/filters/ffmpeg_audio_decoder.cc
++++ b/media/filters/ffmpeg_audio_decoder.cc
+@@ -106,10 +106,11 @@
+ 
+   int16_t* output_buffer = reinterpret_cast<int16_t*>(output_buffer_.get());
+   int output_buffer_size = kOutputBufferSize;
+-  int result = avcodec_decode_audio3(codec_context_,
++  int result = avcodec_decode_audio2(codec_context_,
+                                      output_buffer,
+                                      &output_buffer_size,
+-                                     &packet);
++                                     packet.data,
++                                     packet.size);
+ 
+   // TODO(ajwong): Consider if kOutputBufferSize should just be an int instead
+   // of a size_t.
+--- a/media/filters/ffmpeg_video_decode_engine.cc
++++ b/media/filters/ffmpeg_video_decode_engine.cc
+@@ -78,7 +78,8 @@
+   // to let FFmpeg allocate the structure via avcodec_alloc_frame().
+   int frame_decoded = 0;
+   int result =
+-      avcodec_decode_video2(codec_context_, yuv_frame, &frame_decoded, &packet);
++      avcodec_decode_video(codec_context_, yuv_frame, &frame_decoded,
++                           packet.data, packet.size);
+ 
+   // Log the problem if we can't decode a video frame and exit early.
+   if (result < 0) {
+--- a/third_party/ffmpeg/avcodec-52.sigs
++++ b/third_party/ffmpeg/avcodec-52.sigs
+@@ -8,12 +8,11 @@
+ AVFrame *avcodec_alloc_frame(void);
+ int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
+ int av_new_packet(AVPacket *pkt, int size);
+-int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt);
+-int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt);
++int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, const uint8_t *buf, int buf_size);
++int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const uint8_t *buf, int buf_size);
+ int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
+ int avcodec_close(AVCodecContext *avctx);
+ int avcodec_thread_init(AVCodecContext *s, int thread_count);
+-void av_free_packet(AVPacket *pkt);
+ void av_init_packet(AVPacket *pkt);
+ int av_dup_packet(AVPacket *pkt);
+ void avcodec_flush_buffers(AVCodecContext *avctx);

=== modified file 'debian/patches/series'
--- debian/patches/series	2010-05-10 18:46:43 +0000
+++ debian/patches/series	2010-05-12 05:52:43 +0000
@@ -5,7 +5,6 @@
 no_tree_sink_v8.patch
 disable_dlog_and_dcheck_in_release_builds.patch
 ffmpegfix.patch
-ffmpeg-no-pkgconfig.patch
 nspr.patch
 system-icu.patch
 nss.patch

=== modified file 'debian/rules'
--- debian/rules	2010-05-09 20:05:07 +0000
+++ debian/rules	2010-05-12 07:52:45 +0000
@@ -5,6 +5,9 @@
 DEBIAN_UPSTREAM_VERSION	:= $(shell echo $(DEBIAN_VERSION) | sed 's/^\(.*\)-[^-]*$$/\1/')
 DEBIAN_REVISION		:= $(shell echo $(DEBIAN_VERSION) | sed 's/^.*r\([^-]*\)-.*/\1/')
 DEBIAN_DIST		:= $(shell lsb_release -ds | tr -d '()')
+LIBAVCODEC_BASENAME	:= $(shell basename $$(ls -x /usr/lib/libavcodec.so.* | cut -d ' ' -f 1))
+LIBAVFORMAT_BASENAME	:= $(shell basename $$(ls -x /usr/lib/libavformat.so.* | cut -d ' ' -f 1))
+LIBAVUTIL_BASENAME	:= $(shell basename $$(ls -x /usr/lib/libavutil.so.* | cut -d ' ' -f 1))
 
 # DEB_TAR_SRCDIR has to be 'src' as this is what gyp expects :(
 DEB_TAR_SRCDIR := src
@@ -415,6 +418,13 @@
 	# same for inspector
 	rm -rf $(CURDIR)/debian/tmp/$(LIB_DIR)/resources/inspector/*
 endif
+	# Install symlinks to system ffmpeg libs
+	ln -sf "/usr/lib/$(LIBAVCODEC_BASENAME)" \
+		"$(CURDIR)/debian/$(DEBIAN_NAME)/$(LIB_DIR)/$(LIBAVCODEC_BASENAME)"
+	ln -sf "/usr/lib/$(LIBAVFORMAT_BASENAME)" \
+		"$(CURDIR)/debian/$(DEBIAN_NAME)/$(LIB_DIR)/$(LIBAVFORMAT_BASENAME)"
+	ln -sf "/usr/lib/$(LIBAVUTIL_BASENAME)" \
+		"$(CURDIR)/debian/$(DEBIAN_NAME)/$(LIB_DIR)/$(LIBAVUTIL_BASENAME)"
 
 binary-install/$(DEBIAN_NAME)-l10n::
 	rm $(CURDIR)/debian/$(DEBIAN_NAME)-l10n/$(LIB_DIR)/locales/en-US.pak
@@ -475,6 +485,20 @@
 	fi ; \
 	rm -f /tmp/pkg-$$$$.inhammer /tmp/pkg-$$$$.indebs
 
+binary-makedeb-IMPL/$(DEBIAN_NAME)::
+	dh_gencontrol -p$(DEBIAN_NAME)
+	# Manually insert ffmpeg libs shlib deps for chromium-browser since the
+	# libs are dlopened.
+	sed "s/^Depends:.*$$/&, $$(sh debian/var_info LIBAVCODEC_DEPENDS)/" \
+		-i "debian/$(DEBIAN_NAME)/DEBIAN/control"
+	sed "s/^Depends:.*$$/&, $$(sh debian/var_info LIBAVFORMAT_DEPENDS)/" \
+		-i "debian/$(DEBIAN_NAME)/DEBIAN/control"
+	sed "s/^Depends:.*$$/&, $$(sh debian/var_info LIBAVUTIL_DEPENDS)/" \
+		-i "debian/$(DEBIAN_NAME)/DEBIAN/control"
+	dh_md5sums -p$(DEBIAN_NAME)
+	dh_builddeb -p$(DEBIAN_NAME)
+
+
 ###############################################################################################
 
 # Tarball (get-orig-source & get-current-source)

=== modified file 'debian/run-test.sh' (properties changed: -x to +x)
=== added file 'debian/var_info'
--- debian/var_info	1970-01-01 00:00:00 +0000
+++ debian/var_info	2010-05-12 00:35:18 +0000
@@ -0,0 +1,24 @@
+# -*- sh -*-
+# This file is used as a way to replace text in certain files. Main reason is
+# to get shlib information for the different ffmpeg libraries used by
+# chromium-browser.
+
+case "$1" in
+    LIBAVCODEC_DEPENDS)
+        LIBAVCODEC_DEPENDS=$(cat /var/lib/dpkg/info/libavcodec*.shlibs | \
+          sed 's/^[^[:space:]]\+\?[[:space:]]\+\?[^[:space:]]\+\?[[:space:]]\+\?\(.*\)$/\1/')
+        printf "$LIBAVCODEC_DEPENDS"
+        ;;
+    LIBAVFORMAT_DEPENDS)
+        LIBAVFORMAT_DEPENDS=$(cat /var/lib/dpkg/info/libavformat*.shlibs | \
+          sed 's/^[^[:space:]]\+\?[[:space:]]\+\?[^[:space:]]\+\?[[:space:]]\+\?\(.*\)$/\1/')
+        printf "$LIBAVFORMAT_DEPENDS"
+        ;;
+    LIBAVUTIL_DEPENDS)
+        LIBAVUTIL_DEPENDS=$(cat /var/lib/dpkg/info/libavutil*.shlibs | \
+          sed 's/^[^[:space:]]\+\?[[:space:]]\+\?[^[:space:]]\+\?[[:space:]]\+\?\(.*\)$/\1/')
+        printf "$LIBAVUTIL_DEPENDS"
+        ;;
+esac
+
+exit 0


Reply to: